mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-04 19:25:47 +00:00
Shuffle the transform orders to ensure that these are embedded in a structure before running the Std140 transform. Add more end-to-end tests for these. As pointed out in tint:1673, arrays of matrices are not correctly decomposed by the Std140 transform. This will be addressed by a later change. Bug: tint:1673 Change-Id: I47c93e458ff48578922d576819792e8ed3a5723c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102541 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Zhaoming Jiang <zhaoming.jiang@intel.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: David Neto <dneto@google.com>
128 lines
6.1 KiB
Plaintext
128 lines
6.1 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.3
|
|
; Generator: Google Tint Compiler; 0
|
|
; Bound: 82
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint Vertex %main "main" %gl_VertexIndex_1 %value %vertex_point_size
|
|
OpName %gl_VertexIndex_1 "gl_VertexIndex_1"
|
|
OpName %value "value"
|
|
OpName %vertex_point_size "vertex_point_size"
|
|
OpName %vertexUniformBuffer1_std140 "vertexUniformBuffer1_std140"
|
|
OpMemberName %vertexUniformBuffer1_std140 0 "transform1_0"
|
|
OpMemberName %vertexUniformBuffer1_std140 1 "transform1_1"
|
|
OpName %x_20 "x_20"
|
|
OpName %vertexUniformBuffer2_std140 "vertexUniformBuffer2_std140"
|
|
OpMemberName %vertexUniformBuffer2_std140 0 "transform2_0"
|
|
OpMemberName %vertexUniformBuffer2_std140 1 "transform2_1"
|
|
OpName %x_26 "x_26"
|
|
OpName %load_x_20_transform1 "load_x_20_transform1"
|
|
OpName %load_x_26_transform2 "load_x_26_transform2"
|
|
OpName %main_inner "main_inner"
|
|
OpName %gl_VertexIndex "gl_VertexIndex"
|
|
OpName %indexable "indexable"
|
|
OpName %main "main"
|
|
OpDecorate %gl_VertexIndex_1 BuiltIn VertexIndex
|
|
OpDecorate %value BuiltIn Position
|
|
OpDecorate %vertex_point_size BuiltIn PointSize
|
|
OpDecorate %vertexUniformBuffer1_std140 Block
|
|
OpMemberDecorate %vertexUniformBuffer1_std140 0 Offset 0
|
|
OpMemberDecorate %vertexUniformBuffer1_std140 1 Offset 8
|
|
OpDecorate %x_20 NonWritable
|
|
OpDecorate %x_20 DescriptorSet 0
|
|
OpDecorate %x_20 Binding 0
|
|
OpDecorate %vertexUniformBuffer2_std140 Block
|
|
OpMemberDecorate %vertexUniformBuffer2_std140 0 Offset 0
|
|
OpMemberDecorate %vertexUniformBuffer2_std140 1 Offset 8
|
|
OpDecorate %x_26 NonWritable
|
|
OpDecorate %x_26 DescriptorSet 1
|
|
OpDecorate %x_26 Binding 0
|
|
OpDecorate %_arr_v2float_uint_3 ArrayStride 8
|
|
%uint = OpTypeInt 32 0
|
|
%_ptr_Input_uint = OpTypePointer Input %uint
|
|
%gl_VertexIndex_1 = OpVariable %_ptr_Input_uint Input
|
|
%float = OpTypeFloat 32
|
|
%v4float = OpTypeVector %float 4
|
|
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
|
%8 = OpConstantNull %v4float
|
|
%value = OpVariable %_ptr_Output_v4float Output %8
|
|
%_ptr_Output_float = OpTypePointer Output %float
|
|
%11 = OpConstantNull %float
|
|
%vertex_point_size = OpVariable %_ptr_Output_float Output %11
|
|
%v2float = OpTypeVector %float 2
|
|
%vertexUniformBuffer1_std140 = OpTypeStruct %v2float %v2float
|
|
%_ptr_Uniform_vertexUniformBuffer1_std140 = OpTypePointer Uniform %vertexUniformBuffer1_std140
|
|
%x_20 = OpVariable %_ptr_Uniform_vertexUniformBuffer1_std140 Uniform
|
|
%vertexUniformBuffer2_std140 = OpTypeStruct %v2float %v2float
|
|
%_ptr_Uniform_vertexUniformBuffer2_std140 = OpTypePointer Uniform %vertexUniformBuffer2_std140
|
|
%x_26 = OpVariable %_ptr_Uniform_vertexUniformBuffer2_std140 Uniform
|
|
%mat2v2float = OpTypeMatrix %v2float 2
|
|
%19 = OpTypeFunction %mat2v2float
|
|
%uint_0 = OpConstant %uint 0
|
|
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
|
|
%uint_1 = OpConstant %uint 1
|
|
%44 = OpTypeFunction %v4float %uint
|
|
%uint_3 = OpConstant %uint 3
|
|
%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
|
|
%_ptr_Function__arr_v2float_uint_3 = OpTypePointer Function %_arr_v2float_uint_3
|
|
%52 = OpConstantNull %_arr_v2float_uint_3
|
|
%float_n1 = OpConstant %float -1
|
|
%float_1 = OpConstant %float 1
|
|
%57 = OpConstantComposite %v2float %float_n1 %float_1
|
|
%58 = OpConstantComposite %v2float %float_1 %float_1
|
|
%59 = OpConstantComposite %v2float %float_n1 %float_n1
|
|
%60 = OpConstantComposite %_arr_v2float_uint_3 %57 %58 %59
|
|
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
|
%64 = OpConstantNull %uint
|
|
%void = OpTypeVoid
|
|
%76 = OpTypeFunction %void
|
|
%load_x_20_transform1 = OpFunction %mat2v2float None %19
|
|
%22 = OpLabel
|
|
%27 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_0
|
|
%28 = OpLoad %v2float %27
|
|
%31 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_1
|
|
%32 = OpLoad %v2float %31
|
|
%33 = OpCompositeConstruct %mat2v2float %28 %32
|
|
OpReturnValue %33
|
|
OpFunctionEnd
|
|
%load_x_26_transform2 = OpFunction %mat2v2float None %19
|
|
%35 = OpLabel
|
|
%38 = OpAccessChain %_ptr_Uniform_v2float %x_26 %uint_0
|
|
%39 = OpLoad %v2float %38
|
|
%41 = OpAccessChain %_ptr_Uniform_v2float %x_26 %uint_1
|
|
%42 = OpLoad %v2float %41
|
|
%43 = OpCompositeConstruct %mat2v2float %39 %42
|
|
OpReturnValue %43
|
|
OpFunctionEnd
|
|
%main_inner = OpFunction %v4float None %44
|
|
%gl_VertexIndex = OpFunctionParameter %uint
|
|
%47 = OpLabel
|
|
%indexable = OpVariable %_ptr_Function__arr_v2float_uint_3 Function %52
|
|
%53 = OpFunctionCall %mat2v2float %load_x_20_transform1
|
|
%54 = OpFunctionCall %mat2v2float %load_x_26_transform2
|
|
OpStore %indexable %60
|
|
%62 = OpAccessChain %_ptr_Function_v2float %indexable %gl_VertexIndex
|
|
%63 = OpLoad %v2float %62
|
|
%65 = OpCompositeExtract %v2float %53 0
|
|
%66 = OpCompositeExtract %v2float %54 0
|
|
%67 = OpFAdd %v2float %65 %66
|
|
%68 = OpCompositeExtract %v2float %53 1
|
|
%69 = OpCompositeExtract %v2float %54 1
|
|
%70 = OpFAdd %v2float %68 %69
|
|
%71 = OpCompositeConstruct %mat2v2float %67 %70
|
|
%72 = OpMatrixTimesVector %v2float %71 %63
|
|
%73 = OpCompositeExtract %float %72 0
|
|
%74 = OpCompositeExtract %float %72 1
|
|
%75 = OpCompositeConstruct %v4float %73 %74 %11 %float_1
|
|
OpReturnValue %75
|
|
OpFunctionEnd
|
|
%main = OpFunction %void None %76
|
|
%79 = OpLabel
|
|
%81 = OpLoad %uint %gl_VertexIndex_1
|
|
%80 = OpFunctionCall %v4float %main_inner %81
|
|
OpStore %value %80
|
|
OpStore %vertex_point_size %float_1
|
|
OpReturn
|
|
OpFunctionEnd
|