mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
GLSL: Change Add[Spirv]BlockAttribute to support GLSL
Modify the AddSpirvBlockAttribute transform to fix top-level structure access of uniform, storage and push-constant buffers for use in the GLSL backend. The small change to the transform makes the transform wrap host-sharable buffers, if they're also used as a non-host-sharable structure. Also rename the transform to AddBlockAttrbibute in order to reflect its wider applicability. Change-Id: Ib2bf4ebf6bce72790791dbae9387032be765e4b9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101061 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
822de46c74
commit
863d9edf59
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 64
|
||||
; Bound: 65
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
@@ -9,6 +9,8 @@
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %src_private "src_private"
|
||||
OpName %src_workgroup "src_workgroup"
|
||||
OpName %src_uniform_block "src_uniform_block"
|
||||
OpMemberName %src_uniform_block 0 "inner"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "arr"
|
||||
OpName %src_uniform "src_uniform"
|
||||
@@ -23,7 +25,8 @@
|
||||
OpName %dst_nested "dst_nested"
|
||||
OpName %src_nested "src_nested"
|
||||
OpDecorate %_arr_v4int_uint_4 ArrayStride 16
|
||||
OpDecorate %S Block
|
||||
OpDecorate %src_uniform_block Block
|
||||
OpMemberDecorate %src_uniform_block 0 Offset 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %src_uniform NonWritable
|
||||
OpDecorate %src_uniform DescriptorSet 0
|
||||
@@ -44,24 +47,25 @@
|
||||
%_ptr_Workgroup__arr_v4int_uint_4 = OpTypePointer Workgroup %_arr_v4int_uint_4
|
||||
%src_workgroup = OpVariable %_ptr_Workgroup__arr_v4int_uint_4 Workgroup
|
||||
%S = OpTypeStruct %_arr_v4int_uint_4
|
||||
%_ptr_Uniform_S = OpTypePointer Uniform %S
|
||||
%src_uniform = OpVariable %_ptr_Uniform_S Uniform
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%src_storage = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%src_uniform_block = OpTypeStruct %S
|
||||
%_ptr_Uniform_src_uniform_block = OpTypePointer Uniform %src_uniform_block
|
||||
%src_uniform = OpVariable %_ptr_Uniform_src_uniform_block Uniform
|
||||
%_ptr_StorageBuffer_src_uniform_block = OpTypePointer StorageBuffer %src_uniform_block
|
||||
%src_storage = OpVariable %_ptr_StorageBuffer_src_uniform_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%16 = OpTypeFunction %void
|
||||
%20 = OpTypeFunction %_arr_v4int_uint_4
|
||||
%23 = OpTypeFunction %S
|
||||
%26 = OpConstantNull %S
|
||||
%27 = OpTypeFunction %void %_arr_v4int_uint_4
|
||||
%17 = OpTypeFunction %void
|
||||
%21 = OpTypeFunction %_arr_v4int_uint_4
|
||||
%24 = OpTypeFunction %S
|
||||
%27 = OpConstantNull %S
|
||||
%28 = OpTypeFunction %void %_arr_v4int_uint_4
|
||||
%_ptr_Function__arr_v4int_uint_4 = OpTypePointer Function %_arr_v4int_uint_4
|
||||
%int_1 = OpConstant %int 1
|
||||
%35 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%36 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%int_2 = OpConstant %int 2
|
||||
%37 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%38 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2
|
||||
%int_3 = OpConstant %int 3
|
||||
%39 = OpConstantComposite %v4int %int_3 %int_3 %int_3 %int_3
|
||||
%40 = OpConstantComposite %_arr_v4int_uint_4 %35 %37 %39 %39
|
||||
%40 = OpConstantComposite %v4int %int_3 %int_3 %int_3 %int_3
|
||||
%41 = OpConstantComposite %_arr_v4int_uint_4 %36 %38 %40 %40
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform__arr_v4int_uint_4 = OpTypePointer Uniform %_arr_v4int_uint_4
|
||||
%_ptr_StorageBuffer__arr_v4int_uint_4 = OpTypePointer StorageBuffer %_arr_v4int_uint_4
|
||||
@@ -71,47 +75,47 @@
|
||||
%_arr__arr_int_uint_2_uint_3 = OpTypeArray %_arr_int_uint_2 %uint_3
|
||||
%_arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypeArray %_arr__arr_int_uint_2_uint_3 %uint_4
|
||||
%_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Function %_arr__arr__arr_int_uint_2_uint_3_uint_4
|
||||
%61 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4
|
||||
%unused_entry_point = OpFunction %void None %16
|
||||
%19 = OpLabel
|
||||
%62 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4
|
||||
%unused_entry_point = OpFunction %void None %17
|
||||
%20 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%ret_arr = OpFunction %_arr_v4int_uint_4 None %20
|
||||
%22 = OpLabel
|
||||
%ret_arr = OpFunction %_arr_v4int_uint_4 None %21
|
||||
%23 = OpLabel
|
||||
OpReturnValue %8
|
||||
OpFunctionEnd
|
||||
%ret_struct_arr = OpFunction %S None %23
|
||||
%25 = OpLabel
|
||||
OpReturnValue %26
|
||||
%ret_struct_arr = OpFunction %S None %24
|
||||
%26 = OpLabel
|
||||
OpReturnValue %27
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %27
|
||||
%foo = OpFunction %void None %28
|
||||
%src_param = OpFunctionParameter %_arr_v4int_uint_4
|
||||
%30 = OpLabel
|
||||
%31 = OpLabel
|
||||
%src_function = OpVariable %_ptr_Function__arr_v4int_uint_4 Function %8
|
||||
%dst = OpVariable %_ptr_Function__arr_v4int_uint_4 Function %8
|
||||
%dst_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %61
|
||||
%src_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %61
|
||||
OpStore %dst %40
|
||||
OpStore %dst %src_param
|
||||
%41 = OpFunctionCall %_arr_v4int_uint_4 %ret_arr
|
||||
%dst_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %62
|
||||
%src_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %62
|
||||
OpStore %dst %41
|
||||
OpStore %dst %8
|
||||
%42 = OpLoad %_arr_v4int_uint_4 %src_function
|
||||
OpStore %dst %src_param
|
||||
%42 = OpFunctionCall %_arr_v4int_uint_4 %ret_arr
|
||||
OpStore %dst %42
|
||||
%43 = OpLoad %_arr_v4int_uint_4 %src_private
|
||||
OpStore %dst %8
|
||||
%43 = OpLoad %_arr_v4int_uint_4 %src_function
|
||||
OpStore %dst %43
|
||||
%44 = OpLoad %_arr_v4int_uint_4 %src_workgroup
|
||||
%44 = OpLoad %_arr_v4int_uint_4 %src_private
|
||||
OpStore %dst %44
|
||||
%45 = OpFunctionCall %S %ret_struct_arr
|
||||
%46 = OpCompositeExtract %_arr_v4int_uint_4 %45 0
|
||||
OpStore %dst %46
|
||||
%49 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %src_uniform %uint_0
|
||||
%50 = OpLoad %_arr_v4int_uint_4 %49
|
||||
OpStore %dst %50
|
||||
%52 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %src_storage %uint_0
|
||||
%53 = OpLoad %_arr_v4int_uint_4 %52
|
||||
OpStore %dst %53
|
||||
%63 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %src_nested
|
||||
OpStore %dst_nested %63
|
||||
%45 = OpLoad %_arr_v4int_uint_4 %src_workgroup
|
||||
OpStore %dst %45
|
||||
%46 = OpFunctionCall %S %ret_struct_arr
|
||||
%47 = OpCompositeExtract %_arr_v4int_uint_4 %46 0
|
||||
OpStore %dst %47
|
||||
%50 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %src_uniform %uint_0 %uint_0
|
||||
%51 = OpLoad %_arr_v4int_uint_4 %50
|
||||
OpStore %dst %51
|
||||
%53 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %src_storage %uint_0 %uint_0
|
||||
%54 = OpLoad %_arr_v4int_uint_4 %53
|
||||
OpStore %dst %54
|
||||
%64 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %src_nested
|
||||
OpStore %dst_nested %64
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user