mirror of
				https://github.com/encounter/dawn-cmake.git
				synced 2025-10-26 03:30:30 +00:00 
			
		
		
		
	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>
		
			
				
	
	
		
			125 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			125 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| ; SPIR-V
 | |
| ; Version: 1.3
 | |
| ; Generator: Google Tint Compiler; 0
 | |
| ; Bound: 68
 | |
| ; 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"
 | |
|                OpMemberName %S 1 "b"
 | |
|                OpMemberName %S 2 "c"
 | |
|                OpName %v "v"
 | |
|                OpName %i "i"
 | |
|                OpName %unused_entry_point "unused_entry_point"
 | |
|                OpName %idx1 "idx1"
 | |
|                OpName %idx2 "idx2"
 | |
|                OpName %idx3 "idx3"
 | |
|                OpName %foo "foo"
 | |
|                OpName %a "a"
 | |
|                OpDecorate %v_block Block
 | |
|                OpMemberDecorate %v_block 0 Offset 0
 | |
|                OpMemberDecorate %S 0 Offset 0
 | |
|                OpMemberDecorate %S 1 Offset 16
 | |
|                OpMemberDecorate %S 2 Offset 32
 | |
|                OpMemberDecorate %S 2 ColMajor
 | |
|                OpMemberDecorate %S 2 MatrixStride 8
 | |
|                OpDecorate %v DescriptorSet 0
 | |
|                OpDecorate %v Binding 0
 | |
|                OpDecorate %_arr_float_uint_4 ArrayStride 4
 | |
|         %int = OpTypeInt 32 1
 | |
|       %float = OpTypeFloat 32
 | |
|     %v4float = OpTypeVector %float 4
 | |
|     %v2float = OpTypeVector %float 2
 | |
| %mat2v2float = OpTypeMatrix %v2float 2
 | |
|           %S = OpTypeStruct %int %v4float %mat2v2float
 | |
|     %v_block = OpTypeStruct %S
 | |
| %_ptr_StorageBuffer_v_block = OpTypePointer StorageBuffer %v_block
 | |
|           %v = OpVariable %_ptr_StorageBuffer_v_block StorageBuffer
 | |
|        %uint = OpTypeInt 32 0
 | |
| %_ptr_Private_uint = OpTypePointer Private %uint
 | |
|          %13 = OpConstantNull %uint
 | |
|           %i = OpVariable %_ptr_Private_uint Private %13
 | |
|        %void = OpTypeVoid
 | |
|          %14 = OpTypeFunction %void
 | |
|          %18 = OpTypeFunction %int
 | |
|      %uint_1 = OpConstant %uint 1
 | |
|       %int_1 = OpConstant %int 1
 | |
|      %uint_2 = OpConstant %uint 2
 | |
|      %uint_3 = OpConstant %uint 3
 | |
|      %uint_4 = OpConstant %uint 4
 | |
| %_arr_float_uint_4 = OpTypeArray %float %uint_4
 | |
|          %39 = OpConstantNull %_arr_float_uint_4
 | |
| %_ptr_Function__arr_float_uint_4 = OpTypePointer Function %_arr_float_uint_4
 | |
| %_ptr_Function_float = OpTypePointer Function %float
 | |
|     %float_2 = OpConstant %float 2
 | |
|    %float_10 = OpConstant %float 10
 | |
|        %bool = OpTypeBool
 | |
|     %float_1 = OpConstant %float 1
 | |
| %unused_entry_point = OpFunction %void None %14
 | |
|          %17 = OpLabel
 | |
|                OpReturn
 | |
|                OpFunctionEnd
 | |
|        %idx1 = OpFunction %int None %18
 | |
|          %20 = OpLabel
 | |
|          %21 = OpLoad %uint %i
 | |
|          %23 = OpIAdd %uint %21 %uint_1
 | |
|                OpStore %i %23
 | |
|                OpReturnValue %int_1
 | |
|                OpFunctionEnd
 | |
|        %idx2 = OpFunction %int None %18
 | |
|          %26 = OpLabel
 | |
|          %27 = OpLoad %uint %i
 | |
|          %29 = OpIAdd %uint %27 %uint_2
 | |
|                OpStore %i %29
 | |
|                OpReturnValue %int_1
 | |
|                OpFunctionEnd
 | |
|        %idx3 = OpFunction %int None %18
 | |
|          %31 = OpLabel
 | |
|          %32 = OpLoad %uint %i
 | |
|          %34 = OpIAdd %uint %32 %uint_3
 | |
|                OpStore %i %34
 | |
|                OpReturnValue %int_1
 | |
|                OpFunctionEnd
 | |
|         %foo = OpFunction %void None %14
 | |
|          %36 = OpLabel
 | |
|           %a = OpVariable %_ptr_Function__arr_float_uint_4 Function %39
 | |
|                OpStore %a %39
 | |
|          %42 = OpFunctionCall %int %idx1
 | |
|          %44 = OpAccessChain %_ptr_Function_float %a %42
 | |
|          %45 = OpAccessChain %_ptr_Function_float %a %42
 | |
|          %46 = OpLoad %float %45
 | |
|          %48 = OpFMul %float %46 %float_2
 | |
|                OpStore %44 %48
 | |
|                OpBranch %49
 | |
|          %49 = OpLabel
 | |
|                OpLoopMerge %50 %51 None
 | |
|                OpBranch %52
 | |
|          %52 = OpLabel
 | |
|          %53 = OpFunctionCall %int %idx2
 | |
|          %55 = OpAccessChain %_ptr_Function_float %a %53
 | |
|          %56 = OpLoad %float %55
 | |
|          %58 = OpFOrdLessThan %bool %56 %float_10
 | |
|          %54 = OpLogicalNot %bool %58
 | |
|                OpSelectionMerge %60 None
 | |
|                OpBranchConditional %54 %61 %60
 | |
|          %61 = OpLabel
 | |
|                OpBranch %50
 | |
|          %60 = OpLabel
 | |
|                OpBranch %51
 | |
|          %51 = OpLabel
 | |
|          %62 = OpFunctionCall %int %idx3
 | |
|          %63 = OpAccessChain %_ptr_Function_float %a %62
 | |
|          %64 = OpAccessChain %_ptr_Function_float %a %62
 | |
|          %65 = OpLoad %float %64
 | |
|          %67 = OpFAdd %float %65 %float_1
 | |
|                OpStore %63 %67
 | |
|                OpBranch %49
 | |
|          %50 = OpLabel
 | |
|                OpReturn
 | |
|                OpFunctionEnd
 |