7#ifndef HDX_COLORCORRECTION_TASK_H
8#define HDX_COLORCORRECTION_TASK_H
11#include "pxr/usd/sdf/path.h"
12#include "pxr/imaging/hdx/api.h"
13#include "pxr/imaging/hdx/task.h"
14#include "pxr/imaging/hdx/tokens.h"
15#include "pxr/imaging/hgi/attachmentDesc.h"
16#include "pxr/imaging/hgi/buffer.h"
17#include "pxr/imaging/hgi/graphicsCmds.h"
18#include "pxr/imaging/hgi/graphicsPipeline.h"
19#include "pxr/imaging/hgi/resourceBindings.h"
20#include "pxr/imaging/hgi/shaderProgram.h"
21#include "pxr/imaging/hgi/texture.h"
25PXR_NAMESPACE_OPEN_SCOPE
53 std::string displayOCIO;
55 std::string colorspaceOCIO;
56 std::string looksOCIO;
89 void Execute(HdTaskContext* ctx)
override;
96 HdDirtyBits* dirtyBits)
override;
104 struct _TextureSamplerDesc {
107 std::vector<float> samples;
111 struct _UniformBufferDesc {
112 std::string typeName;
114 std::vector<uint8_t> data;
118 friend struct HdxColorCorrectionTask_UboBuilder;
121 struct _OCIOResources {
122 std::vector<_TextureSamplerDesc> luts;
123 std::vector<_UniformBufferDesc> ubos;
124 std::vector<unsigned char> constantValues;
125 std::string gpuShaderText;
130 _CreateOpenColorIOResources(
133 _OCIOResources *result);
135 _CreateOpenColorIOResourcesImpl(
138 _OCIOResources *result);
141 bool _GetUseOcio()
const;
144 bool _CreateShaderResources();
147 std::string _CreateOpenColorIOShaderCode(std::string &ocioGpuShaderText,
151 bool _CreateBufferResources();
163 bool _CreateAovSampler();
172 void _DestroyShaderProgram();
175 void _PrintCompileErrors();
180 _OCIOResources _ocioResources;
187 struct TextureSamplerInfo
192 std::string samplerName;
195 std::vector<TextureSamplerInfo> _textureLUTs;
199 std::string typeName;
204 std::vector<BufferInfo> _bufferConstants;
209 float _screenSize[2];
211 std::unique_ptr<class WorkDispatcher> _workDispatcher;
225PXR_NAMESPACE_CLOSE_SCOPE
The render index is part of the Hydra 1.0 API and is only used for emulation purposes so that HdScene...
Adapter class providing data exchange with the client scene graph.
A task for performing color correction (and optionally color grading) on a color buffer to transform ...
HDX_API void _Sync(HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits) override
Sync the render pass resources.
HDX_API void Prepare(HdTaskContext *ctx, HdRenderIndex *renderIndex) override
Prepare the tasks resources.
HDX_API void Execute(HdTaskContext *ctx) override
Execute the color correction task.
Base class for (some) tasks in Hdx that provides common progressive rendering and Hgi functionality.
A graphics API independent abstraction of graphics commands.
Hydra Graphics Interface.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
ColorCorrectionTask parameters.
Describes the properties of a framebuffer attachment.
Describes a set of resources that are bound to the GPU during encoding.
Describes the properties needed to create a GPU sampler.
Describes the properties needed to create a GPU shader function.
Describes the properties needed to create a GPU texture.