summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-09 12:18:19 -0700
committerGitHub <noreply@github.com>2024-10-09 12:18:19 -0700
commitb8aab84e2c4c3e6d91d75ffcebfcc2f6e84da01c (patch)
tree79207c563a1142bad97547c873d73d084f8748b6 /source/slang/slang-emit-glsl.cpp
parent1bbc421a663bd494cc1a4dd097852553049cc1d5 (diff)
Use user defined type name in glsl buffer declarations. (#5242)
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp
index c0a0bf3db..ca5569602 100644
--- a/source/slang/slang-emit-glsl.cpp
+++ b/source/slang/slang-emit-glsl.cpp
@@ -453,10 +453,9 @@ void GLSLSourceEmitter::_emitGLSLParameterGroup(IRGlobalParam* varDecl, IRUnifor
m_writer->emit(") uniform ");
}
- // Generate a dummy name for the block
- m_writer->emit("_S");
- m_writer->emit(m_uniqueIDCounter++);
-
+ // Generate a name for the block.
+ m_writer->emit(_generateUniqueName(
+ (StringBuilder() << "block_" << getUnmangledName(type->getElementType()).getUnownedSlice()).getUnownedSlice()));
auto elementType = type->getElementType();
auto structType = as<IRStructType>(elementType);