| 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 #ifndef GrVkCommandBuffer_DEFINED | 8 #ifndef GrVkCommandBuffer_DEFINED |
| 9 #define GrVkCommandBuffer_DEFINED | 9 #define GrVkCommandBuffer_DEFINED |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 GR_VK_CALL(gpu->vkInterface(), CmdBindIndexBuffer(fCmdBuffer, | 84 GR_VK_CALL(gpu->vkInterface(), CmdBindIndexBuffer(fCmdBuffer, |
| 85 vkBuffer, | 85 vkBuffer, |
| 86 0, | 86 0, |
| 87 VK_INDEX_TYPE_UINT
16)); | 87 VK_INDEX_TYPE_UINT
16)); |
| 88 fBoundIndexBufferIsValid = true; | 88 fBoundIndexBufferIsValid = true; |
| 89 fBoundIndexBuffer = vkBuffer; | 89 fBoundIndexBuffer = vkBuffer; |
| 90 addResource(ibuffer->resource()); | 90 addResource(ibuffer->resource()); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 void bindPipeline(const GrVkGpu* gpu, const GrVkPipeline* pipeline) { | |
| 95 GR_VK_CALL(gpu->vkInterface(), CmdBindPipeline(fCmdBuffer, | |
| 96 VK_PIPELINE_BIND_POINT_GR
APHICS, | |
| 97 pipeline->pipeline())); | |
| 98 addResource(pipeline); | |
| 99 } | |
| 100 | |
| 101 void bindDescriptorSets(const GrVkGpu* gpu, | 94 void bindDescriptorSets(const GrVkGpu* gpu, |
| 102 GrVkProgram*, | 95 GrVkProgram*, |
| 103 VkPipelineLayout layout, | 96 VkPipelineLayout layout, |
| 104 uint32_t firstSet, | 97 uint32_t firstSet, |
| 105 uint32_t setCount, | 98 uint32_t setCount, |
| 106 const VkDescriptorSet* descriptorSets, | 99 const VkDescriptorSet* descriptorSets, |
| 107 uint32_t dynamicOffsetCount, | 100 uint32_t dynamicOffsetCount, |
| 108 const uint32_t* dynamicOffsets); | 101 const uint32_t* dynamicOffsets); |
| 109 | 102 |
| 103 void setViewport(const GrVkGpu* gpu, |
| 104 uint32_t firstViewport, |
| 105 uint32_t viewportCount, |
| 106 const VkViewport* viewports); |
| 107 |
| 108 void setScissor(const GrVkGpu* gpu, |
| 109 uint32_t firstScissor, |
| 110 uint32_t scissorCount, |
| 111 const VkRect2D* scissors); |
| 112 |
| 113 void setBlendConstants(const GrVkGpu* gpu, const float blendConstants[4]); |
| 114 |
| 110 // Commands that only work outside of a render pass | 115 // Commands that only work outside of a render pass |
| 111 void clearColorImage(const GrVkGpu* gpu, | 116 void clearColorImage(const GrVkGpu* gpu, |
| 112 GrVkImage* image, | 117 GrVkImage* image, |
| 113 const VkClearColorValue* color, | 118 const VkClearColorValue* color, |
| 114 uint32_t subRangeCount, | 119 uint32_t subRangeCount, |
| 115 const VkImageSubresourceRange* subRanges); | 120 const VkImageSubresourceRange* subRanges); |
| 116 | 121 |
| 117 void clearDepthStencilImage(const GrVkGpu* gpu, | 122 void clearDepthStencilImage(const GrVkGpu* gpu, |
| 118 GrVkImage* image, | 123 GrVkImage* image, |
| 119 const VkClearDepthStencilValue* color, | 124 const VkClearDepthStencilValue* color, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 142 uint32_t copyRegionCount, | 147 uint32_t copyRegionCount, |
| 143 const VkBufferImageCopy* copyRegions); | 148 const VkBufferImageCopy* copyRegions); |
| 144 | 149 |
| 145 // Commands that only work inside of a render pass | 150 // Commands that only work inside of a render pass |
| 146 void clearAttachments(const GrVkGpu* gpu, | 151 void clearAttachments(const GrVkGpu* gpu, |
| 147 int numAttachments, | 152 int numAttachments, |
| 148 const VkClearAttachment* attachments, | 153 const VkClearAttachment* attachments, |
| 149 int numRects, | 154 int numRects, |
| 150 const VkClearRect* clearRects) const; | 155 const VkClearRect* clearRects) const; |
| 151 | 156 |
| 157 void bindPipeline(const GrVkGpu* gpu, const GrVkPipeline* pipeline); |
| 158 |
| 159 |
| 152 void drawIndexed(const GrVkGpu* gpu, | 160 void drawIndexed(const GrVkGpu* gpu, |
| 153 uint32_t indexCount, | 161 uint32_t indexCount, |
| 154 uint32_t instanceCount, | 162 uint32_t instanceCount, |
| 155 uint32_t firstIndex, | 163 uint32_t firstIndex, |
| 156 int32_t vertexOffset, | 164 int32_t vertexOffset, |
| 157 uint32_t firstInstance) const; | 165 uint32_t firstInstance) const; |
| 158 | 166 |
| 159 void draw(const GrVkGpu* gpu, | 167 void draw(const GrVkGpu* gpu, |
| 160 uint32_t vertexCount, | 168 uint32_t vertexCount, |
| 161 uint32_t instanceCount, | 169 uint32_t instanceCount, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 211 |
| 204 // Stores a pointer to the current active render pass (i.e. begin has been c
alled but not end). | 212 // Stores a pointer to the current active render pass (i.e. begin has been c
alled but not end). |
| 205 // A nullptr means there is no active render pass. The GrVKCommandBuffer doe
s not own the render | 213 // A nullptr means there is no active render pass. The GrVKCommandBuffer doe
s not own the render |
| 206 // pass. | 214 // pass. |
| 207 const GrVkRenderPass* fActiveRenderPass; | 215 const GrVkRenderPass* fActiveRenderPass; |
| 208 }; | 216 }; |
| 209 | 217 |
| 210 | 218 |
| 211 #endif | 219 #endif |
| 212 | 220 |
| OLD | NEW |