blob: 8266cfa76bbfda7fbc10b314e5d9e0f2d6b09e6a [file] [log] [blame]
bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform control flow
normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
^^^^
bug/tint/1118.wgsl:47:3 note: control flow depends on non-uniform value
if ((x_9 > 0.0)) {
^^
bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value
let x_9 : f32 = fClipDistance3;
^^^^^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 194
; Schema: 0
OpCapability Shader
%71 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %fClipDistance3_param_1 %fClipDistance4_param_1 %glFragColor_1_1
OpExecutionMode %main OriginUpperLeft
OpName %fClipDistance3_param_1 "fClipDistance3_param_1"
OpName %fClipDistance4_param_1 "fClipDistance4_param_1"
OpName %glFragColor_1_1 "glFragColor_1_1"
OpName %fClipDistance3 "fClipDistance3"
OpName %fClipDistance4 "fClipDistance4"
OpName %Scene "Scene"
OpMemberName %Scene 0 "vEyePosition"
OpName %x_29 "x_29"
OpName %Material "Material"
OpMemberName %Material 0 "vDiffuseColor"
OpMemberName %Material 1 "vAmbientColor"
OpMemberName %Material 2 "placeholder"
OpMemberName %Material 3 "vEmissiveColor"
OpMemberName %Material 4 "placeholder2"
OpName %x_49 "x_49"
OpName %Mesh "Mesh"
OpMemberName %Mesh 0 "visibility"
OpName %x_137 "x_137"
OpName %glFragColor "glFragColor"
OpName %tint_discard "tint_discard"
OpName %main_1 "main_1"
OpName %viewDirectionW "viewDirectionW"
OpName %baseColor "baseColor"
OpName %diffuseColor "diffuseColor"
OpName %alpha "alpha"
OpName %normalW "normalW"
OpName %uvOffset "uvOffset"
OpName %baseAmbientColor "baseAmbientColor"
OpName %glossiness "glossiness"
OpName %diffuseBase "diffuseBase"
OpName %shadow "shadow"
OpName %refractionColor "refractionColor"
OpName %reflectionColor "reflectionColor"
OpName %emissiveColor "emissiveColor"
OpName %finalDiffuse "finalDiffuse"
OpName %finalSpecular "finalSpecular"
OpName %color "color"
OpName %tint_discard_func "tint_discard_func"
OpName %main_out "main_out"
OpMemberName %main_out 0 "glFragColor_1"
OpName %main_inner "main_inner"
OpName %fClipDistance3_param "fClipDistance3_param"
OpName %fClipDistance4_param "fClipDistance4_param"
OpName %main "main"
OpDecorate %fClipDistance3_param_1 Location 2
OpDecorate %fClipDistance4_param_1 Location 3
OpDecorate %glFragColor_1_1 Location 0
OpDecorate %Scene Block
OpMemberDecorate %Scene 0 Offset 0
OpDecorate %x_29 NonWritable
OpDecorate %x_29 DescriptorSet 0
OpDecorate %x_29 Binding 0
OpDecorate %Material Block
OpMemberDecorate %Material 0 Offset 0
OpMemberDecorate %Material 1 Offset 16
OpMemberDecorate %Material 2 Offset 28
OpMemberDecorate %Material 3 Offset 32
OpMemberDecorate %Material 4 Offset 44
OpDecorate %x_49 NonWritable
OpDecorate %x_49 DescriptorSet 0
OpDecorate %x_49 Binding 1
OpDecorate %Mesh Block
OpMemberDecorate %Mesh 0 Offset 0
OpDecorate %x_137 NonWritable
OpDecorate %x_137 DescriptorSet 0
OpDecorate %x_137 Binding 2
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%_ptr_Input_float = OpTypePointer Input %float
%fClipDistance3_param_1 = OpVariable %_ptr_Input_float Input
%fClipDistance4_param_1 = OpVariable %_ptr_Input_float Input
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%8 = OpConstantNull %v4float
%glFragColor_1_1 = OpVariable %_ptr_Output_v4float Output %8
%_ptr_Private_float = OpTypePointer Private %float
%11 = OpConstantNull %float
%fClipDistance3 = OpVariable %_ptr_Private_float Private %11
%fClipDistance4 = OpVariable %_ptr_Private_float Private %11
%Scene = OpTypeStruct %v4float
%_ptr_Uniform_Scene = OpTypePointer Uniform %Scene
%x_29 = OpVariable %_ptr_Uniform_Scene Uniform
%v3float = OpTypeVector %float 3
%Material = OpTypeStruct %v4float %v3float %float %v3float %float
%_ptr_Uniform_Material = OpTypePointer Uniform %Material
%x_49 = OpVariable %_ptr_Uniform_Material Uniform
%Mesh = OpTypeStruct %float
%_ptr_Uniform_Mesh = OpTypePointer Uniform %Mesh
%x_137 = OpVariable %_ptr_Uniform_Mesh Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%glFragColor = OpVariable %_ptr_Private_v4float Private %8
%bool = OpTypeBool
%26 = OpConstantNull %bool
%_ptr_Private_bool = OpTypePointer Private %bool
%tint_discard = OpVariable %_ptr_Private_bool Private %26
%void = OpTypeVoid
%29 = OpTypeFunction %void
%_ptr_Function_v3float = OpTypePointer Function %v3float
%35 = OpConstantNull %v3float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_float = OpTypePointer Function %float
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%45 = OpConstantNull %v2float
%true = OpConstantTrue %bool
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_1 = OpConstant %float 1
%78 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%uint_3 = OpConstant %uint 3
%_ptr_Uniform_float = OpTypePointer Uniform %float
%110 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%111 = OpConstantComposite %v4float %11 %11 %11 %float_1
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
%uint_1 = OpConstant %uint 1
%main_out = OpTypeStruct %v4float
%174 = OpTypeFunction %main_out %float %float
%185 = OpConstantNull %main_out
%main_1 = OpFunction %void None %29
%32 = OpLabel
%viewDirectionW = OpVariable %_ptr_Function_v3float Function %35
%baseColor = OpVariable %_ptr_Function_v4float Function %8
%diffuseColor = OpVariable %_ptr_Function_v3float Function %35
%alpha = OpVariable %_ptr_Function_float Function %11
%normalW = OpVariable %_ptr_Function_v3float Function %35
%uvOffset = OpVariable %_ptr_Function_v2float Function %45
%baseAmbientColor = OpVariable %_ptr_Function_v3float Function %35
%glossiness = OpVariable %_ptr_Function_float Function %11
%diffuseBase = OpVariable %_ptr_Function_v3float Function %35
%shadow = OpVariable %_ptr_Function_float Function %11
%refractionColor = OpVariable %_ptr_Function_v4float Function %8
%reflectionColor = OpVariable %_ptr_Function_v4float Function %8
%emissiveColor = OpVariable %_ptr_Function_v3float Function %35
%finalDiffuse = OpVariable %_ptr_Function_v3float Function %35
%finalSpecular = OpVariable %_ptr_Function_v3float Function %35
%color = OpVariable %_ptr_Function_v4float Function %8
%56 = OpLoad %float %fClipDistance3
%57 = OpFOrdGreaterThan %bool %56 %11
OpSelectionMerge %58 None
OpBranchConditional %57 %59 %58
%59 = OpLabel
OpStore %tint_discard %true
OpReturn
%58 = OpLabel
%61 = OpLoad %float %fClipDistance4
%62 = OpFOrdGreaterThan %bool %61 %11
OpSelectionMerge %63 None
OpBranchConditional %62 %64 %63
%64 = OpLabel
OpStore %tint_discard %true
OpReturn
%63 = OpLabel
%68 = OpAccessChain %_ptr_Uniform_v4float %x_29 %uint_0
%69 = OpLoad %v4float %68
%72 = OpCompositeExtract %float %69 0
%73 = OpCompositeExtract %float %69 1
%74 = OpCompositeExtract %float %69 2
%75 = OpCompositeConstruct %v3float %72 %73 %74
%76 = OpFSub %v3float %75 %35
%70 = OpExtInst %v3float %71 Normalize %76
OpStore %viewDirectionW %70
OpStore %baseColor %78
%79 = OpAccessChain %_ptr_Uniform_v4float %x_49 %uint_0
%80 = OpLoad %v4float %79
%81 = OpCompositeExtract %float %80 0
%82 = OpCompositeExtract %float %80 1
%83 = OpCompositeExtract %float %80 2
%84 = OpCompositeConstruct %v3float %81 %82 %83
OpStore %diffuseColor %84
%87 = OpAccessChain %_ptr_Uniform_float %x_49 %uint_0 %uint_3
%88 = OpLoad %float %87
OpStore %alpha %88
%92 = OpDPdx %v3float %35
%93 = OpDPdy %v3float %35
%91 = OpExtInst %v3float %71 Cross %92 %93
%90 = OpFNegate %v3float %91
%89 = OpExtInst %v3float %71 Normalize %90
OpStore %normalW %89
OpStore %uvOffset %45
%94 = OpLoad %v4float %baseColor
%95 = OpCompositeExtract %float %94 0
%96 = OpCompositeExtract %float %94 1
%97 = OpCompositeExtract %float %94 2
%98 = OpCompositeConstruct %v3float %95 %96 %97
%99 = OpCompositeExtract %float %8 0
%100 = OpCompositeExtract %float %8 1
%101 = OpCompositeExtract %float %8 2
%102 = OpCompositeConstruct %v3float %99 %100 %101
%103 = OpFMul %v3float %98 %102
%104 = OpLoad %v4float %baseColor
%105 = OpCompositeExtract %float %103 0
%106 = OpCompositeExtract %float %103 1
%107 = OpCompositeExtract %float %103 2
%108 = OpCompositeExtract %float %104 3
%109 = OpCompositeConstruct %v4float %105 %106 %107 %108
OpStore %baseColor %109
OpStore %baseAmbientColor %110
OpStore %glossiness %11
OpStore %diffuseBase %35
OpStore %shadow %float_1
OpStore %refractionColor %111
OpStore %reflectionColor %111
%113 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_3
%114 = OpLoad %v3float %113
OpStore %emissiveColor %114
%115 = OpLoad %v3float %diffuseBase
%116 = OpLoad %v3float %diffuseColor
%117 = OpLoad %v3float %emissiveColor
%119 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_1
%120 = OpLoad %v3float %119
%121 = OpLoad %v4float %baseColor
%123 = OpFMul %v3float %115 %116
%124 = OpFAdd %v3float %123 %117
%125 = OpFAdd %v3float %124 %120
%122 = OpExtInst %v3float %71 NClamp %125 %35 %110
%126 = OpCompositeExtract %float %121 0
%127 = OpCompositeExtract %float %121 1
%128 = OpCompositeExtract %float %121 2
%129 = OpCompositeConstruct %v3float %126 %127 %128
%130 = OpFMul %v3float %122 %129
OpStore %finalDiffuse %130
OpStore %finalSpecular %35
%131 = OpLoad %v3float %finalDiffuse
%132 = OpLoad %v3float %baseAmbientColor
%133 = OpLoad %v3float %finalSpecular
%134 = OpLoad %v4float %reflectionColor
%135 = OpLoad %v4float %refractionColor
%136 = OpFMul %v3float %131 %132
%137 = OpFAdd %v3float %136 %133
%138 = OpCompositeExtract %float %134 0
%139 = OpCompositeExtract %float %134 1
%140 = OpCompositeExtract %float %134 2
%141 = OpCompositeConstruct %v3float %138 %139 %140
%142 = OpFAdd %v3float %137 %141
%143 = OpCompositeExtract %float %135 0
%144 = OpCompositeExtract %float %135 1
%145 = OpCompositeExtract %float %135 2
%146 = OpCompositeConstruct %v3float %143 %144 %145
%147 = OpFAdd %v3float %142 %146
%148 = OpLoad %float %alpha
%149 = OpCompositeExtract %float %147 0
%150 = OpCompositeExtract %float %147 1
%151 = OpCompositeExtract %float %147 2
%152 = OpCompositeConstruct %v4float %149 %150 %151 %148
OpStore %color %152
%153 = OpLoad %v4float %color
%155 = OpCompositeExtract %float %153 0
%156 = OpCompositeExtract %float %153 1
%157 = OpCompositeExtract %float %153 2
%158 = OpCompositeConstruct %v3float %155 %156 %157
%154 = OpExtInst %v3float %71 NMax %158 %35
%159 = OpLoad %v4float %color
%160 = OpCompositeExtract %float %154 0
%161 = OpCompositeExtract %float %154 1
%162 = OpCompositeExtract %float %154 2
%163 = OpCompositeExtract %float %159 3
%164 = OpCompositeConstruct %v4float %160 %161 %162 %163
OpStore %color %164
%165 = OpAccessChain %_ptr_Uniform_float %x_137 %uint_0
%166 = OpLoad %float %165
%167 = OpAccessChain %_ptr_Function_float %color %uint_3
%168 = OpLoad %float %167
%169 = OpAccessChain %_ptr_Function_float %color %uint_3
%170 = OpFMul %float %168 %166
OpStore %169 %170
%171 = OpLoad %v4float %color
OpStore %glFragColor %171
OpReturn
OpFunctionEnd
%tint_discard_func = OpFunction %void None %29
%173 = OpLabel
OpKill
OpFunctionEnd
%main_inner = OpFunction %main_out None %174
%fClipDistance3_param = OpFunctionParameter %float
%fClipDistance4_param = OpFunctionParameter %float
%179 = OpLabel
OpStore %fClipDistance3 %fClipDistance3_param
OpStore %fClipDistance4 %fClipDistance4_param
%180 = OpFunctionCall %void %main_1
%181 = OpLoad %bool %tint_discard
OpSelectionMerge %182 None
OpBranchConditional %181 %183 %182
%183 = OpLabel
%184 = OpFunctionCall %void %tint_discard_func
OpReturnValue %185
%182 = OpLabel
%186 = OpLoad %v4float %glFragColor
%187 = OpCompositeConstruct %main_out %186
OpReturnValue %187
OpFunctionEnd
%main = OpFunction %void None %29
%189 = OpLabel
%191 = OpLoad %float %fClipDistance3_param_1
%192 = OpLoad %float %fClipDistance4_param_1
%190 = OpFunctionCall %main_out %main_inner %191 %192
%193 = OpCompositeExtract %v4float %190 0
OpStore %glFragColor_1_1 %193
OpReturn
OpFunctionEnd