blob: e3d5f928d8d0f135ceab24d3bda5c1a1502b24a3 [file] [log] [blame]
<dawn>/test/tint/diagnostic_filtering/switch_statement_attribute.wgsl:7:27 warning: 'dpdx' must only be called from uniform control flow
switch (i32(x == 0.0 && dpdx(1.0) == 0.0)) {
^^^^^^^^^
<dawn>/test/tint/diagnostic_filtering/switch_statement_attribute.wgsl:7:15 note: control flow depends on possibly non-uniform value
switch (i32(x == 0.0 && dpdx(1.0) == 0.0)) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<dawn>/test/tint/diagnostic_filtering/switch_statement_attribute.wgsl:7:15 note: user-defined input 'x' of 'main' may be non-uniform
switch (i32(x == 0.0 && dpdx(1.0) == 0.0)) {
^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %x_1
OpExecutionMode %main OriginUpperLeft
OpName %x_1 "x_1"
OpName %t "t"
OpName %s "s"
OpName %main_inner "main_inner"
OpName %x "x"
OpName %tint_symbol "tint_symbol"
OpName %main "main"
OpDecorate %x_1 Location 0
OpDecorate %t DescriptorSet 0
OpDecorate %t Binding 1
OpDecorate %s DescriptorSet 0
OpDecorate %s Binding 2
%float = OpTypeFloat 32
%_ptr_Input_float = OpTypePointer Input %float
%x_1 = OpVariable %_ptr_Input_float Input
%6 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%t = OpVariable %_ptr_UniformConstant_6 UniformConstant
%9 = OpTypeSampler
%_ptr_UniformConstant_9 = OpTypePointer UniformConstant %9
%s = OpVariable %_ptr_UniformConstant_9 UniformConstant
%void = OpTypeVoid
%10 = OpTypeFunction %void %float
%15 = OpConstantNull %float
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%20 = OpConstantNull %bool
%float_1 = OpConstant %float 1
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%34 = OpTypeFunction %void
%main_inner = OpFunction %void None %10
%x = OpFunctionParameter %float
%14 = OpLabel
%tint_symbol = OpVariable %_ptr_Function_bool Function %20
%16 = OpFOrdEqual %bool %x %15
OpStore %tint_symbol %16
%21 = OpLoad %bool %tint_symbol
OpSelectionMerge %22 None
OpBranchConditional %21 %23 %22
%23 = OpLabel
%24 = OpDPdx %float %float_1
%26 = OpFOrdEqual %bool %24 %15
OpStore %tint_symbol %26
OpBranch %22
%22 = OpLabel
%30 = OpLoad %bool %tint_symbol
%28 = OpSelect %int %30 %int_1 %int_0
OpSelectionMerge %27 None
OpSwitch %28 %33
%33 = OpLabel
OpBranch %27
%27 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %34
%36 = OpLabel
%38 = OpLoad %float %x_1
%37 = OpFunctionCall %void %main_inner %38
OpReturn
OpFunctionEnd