From 5636c9d85b2514bf96fd200d10371c07e98ae4bc Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 23 Jun 2026 08:42:55 +0200 Subject: [PATCH] Add GPU Texture binding as Gameplay Global texture for runtime-textures --- Source/Engine/Graphics/Materials/MaterialParams.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Engine/Graphics/Materials/MaterialParams.cpp b/Source/Engine/Graphics/Materials/MaterialParams.cpp index 711fcdf2b..5e42f004b 100644 --- a/Source/Engine/Graphics/Materials/MaterialParams.cpp +++ b/Source/Engine/Graphics/Materials/MaterialParams.cpp @@ -478,6 +478,13 @@ void MaterialParameter::Bind(BindMeta& meta) const meta.Context->BindSR(_registerIndex, texture ? texture->GetTexture() : nullptr); break; } + case VariantType::Object: + { + // GPU Texture bind must match dimensions of the value archetype (eg. 2d or cube texture) + auto gpuTexture = Cast(e->Value.AsObject); + meta.Context->BindSR(_registerIndex, gpuTexture); + break; + } default: #if !BUILD_RELEASE LOG(Warning, "Invalid Gameplay Global '{}' ({}) value type '{}' to bind to material", _name, _asAsset->GetPath(), e->Value.Type.ToString());