diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-12 13:47:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-12 13:47:14 -0700 |
| commit | edc85fc4631782d42e113f00dfbbd113dcd8c96f (patch) | |
| tree | 8d6ce10d7ea4d62633d9ce74d78ae2d41578fffb /tests/spirv | |
| parent | 8b5196033ae5e8113e6d06cb64c7cbe570496c51 (diff) | |
Make type names spec-conformant in SPIRV reflect. (#3748)
* Preserve ByteAddressBuffer user type name.
* Make user type lowercase.
* Make typenames conform to spec.
* Use `SpvOpDecorateString`.
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/spirv-reflection.slang | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/spirv/spirv-reflection.slang b/tests/spirv/spirv-reflection.slang index 90414eb59..d1de9e974 100644 --- a/tests/spirv/spirv-reflection.slang +++ b/tests/spirv/spirv-reflection.slang @@ -9,25 +9,27 @@ struct MyElement } StructuredBuffer<MyElement> myBuffer : MY_HLSL_SEMANTIC1; AppendStructuredBuffer<float> myAppendBuffer : MY_HLSL_SEMANTIC2; - +ByteAddressBuffer bw; [numthreads(8, 8, 1)] void computeMain() { float4 color = mTexture.Load(int3(0, 0, 0)); - myAppendBuffer.Append(color.x + myBuffer[0].x); + myAppendBuffer.Append(color.x + myBuffer[0].x + bw.Load(0)); } // SPIRV-DAG: OpExtension "SPV_GOOGLE_user_type" -// SPIRV-DAG: OpDecorate %mTexture UserTypeGOOGLE "Texture2D" -// SPIRV-DAG: OpDecorate %mTexture UserSemantic "MY_HLSL_SEMANTIC" +// SPIRV-DAG: OpDecorateString %mTexture UserTypeGOOGLE "texture2d" +// SPIRV-DAG: OpDecorateString %mTexture UserSemantic "MY_HLSL_SEMANTIC" -// SPIRV-DAG: OpDecorate %myBuffer UserTypeGOOGLE "StructuredBuffer<MyElement_std430>" -// SPIRV-DAG: OpDecorate %myBuffer UserSemantic "MY_HLSL_SEMANTIC1" +// SPIRV-DAG: OpDecorateString %myBuffer UserTypeGOOGLE "structuredbuffer:<MyElement>" +// SPIRV-DAG: OpDecorateString %myBuffer UserSemantic "MY_HLSL_SEMANTIC1" -// SPIRV-DAG: OpDecorate %myAppendBuffer_counter UserTypeGOOGLE "RWStructuredBuffer<int>" -// SPIRV-DAG: OpDecorate %myAppendBuffer_counter UserSemantic "MY_HLSL_SEMANTIC2" +// SPIRV-DAG: OpDecorateString %myAppendBuffer_counter UserTypeGOOGLE "appendstructuredbuffer:<float>" +// SPIRV-DAG: OpDecorateString %myAppendBuffer_counter UserSemantic "MY_HLSL_SEMANTIC2" -// SPIRV-DAG: OpDecorate %myAppendBuffer_elements UserTypeGOOGLE "RWStructuredBuffer<float>" -// SPIRV-DAG: OpDecorate %myAppendBuffer_elements UserSemantic "MY_HLSL_SEMANTIC2" +// SPIRV-DAG: OpDecorateString %myAppendBuffer_elements UserTypeGOOGLE "appendstructuredbuffer:<float>" +// SPIRV-DAG: OpDecorateString %myAppendBuffer_elements UserSemantic "MY_HLSL_SEMANTIC2" // SPIRV-DAG: OpDecorateId %myAppendBuffer_elements CounterBuffer %myAppendBuffer_counter + +// SPIRV-DAG: OpDecorateString %bw UserTypeGOOGLE "byteaddressbuffer"
\ No newline at end of file |
