[PATCH 0/1] MR395: vkd3d-shader/spirv: When declaring a CBV initialise the register with the register index range.
It makes sense to use the {id}_{range_first} naming scheme for SRVs, UAVs and samplers too because their registers contain the same info, but just fixing this for now. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/395
From: Conor McCarthy <cmccarthy(a)codeweavers.com> 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 07e276c57..1e780a838 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5627,8 +5627,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)); -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/395
This merge request was approved by Henri Verbeet. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/395
participants (3)
-
Conor McCarthy -
Conor McCarthy (@cmccarthy) -
Henri Verbeet (@hverbeet)