tint: Show the source of non-uniformity

Show the original source of non-uniformity when producing errors from
the uniformity analysis.

Bug: tint:880
Change-Id: Id386ae8fa5ff1b1443d54c0b5ef12ab76b3b3f13
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89723
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
James Price
2022-05-11 22:05:15 +00:00
parent 9c03abfb55
commit 7dd0ab791a
32 changed files with 743 additions and 37 deletions

View File

@@ -2,6 +2,10 @@ bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from unifor
var srcColor = textureSample(myTexture, mySampler, texcoord);
^^^^^^^^^^^^^
bug/dawn/947.wgsl:54:15 note: reading from user-defined input 'texcoord' may result in a non-uniform value
clamp(texcoord, vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 1.0));
^^^^^^^^
#version 310 es
layout(location = 0) out vec2 texcoords_1;

View File

@@ -2,6 +2,10 @@ bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from unifor
var srcColor = textureSample(myTexture, mySampler, texcoord);
^^^^^^^^^^^^^
bug/dawn/947.wgsl:54:15 note: reading from user-defined input 'texcoord' may result in a non-uniform value
clamp(texcoord, vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 1.0));
^^^^^^^^
cbuffer cbuffer_uniforms : register(b0, space0) {
uint4 uniforms[1];
};

View File

@@ -2,6 +2,10 @@ bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from unifor
var srcColor = textureSample(myTexture, mySampler, texcoord);
^^^^^^^^^^^^^
bug/dawn/947.wgsl:54:15 note: reading from user-defined input 'texcoord' may result in a non-uniform value
clamp(texcoord, vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 1.0));
^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@@ -2,6 +2,10 @@ bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from unifor
var srcColor = textureSample(myTexture, mySampler, texcoord);
^^^^^^^^^^^^^
bug/dawn/947.wgsl:54:15 note: reading from user-defined input 'texcoord' may result in a non-uniform value
clamp(texcoord, vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 1.0));
^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -2,6 +2,10 @@ bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from unifor
var srcColor = textureSample(myTexture, mySampler, texcoord);
^^^^^^^^^^^^^
bug/dawn/947.wgsl:54:15 note: reading from user-defined input 'texcoord' may result in a non-uniform value
clamp(texcoord, vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 1.0));
^^^^^^^^
struct Uniforms {
u_scale : vec2<f32>,
u_offset : vec2<f32>,

View File

@@ -2,6 +2,10 @@ bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must o
let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
^^^^^^^^^^^^^
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;
^^^^^^^^^^^^^
#version 310 es
precision mediump float;

View File

@@ -2,6 +2,10 @@ bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must o
let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
^^^^^^^^^^^^^
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;
^^^^^^^^^^^^^
SamplerState tint_symbol : register(s0, space0);
Texture2D<float4> randomTexture : register(t1, space0);
Texture2D<float4> depthTexture : register(t2, space0);

View File

@@ -2,6 +2,10 @@ bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must o
let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
^^^^^^^^^^^^^
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;
^^^^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@@ -2,6 +2,10 @@ bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must o
let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
^^^^^^^^^^^^^
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

View File

@@ -2,6 +2,10 @@ bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must o
let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r;
^^^^^^^^^^^^^
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;
^^^^^^^^^^^^^
@group(0) @binding(0) var Sampler : sampler;
@group(0) @binding(1) var randomTexture : texture_2d<f32>;

View File

@@ -2,6 +2,10 @@ bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform contro
normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
^^^^
bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value
let x_9 : f32 = fClipDistance3;
^^^^^^^^^^^^^^
#version 310 es
precision mediump float;

View File

@@ -2,6 +2,10 @@ bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform contro
normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
^^^^
bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value
let x_9 : f32 = fClipDistance3;
^^^^^^^^^^^^^^
static float fClipDistance3 = 0.0f;
static float fClipDistance4 = 0.0f;
cbuffer cbuffer_x_29 : register(b0, space0) {

View File

@@ -2,6 +2,10 @@ bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform contro
normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
^^^^
bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value
let x_9 : f32 = fClipDistance3;
^^^^^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@@ -2,6 +2,10 @@ bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform contro
normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
^^^^
bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value
let x_9 : f32 = fClipDistance3;
^^^^^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -2,6 +2,10 @@ bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform contro
normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64))));
^^^^
bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value
let x_9 : f32 = fClipDistance3;
^^^^^^^^^^^^^^
struct Scene {
vEyePosition : vec4<f32>,
}

View File

@@ -1,5 +1,6 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value
#version 310 es
struct Uniforms {

View File

@@ -1,5 +1,6 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value
static int dimAOuter_1 = 0;
cbuffer cbuffer_x_48 : register(b3, space0) {
uint4 x_48[5];

View File

@@ -1,5 +1,6 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value
#include <metal_stdlib>
using namespace metal;

View File

@@ -1,5 +1,6 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,5 +1,6 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value
struct Uniforms {
NAN : f32,
@size(12)

View File

@@ -2,6 +2,10 @@ bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from u
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
bug/tint/948.wgsl:146:33 note: return value of 'textureSampleBias' may be non-uniform
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
#version 310 es
precision mediump float;

View File

@@ -2,6 +2,10 @@ bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from u
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
bug/tint/948.wgsl:146:33 note: return value of 'textureSampleBias' may be non-uniform
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
cbuffer cbuffer_x_20 : register(b9, space2) {
uint4 x_20[8];
};

View File

@@ -2,6 +2,10 @@ bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from u
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
bug/tint/948.wgsl:146:33 note: return value of 'textureSampleBias' may be non-uniform
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@@ -2,6 +2,10 @@ bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from u
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
bug/tint/948.wgsl:146:33 note: return value of 'textureSampleBias' may be non-uniform
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -2,6 +2,10 @@ bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from u
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
bug/tint/948.wgsl:146:33 note: return value of 'textureSampleBias' may be non-uniform
let x_217 : vec4<f32> = textureSampleBias(animationMapTexture, animationMapSampler, vec2<f32>(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0);
^^^^^^^^^^^^^^^^^
struct LeftOver {
time : f32,
@size(12)

View File

@@ -2,6 +2,10 @@ bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from unifo
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
bug/tint/949.wgsl:326:29 note: return value of 'textureSample' may be non-uniform
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
#version 310 es
precision mediump float;

View File

@@ -2,6 +2,10 @@ bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from unifo
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
bug/tint/949.wgsl:326:29 note: return value of 'textureSample' may be non-uniform
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
struct lightingInfo {
float3 diffuse;
float3 specular;

View File

@@ -2,6 +2,10 @@ bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from unifo
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
bug/tint/949.wgsl:326:29 note: return value of 'textureSample' may be non-uniform
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
#include <metal_stdlib>
using namespace metal;

View File

@@ -2,6 +2,10 @@ bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from unifo
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
bug/tint/949.wgsl:326:29 note: return value of 'textureSample' may be non-uniform
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -2,6 +2,10 @@ bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from unifo
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
bug/tint/949.wgsl:326:29 note: return value of 'textureSample' may be non-uniform
let x_397 : vec4<f32> = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395));
^^^^^^^^^^^^^
struct lightingInfo {
diffuse : vec3<f32>,
specular : vec3<f32>,