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".
This commit is contained in:
Conor McCarthy 2023-10-06 14:14:23 +10:00 committed by Alexandre Julliard
parent a4c5f3a798
commit 75c2af3640
Notes: Alexandre Julliard 2023-10-09 23:09:45 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/395

View File

@ -5633,8 +5633,10 @@ static void spirv_compiler_emit_cbv_declaration(struct spirv_compiler *compiler,
struct vkd3d_symbol reg_symbol; struct vkd3d_symbol reg_symbol;
unsigned int size; unsigned int size;
vsir_register_init(&reg, VKD3DSPR_CONSTBUFFER, VKD3D_DATA_FLOAT, 1); vsir_register_init(&reg, VKD3DSPR_CONSTBUFFER, VKD3D_DATA_FLOAT, 3);
reg.idx[0].offset = register_id; 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)); size = size_in_bytes / (VKD3D_VEC4_SIZE * sizeof(uint32_t));