From 6028b89effaa86b9a40acdcacc6f8dac3a5826ee Mon Sep 17 00:00:00 2001 From: Andrew Richards Date: Thu, 9 Jan 2025 15:13:05 +0000 Subject: [PATCH] Updated StructuredBuffer::GetDimensions() in GLSL. --- Applications/Sfx/Sfx.ypp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Applications/Sfx/Sfx.ypp b/Applications/Sfx/Sfx.ypp index e614af739..c92ca4c6a 100644 --- a/Applications/Sfx/Sfx.ypp +++ b/Applications/Sfx/Sfx.ypp @@ -3969,7 +3969,12 @@ string GetSizeFunction(string textureName, string x, string y, string z) if (config->getSizeExpression.size() > 0) { ShaderResourceType type = GetShaderResourceType(buildFunction, textureName); - if (IsTexture(type)) + //STRUCTURED_BUFFER and RW_STRUCTURED_BUFFER GetDeminsion for GLSL - AJR. TODO: Find a better solution to this! + if (IsStructuredBuffer(type) || IsRWStructuredBuffer(type)) + { + full_expr << x << "=" << textureName << ".length()"; + } + else { bool isImage = IsRW(type); bool isMsaa = IsMSAATexture(type); @@ -4044,10 +4049,6 @@ string GetSizeFunction(string textureName, string x, string y, string z) } } } - else //STRUCTURED_BUFFER and RW_STRUCTURED_BUFFER GetDeminsion for GLSL - AJR. TODO: Find a better solution to this! - { - full_expr << x << "=" << textureName << ".length()"; - } } else {