blob: 9ecd908d5e81de915ca37efc45718abdd972c4d8 [file] [edit]
<dawn>/test/tint/diagnostic_filtering/switch_body_attribute.wgsl:5:11 warning: 'dpdx' must only be called from uniform control flow
_ = dpdx(1.0);
^^^^^^^^^
<dawn>/test/tint/diagnostic_filtering/switch_body_attribute.wgsl:3:3 note: control flow depends on possibly non-uniform value
switch (i32(x)) @diagnostic(warning, derivative_uniformity) {
^^^^^^
<dawn>/test/tint/diagnostic_filtering/switch_body_attribute.wgsl:3:15 note: user-defined input 'x' of 'main' may be non-uniform
switch (i32(x)) @diagnostic(warning, derivative_uniformity) {
^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 34
; 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 %tint_f32_to_i32 "tint_f32_to_i32"
OpName %value "value"
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
%int = OpTypeInt 32 1
%float_1 = OpConstant %float 1
%17 = OpTypeFunction %int %float
%float_n2_14748365e_09 = OpConstant %float -2.14748365e+09
%bool = OpTypeBool
%int_n2147483648 = OpConstant %int -2147483648
%float_2_14748352e_09 = OpConstant %float 2.14748352e+09
%int_2147483647 = OpConstant %int 2147483647
%30 = OpTypeFunction %void
%main_inner = OpFunction %void None %7
%x = OpFunctionParameter %float
%8 = OpLabel
%9 = OpFunctionCall %int %tint_f32_to_i32 %x
OpSelectionMerge %13 None
OpSwitch %9 %12
%12 = OpLabel
%14 = OpDPdx %float %float_1
OpBranch %13
%13 = OpLabel
OpReturn
OpFunctionEnd
%tint_f32_to_i32 = OpFunction %int None %17
%value = OpFunctionParameter %float
%18 = OpLabel
%19 = OpConvertFToS %int %value
%20 = OpFOrdGreaterThanEqual %bool %value %float_n2_14748365e_09
%23 = OpSelect %int %20 %19 %int_n2147483648
%25 = OpFOrdLessThanEqual %bool %value %float_2_14748352e_09
%27 = OpSelect %int %25 %23 %int_2147483647
OpReturnValue %27
OpFunctionEnd
%main = OpFunction %void None %30
%31 = OpLabel
%32 = OpLoad %float %main_loc0_Input None
%33 = OpFunctionCall %void %main_inner %32
OpReturn
OpFunctionEnd