#pragma once #include "OpenGLRenderer.h" #include "ShaderTypes.h" #include #include class ShaderTextureBindings { public: using LayerProgram = OpenGLRenderer::LayerProgram; struct RuntimeTextureBinding { std::string semanticName; std::string samplerName; GLuint texture = 0; GLuint textureUnit = 0; }; struct RuntimeTextureBindingPlan { std::vector bindings; }; bool LoadTextureAsset(const ShaderTextureAsset& textureAsset, GLuint& textureId, std::string& error); void CreateTextBindings(const RuntimeRenderState& state, std::vector& textBindings); bool UpdateTextBindingTexture(const RuntimeRenderState& state, LayerProgram::TextBinding& textBinding, std::string& error); GLint FindSamplerUniformLocation(GLuint program, const std::string& samplerName) const; GLuint ResolveShaderTextureBase(const RuntimeRenderState& state, unsigned historyCap) const; void AssignLayerSamplerUniforms(GLuint program, const RuntimeRenderState& state, const LayerProgram& layerProgram, unsigned historyCap) const; RuntimeTextureBindingPlan BuildLayerRuntimeBindingPlan( const LayerProgram& layerProgram, GLuint layerInputTexture, const std::vector& sourceHistoryTextures, const std::vector& temporalHistoryTextures) const; void BindRuntimeTexturePlan(const RuntimeTextureBindingPlan& plan) const; void UnbindRuntimeTexturePlan(const RuntimeTextureBindingPlan& plan) const; };