OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrVkCommandBuffer.h" | 8 #include "GrVkCommandBuffer.h" |
9 | 9 |
10 #include "GrVkFramebuffer.h" | 10 #include "GrVkFramebuffer.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 VK_PIPELINE_BIND_POINT_ GRAPHICS, | 348 VK_PIPELINE_BIND_POINT_ GRAPHICS, |
349 layout, | 349 layout, |
350 firstSet, | 350 firstSet, |
351 setCount, | 351 setCount, |
352 descriptorSets, | 352 descriptorSets, |
353 dynamicOffsetCount, | 353 dynamicOffsetCount, |
354 dynamicOffsets)); | 354 dynamicOffsets)); |
355 program->addUniformResources(*this); | 355 program->addUniformResources(*this); |
356 } | 356 } |
357 | 357 |
358 void GrVkCommandBuffer::bindPipeline(const GrVkGpu* gpu, const GrVkPipeline* pip eline) { | |
jvanverth1
2016/03/18 15:02:26
I'm curious why you moved this from the header.
egdaniel
2016/03/18 19:29:58
all the other command buffer functions were in the
| |
359 SkASSERT(fIsActive); | |
360 SkASSERT(fActiveRenderPass); | |
361 GR_VK_CALL(gpu->vkInterface(), CmdBindPipeline(fCmdBuffer, | |
362 VK_PIPELINE_BIND_POINT_GRAPHI CS, | |
363 pipeline->pipeline())); | |
364 addResource(pipeline); | |
365 } | |
366 | |
358 void GrVkCommandBuffer::drawIndexed(const GrVkGpu* gpu, | 367 void GrVkCommandBuffer::drawIndexed(const GrVkGpu* gpu, |
359 uint32_t indexCount, | 368 uint32_t indexCount, |
360 uint32_t instanceCount, | 369 uint32_t instanceCount, |
361 uint32_t firstIndex, | 370 uint32_t firstIndex, |
362 int32_t vertexOffset, | 371 int32_t vertexOffset, |
363 uint32_t firstInstance) const { | 372 uint32_t firstInstance) const { |
364 SkASSERT(fIsActive); | 373 SkASSERT(fIsActive); |
365 SkASSERT(fActiveRenderPass); | 374 SkASSERT(fActiveRenderPass); |
366 GR_VK_CALL(gpu->vkInterface(), CmdDrawIndexed(fCmdBuffer, | 375 GR_VK_CALL(gpu->vkInterface(), CmdDrawIndexed(fCmdBuffer, |
367 indexCount, | 376 indexCount, |
368 instanceCount, | 377 instanceCount, |
369 firstIndex, | 378 firstIndex, |
370 vertexOffset, | 379 vertexOffset, |
371 firstInstance)); | 380 firstInstance)); |
372 } | 381 } |
373 | 382 |
374 void GrVkCommandBuffer::draw(const GrVkGpu* gpu, | 383 void GrVkCommandBuffer::draw(const GrVkGpu* gpu, |
375 uint32_t vertexCount, | 384 uint32_t vertexCount, |
376 uint32_t instanceCount, | 385 uint32_t instanceCount, |
377 uint32_t firstVertex, | 386 uint32_t firstVertex, |
378 uint32_t firstInstance) const { | 387 uint32_t firstInstance) const { |
379 SkASSERT(fIsActive); | 388 SkASSERT(fIsActive); |
380 SkASSERT(fActiveRenderPass); | 389 SkASSERT(fActiveRenderPass); |
381 GR_VK_CALL(gpu->vkInterface(), CmdDraw(fCmdBuffer, | 390 GR_VK_CALL(gpu->vkInterface(), CmdDraw(fCmdBuffer, |
382 vertexCount, | 391 vertexCount, |
383 instanceCount, | 392 instanceCount, |
384 firstVertex, | 393 firstVertex, |
385 firstInstance)); | 394 firstInstance)); |
386 } | 395 } |
396 | |
397 void GrVkCommandBuffer::setViewport(const GrVkGpu* gpu, | |
398 uint32_t firstViewport, | |
399 uint32_t viewportCount, | |
400 const VkViewport* viewports) { | |
401 SkASSERT(fIsActive); | |
402 GR_VK_CALL(gpu->vkInterface(), CmdSetViewport(fCmdBuffer, | |
403 firstViewport, | |
404 viewportCount, | |
405 viewports)); | |
406 } | |
407 | |
408 void GrVkCommandBuffer::setScissor(const GrVkGpu* gpu, | |
409 uint32_t firstScissor, | |
410 uint32_t scissorCount, | |
411 const VkRect2D* scissors) { | |
412 SkASSERT(fIsActive); | |
413 GR_VK_CALL(gpu->vkInterface(), CmdSetScissor(fCmdBuffer, | |
414 firstScissor, | |
415 scissorCount, | |
416 scissors)); | |
417 } | |
418 | |
419 void GrVkCommandBuffer::setBlendConstants(const GrVkGpu* gpu, | |
420 const float blendConstants[4]) { | |
421 SkASSERT(fIsActive); | |
422 GR_VK_CALL(gpu->vkInterface(), CmdSetBlendConstants(fCmdBuffer, blendConstan ts)); | |
423 } | |
OLD | NEW |