blob: 42fde31b2d64e1ee8f219a891fe859148d94ddef [file] [log] [blame]
bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must only be called from uniform control flow
let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
^^^^^^^^^^^^^
bug/fxc/gradient_in_varying_loop/1112.wgsl:18:28 note: control flow depends on non-uniform value
if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) {
^^
bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSample' may be non-uniform
let random: vec3<f32> = textureSample(randomTexture, Sampler, vUV).rgb;
^^^^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 82
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %vUV_1 %value
OpExecutionMode %main OriginUpperLeft
OpName %vUV_1 "vUV_1"
OpName %value "value"
OpName %Sampler "Sampler"
OpName %randomTexture "randomTexture"
OpName %depthTexture "depthTexture"
OpName %main_inner "main_inner"
OpName %vUV "vUV"
OpName %i "i"
OpName %main "main"
OpDecorate %vUV_1 Location 0
OpDecorate %value Location 0
OpDecorate %Sampler DescriptorSet 0
OpDecorate %Sampler Binding 0
OpDecorate %randomTexture DescriptorSet 0
OpDecorate %randomTexture Binding 1
OpDecorate %depthTexture DescriptorSet 0
OpDecorate %depthTexture Binding 2
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Input_v2float = OpTypePointer Input %v2float
%vUV_1 = OpVariable %_ptr_Input_v2float Input
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%8 = OpConstantNull %v4float
%value = OpVariable %_ptr_Output_v4float Output %8
%11 = OpTypeSampler
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
%Sampler = OpVariable %_ptr_UniformConstant_11 UniformConstant
%14 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
%randomTexture = OpVariable %_ptr_UniformConstant_14 UniformConstant
%depthTexture = OpVariable %_ptr_UniformConstant_14 UniformConstant
%16 = OpTypeFunction %v4float %v2float
%23 = OpTypeSampledImage %14
%v3float = OpTypeVector %float 3
%int = OpTypeInt 32 1
%28 = OpConstantNull %int
%_ptr_Function_int = OpTypePointer Function %int
%int_1 = OpConstant %int 1
%bool = OpTypeBool
%45 = OpConstantNull %float
%float_1 = OpConstant %float 1
%75 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%void = OpTypeVoid
%76 = OpTypeFunction %void
%main_inner = OpFunction %v4float None %16
%vUV = OpFunctionParameter %v2float
%19 = OpLabel
%i = OpVariable %_ptr_Function_int Function %28
%21 = OpLoad %11 %Sampler
%22 = OpLoad %14 %randomTexture
%24 = OpSampledImage %23 %22 %21
%20 = OpImageSampleImplicitLod %v4float %24 %vUV
%26 = OpVectorShuffle %v3float %20 %20 0 1 2
OpStore %i %28
OpBranch %31
%31 = OpLabel
OpLoopMerge %32 %33 None
OpBranch %34
%34 = OpLabel
%35 = OpLoad %int %i
%37 = OpSLessThan %bool %35 %int_1
OpSelectionMerge %39 None
OpBranchConditional %37 %40 %41
%40 = OpLabel
OpBranch %39
%41 = OpLabel
OpBranch %32
%39 = OpLabel
%42 = OpCompositeExtract %float %26 0
%43 = OpCompositeConstruct %v3float %42 %42 %42
%44 = OpCompositeExtract %float %43 0
%46 = OpFOrdLessThan %bool %44 %45
OpSelectionMerge %47 None
OpBranchConditional %46 %47 %48
%48 = OpLabel
%49 = OpCompositeExtract %float %43 1
%50 = OpFOrdLessThan %bool %49 %45
OpBranch %47
%47 = OpLabel
%51 = OpPhi %bool %46 %39 %50 %48
OpSelectionMerge %52 None
OpBranchConditional %51 %52 %53
%53 = OpLabel
%54 = OpCompositeExtract %float %43 0
%56 = OpFOrdGreaterThan %bool %54 %float_1
OpBranch %52
%52 = OpLabel
%57 = OpPhi %bool %51 %47 %56 %53
OpSelectionMerge %58 None
OpBranchConditional %57 %58 %59
%59 = OpLabel
%60 = OpCompositeExtract %float %43 1
%61 = OpFOrdGreaterThan %bool %60 %float_1
OpBranch %58
%58 = OpLabel
%62 = OpPhi %bool %57 %52 %61 %59
OpSelectionMerge %63 None
OpBranchConditional %62 %64 %63
%64 = OpLabel
%65 = OpLoad %int %i
%66 = OpIAdd %int %65 %int_1
OpStore %i %66
OpBranch %33
%63 = OpLabel
%68 = OpLoad %11 %Sampler
%69 = OpLoad %14 %depthTexture
%70 = OpSampledImage %23 %69 %68
%71 = OpVectorShuffle %v2float %43 %43 0 1
%67 = OpImageSampleImplicitLod %v4float %70 %71
%72 = OpCompositeExtract %float %67 0
%73 = OpLoad %int %i
%74 = OpIAdd %int %73 %int_1
OpStore %i %74
OpBranch %33
%33 = OpLabel
OpBranch %31
%32 = OpLabel
OpReturnValue %75
OpFunctionEnd
%main = OpFunction %void None %76
%79 = OpLabel
%81 = OpLoad %v2float %vUV_1
%80 = OpFunctionCall %v4float %main_inner %81
OpStore %value %80
OpReturn
OpFunctionEnd