yes
This commit is contained in:
+59
@@ -0,0 +1,59 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying column major to row major matrix.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct1 Block
|
||||
OpMemberDecorate %struct1 0 Offset 0
|
||||
OpMemberDecorate %struct1 0 ColMajor
|
||||
OpMemberDecorate %struct1 0 MatrixStride 16
|
||||
OpDecorate %struct2 Block
|
||||
OpMemberDecorate %struct2 0 Offset 0
|
||||
OpMemberDecorate %struct2 0 RowMajor
|
||||
OpMemberDecorate %struct2 0 MatrixStride 16
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%float4 = OpTypeVector %float 4
|
||||
%matrix = OpTypeMatrix %float4 4
|
||||
|
||||
%struct1 = OpTypeStruct %matrix
|
||||
%ptr_struct1 = OpTypePointer StorageBuffer %struct1
|
||||
|
||||
%struct2 = OpTypeStruct %matrix
|
||||
%ptr_struct2 = OpTypePointer StorageBuffer %struct2
|
||||
|
||||
%in_var = OpVariable %ptr_struct1 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct2 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_struct = OpLoad %struct1 %in_var
|
||||
%copy = OpCopyLogical %struct2 %in_struct
|
||||
OpStore %out_var %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata vec4 0 1 2 3 4
|
||||
ssbo 0:0 subdata vec4 16 5 6 7 8
|
||||
ssbo 0:0 subdata vec4 32 9 10 11 12
|
||||
ssbo 0:0 subdata vec4 48 13 14 15 16
|
||||
ssbo 0:1 64
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo vec4 0:1 0 == 1 5 9 13
|
||||
probe ssbo vec4 0:1 16 == 2 6 10 14
|
||||
probe ssbo vec4 0:1 32 == 3 7 11 15
|
||||
probe ssbo vec4 0:1 48 == 4 8 12 16
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying structs containing a matrix with different matrix strides.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct1 Block
|
||||
OpMemberDecorate %struct1 0 Offset 0
|
||||
OpMemberDecorate %struct1 0 ColMajor
|
||||
OpMemberDecorate %struct1 0 MatrixStride 16
|
||||
OpDecorate %struct2 Block
|
||||
OpMemberDecorate %struct2 0 Offset 0
|
||||
OpMemberDecorate %struct2 0 ColMajor
|
||||
OpMemberDecorate %struct2 0 MatrixStride 32
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%float4 = OpTypeVector %float 4
|
||||
%matrix = OpTypeMatrix %float4 4
|
||||
|
||||
%struct1 = OpTypeStruct %matrix
|
||||
%ptr_struct1 = OpTypePointer StorageBuffer %struct1
|
||||
|
||||
%struct2 = OpTypeStruct %matrix
|
||||
%ptr_struct2 = OpTypePointer StorageBuffer %struct2
|
||||
|
||||
%in_var = OpVariable %ptr_struct1 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct2 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_struct = OpLoad %struct1 %in_var
|
||||
%copy = OpCopyLogical %struct2 %in_struct
|
||||
OpStore %out_var %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata vec4 0 1 2 3 4
|
||||
ssbo 0:0 subdata vec4 16 5 6 7 8
|
||||
ssbo 0:0 subdata vec4 32 9 10 11 12
|
||||
ssbo 0:0 subdata vec4 48 13 14 15 16
|
||||
ssbo 0:1 128
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo vec4 0:1 0 == 1 2 3 4
|
||||
probe ssbo vec4 0:1 32 == 5 6 7 8
|
||||
probe ssbo vec4 0:1 64 == 9 10 11 12
|
||||
probe ssbo vec4 0:1 96 == 13 14 15 16
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying two nested arrays with different inner array strides.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct_stride_4 Block
|
||||
OpMemberDecorate %struct_stride_4 0 Offset 0
|
||||
OpDecorate %struct_stride_8 Block
|
||||
OpMemberDecorate %struct_stride_8 0 Offset 0
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
OpDecorate %float_array_32_stride_4 ArrayStride 4
|
||||
OpDecorate %float_array_32_stride_8 ArrayStride 8
|
||||
OpDecorate %array_array_stride_4 ArrayStride 256
|
||||
OpDecorate %array_array_stride_8 ArrayStride 256
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_8 = OpConstant %uint 8
|
||||
%uint_32 = OpConstant %uint 32
|
||||
|
||||
%float_array_32_stride_4 = OpTypeArray %float %uint_32
|
||||
%array_array_stride_4 = OpTypeArray %float_array_32_stride_4 %uint_8
|
||||
%ptr_array_array_stride_4 = OpTypePointer StorageBuffer %array_array_stride_4
|
||||
%struct_stride_4 = OpTypeStruct %array_array_stride_4
|
||||
%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
|
||||
|
||||
%float_array_32_stride_8 = OpTypeArray %float %uint_32
|
||||
%array_array_stride_8 = OpTypeArray %float_array_32_stride_8 %uint_8
|
||||
%ptr_array_array_stride_8 = OpTypePointer StorageBuffer %array_array_stride_8
|
||||
%struct_stride_8 = OpTypeStruct %array_array_stride_8
|
||||
%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
|
||||
|
||||
%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_gep = OpAccessChain %ptr_array_array_stride_4 %in_var %uint_0
|
||||
%in_array = OpLoad %array_array_stride_4 %in_gep
|
||||
%copy = OpCopyLogical %array_array_stride_8 %in_array
|
||||
%out_gep = OpAccessChain %ptr_array_array_stride_8 %out_var %uint_0
|
||||
OpStore %out_gep %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 256 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 512 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 768 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 1024 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 1280 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 1536 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 1792 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:1 subdata float 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 512 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 768 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1024 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1280 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1536 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1792 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo float 0:1 0 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 256 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 512 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 768 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1024 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1280 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1536 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1792 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying nested arrays with differing outer array strides.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct_stride_4 Block
|
||||
OpMemberDecorate %struct_stride_4 0 Offset 0
|
||||
OpDecorate %struct_stride_8 Block
|
||||
OpMemberDecorate %struct_stride_8 0 Offset 0
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
OpDecorate %float_array_32_stride_4 ArrayStride 4
|
||||
OpDecorate %float_array_32_stride_8 ArrayStride 4 ;; for ease this ID is odd
|
||||
OpDecorate %array_array_stride_4 ArrayStride 128
|
||||
OpDecorate %array_array_stride_8 ArrayStride 256
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_8 = OpConstant %uint 8
|
||||
%uint_32 = OpConstant %uint 32
|
||||
|
||||
%float_array_32_stride_4 = OpTypeArray %float %uint_32
|
||||
%array_array_stride_4 = OpTypeArray %float_array_32_stride_4 %uint_8
|
||||
%ptr_array_array_stride_4 = OpTypePointer StorageBuffer %array_array_stride_4
|
||||
%struct_stride_4 = OpTypeStruct %array_array_stride_4
|
||||
%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
|
||||
|
||||
%float_array_32_stride_8 = OpTypeArray %float %uint_32
|
||||
%array_array_stride_8 = OpTypeArray %float_array_32_stride_4 %uint_8
|
||||
%ptr_array_array_stride_8 = OpTypePointer StorageBuffer %array_array_stride_8
|
||||
%struct_stride_8 = OpTypeStruct %array_array_stride_8
|
||||
%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
|
||||
|
||||
%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_gep = OpAccessChain %ptr_array_array_stride_4 %in_var %uint_0
|
||||
%in_array = OpLoad %array_array_stride_4 %in_gep
|
||||
%copy = OpCopyLogical %array_array_stride_8 %in_array
|
||||
%out_gep = OpAccessChain %ptr_array_array_stride_8 %out_var %uint_0
|
||||
OpStore %out_gep %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 128 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 256 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 384 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 512 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 640 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 768 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 896 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:1 2048
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo float 0:1 0 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
probe ssbo float 0:1 256 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
probe ssbo float 0:1 512 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
probe ssbo float 0:1 768 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
probe ssbo float 0:1 1024 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
probe ssbo float 0:1 1280 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
probe ssbo float 0:1 1536 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
probe ssbo float 0:1 1792 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying nested arrays with differing inner and outer array strides.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct_stride_4 Block
|
||||
OpMemberDecorate %struct_stride_4 0 Offset 0
|
||||
OpDecorate %struct_stride_8 Block
|
||||
OpMemberDecorate %struct_stride_8 0 Offset 0
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
OpDecorate %float_array_32_stride_4 ArrayStride 4
|
||||
OpDecorate %float_array_32_stride_8 ArrayStride 8
|
||||
OpDecorate %array_array_stride_4 ArrayStride 128
|
||||
OpDecorate %array_array_stride_8 ArrayStride 256
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_8 = OpConstant %uint 8
|
||||
%uint_32 = OpConstant %uint 32
|
||||
|
||||
%float_array_32_stride_4 = OpTypeArray %float %uint_32
|
||||
%array_array_stride_4 = OpTypeArray %float_array_32_stride_4 %uint_8
|
||||
%ptr_array_array_stride_4 = OpTypePointer StorageBuffer %array_array_stride_4
|
||||
%struct_stride_4 = OpTypeStruct %array_array_stride_4
|
||||
%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
|
||||
|
||||
%float_array_32_stride_8 = OpTypeArray %float %uint_32
|
||||
%array_array_stride_8 = OpTypeArray %float_array_32_stride_8 %uint_8
|
||||
%ptr_array_array_stride_8 = OpTypePointer StorageBuffer %array_array_stride_8
|
||||
%struct_stride_8 = OpTypeStruct %array_array_stride_8
|
||||
%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
|
||||
|
||||
%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_gep = OpAccessChain %ptr_array_array_stride_4 %in_var %uint_0
|
||||
%in_array = OpLoad %array_array_stride_4 %in_gep
|
||||
%copy = OpCopyLogical %array_array_stride_8 %in_array
|
||||
%out_gep = OpAccessChain %ptr_array_array_stride_8 %out_var %uint_0
|
||||
OpStore %out_gep %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 128 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 256 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 384 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 512 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 640 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 768 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:0 subdata float 896 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:1 subdata float 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 512 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 768 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1024 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1280 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1536 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
ssbo 0:1 subdata float 1792 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo float 0:1 0 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 256 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 512 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 768 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1024 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1280 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1536 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
probe ssbo float 0:1 1792 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copy of same structural array given two IDs.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct1 Block
|
||||
OpMemberDecorate %struct1 0 Offset 0
|
||||
OpDecorate %struct2 Block
|
||||
OpMemberDecorate %struct2 0 Offset 0
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
OpDecorate %float_array1 ArrayStride 4
|
||||
OpDecorate %float_array2 ArrayStride 4
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_32 = OpConstant %uint 32
|
||||
|
||||
%float_array1 = OpTypeArray %float %uint_32
|
||||
%ptr_float_array1 = OpTypePointer StorageBuffer %float_array1
|
||||
%struct1 = OpTypeStruct %float_array1
|
||||
%ptr_struct1 = OpTypePointer StorageBuffer %struct1
|
||||
|
||||
%float_array2 = OpTypeArray %float %uint_32
|
||||
%ptr_float_array2 = OpTypePointer StorageBuffer %float_array2
|
||||
%struct2 = OpTypeStruct %float_array2
|
||||
%ptr_struct2 = OpTypePointer StorageBuffer %struct2
|
||||
|
||||
%in_var = OpVariable %ptr_struct1 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct2 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_gep = OpAccessChain %ptr_float_array1 %in_var %uint_0
|
||||
%in_array = OpLoad %float_array1 %in_gep
|
||||
%copy = OpCopyLogical %float_array2 %in_array
|
||||
%out_gep = OpAccessChain %ptr_float_array2 %out_var %uint_0
|
||||
OpStore %out_gep %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata float 0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
|
||||
ssbo 0:1 128
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo float 0:1 0 == 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying same structural struct with different IDs.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct1 Block
|
||||
OpMemberDecorate %struct1 0 Offset 0
|
||||
OpMemberDecorate %struct1 1 Offset 4
|
||||
OpMemberDecorate %struct1 2 Offset 8
|
||||
OpMemberDecorate %struct1 3 Offset 12
|
||||
OpDecorate %struct2 Block
|
||||
OpMemberDecorate %struct2 0 Offset 0
|
||||
OpMemberDecorate %struct2 1 Offset 4
|
||||
OpMemberDecorate %struct2 2 Offset 8
|
||||
OpMemberDecorate %struct2 3 Offset 12
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
%void = OpTypeVoid
|
||||
%int = OpTypeInt 32 0
|
||||
|
||||
%struct1 = OpTypeStruct %int %int %int %int
|
||||
%ptr_struct1 = OpTypePointer Uniform %struct1
|
||||
|
||||
%struct2 = OpTypeStruct %int %int %int %int
|
||||
%ptr_struct2 = OpTypePointer StorageBuffer %struct2
|
||||
|
||||
%in_var = OpVariable %ptr_struct1 Uniform
|
||||
%out_var = OpVariable %ptr_struct2 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_struct = OpLoad %struct1 %in_var
|
||||
%copy = OpCopyLogical %struct2 %in_struct
|
||||
OpStore %out_var %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
uniform ubo 0:0 uvec4 0 1 2 3 4
|
||||
ssbo 0:1 subdata uvec4 0 8 8 8 8
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo uvec4 0:1 0 == 1 2 3 4
|
||||
@@ -0,0 +1,94 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests converting from SSBO layout to UBO layout.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
|
||||
OpDecorate %struct1 Block
|
||||
OpMemberDecorate %struct1 0 Offset 0
|
||||
OpMemberDecorate %struct1 1 Offset 16
|
||||
OpMemberDecorate %struct1 2 Offset 48
|
||||
OpMemberDecorate %struct1 3 Offset 64
|
||||
OpMemberDecorate %struct1 4 Offset 80
|
||||
OpMemberDecorate %struct1 5 Offset 96
|
||||
OpMemberDecorate %struct1 6 Offset 112
|
||||
|
||||
OpDecorate %struct2 Block
|
||||
OpMemberDecorate %struct2 0 Offset 0
|
||||
OpMemberDecorate %struct2 1 Offset 4
|
||||
OpMemberDecorate %struct2 2 Offset 12
|
||||
OpMemberDecorate %struct2 3 Offset 16
|
||||
OpMemberDecorate %struct2 4 Offset 32
|
||||
OpMemberDecorate %struct2 5 Offset 48
|
||||
OpMemberDecorate %struct2 6 Offset 64
|
||||
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
|
||||
OpDecorate %int_array_2_stride_4 ArrayStride 4
|
||||
OpDecorate %int_array_2_stride_16 ArrayStride 16
|
||||
OpMemberDecorate %int_struct1 0 Offset 4
|
||||
OpMemberDecorate %int_struct2 0 Offset 8
|
||||
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%float2 = OpTypeVector %float 2
|
||||
%float3 = OpTypeVector %float 3
|
||||
%float4 = OpTypeVector %float 4
|
||||
%matrix = OpTypeMatrix %float4 4
|
||||
%int = OpTypeInt 32 0
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_array_2_stride_4 = OpTypeArray %int %int_2
|
||||
%int_array_2_stride_16 = OpTypeArray %int %int_2
|
||||
%int_struct1 = OpTypeStruct %int
|
||||
%int_struct2 = OpTypeStruct %int
|
||||
|
||||
%struct1 = OpTypeStruct %int %int_array_2_stride_16 %int %int_struct1 %float4 %float3 %float2
|
||||
%ptr_struct1 = OpTypePointer StorageBuffer %struct1
|
||||
|
||||
%struct2 = OpTypeStruct %int %int_array_2_stride_4 %int %int_struct2 %float4 %float3 %float2
|
||||
%ptr_struct2 = OpTypePointer StorageBuffer %struct2
|
||||
|
||||
%in_var = OpVariable %ptr_struct2 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct1 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_struct = OpLoad %struct2 %in_var
|
||||
%copy = OpCopyLogical %struct1 %in_struct
|
||||
OpStore %out_var %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata uint 0 1
|
||||
ssbo 0:0 subdata uint 4 2 3
|
||||
ssbo 0:0 subdata uint 12 4
|
||||
ssbo 0:0 subdata uint 24 5
|
||||
# Really vec4
|
||||
ssbo 0:0 subdata uint 32 6 7 8 9
|
||||
# Really vec3
|
||||
ssbo 0:0 subdata uint 48 10 11 12
|
||||
# Really vec2
|
||||
ssbo 0:0 subdata uint 64 13 14
|
||||
ssbo 0:1 128
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo uint 0:1 0 == 1
|
||||
probe ssbo uint 0:1 16 == 2
|
||||
probe ssbo uint 0:1 32 == 3
|
||||
probe ssbo uint 0:1 48 == 4
|
||||
probe ssbo uint 0:1 68 == 5
|
||||
probe ssbo uint 0:1 80 == 6 7 8 9
|
||||
probe ssbo uint 0:1 96 == 10 11 12
|
||||
probe ssbo uint 0:1 112 == 13 14
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying smaller array stride to larger array stride.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct_stride_4 Block
|
||||
OpMemberDecorate %struct_stride_4 0 Offset 0
|
||||
OpDecorate %struct_stride_8 Block
|
||||
OpMemberDecorate %struct_stride_8 0 Offset 0
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
OpDecorate %float_array_32_stride_4 ArrayStride 4
|
||||
OpDecorate %float_array_32_stride_8 ArrayStride 8
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_32 = OpConstant %uint 32
|
||||
|
||||
%float_array_32_stride_4 = OpTypeArray %float %uint_32
|
||||
%ptr_float_array_32_stride_4 = OpTypePointer StorageBuffer %float_array_32_stride_4
|
||||
%struct_stride_4 = OpTypeStruct %float_array_32_stride_4
|
||||
%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
|
||||
|
||||
%float_array_32_stride_8 = OpTypeArray %float %uint_32
|
||||
%ptr_float_array_32_stride_8 = OpTypePointer StorageBuffer %float_array_32_stride_8
|
||||
%struct_stride_8 = OpTypeStruct %float_array_32_stride_8
|
||||
%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
|
||||
|
||||
%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_gep = OpAccessChain %ptr_float_array_32_stride_4 %in_var %uint_0
|
||||
%in_array = OpLoad %float_array_32_stride_4 %in_gep
|
||||
%copy = OpCopyLogical %float_array_32_stride_8 %in_array
|
||||
%out_gep = OpAccessChain %ptr_float_array_32_stride_8 %out_var %uint_0
|
||||
OpStore %out_gep %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
ssbo 0:1 subdata float 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo float 0:1 0 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests copying larger array stride to smaller array stride.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpDecorate %struct_stride_4 Block
|
||||
OpMemberDecorate %struct_stride_4 0 Offset 0
|
||||
OpDecorate %struct_stride_8 Block
|
||||
OpMemberDecorate %struct_stride_8 0 Offset 0
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
OpDecorate %float_array_32_stride_4 ArrayStride 4
|
||||
OpDecorate %float_array_32_stride_8 ArrayStride 8
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%uint_32 = OpConstant %uint 32
|
||||
|
||||
%float_array_32_stride_4 = OpTypeArray %float %uint_32
|
||||
%ptr_float_array_32_stride_4 = OpTypePointer StorageBuffer %float_array_32_stride_4
|
||||
%struct_stride_4 = OpTypeStruct %float_array_32_stride_4
|
||||
%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
|
||||
|
||||
%float_array_32_stride_8 = OpTypeArray %float %uint_32
|
||||
%ptr_float_array_32_stride_8 = OpTypePointer StorageBuffer %float_array_32_stride_8
|
||||
%struct_stride_8 = OpTypeStruct %float_array_32_stride_8
|
||||
%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
|
||||
|
||||
%in_var = OpVariable %ptr_struct_stride_8 StorageBuffer
|
||||
%out_var = OpVariable %ptr_struct_stride_4 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_gep = OpAccessChain %ptr_float_array_32_stride_8 %in_var %uint_0
|
||||
%in_array = OpLoad %float_array_32_stride_8 %in_gep
|
||||
%copy = OpCopyLogical %float_array_32_stride_4 %in_array
|
||||
%out_gep = OpAccessChain %ptr_float_array_32_stride_4 %out_var %uint_0
|
||||
OpStore %out_gep %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
ssbo 0:0 subdata float 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
|
||||
ssbo 0:1 128
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo float 0:1 0 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
||||
@@ -0,0 +1,96 @@
|
||||
[require]
|
||||
VK_KHR_spirv_1_4
|
||||
|
||||
[compute shader spirv]
|
||||
; Tests conversion from UBO layout to SSBO layout.
|
||||
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %in_var %out_var
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
|
||||
OpDecorate %struct1 Block
|
||||
OpMemberDecorate %struct1 0 Offset 0
|
||||
OpMemberDecorate %struct1 1 Offset 16
|
||||
OpMemberDecorate %struct1 2 Offset 48
|
||||
OpMemberDecorate %struct1 3 Offset 64
|
||||
OpMemberDecorate %struct1 4 Offset 80
|
||||
OpMemberDecorate %struct1 5 Offset 96
|
||||
OpMemberDecorate %struct1 6 Offset 112
|
||||
|
||||
OpDecorate %struct2 Block
|
||||
OpMemberDecorate %struct2 0 Offset 0
|
||||
OpMemberDecorate %struct2 1 Offset 4
|
||||
OpMemberDecorate %struct2 2 Offset 12
|
||||
OpMemberDecorate %struct2 3 Offset 16
|
||||
OpMemberDecorate %struct2 4 Offset 32
|
||||
OpMemberDecorate %struct2 5 Offset 48
|
||||
OpMemberDecorate %struct2 6 Offset 64
|
||||
|
||||
OpDecorate %in_var DescriptorSet 0
|
||||
OpDecorate %in_var Binding 0
|
||||
OpDecorate %out_var DescriptorSet 0
|
||||
OpDecorate %out_var Binding 1
|
||||
|
||||
OpDecorate %int_array_2_stride_4 ArrayStride 4
|
||||
OpDecorate %int_array_2_stride_16 ArrayStride 16
|
||||
OpMemberDecorate %int_struct1 0 Offset 4
|
||||
OpMemberDecorate %int_struct2 0 Offset 8
|
||||
|
||||
%void = OpTypeVoid
|
||||
%float = OpTypeFloat 32
|
||||
%float2 = OpTypeVector %float 2
|
||||
%float3 = OpTypeVector %float 3
|
||||
%float4 = OpTypeVector %float 4
|
||||
%matrix = OpTypeMatrix %float4 4
|
||||
%int = OpTypeInt 32 0
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_array_2_stride_4 = OpTypeArray %int %int_2
|
||||
%int_array_2_stride_16 = OpTypeArray %int %int_2
|
||||
%int_struct1 = OpTypeStruct %int
|
||||
%int_struct2 = OpTypeStruct %int
|
||||
|
||||
%struct1 = OpTypeStruct %int %int_array_2_stride_16 %int %int_struct1 %float4 %float3 %float2
|
||||
%ptr_struct1 = OpTypePointer Uniform %struct1
|
||||
|
||||
%struct2 = OpTypeStruct %int %int_array_2_stride_4 %int %int_struct2 %float4 %float3 %float2
|
||||
%ptr_struct2 = OpTypePointer StorageBuffer %struct2
|
||||
|
||||
%in_var = OpVariable %ptr_struct1 Uniform
|
||||
%out_var = OpVariable %ptr_struct2 StorageBuffer
|
||||
|
||||
%func_ty = OpTypeFunction %void
|
||||
%main = OpFunction %void None %func_ty
|
||||
%1 = OpLabel
|
||||
%in_struct = OpLoad %struct1 %in_var
|
||||
%copy = OpCopyLogical %struct2 %in_struct
|
||||
OpStore %out_var %copy
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
[test]
|
||||
# Really uint
|
||||
uniform ubo 0:0 uint 0 1
|
||||
uniform ubo 0:0 uint 16 2
|
||||
uniform ubo 0:0 uint 32 3
|
||||
uniform ubo 0:0 uint 48 4
|
||||
uniform ubo 0:0 uint 68 5
|
||||
# Really vec4
|
||||
uniform ubo 0:0 uint 80 6 7 8 9
|
||||
# Really vec3
|
||||
uniform ubo 0:0 uint 96 10 11 12
|
||||
# Really vec2
|
||||
uniform ubo 0:0 uint 112 13 14
|
||||
ssbo 0:1 72
|
||||
|
||||
compute entrypoint main
|
||||
compute 1 1 1
|
||||
|
||||
probe ssbo uint 0:1 0 == 1
|
||||
probe ssbo uint 0:1 4 == 2
|
||||
probe ssbo uint 0:1 8 == 3
|
||||
probe ssbo uint 0:1 12 == 4
|
||||
probe ssbo uint 0:1 24 == 5
|
||||
probe ssbo uint 0:1 32 == 6 7 8 9
|
||||
probe ssbo uint 0:1 48 == 10 11 12
|
||||
probe ssbo uint 0:1 64 == 13 14
|
||||
Reference in New Issue
Block a user