Refactor material shaders to use separate constant buffer (slot 1) for shared per-view constants

This commit is contained in:
Wojtek Figat
2022-11-27 12:06:31 +01:00
parent 189575efec
commit 835a230323
26 changed files with 92 additions and 194 deletions

View File

@@ -8,6 +8,7 @@ struct MaterialParamsLink;
class GPUShader;
class GPUContext;
class GPUTextureView;
class GPUConstantBuffer;
class RenderBuffers;
class SceneRenderTask;
struct RenderView;
@@ -157,6 +158,12 @@ public:
BindParameters(::GPUContext* context, const ::RenderContext& renderContext);
BindParameters(::GPUContext* context, const ::RenderContext& renderContext, const DrawCall& drawCall);
BindParameters(::GPUContext* context, const ::RenderContext& renderContext, const DrawCall* firstDrawCall, int32 drawCallsCount);
// Per-view shared constant buffer (see ViewData in MaterialCommon.hlsl).
static GPUConstantBuffer* PerViewConstants;
// Binds the shared per-view constant buffer at slot 1 (see ViewData in MaterialCommon.hlsl)
void BindViewData();
};
/// <summary>