mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
Tint/transform: make AddBlockAttribute always do wrapping if possible
This CL make transform AddBlockAttribute always try to wrap types used by buffer variables into a struct, in order to generate valid GLSL code for assigning one buffer struct variable to another buffer struct variable. Fixed: tint:1735 Change-Id: I009d8a9ca7ecea1dc0ad6164275c964a18acb33f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108023 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
2bea9055f4
commit
6ab5d3c151
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a & ivec4(2));
|
||||
v.inner.a = (v.inner.a & ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpBitwiseAnd %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpBitwiseAnd %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
vec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a / 2.0f);
|
||||
v.inner.a = (v.inner.a / 2.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,46 +1,50 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 24
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%S = OpTypeStruct %v4float
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
|
||||
%float_2 = OpConstant %float 2
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%22 = OpConstantNull %v4float
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%23 = OpConstantNull %v4float
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v4float Function %22
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%17 = OpLoad %v4float %16
|
||||
%23 = OpCompositeConstruct %v4float %float_2 %float_2 %float_2 %float_2
|
||||
%19 = OpFDiv %v4float %17 %23
|
||||
OpStore %15 %19
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%21 = OpVariable %_ptr_Function_v4float Function %23
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4float %17
|
||||
%24 = OpCompositeConstruct %v4float %float_2 %float_2 %float_2 %float_2
|
||||
%20 = OpFDiv %v4float %18 %24
|
||||
OpStore %16 %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a / ivec4(2));
|
||||
v.inner.a = (v.inner.a / ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpSDiv %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpSDiv %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
vec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a - 2.0f);
|
||||
v.inner.a = (v.inner.a - 2.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,46 +1,50 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 24
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%S = OpTypeStruct %v4float
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
|
||||
%float_2 = OpConstant %float 2
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%22 = OpConstantNull %v4float
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%23 = OpConstantNull %v4float
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v4float Function %22
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%17 = OpLoad %v4float %16
|
||||
%23 = OpCompositeConstruct %v4float %float_2 %float_2 %float_2 %float_2
|
||||
%19 = OpFSub %v4float %17 %23
|
||||
OpStore %15 %19
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%21 = OpVariable %_ptr_Function_v4float Function %23
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4float %17
|
||||
%24 = OpCompositeConstruct %v4float %float_2 %float_2 %float_2 %float_2
|
||||
%20 = OpFSub %v4float %18 %24
|
||||
OpStore %16 %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a - ivec4(2));
|
||||
v.inner.a = (v.inner.a - ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpISub %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpISub %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a % 2);
|
||||
v.inner.a = (v.inner.a % 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,46 +1,50 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 24
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%22 = OpConstantNull %v4int
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%23 = OpConstantNull %v4int
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v4int Function %22
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%23 = OpCompositeConstruct %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%19 = OpSMod %v4int %17 %23
|
||||
OpStore %15 %19
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%21 = OpVariable %_ptr_Function_v4int Function %23
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%24 = OpCompositeConstruct %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%20 = OpSMod %v4int %18 %24
|
||||
OpStore %16 %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a % ivec4(2));
|
||||
v.inner.a = (v.inner.a % ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpSMod %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpSMod %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a | ivec4(2));
|
||||
v.inner.a = (v.inner.a | ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpBitwiseOr %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpBitwiseOr %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
vec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a + 2.0f);
|
||||
v.inner.a = (v.inner.a + 2.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,46 +1,50 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 24
|
||||
; Bound: 25
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%S = OpTypeStruct %v4float
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
|
||||
%float_2 = OpConstant %float 2
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%22 = OpConstantNull %v4float
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%23 = OpConstantNull %v4float
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v4float Function %22
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%17 = OpLoad %v4float %16
|
||||
%23 = OpCompositeConstruct %v4float %float_2 %float_2 %float_2 %float_2
|
||||
%19 = OpFAdd %v4float %17 %23
|
||||
OpStore %15 %19
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%21 = OpVariable %_ptr_Function_v4float Function %23
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4float %17
|
||||
%24 = OpCompositeConstruct %v4float %float_2 %float_2 %float_2 %float_2
|
||||
%20 = OpFAdd %v4float %18 %24
|
||||
OpStore %16 %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a + ivec4(2));
|
||||
v.inner.a = (v.inner.a + ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpIAdd %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpIAdd %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a << uvec4(2u));
|
||||
v.inner.a = (v.inner.a << uvec4(2u));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,44 +1,48 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 22
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%v4uint = OpTypeVector %uint 4
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%20 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%21 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%21 = OpShiftLeftLogical %v4int %17 %20
|
||||
OpStore %15 %21
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%22 = OpShiftLeftLogical %v4int %18 %21
|
||||
OpStore %16 %22
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a >> uvec4(2u));
|
||||
v.inner.a = (v.inner.a >> uvec4(2u));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,44 +1,48 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 22
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%v4uint = OpTypeVector %uint 4
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%20 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%21 = OpConstantComposite %v4uint %uint_2 %uint_2 %uint_2 %uint_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%21 = OpShiftRightArithmetic %v4int %17 %20
|
||||
OpStore %15 %21
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%22 = OpShiftRightArithmetic %v4int %18 %21
|
||||
OpStore %16 %22
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
vec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a * mat4(vec4(0.0f), vec4(0.0f), vec4(0.0f), vec4(0.0f)));
|
||||
v.inner.a = (v.inner.a * mat4(vec4(0.0f), vec4(0.0f), vec4(0.0f), vec4(0.0f)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%S = OpTypeStruct %v4float
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
|
||||
%mat4v4float = OpTypeMatrix %v4float 4
|
||||
%19 = OpConstantNull %mat4v4float
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantNull %mat4v4float
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%17 = OpLoad %v4float %16
|
||||
%20 = OpVectorTimesMatrix %v4float %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4float %17
|
||||
%21 = OpVectorTimesMatrix %v4float %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
vec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a * 2.0f);
|
||||
v.inner.a = (v.inner.a * 2.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 20
|
||||
; Bound: 21
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%S = OpTypeStruct %v4float
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
|
||||
%float_2 = OpConstant %float 2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0
|
||||
%17 = OpLoad %v4float %16
|
||||
%19 = OpVectorTimesScalar %v4float %17 %float_2
|
||||
OpStore %15 %19
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4float %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4float %17
|
||||
%20 = OpVectorTimesScalar %v4float %18 %float_2
|
||||
OpStore %16 %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a * ivec4(2));
|
||||
v.inner.a = (v.inner.a * ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpIMul %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpIMul %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -4,11 +4,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
layout(binding = 0, std430) buffer S_ssbo {
|
||||
struct S {
|
||||
ivec4 a;
|
||||
};
|
||||
|
||||
layout(binding = 0, std430) buffer v_block_ssbo {
|
||||
S inner;
|
||||
} v;
|
||||
|
||||
void foo() {
|
||||
v.a = (v.a ^ ivec4(2));
|
||||
v.inner.a = (v.inner.a ^ ivec4(2));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %v_block "v_block"
|
||||
OpMemberName %v_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %v "v"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %S Block
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %v DescriptorSet 0
|
||||
OpDecorate %v Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%S = OpTypeStruct %v4int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%v = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%v_block = OpTypeStruct %S
|
||||
%_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
|
||||
%v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%7 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
%19 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%20 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%unused_entry_point = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%15 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0
|
||||
%17 = OpLoad %v4int %16
|
||||
%20 = OpBitwiseXor %v4int %17 %19
|
||||
OpStore %15 %20
|
||||
%foo = OpFunction %void None %7
|
||||
%12 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%18 = OpLoad %v4int %17
|
||||
%21 = OpBitwiseXor %v4int %18 %20
|
||||
OpStore %16 %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user