From 75c2af3640809619d8b6c55e1c9eec66d0ac2cb5 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Fri, 6 Oct 2023 14:14:23 +1000 Subject: [PATCH] vkd3d-shader/spirv: When declaring a CBV initialise the register with the register index range. The declaration instruction register contains id, range first, and range last. The backend includes range first in the variable name. After commit e8b3561252 it was always zero, and since commit 67f0196c33 it is UINT_MAX, so constant buffers are named, e.g., "%cb0_4294967295". --- libs/vkd3d-shader/spirv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index b3f6947b..1c8b52e6 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5633,8 +5633,10 @@ static void spirv_compiler_emit_cbv_declaration(struct spirv_compiler *compiler, struct vkd3d_symbol reg_symbol; unsigned int size; - vsir_register_init(®, VKD3DSPR_CONSTBUFFER, VKD3D_DATA_FLOAT, 1); + vsir_register_init(®, VKD3DSPR_CONSTBUFFER, VKD3D_DATA_FLOAT, 3); reg.idx[0].offset = register_id; + reg.idx[1].offset = range->first; + reg.idx[2].offset = range->last; size = size_in_bytes / (VKD3D_VEC4_SIZE * sizeof(uint32_t));