From a64eb75c1dd01b4e8b0774b1796dad30b5748132 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Wed, 13 Mar 2024 14:24:22 +1000 Subject: [PATCH] vkd3d-shader/spirv: Emit an error if COUNTBITS has a 64-bit source. --- libs/vkd3d-shader/spirv.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 56c89f76..86cf678a 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7020,6 +7020,15 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil SpvOp op = SpvOpMax; unsigned int i; + if (src->reg.data_type == VKD3D_DATA_UINT64 && instruction->handler_idx == VKD3DSIH_COUNTBITS) + { + /* At least some drivers support this anyway, but if validation is enabled it will fail. */ + FIXME("Unsupported 64-bit source for bit count.\n"); + spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_NOT_IMPLEMENTED, + "64-bit source for bit count is not supported."); + return VKD3D_ERROR_INVALID_SHADER; + } + if (src->reg.data_type == VKD3D_DATA_BOOL) { if (dst->reg.data_type == VKD3D_DATA_BOOL)