diff options
| -rw-r--r-- | source/slang/slang-emit-glsl.cpp | 7 | ||||
| -rw-r--r-- | tests/bindings/hlsl-to-vulkan-global-binding.hlsl | 2 | ||||
| -rw-r--r-- | tests/cross-compile/texture-load.slang | 4 |
3 files changed, 7 insertions, 6 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); diff --git a/tests/bindings/hlsl-to-vulkan-global-binding.hlsl b/tests/bindings/hlsl-to-vulkan-global-binding.hlsl index ebccaab18..ef9995e8f 100644 --- a/tests/bindings/hlsl-to-vulkan-global-binding.hlsl +++ b/tests/bindings/hlsl-to-vulkan-global-binding.hlsl @@ -5,7 +5,7 @@ // CHECK: layout(binding = 1) // CHECK: uniform sampler sampler_0; // CHECK: layout(binding = 5, set = 9) -// CHECK: layout(std140) uniform _S1 +// CHECK: layout(std140) uniform block_ uniform int a; uniform float b; diff --git a/tests/cross-compile/texture-load.slang b/tests/cross-compile/texture-load.slang index 71f22b13a..167db7831 100644 --- a/tests/cross-compile/texture-load.slang +++ b/tests/cross-compile/texture-load.slang @@ -3,7 +3,7 @@ // Confirm that texture `Load` operations yield the // expected type when compiled to SPIR-V. -//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage compute +//TEST:SIMPLE(filecheck=CHECK):-target spirv-assembly -entry main -stage compute -emit-spirv-via-glsl Texture2D<float2> inputTexture; RWTexture2D<float2> outputTexture; @@ -13,6 +13,8 @@ cbuffer C int2 pos; } +// CHECK: OpImageWrite + [numthreads(16, 16, 1)] void main(uint2 pixelIndex : SV_DispatchThreadID) { |
