LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::DrawIndirectArguments Struct Reference

Structure for the arguments of an indirect draw command. More...

#include <IndirectArguments.h>

Public Attributes

std::uint32_t numVertices
 Specifies the number of vertices per instance.
std::uint32_t numInstances
 Specifies the number of instances to draw.
std::uint32_t firstVertex
 Specifies the zero-based offset of the first vertex from the vertex buffer.
std::uint32_t firstInstance
 Specifies the zero-based offset of the first instance.

Detailed Description

Structure for the arguments of an indirect draw command.

Remarks
This is a plain-old-data (POD) structure aligned with no default constructor to make it compatible between CPU and GPU memory space.
See also
CommandBuffer::DrawIndirect
OpenGL counterpart DrawArraysIndirectCommand: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_draw_indirect.txt
Vulkan counterpart VkDrawIndirectCommand: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkDrawIndirectCommand.html
Direct3D11 counterpart D3D11_DRAW_INSTANCED_INDIRECT_ARGS: https://docs.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_draw_instanced_indirect_args
Direct3D12 counterpart D3D12_DRAW_ARGUMENTS: https://docs.microsoft.com/en-us/windows/desktop/api/D3D12/ns-d3d12-d3d12_draw_arguments
Metal counterpart MTLDrawPrimitivesIndirectArguments: https://developer.apple.com/documentation/metal/mtldrawprimitivesindirectarguments?language=objc

Member Data Documentation

◆ firstInstance

std::uint32_t LLGL::DrawIndirectArguments::firstInstance

Specifies the zero-based offset of the first instance.

Note
This parameter modifies the instance ID within the shader pipeline differently for SV_InstanceID in HLSL and gl_InstanceID in GLSL (or gl_InstanceIndex for Vulkan), due to rendering API differences. The system value SV_InstanceID in HLSL will always start with zero, but the system value gl_InstanceID in GLSL (or gl_InstanceIndex for Vulkan) will start with the value of firstInstance.

◆ firstVertex

std::uint32_t LLGL::DrawIndirectArguments::firstVertex

Specifies the zero-based offset of the first vertex from the vertex buffer.

Note
This parameter modifies the vertex ID within the shader pipeline differently for SV_VertexID in HLSL and gl_VertexID in GLSL (or gl_VertexIndex for Vulkan), due to rendering API differences. The system value SV_VertexID in HLSL will always start with zero, but the system value gl_VertexID in GLSL (or gl_VertexIndex for Vulkan) will start with the value of firstVertex.

◆ numInstances

std::uint32_t LLGL::DrawIndirectArguments::numInstances

Specifies the number of instances to draw.

◆ numVertices

std::uint32_t LLGL::DrawIndirectArguments::numVertices

Specifies the number of vertices per instance.


The documentation for this struct was generated from the following file: