@@ -2665,6 +2665,9 @@ namespace nvrhi
26652665
26662666 IBuffer* indirectParams = nullptr ;
26672667
2668+ IBuffer* indirectCountBuffer = nullptr ;
2669+ uint32_t indirectCountOffset = 0 ;
2670+
26682671 GraphicsState& setPipeline (IGraphicsPipeline* value) { pipeline = value; return *this ; }
26692672 GraphicsState& setFramebuffer (IFramebuffer* value) { framebuffer = value; return *this ; }
26702673 GraphicsState& setViewport (const ViewportState& value) { viewport = value; return *this ; }
@@ -2675,6 +2678,7 @@ namespace nvrhi
26752678 GraphicsState& addVertexBuffer (const VertexBufferBinding& value) { vertexBuffers.push_back (value); return *this ; }
26762679 GraphicsState& setIndexBuffer (const IndexBufferBinding& value) { indexBuffer = value; return *this ; }
26772680 GraphicsState& setIndirectParams (IBuffer* value) { indirectParams = value; return *this ; }
2681+ GraphicsState& setIndirectCountBuffer (IBuffer* buf, uint32_t offset = 0 ) { indirectCountBuffer = buf; indirectCountOffset = offset; return *this ; }
26782682 };
26792683
26802684 struct DrawArguments
@@ -3286,7 +3290,14 @@ namespace nvrhi
32863290 // - DX12: Maps to ExecuteIndirect with a predefined signature.
32873291 // - Vulkan: Maps to vkCmdDrawIndexedIndirect.
32883292 virtual void drawIndexedIndirect (uint32_t offsetBytes, uint32_t drawCount = 1 ) = 0;
3289-
3293+
3294+ // Draws primitives with indexed vertices using the parameters provided in the indirect arguments buffer.
3295+ // The draw count is read from the indirectCountBuffer specified in setGraphicsState(...).
3296+ // - DX11: Not supported (falls back to maxDrawCount draws).
3297+ // - DX12: Maps to ExecuteIndirect with pCountBuffer parameter.
3298+ // - Vulkan: Maps to vkCmdDrawIndexedIndirectCount.
3299+ virtual void drawIndexedIndirectCount (uint32_t offsetBytes, uint32_t maxDrawCount) = 0;
3300+
32903301 // Sets the specified compute state on the command list.
32913302 // The state includes the pipeline (or individual shaders on DX11) and all resources bound to it.
32923303 // See the members of ComputeState for more information.
0 commit comments