diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-16 09:54:43 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-16 09:54:43 -0700 |
| commit | 2ee898109006986250d5356a59003eb741a89ca4 (patch) | |
| tree | d1c6f9c4cc7b17878c8bba53f6f89754e0a713e1 /tests | |
| parent | 9e32b006318814e688501c4b547308d7fb472e78 (diff) | |
Fix spirv debug info for pointer types. (#5319)
* Fix spirv debug info for pointer types.
* fix comment.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/spirv/debug-type-pointer-2.slang | 24 | ||||
| -rw-r--r-- | tests/spirv/debug-type-pointer.slang | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/spirv/debug-type-pointer-2.slang b/tests/spirv/debug-type-pointer-2.slang new file mode 100644 index 000000000..4112d4905 --- /dev/null +++ b/tests/spirv/debug-type-pointer-2.slang @@ -0,0 +1,24 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv + +// Check that we do not emit forward reference for debug pointer types if there isn't a need to do so. + +// CHECK-NOT: OpExtension "SPV_KHR_relaxed_extended_instruction" +struct T +{ + uint inner; +} + +struct Problem +{ + int getVal() { return some_bda_ptr->inner;} + T *some_bda_ptr; +} + +uniform Problem probs; + +RWStructuredBuffer<float4> outputBuffer; +[shader("compute")] +float4 main() +{ + outputBuffer[0] = float(probs.getVal()); +}
\ No newline at end of file diff --git a/tests/spirv/debug-type-pointer.slang b/tests/spirv/debug-type-pointer.slang index fd3248c59..f6add1735 100644 --- a/tests/spirv/debug-type-pointer.slang +++ b/tests/spirv/debug-type-pointer.slang @@ -9,7 +9,7 @@ RWStructuredBuffer<float> outputBuffer; //SPV:OpExtension "SPV_KHR_relaxed_extended_instruction" //SPV: [[STRING_float:%[1-9][0-9]*]] = OpString "float" //SPV: [[STRING_pValue:%[1-9][0-9]*]] = OpString "pValue" -//SPV: [[STRING_LinkedNode:%[1-9][0-9]*]] = OpString "LinkedNode" +//SPV: [[STRING_LinkedNode:%[1-9][0-9]*]] = OpString "LinkedNode{{.*}}" //SPV: [[STRING_pNext:%[1-9][0-9]*]] = OpString "pNext" struct LinkedNode |
