2022-05-11 22:05:15 +00:00
|
|
|
bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow
|
|
|
|
var srcColor = textureSample(myTexture, mySampler, texcoord);
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
2022-05-16 11:53:25 +00:00
|
|
|
bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value
|
|
|
|
if (!all(clampedTexcoord == texcoord)) {
|
|
|
|
^^
|
|
|
|
|
2022-05-16 11:53:25 +00:00
|
|
|
bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value
|
|
|
|
if (!all(clampedTexcoord == texcoord)) {
|
|
|
|
^^^^^^^^
|
2022-05-11 22:05:15 +00:00
|
|
|
|
2021-06-21 19:27:26 +00:00
|
|
|
; SPIR-V
|
|
|
|
; Version: 1.3
|
|
|
|
; Generator: Google Tint Compiler; 0
|
2022-03-28 20:51:32 +00:00
|
|
|
; Bound: 140
|
2021-06-21 19:27:26 +00:00
|
|
|
; Schema: 0
|
|
|
|
OpCapability Shader
|
2022-03-28 20:51:32 +00:00
|
|
|
%118 = OpExtInstImport "GLSL.std.450"
|
2021-06-21 19:27:26 +00:00
|
|
|
OpMemoryModel Logical GLSL450
|
2021-08-05 17:34:19 +00:00
|
|
|
OpEntryPoint Vertex %vs_main "vs_main" %VertexIndex_1 %texcoords_1 %position_1 %vertex_point_size
|
|
|
|
OpEntryPoint Fragment %fs_main "fs_main" %texcoord_1 %value
|
2021-06-21 19:27:26 +00:00
|
|
|
OpExecutionMode %fs_main OriginUpperLeft
|
2021-08-05 17:34:19 +00:00
|
|
|
OpName %VertexIndex_1 "VertexIndex_1"
|
|
|
|
OpName %texcoords_1 "texcoords_1"
|
|
|
|
OpName %position_1 "position_1"
|
|
|
|
OpName %vertex_point_size "vertex_point_size"
|
|
|
|
OpName %texcoord_1 "texcoord_1"
|
|
|
|
OpName %value "value"
|
2021-06-21 19:27:26 +00:00
|
|
|
OpName %Uniforms "Uniforms"
|
|
|
|
OpMemberName %Uniforms 0 "u_scale"
|
|
|
|
OpMemberName %Uniforms 1 "u_offset"
|
|
|
|
OpName %uniforms "uniforms"
|
|
|
|
OpName %mySampler "mySampler"
|
|
|
|
OpName %myTexture "myTexture"
|
|
|
|
OpName %VertexOutputs "VertexOutputs"
|
|
|
|
OpMemberName %VertexOutputs 0 "texcoords"
|
|
|
|
OpMemberName %VertexOutputs 1 "position"
|
2021-08-05 17:34:19 +00:00
|
|
|
OpName %vs_main_inner "vs_main_inner"
|
|
|
|
OpName %VertexIndex "VertexIndex"
|
2021-06-21 19:27:26 +00:00
|
|
|
OpName %texcoord "texcoord"
|
|
|
|
OpName %output "output"
|
|
|
|
OpName %flipY "flipY"
|
2021-08-05 17:34:19 +00:00
|
|
|
OpName %vs_main "vs_main"
|
2022-03-28 20:51:32 +00:00
|
|
|
OpName %tint_discard_func "tint_discard_func"
|
2021-08-05 17:34:19 +00:00
|
|
|
OpName %fs_main_inner "fs_main_inner"
|
|
|
|
OpName %texcoord_0 "texcoord"
|
2021-06-21 19:27:26 +00:00
|
|
|
OpName %clampedTexcoord "clampedTexcoord"
|
|
|
|
OpName %srcColor "srcColor"
|
2021-08-05 17:34:19 +00:00
|
|
|
OpName %fs_main "fs_main"
|
|
|
|
OpDecorate %VertexIndex_1 BuiltIn VertexIndex
|
|
|
|
OpDecorate %texcoords_1 Location 0
|
|
|
|
OpDecorate %position_1 BuiltIn Position
|
|
|
|
OpDecorate %vertex_point_size BuiltIn PointSize
|
|
|
|
OpDecorate %texcoord_1 Location 0
|
|
|
|
OpDecorate %value Location 0
|
2021-06-21 19:27:26 +00:00
|
|
|
OpDecorate %Uniforms Block
|
|
|
|
OpMemberDecorate %Uniforms 0 Offset 0
|
|
|
|
OpMemberDecorate %Uniforms 1 Offset 8
|
|
|
|
OpDecorate %uniforms NonWritable
|
|
|
|
OpDecorate %uniforms Binding 0
|
|
|
|
OpDecorate %uniforms DescriptorSet 0
|
|
|
|
OpDecorate %mySampler Binding 1
|
|
|
|
OpDecorate %mySampler DescriptorSet 0
|
|
|
|
OpDecorate %myTexture Binding 2
|
|
|
|
OpDecorate %myTexture DescriptorSet 0
|
|
|
|
OpMemberDecorate %VertexOutputs 0 Offset 0
|
|
|
|
OpMemberDecorate %VertexOutputs 1 Offset 16
|
|
|
|
OpDecorate %_arr_v2float_uint_3 ArrayStride 8
|
|
|
|
%uint = OpTypeInt 32 0
|
|
|
|
%_ptr_Input_uint = OpTypePointer Input %uint
|
2021-08-05 17:34:19 +00:00
|
|
|
%VertexIndex_1 = OpVariable %_ptr_Input_uint Input
|
|
|
|
%float = OpTypeFloat 32
|
|
|
|
%v2float = OpTypeVector %float 2
|
2021-06-21 19:27:26 +00:00
|
|
|
%_ptr_Output_v2float = OpTypePointer Output %v2float
|
2021-08-05 17:34:19 +00:00
|
|
|
%8 = OpConstantNull %v2float
|
|
|
|
%texcoords_1 = OpVariable %_ptr_Output_v2float Output %8
|
2021-06-21 19:27:26 +00:00
|
|
|
%v4float = OpTypeVector %float 4
|
|
|
|
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
2021-08-05 17:34:19 +00:00
|
|
|
%12 = OpConstantNull %v4float
|
|
|
|
%position_1 = OpVariable %_ptr_Output_v4float Output %12
|
|
|
|
%_ptr_Output_float = OpTypePointer Output %float
|
|
|
|
%15 = OpConstantNull %float
|
|
|
|
%vertex_point_size = OpVariable %_ptr_Output_float Output %15
|
2021-06-21 19:27:26 +00:00
|
|
|
%_ptr_Input_v2float = OpTypePointer Input %v2float
|
2021-08-05 17:34:19 +00:00
|
|
|
%texcoord_1 = OpVariable %_ptr_Input_v2float Input
|
|
|
|
%value = OpVariable %_ptr_Output_v4float Output %12
|
|
|
|
%Uniforms = OpTypeStruct %v2float %v2float
|
|
|
|
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
|
|
|
|
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
|
|
|
|
%24 = OpTypeSampler
|
|
|
|
%_ptr_UniformConstant_24 = OpTypePointer UniformConstant %24
|
|
|
|
%mySampler = OpVariable %_ptr_UniformConstant_24 UniformConstant
|
|
|
|
%27 = OpTypeImage %float 2D 0 0 0 1 Unknown
|
|
|
|
%_ptr_UniformConstant_27 = OpTypePointer UniformConstant %27
|
|
|
|
%myTexture = OpVariable %_ptr_UniformConstant_27 UniformConstant
|
2021-06-21 19:27:26 +00:00
|
|
|
%VertexOutputs = OpTypeStruct %v2float %v4float
|
2021-08-05 17:34:19 +00:00
|
|
|
%28 = OpTypeFunction %VertexOutputs %uint
|
2021-06-21 19:27:26 +00:00
|
|
|
%uint_3 = OpConstant %uint 3
|
|
|
|
%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
|
|
|
|
%float_n0_5 = OpConstant %float -0.5
|
|
|
|
%float_0 = OpConstant %float 0
|
2021-08-05 17:34:19 +00:00
|
|
|
%37 = OpConstantComposite %v2float %float_n0_5 %float_0
|
2021-06-21 19:27:26 +00:00
|
|
|
%float_1_5 = OpConstant %float 1.5
|
2021-08-05 17:34:19 +00:00
|
|
|
%39 = OpConstantComposite %v2float %float_1_5 %float_0
|
2021-06-21 19:27:26 +00:00
|
|
|
%float_0_5 = OpConstant %float 0.5
|
|
|
|
%float_2 = OpConstant %float 2
|
2021-08-05 17:34:19 +00:00
|
|
|
%42 = OpConstantComposite %v2float %float_0_5 %float_2
|
|
|
|
%43 = OpConstantComposite %_arr_v2float_uint_3 %37 %39 %42
|
2021-06-21 19:27:26 +00:00
|
|
|
%_ptr_Function__arr_v2float_uint_3 = OpTypePointer Function %_arr_v2float_uint_3
|
2021-08-05 17:34:19 +00:00
|
|
|
%46 = OpConstantNull %_arr_v2float_uint_3
|
2021-06-21 19:27:26 +00:00
|
|
|
%_ptr_Function_VertexOutputs = OpTypePointer Function %VertexOutputs
|
2021-08-05 17:34:19 +00:00
|
|
|
%49 = OpConstantNull %VertexOutputs
|
2021-06-21 19:27:26 +00:00
|
|
|
%uint_1 = OpConstant %uint 1
|
|
|
|
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
|
|
|
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
2021-08-05 17:34:19 +00:00
|
|
|
%float_1 = OpConstant %float 1
|
|
|
|
%58 = OpConstantComposite %v2float %float_1 %float_1
|
2021-06-21 19:27:26 +00:00
|
|
|
%uint_0 = OpConstant %uint 0
|
|
|
|
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
|
|
|
%bool = OpTypeBool
|
|
|
|
%_ptr_Function_bool = OpTypePointer Function %bool
|
2021-08-05 17:34:19 +00:00
|
|
|
%71 = OpConstantNull %bool
|
2021-06-21 19:27:26 +00:00
|
|
|
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
|
|
|
|
%float_n1 = OpConstant %float -1
|
2021-08-05 17:34:19 +00:00
|
|
|
%87 = OpConstantComposite %v2float %float_1 %float_n1
|
|
|
|
%89 = OpConstantComposite %v2float %float_0 %float_1
|
|
|
|
%void = OpTypeVoid
|
|
|
|
%103 = OpTypeFunction %void
|
2022-03-28 20:51:32 +00:00
|
|
|
%113 = OpTypeFunction %v4float %v2float
|
|
|
|
%119 = OpConstantComposite %v2float %float_0 %float_0
|
2021-06-21 19:27:26 +00:00
|
|
|
%v2bool = OpTypeVector %bool 2
|
2022-03-28 20:51:32 +00:00
|
|
|
%132 = OpTypeSampledImage %27
|
2021-08-05 17:34:19 +00:00
|
|
|
%vs_main_inner = OpFunction %VertexOutputs None %28
|
|
|
|
%VertexIndex = OpFunctionParameter %uint
|
|
|
|
%32 = OpLabel
|
|
|
|
%texcoord = OpVariable %_ptr_Function__arr_v2float_uint_3 Function %46
|
|
|
|
%output = OpVariable %_ptr_Function_VertexOutputs Function %49
|
|
|
|
%flipY = OpVariable %_ptr_Function_bool Function %71
|
|
|
|
OpStore %texcoord %43
|
|
|
|
%52 = OpAccessChain %_ptr_Function_v4float %output %uint_1
|
|
|
|
%54 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
|
|
|
|
%55 = OpLoad %v2float %54
|
|
|
|
%56 = OpVectorTimesScalar %v2float %55 %float_2
|
|
|
|
%59 = OpFSub %v2float %56 %58
|
|
|
|
%60 = OpCompositeExtract %float %59 0
|
|
|
|
%61 = OpCompositeExtract %float %59 1
|
|
|
|
%62 = OpCompositeConstruct %v4float %60 %61 %float_0 %float_1
|
|
|
|
OpStore %52 %62
|
|
|
|
%65 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_1
|
|
|
|
%66 = OpLoad %float %65
|
|
|
|
%67 = OpFOrdLessThan %bool %66 %float_0
|
|
|
|
OpStore %flipY %67
|
|
|
|
%72 = OpLoad %bool %flipY
|
|
|
|
OpSelectionMerge %73 None
|
|
|
|
OpBranchConditional %72 %74 %75
|
|
|
|
%74 = OpLabel
|
|
|
|
%76 = OpAccessChain %_ptr_Function_v2float %output %uint_0
|
|
|
|
%77 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
|
|
|
|
%78 = OpLoad %v2float %77
|
|
|
|
%80 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0
|
|
|
|
%81 = OpLoad %v2float %80
|
|
|
|
%82 = OpFMul %v2float %78 %81
|
|
|
|
%83 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_1
|
|
|
|
%84 = OpLoad %v2float %83
|
|
|
|
%85 = OpFAdd %v2float %82 %84
|
|
|
|
%88 = OpFMul %v2float %85 %87
|
|
|
|
%90 = OpFAdd %v2float %88 %89
|
|
|
|
OpStore %76 %90
|
|
|
|
OpBranch %73
|
|
|
|
%75 = OpLabel
|
|
|
|
%91 = OpAccessChain %_ptr_Function_v2float %output %uint_0
|
|
|
|
%92 = OpAccessChain %_ptr_Function_v2float %texcoord %VertexIndex
|
|
|
|
%93 = OpLoad %v2float %92
|
|
|
|
%94 = OpFMul %v2float %93 %87
|
|
|
|
%95 = OpFAdd %v2float %94 %89
|
|
|
|
%96 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_0
|
|
|
|
%97 = OpLoad %v2float %96
|
|
|
|
%98 = OpFMul %v2float %95 %97
|
|
|
|
%99 = OpAccessChain %_ptr_Uniform_v2float %uniforms %uint_1
|
|
|
|
%100 = OpLoad %v2float %99
|
|
|
|
%101 = OpFAdd %v2float %98 %100
|
|
|
|
OpStore %91 %101
|
|
|
|
OpBranch %73
|
|
|
|
%73 = OpLabel
|
|
|
|
%102 = OpLoad %VertexOutputs %output
|
|
|
|
OpReturnValue %102
|
2021-06-21 19:27:26 +00:00
|
|
|
OpFunctionEnd
|
2021-08-05 17:34:19 +00:00
|
|
|
%vs_main = OpFunction %void None %103
|
|
|
|
%106 = OpLabel
|
|
|
|
%108 = OpLoad %uint %VertexIndex_1
|
|
|
|
%107 = OpFunctionCall %VertexOutputs %vs_main_inner %108
|
|
|
|
%109 = OpCompositeExtract %v2float %107 0
|
|
|
|
OpStore %texcoords_1 %109
|
|
|
|
%110 = OpCompositeExtract %v4float %107 1
|
|
|
|
OpStore %position_1 %110
|
|
|
|
OpStore %vertex_point_size %float_1
|
2021-06-21 19:27:26 +00:00
|
|
|
OpReturn
|
|
|
|
OpFunctionEnd
|
2022-03-28 20:51:32 +00:00
|
|
|
%tint_discard_func = OpFunction %void None %103
|
|
|
|
%112 = OpLabel
|
|
|
|
OpKill
|
|
|
|
OpFunctionEnd
|
|
|
|
%fs_main_inner = OpFunction %v4float None %113
|
2021-08-05 17:34:19 +00:00
|
|
|
%texcoord_0 = OpFunctionParameter %v2float
|
2022-03-28 20:51:32 +00:00
|
|
|
%116 = OpLabel
|
2021-08-05 17:34:19 +00:00
|
|
|
%clampedTexcoord = OpVariable %_ptr_Function_v2float Function %8
|
|
|
|
%srcColor = OpVariable %_ptr_Function_v4float Function %12
|
2022-03-28 20:51:32 +00:00
|
|
|
%117 = OpExtInst %v2float %118 NClamp %texcoord_0 %119 %58
|
|
|
|
OpStore %clampedTexcoord %117
|
|
|
|
%123 = OpLoad %v2float %clampedTexcoord
|
|
|
|
%124 = OpFOrdEqual %v2bool %123 %texcoord_0
|
|
|
|
%122 = OpAll %bool %124
|
|
|
|
%121 = OpLogicalNot %bool %122
|
|
|
|
OpSelectionMerge %126 None
|
|
|
|
OpBranchConditional %121 %127 %126
|
|
|
|
%127 = OpLabel
|
|
|
|
%128 = OpFunctionCall %void %tint_discard_func
|
|
|
|
OpReturnValue %12
|
|
|
|
%126 = OpLabel
|
|
|
|
%130 = OpLoad %24 %mySampler
|
|
|
|
%131 = OpLoad %27 %myTexture
|
|
|
|
%133 = OpSampledImage %132 %131 %130
|
|
|
|
%129 = OpImageSampleImplicitLod %v4float %133 %texcoord_0
|
|
|
|
OpStore %srcColor %129
|
|
|
|
%135 = OpLoad %v4float %srcColor
|
|
|
|
OpReturnValue %135
|
2021-08-05 17:34:19 +00:00
|
|
|
OpFunctionEnd
|
|
|
|
%fs_main = OpFunction %void None %103
|
2022-03-28 20:51:32 +00:00
|
|
|
%137 = OpLabel
|
|
|
|
%139 = OpLoad %v2float %texcoord_1
|
|
|
|
%138 = OpFunctionCall %v4float %fs_main_inner %139
|
|
|
|
OpStore %value %138
|
2021-06-21 19:27:26 +00:00
|
|
|
OpReturn
|
|
|
|
OpFunctionEnd
|