tint: Add support for workgroupUniformLoad

Accept any type in the intrinsics definition, and then manually
validate that there are no atomics in the type. Add manual E2E tests
for composite types.

Use the BuiltinPolyfill transform to implement it for all backends.

Update the uniformity analysis with special-case tags for the builtin.

Fixed: tint:1780
Change-Id: I95786dff4df70a0b16ed1c53b853b5d0ec6bc501
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114862
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: James Price <jrprice@google.com>
This commit is contained in:
James Price
2023-01-06 02:25:06 +00:00
committed by Dawn LUCI CQ
parent 3b83e389fa
commit 128980f218
148 changed files with 5314 additions and 1407 deletions

View File

@@ -0,0 +1,41 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; 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 "v"
OpName %unused_entry_point "unused_entry_point"
OpName %tint_workgroupUniformLoad_v "tint_workgroupUniformLoad_v"
OpName %foo "foo"
OpDecorate %_arr_int_uint_4 ArrayStride 4
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_int_uint_4 = OpTypeArray %int %uint_4
%_ptr_Workgroup__arr_int_uint_4 = OpTypePointer Workgroup %_arr_int_uint_4
%v = OpVariable %_ptr_Workgroup__arr_int_uint_4 Workgroup
%void = OpTypeVoid
%7 = OpTypeFunction %void
%11 = OpTypeFunction %_arr_int_uint_4
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%unused_entry_point = OpFunction %void None %7
%10 = OpLabel
OpReturn
OpFunctionEnd
%tint_workgroupUniformLoad_v = OpFunction %_arr_int_uint_4 None %11
%13 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%17 = OpLoad %_arr_int_uint_4 %v
OpControlBarrier %uint_2 %uint_2 %uint_264
OpReturnValue %17
OpFunctionEnd
%foo = OpFunction %_arr_int_uint_4 None %11
%20 = OpLabel
%21 = OpFunctionCall %_arr_int_uint_4 %tint_workgroupUniformLoad_v
OpReturnValue %21
OpFunctionEnd