tint/writer/spirv: Fix build on MSVC / some clang builds

For some reason, only a handful of compilers complain about the implicit cast of an enum to a uint32_t.
Make the cast explicit to fix these builds.

Change-Id: Ib57026cbbb28e330055a5c64eaf1ae05ea3ff7dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131744
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2023-05-05 17:00:52 +00:00 committed by Dawn LUCI CQ
parent 1dd578ad35
commit 4204bb3ef1
1 changed files with 3 additions and 2 deletions

View File

@ -106,8 +106,9 @@ void GeneratorImplIr::EmitFunction(const ir::Function* func) {
}); });
// Declare the function. // Declare the function.
auto decl = Instruction{spv::Op::OpFunction, auto decl =
{return_type_id, id, SpvFunctionControlMaskNone, function_type_id}}; Instruction{spv::Op::OpFunction,
{return_type_id, id, U32Operand(SpvFunctionControlMaskNone), function_type_id}};
// Create a function that we will add instructions to. // Create a function that we will add instructions to.
// TODO(jrprice): Add the parameter declarations when they are supported in the IR. // TODO(jrprice): Add the parameter declarations when they are supported in the IR.