7#ifndef PXR_IMAGING_HGI_INDIRECT_COMMAND_ENCODER_H
8#define PXR_IMAGING_HGI_INDIRECT_COMMAND_ENCODER_H
11#include "pxr/imaging/hgi/api.h"
12#include "pxr/imaging/hgi/cmds.h"
13#include "pxr/imaging/hgi/resourceBindings.h"
14#include "pxr/imaging/hgi/graphicsPipeline.h"
19PXR_NAMESPACE_OPEN_SCOPE
25struct HgiIndirectCommands
27 HgiIndirectCommands(uint32_t drawCount,
30 : drawCount(drawCount)
31 , graphicsPipeline(graphicsPipeline)
32 , resourceBindings(resourceBindings)
36 virtual ~HgiIndirectCommands() =
default;
43using HgiIndirectCommandsUniquePtr = std::unique_ptr<HgiIndirectCommands>;
70 HgiVertexBufferBindingVector
const& vertexBindings,
72 uint32_t drawBufferByteOffset,
84 HgiVertexBufferBindingVector
const& vertexBindings,
87 uint32_t drawBufferByteOffset,
90 uint32_t patchBaseVertexByteOffset) = 0;
97 HgiIndirectCommands
const* commands) = 0;
108PXR_NAMESPACE_CLOSE_SCOPE
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.
A graphics API independent abstraction of compute commands.
A graphics API independent abstraction of graphics commands.
Hydra Graphics Interface.
The indirect command encoder is used to record the drawing primitives for a batch and capture the res...
virtual HGI_API void ExecuteDraw(HgiGraphicsCmds *gfxCmds, HgiIndirectCommands const *commands)=0
Excutes an indirect command batch from the HgiIndirectCommands structure.
virtual HGI_API HgiIndirectCommandsUniquePtr EncodeDrawIndexed(HgiComputeCmds *computeCmds, HgiGraphicsPipelineHandle const &pipeline, HgiResourceBindingsHandle const &resourceBindings, HgiVertexBufferBindingVector const &vertexBindings, HgiBufferHandle const &indexBuffer, HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferByteOffset, uint32_t drawCount, uint32_t stride, uint32_t patchBaseVertexByteOffset)=0
Encodes a batch of indexed draw commands from the drawParameterBuffer.
virtual HGI_API HgiIndirectCommandsUniquePtr EncodeDraw(HgiComputeCmds *computeCmds, HgiGraphicsPipelineHandle const &pipeline, HgiResourceBindingsHandle const &resourceBindings, HgiVertexBufferBindingVector const &vertexBindings, HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferByteOffset, uint32_t drawCount, uint32_t stride)=0
Encodes a batch of draw commands from the drawParameterBuffer.