blob: 4a2c68b8c4a78e09f721cfd75bd03dc476a9bd61 [file] [edit]
<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
%float_1 = OpConstant %float 1
%false = OpConstantFalse %bool
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%int_0 = OpConstant %int 0
%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
%15 = OpDPdx %float %float_1
%17 = OpFOrdEqual %bool %15 %float_0
OpBranch %12
%14 = OpLabel
OpBranch %12
%12 = OpLabel
%18 = OpPhi %bool %17 %13 %false %14
%21 = OpSelect %int %18 %int_1 %int_0
OpSelectionMerge %25 None
OpSwitch %21 %24
%24 = OpLabel
OpBranch %25
%25 = 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