tint: make uniformity analysis failures warnings again

Bug: tint:1728
Change-Id: I7684a49567d2e5c2c49f3c5b1d45a9fe543abbc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano 2022-10-26 00:27:38 +00:00 committed by Dawn LUCI CQ
parent ee42e05101
commit 0640c81073
6 changed files with 203 additions and 184 deletions

View File

@ -1,5 +1,11 @@
# Tint changes during Origin Trial # Tint changes during Origin Trial
## Changes for M109
### New features
* Uniformity analysis failures are warnings again [tint:1728](crbug.com/tint/1728)
## Changes for M108 ## Changes for M108
### New features ### New features

View File

@ -872,7 +872,8 @@ TEST_P(ShaderTests, ConflictingBindingsDueToTransformOrder) {
// Check that chromium_disable_uniformity_analysis can be used. It is normally disallowed as unsafe // Check that chromium_disable_uniformity_analysis can be used. It is normally disallowed as unsafe
// but DawnTests allow all unsafe APIs by default. // but DawnTests allow all unsafe APIs by default.
TEST_P(ShaderTests, CheckUsageOf_chromium_disable_uniformity_analysis) { // TODO(crbug.com/tint/1728): Enable again when uniformity failures are errors again
TEST_P(ShaderTests, DISABLED_CheckUsageOf_chromium_disable_uniformity_analysis) {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
enable chromium_disable_uniformity_analysis; enable chromium_disable_uniformity_analysis;

View File

@ -174,7 +174,9 @@ bool Resolver::ResolveInternal() {
if (!enabled_extensions_.Contains(ast::Extension::kChromiumDisableUniformityAnalysis)) { if (!enabled_extensions_.Contains(ast::Extension::kChromiumDisableUniformityAnalysis)) {
if (!AnalyzeUniformity(builder_, dependencies_)) { if (!AnalyzeUniformity(builder_, dependencies_)) {
return false; if (kUniformityFailuresAsError) {
return false;
}
} }
} }

View File

@ -1672,7 +1672,9 @@ class UniformityGraph {
// the `MakeError` function. // the `MakeError` function.
auto report = [&](Source source, std::string msg) { auto report = [&](Source source, std::string msg) {
diag::Diagnostic error{}; diag::Diagnostic error{};
error.severity = note ? diag::Severity::Note : diag::Severity::Error; auto failureSeverity =
kUniformityFailuresAsError ? diag::Severity::Error : diag::Severity::Warning;
error.severity = note ? diag::Severity::Note : failureSeverity;
error.system = diag::System::Resolver; error.system = diag::System::Resolver;
error.source = source; error.source = source;
error.message = msg; error.message = msg;

View File

@ -25,6 +25,9 @@ class ProgramBuilder;
namespace tint::resolver { namespace tint::resolver {
/// If true, uniformity analysis failures will be treated as an error, else as a warning.
constexpr bool kUniformityFailuresAsError = false;
/// Analyze the uniformity of a program. /// Analyze the uniformity of a program.
/// @param builder the program to analyze /// @param builder the program to analyze
/// @param dependency_graph the dependency-ordered module-scope declarations /// @param dependency_graph the dependency-ordered module-scope declarations

File diff suppressed because it is too large Load Diff