24 #ifndef PXR_IMAGING_HGI_GRAPHICS_CMDS_H
25 #define PXR_IMAGING_HGI_GRAPHICS_CMDS_H
29 #include "pxr/imaging/hgi/api.h"
30 #include "pxr/imaging/hgi/graphicsCmdsDesc.h"
31 #include "pxr/imaging/hgi/graphicsPipeline.h"
32 #include "pxr/imaging/hgi/resourceBindings.h"
33 #include "pxr/imaging/hgi/cmds.h"
36 PXR_NAMESPACE_OPEN_SCOPE
38 using HgiGraphicsCmdsUniquePtr = std::unique_ptr<class HgiGraphicsCmds>;
96 HgiShaderStage stages,
99 const void* data) = 0;
107 uint32_t firstBinding,
108 HgiBufferHandleVector
const& buffers,
109 std::vector<uint32_t>
const& byteOffsets) = 0;
120 uint32_t vertexCount,
121 uint32_t firstVertex,
122 uint32_t instanceCount) = 0;
141 uint32_t drawBufferOffset,
143 uint32_t stride) = 0;
159 uint32_t indexBufferByteOffset,
160 uint32_t vertexOffset,
161 uint32_t instanceCount) = 0;
182 uint32_t drawBufferOffset,
184 uint32_t stride) = 0;
196 HgiGraphicsCmds & operator=(
const HgiGraphicsCmds&) =
delete;
197 HgiGraphicsCmds(
const HgiGraphicsCmds&) =
delete;
202 PXR_NAMESPACE_CLOSE_SCOPE
Basic type for a vector of 4 int components.
A graphics API independent abstraction of graphics commands.
virtual HGI_API void BindVertexBuffers(uint32_t firstBinding, HgiBufferHandleVector const &buffers, std::vector< uint32_t > const &byteOffsets)=0
Binds the vertex buffer(s) that describe the vertex attributes.
virtual HGI_API void SetConstantValues(HgiGraphicsPipelineHandle pipeline, HgiShaderStage stages, uint32_t bindIndex, uint32_t byteSize, const void *data)=0
Set Push / Function constants.
virtual HGI_API void MemoryBarrier(HgiMemoryBarrier barrier)=0
Inserts a barrier so that data written to memory by commands before the barrier is available to comma...
virtual HGI_API void Draw(uint32_t vertexCount, uint32_t firstVertex, uint32_t instanceCount)=0
Records a draw command that renders one or more instances of primitives using the number of vertices ...
virtual HGI_API void DrawIndexedIndirect(HgiBufferHandle const &indexBuffer, HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferOffset, uint32_t drawCount, uint32_t stride)=0
Records a indexed multi-draw command that reads the draw parameters from a provided drawParameterBuff...
virtual HGI_API void PushDebugGroup(const char *label)=0
Push a debug marker.
virtual HGI_API void DrawIndirect(HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferOffset, uint32_t drawCount, uint32_t stride)=0
Records a multi-draw command that reads the draw parameters from a provided drawParameterBuffer.
virtual HGI_API void SetScissor(GfVec4i const &sc)=0
Only pixels that lie within the scissor box are modified by drawing commands.
virtual HGI_API void PopDebugGroup()=0
Pop the last debug marker.
virtual HGI_API void SetViewport(GfVec4i const &vp)=0
Set viewport [left, BOTTOM, width, height] - OpenGL coords.
virtual HGI_API void DrawIndexed(HgiBufferHandle const &indexBuffer, uint32_t indexCount, uint32_t indexBufferByteOffset, uint32_t vertexOffset, uint32_t instanceCount)=0
Records a draw command that renders one or more instances of primitives using an indexBuffer starting...
virtual HGI_API void BindPipeline(HgiGraphicsPipelineHandle pipeline)=0
Bind a pipeline state object.
virtual HGI_API void BindResources(HgiResourceBindingsHandle resources)=0
Bind resources such as textures and uniform buffers.
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.