tint: Show the reason for a uniformity requirement

When producing an error from the uniformity analysis, add notes to
show the underlying reason for the uniformity requirement.

For function calls that are required-to-be-uniform, show the innermost
builtin call that has the requirement.

For function parameters that are required-to-be-uniform, recurse into
that function to show where its requirement comes from.

Add some new tests to specifically test the error messages.

Bug: tint:880
Change-Id: Ib166fdeceaffb156a3afc50ebc5a4ad0860dc002
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89722
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2022-05-11 22:05:15 +00:00
parent 874b61f1ba
commit 9c03abfb55
7 changed files with 264 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
#version 310 es
struct Uniforms {

View File

@@ -1,4 +1,5 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
static int dimAOuter_1 = 0;
cbuffer cbuffer_x_48 : register(b3, space0) {
uint4 x_48[5];

View File

@@ -1,4 +1,5 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
#include <metal_stdlib>
using namespace metal;

View File

@@ -1,4 +1,5 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0

View File

@@ -1,4 +1,5 @@
warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform
note: 'workgroupBarrier' must only be called from uniform control flow
struct Uniforms {
NAN : f32,
@size(12)