diff options
| -rw-r--r-- | source/slang/slang-emit-metal.cpp | 3 | ||||
| -rw-r--r-- | tests/metal/test_descriptor_handle.slang | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/slang-emit-metal.cpp b/source/slang/slang-emit-metal.cpp index 1915be58b..9858e51a1 100644 --- a/source/slang/slang-emit-metal.cpp +++ b/source/slang/slang-emit-metal.cpp @@ -1102,6 +1102,9 @@ void MetalSourceEmitter::emitSimpleTypeImpl(IRType* type) case kIROp_StructType: m_writer->emit(getName(type)); return; + case kIROp_DescriptorHandleType: + emitType(type); + return; case kIROp_DoubleType: SLANG_UNEXPECTED("'double' type emitted"); diff --git a/tests/metal/test_descriptor_handle.slang b/tests/metal/test_descriptor_handle.slang new file mode 100644 index 000000000..8579fee4a --- /dev/null +++ b/tests/metal/test_descriptor_handle.slang @@ -0,0 +1,17 @@ +//TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target metal + +struct MyStruct +{ + uint value; +} +// CHECK-NOT: DescriptorHandle +ParameterBlock<DescriptorHandle<Buffer<uint>>> param; +RWStructuredBuffer<uint> outputBuffer; +[numthreads(4, 1, 1)] +void computeMain(uint3 dtid : SV_DispatchThreadID) +{ + uint idx = dtid.x; + // Load values from the buffer to verify correct access + // CHECK: {{.*}}outputBuffer{{.*}}= + outputBuffer[idx] = param[0]; +} |
