Fixup various warnings in Tint which were accidentally suppressed.

When enabling the SPIR-V reader or SPIR-V writer we were suppressing
-Wnewline-eof, -Wold-style-cast, -Wsign-conversion, and -Wweak-vtables
for the `libtint` cmake target and anything that depended on that
target. Because we'd build all readers/ writers by default this caused
us to never hit those warnings.

A recent change to the cmake build sets the Tint backend based on
the Dawn backend. So, there is a much higher chance of not building
the SPIR-V support if you're on a Mac or Windows machine.

This CL removes the suppression of the warnings, adds specific pragmas
into the SPIR-V reader code which imports the SPIRV-Tools headers
and fixes up the warnings which were then firing due to checking
for the new warnings.

Change-Id: I0d0be6aa3d0b692e939ce8ff924dfb82c82792fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94901
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair
2022-06-29 14:38:15 +00:00
committed by Dawn LUCI CQ
parent ad10eb59d1
commit 3a2a279714
88 changed files with 577 additions and 513 deletions

View File

@@ -815,8 +815,8 @@ void Inspector::GenerateSamplerTargets() {
continue;
}
auto* t = c->args[texture_index];
auto* s = c->args[sampler_index];
auto* t = c->args[static_cast<size_t>(texture_index)];
auto* s = c->args[static_cast<size_t>(sampler_index)];
GetOriginatingResources(
std::array<const ast::Expression*, 2>{t, s},

View File

@@ -3048,7 +3048,7 @@ TEST_F(InspectorGetWorkgroupStorageSizeTest, StructAlignment) {
// here the struct is expected to occupy 1024 bytes of workgroup storage.
const auto* wg_struct_type = MakeStructTypeFromMembers(
"WgStruct",
{MakeStructMember(0, ty.f32(), {create<ast::StructMemberAlignAttribute>(1024)})});
{MakeStructMember(0, ty.f32(), {create<ast::StructMemberAlignAttribute>(1024u)})});
AddWorkgroupStorage("wg_struct_var", ty.Of(wg_struct_type));
MakeStructVariableReferenceBodyFunction("wg_struct_func", "wg_struct_var", {{0, ty.f32()}});

View File

@@ -285,11 +285,11 @@ const ast::Type* InspectorBuilder::GetCoordsType(ast::TextureDimension dim,
return scalar;
case ast::TextureDimension::k2d:
case ast::TextureDimension::k2dArray:
return create<ast::Vector>(scalar, 2);
return create<ast::Vector>(scalar, 2u);
case ast::TextureDimension::k3d:
case ast::TextureDimension::kCube:
case ast::TextureDimension::kCubeArray:
return create<ast::Vector>(scalar, 3);
return create<ast::Vector>(scalar, 3u);
default:
[=]() { FAIL() << "Unsupported texture dimension: " << dim; }();
}