blob: ce683af39cf07b20e52fe6ef1f29c12a13b59ad2 [file]
<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; 1
; Bound: 31
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %main_loc0_Input
OpExecutionMode %main OriginUpperLeft
OpName %main_loc0_Input "main_loc0_Input"
OpName %main_inner "main_inner"
OpName %x "x"
OpName %main "main"
OpDecorate %main_loc0_Input Location 0
%float = OpTypeFloat 32
%_ptr_Input_float = OpTypePointer Input %float
%main_loc0_Input = OpVariable %_ptr_Input_float Input
%void = OpTypeVoid
%7 = OpTypeFunction %void %float
%float_0 = OpConstant %float 0
%bool = OpTypeBool
%false = OpConstantFalse %bool
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%int_0 = OpConstant %int 0
%float_1 = OpConstant %float 1
%27 = OpTypeFunction %void
%main_inner = OpFunction %void None %7
%x = OpFunctionParameter %float
%8 = OpLabel
%9 = OpFOrdEqual %bool %x %float_0
OpSelectionMerge %12 None
OpBranchConditional %9 %13 %14
%13 = OpLabel
%24 = OpDPdx %float %float_1
%16 = OpFOrdEqual %bool %24 %float_0
OpBranch %12
%14 = OpLabel
OpBranch %12
%12 = OpLabel
%15 = OpPhi %bool %16 %13 %false %14
%19 = OpSelect %int %15 %int_1 %int_0
OpSelectionMerge %23 None
OpSwitch %19 %22
%22 = OpLabel
OpBranch %23
%23 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %27
%28 = OpLabel
%29 = OpLoad %float %main_loc0_Input None
%30 = OpFunctionCall %void %main_inner %29
OpReturn
OpFunctionEnd