zink: also declare int size caps inline with signed int type usage

Fixes: 854fd242fa ("zink: declare int/float size caps inline with type usage")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22934>
(cherry picked from commit 5d8103b109)
This commit is contained in:
Mike Blumenkrantz 2023-05-11 09:35:39 -04:00 committed by Eric Engestrom
parent 3b23995a8c
commit ae7dacac62
2 changed files with 7 additions and 1 deletions

View file

@ -364,7 +364,7 @@
"description": "zink: also declare int size caps inline with signed int type usage",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "854fd242faf00bf68555dce10fb0ae98a3ab34c0"
},

View file

@ -1294,6 +1294,12 @@ SpvId
spirv_builder_type_int(struct spirv_builder *b, unsigned width)
{
uint32_t args[] = { width, 1 };
if (width == 8)
spirv_builder_emit_cap(b, SpvCapabilityInt8);
else if (width == 16)
spirv_builder_emit_cap(b, SpvCapabilityInt16);
else if (width == 64)
spirv_builder_emit_cap(b, SpvCapabilityInt64);
return get_type_def(b, SpvOpTypeInt, args, ARRAY_SIZE(args));
}