Added test for local structured buffer variable
authorSebastian Tafuri <tafuri@gmail.com>
Fri, 6 Oct 2017 22:47:54 +0000 (00:47 +0200)
committerSebastian Tafuri <tafuri@gmail.com>
Fri, 6 Oct 2017 22:47:54 +0000 (00:47 +0200)
Test/baseResults/hlsl.localStructuredBuffer.comp.out [new file with mode: 0644]
Test/hlsl.localStructuredBuffer.comp [new file with mode: 0644]
gtests/Hlsl.FromFile.cpp

diff --git a/Test/baseResults/hlsl.localStructuredBuffer.comp.out b/Test/baseResults/hlsl.localStructuredBuffer.comp.out
new file mode 100644 (file)
index 0000000..e5e028f
--- /dev/null
@@ -0,0 +1,64 @@
+hlsl.localStructuredBuffer.comp
+Shader version: 500
+local_size = (1, 1, 1)
+0:? Sequence
+0:2  Function Definition: @main( ( temp void)
+0:2    Function Parameters: 
+0:2  Function Definition: main( ( temp void)
+0:2    Function Parameters: 
+0:?     Sequence
+0:2      Function Call: @main( ( temp void)
+0:?   Linker Objects
+0:?     'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+
+
+Linked compute stage:
+
+
+Shader version: 500
+local_size = (1, 1, 1)
+0:? Sequence
+0:2  Function Definition: @main( ( temp void)
+0:2    Function Parameters: 
+0:2  Function Definition: main( ( temp void)
+0:2    Function Parameters: 
+0:?     Sequence
+0:2      Function Call: @main( ( temp void)
+0:?   Linker Objects
+0:?     'srt0' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 14
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main"
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 6  "@main("
+                              Name 11  "srt0"
+                              MemberName 11(srt0) 0  "@data"
+                              Name 13  "srt0"
+                              Decorate 10 ArrayStride 4
+                              MemberDecorate 11(srt0) 0 Offset 0
+                              Decorate 11(srt0) BufferBlock
+                              Decorate 13(srt0) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               9:             TypeInt 32 0
+              10:             TypeRuntimeArray 9(int)
+        11(srt0):             TypeStruct 10
+              12:             TypePointer Uniform 11(srt0)
+        13(srt0):     12(ptr) Variable Uniform
+         4(main):           2 Function None 3
+               5:             Label
+               8:           2 FunctionCall 6(@main()
+                              Return
+                              FunctionEnd
+       6(@main():           2 Function None 3
+               7:             Label
+                              Return
+                              FunctionEnd
diff --git a/Test/hlsl.localStructuredBuffer.comp b/Test/hlsl.localStructuredBuffer.comp
new file mode 100644 (file)
index 0000000..34e06e0
--- /dev/null
@@ -0,0 +1,4 @@
+RWStructuredBuffer<uint> srt0;\r
+void main() {\r
+    RWStructuredBuffer<uint> srt0Local = srt0;\r
+}
\ No newline at end of file
index 97101af..f951167 100644 (file)
@@ -219,6 +219,7 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.load.rwtexture.array.dx10.frag", "main"},
         {"hlsl.load.offset.dx10.frag", "main"},
         {"hlsl.load.offsetarray.dx10.frag", "main"},
+        {"hlsl.localStructuredBuffer.comp", "main"},
         {"hlsl.logical.binary.frag", "main"},
         {"hlsl.logical.binary.vec.frag", "main"},
         {"hlsl.logicalConvert.frag", "main"},