diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2024-07-18 15:20:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-18 15:20:42 -0700 |
| commit | ce4ffc34204a56a7447db1e4aa0e7d89d74f34f1 (patch) | |
| tree | 4ca464824f0ad66c249a2be84ae395dbdd447e11 /tests | |
| parent | be66cc88acebe87e175659df1afc2e4586ed8958 (diff) | |
Support OpDebugTypePointer for struct member pointer (#4527)
This change supports OpDebugTypePointer for a member variable whose type
is a pointer type for the outer struct that hasn't been declared yet.
It is done with new extension, "SPV_KHR_relaxed_extended_instruction",
that comes with a new instruction, "OpExtInstWithForwardRefs".
Closes #4304
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/spirv/debug-type-pointer.slang | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/spirv/debug-type-pointer.slang b/tests/spirv/debug-type-pointer.slang index ff6d5e6b8..fd3248c59 100644 --- a/tests/spirv/debug-type-pointer.slang +++ b/tests/spirv/debug-type-pointer.slang @@ -6,9 +6,10 @@ //TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer 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_uint64:%[1-9][0-9]*]] = OpString "uint64" +//SPV: [[STRING_LinkedNode:%[1-9][0-9]*]] = OpString "LinkedNode" //SPV: [[STRING_pNext:%[1-9][0-9]*]] = OpString "pNext" struct LinkedNode @@ -20,11 +21,15 @@ struct LinkedNode //SPV: DebugTypeMember [[STRING_pValue]] [[TYPE_float_ptr]] float *pValue; - //SPV: [[TYPE_uint64:%[1-9][0-9]*]] = OpExtInst %void %{{[0-9]*}} DebugTypeBasic [[STRING_uint64]] - //SPV: DebugTypeMember [[STRING_pNext]] [[TYPE_uint64]] + // "MEMBER_pNext" hasn't been declared yet, but OpExtInstWithForwardRefs requires at least one of these "forward declared ID". + //SPV: [[FORWARD_LinkedNode:%[1-9][0-9]*]] = OpExtInstWithForwardRefsKHR %void %{{[0-9]*}} DebugTypeComposite [[STRING_LinkedNode]] {{.*}} [[MEMBER_pNext:%[1-9][0-9]*]] + //SPV: [[TYPE_pLinkedNode:%[1-9][0-9]*]] = OpExtInst %void %{{[0-9]*}} DebugTypePointer [[FORWARD_LinkedNode]] + //SPV: [[MEMBER_pNext]] = {{.*}} DebugTypeMember [[STRING_pNext]] [[TYPE_pLinkedNode]] LinkedNode *pNext; }; +//SPV: OpExtInst %void %{{[0-9]*}} DebugTypeComposite [[STRING_LinkedNode]] {{.*}} [[MEMBER_pNext]] + float test(LinkedNode *pNode) { //SPV: DebugValue %pNodeNext |
