24#ifndef PXR_IMAGING_HDX_EFFECTS_SHADER_H
25#define PXR_IMAGING_HDX_EFFECTS_SHADER_H
29#include "pxr/imaging/hdx/api.h"
31#include "pxr/imaging/hgi/buffer.h"
32#include "pxr/imaging/hgi/graphicsPipeline.h"
33#include "pxr/imaging/hgi/resourceBindings.h"
34#include "pxr/imaging/hgi/shaderProgram.h"
35#include "pxr/imaging/hgi/texture.h"
41PXR_NAMESPACE_OPEN_SCOPE
45using HgiGraphicsCmdsUniquePtr = std::unique_ptr<class HgiGraphicsCmds>;
68 static void PrintCompileErrors(
73 static void PrintCompileErrors(
87 const std::string& debugName);
90 void _SetColorAttachments(
91 const HgiAttachmentDescVector& colorAttachmentDescs);
94 void _SetDepthAttachment(
98 void _SetPrimitiveType(
99 HgiPrimitiveType primitiveType);
102 void _SetShaderProgram(
106 void _SetVertexBufferDescs(
107 const HgiVertexBufferDescVector& vertexBufferDescs);
110 void _SetDepthStencilState(
114 void _SetMultiSampleState(
118 void _SetRasterizationState(
122 void _SetShaderConstants(
125 HgiShaderStage stageUsage);
128 void _SetTextureBindings(
129 const HgiTextureBindDescVector& textures);
132 void _SetBufferBindings(
133 const HgiBufferBindDescVector& buffers);
138 void _CreateAndSubmitGraphicsCmds(
139 const HgiTextureHandleVector& colorTextures,
140 const HgiTextureHandleVector& colorResolveTextures,
148 virtual void _RecordDrawCmds() = 0;
152 void _DrawNonIndexed(
154 uint32_t vertexCount,
156 uint32_t instanceCount,
157 uint32_t baseInstance);
166 uint32_t indexBufferByteOffset,
168 uint32_t instanceCount,
169 uint32_t baseInstance);
172 Hgi* _GetHgi()
const;
178 const std::string& _GetDebugName()
const;
181 void _CreatePipeline(
182 const HgiTextureHandleVector& colorTextures,
183 const HgiTextureHandleVector& colorResolveTextures,
186 void _DestroyPipeline();
188 void _CreateResourceBindings();
189 void _DestroyResourceBindings();
192 const std::string _debugName;
195 std::vector<uint8_t> _constantsData;
198 HgiGraphicsCmdsUniquePtr _gfxCmds;
201PXR_NAMESPACE_CLOSE_SCOPE
Basic type for a vector of 4 int components.
This class provides functionality to create and manage a single HgiGraphicsPipeline instance and to i...
HDX_API HdxEffectsShader(Hgi *hgi, const std::string &debugName)
Create a new shader object.
Handle that contains a hgi object and unique id.
Hydra Graphics Interface.
Describes the properties of a framebuffer attachment.
Properties to configure depth and stencil test.
Describes the properties needed to create a GPU pipeline.
Properties to configure multi sampling.
Properties to configure the rasterization state.
Describes a set of resources that are bound to the GPU during encoding.