7#ifndef PXR_IMAGING_HDX_EFFECTS_SHADER_H
8#define PXR_IMAGING_HDX_EFFECTS_SHADER_H
12#include "pxr/imaging/hdx/api.h"
14#include "pxr/imaging/hgi/buffer.h"
15#include "pxr/imaging/hgi/graphicsPipeline.h"
16#include "pxr/imaging/hgi/resourceBindings.h"
17#include "pxr/imaging/hgi/shaderProgram.h"
18#include "pxr/imaging/hgi/texture.h"
24PXR_NAMESPACE_OPEN_SCOPE
28using HgiGraphicsCmdsUniquePtr = std::unique_ptr<class HgiGraphicsCmds>;
51 static void PrintCompileErrors(
56 static void PrintCompileErrors(
70 const std::string& debugName);
73 void _SetColorAttachments(
74 const HgiAttachmentDescVector& colorAttachmentDescs);
77 void _SetDepthAttachment(
81 void _SetPrimitiveType(
82 HgiPrimitiveType primitiveType);
85 void _SetShaderProgram(
89 void _SetVertexBufferDescs(
90 const HgiVertexBufferDescVector& vertexBufferDescs);
93 void _SetDepthStencilState(
97 void _SetMultiSampleState(
101 void _SetRasterizationState(
105 void _SetShaderConstants(
108 HgiShaderStage stageUsage);
111 void _SetTextureBindings(
112 const HgiTextureBindDescVector& textures);
115 void _SetBufferBindings(
116 const HgiBufferBindDescVector& buffers);
121 void _CreateAndSubmitGraphicsCmds(
122 const HgiTextureHandleVector& colorTextures,
123 const HgiTextureHandleVector& colorResolveTextures,
131 virtual void _RecordDrawCmds() = 0;
135 void _DrawNonIndexed(
137 uint32_t vertexCount,
139 uint32_t instanceCount,
140 uint32_t baseInstance);
149 uint32_t indexBufferByteOffset,
151 uint32_t instanceCount,
152 uint32_t baseInstance);
155 Hgi* _GetHgi()
const;
161 const std::string& _GetDebugName()
const;
164 void _CreatePipeline(
165 const HgiTextureHandleVector& colorTextures,
166 const HgiTextureHandleVector& colorResolveTextures,
169 void _DestroyPipeline();
171 void _CreateResourceBindings();
172 void _DestroyResourceBindings();
175 const std::string _debugName;
178 std::vector<uint8_t> _constantsData;
181 HgiGraphicsCmdsUniquePtr _gfxCmds;
184PXR_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.