From 0dc174ebd719639f799c2ae954ccb67f862a3dfd Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Wed, 13 Mar 2024 14:25:49 +1000 Subject: [PATCH] vkd3d-shader/spirv: Emit an error if a FIRSTBIT instruction has a 64-bit source. --- libs/vkd3d-shader/spirv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 86cf678a..bd0bfb8e 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7169,6 +7169,16 @@ static void spirv_compiler_emit_ext_glsl_instruction(struct spirv_compiler *comp unsigned int i, component_count; enum GLSLstd450 glsl_inst; + if (src[0].reg.data_type == VKD3D_DATA_UINT64 && (instruction->handler_idx == VKD3DSIH_FIRSTBIT_HI + || instruction->handler_idx == VKD3DSIH_FIRSTBIT_LO || instruction->handler_idx == VKD3DSIH_FIRSTBIT_SHI)) + { + /* At least some drivers support this anyway, but if validation is enabled it will fail. */ + FIXME("Unsupported 64-bit source for handler %#x.\n", instruction->handler_idx); + spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_NOT_IMPLEMENTED, + "64-bit source for handler %#x is not supported.", instruction->handler_idx); + return; + } + glsl_inst = spirv_compiler_map_ext_glsl_instruction(instruction); if (glsl_inst == GLSLstd450Bad) {