mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/dxil: Emit SAMPLER, UAV and RESOURCE registers with only 2 indices.
DXIL handles are used to represent descriptors. Currently they are translated to registers of the appropriate type (depending on the descriptor type) and three indices. The first two indices are used to represent the descriptor itself (through its signature and array index), and are filled when the handle itself is created. The last index is used with constant buffers to address the data inside the buffer itself, and it goes unused with other descriptor types. As currently implemented, however, registers for descriptors other than constant buffers are still created with three indices, even if the last one is useless and set to -1. In the interest of creating more sensible VSIR code, this is now removed: DXIL handles are created with just two indices; a third one is added when accessing constant buffers, and nothing is changed for other descriptor types.
This commit is contained in:
parent
cebe0a8b95
commit
da7c9694f1
Notes:
Henri Verbeet
2024-10-03 19:35:06 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1142
@ -4864,8 +4864,10 @@ static void sm6_parser_emit_dx_cbuffer_load(struct sm6_parser *sm6, enum dx_intr
|
||||
if (!(src_param = instruction_src_params_alloc(ins, 1, sm6)))
|
||||
return;
|
||||
src_param_init_vector_from_reg(src_param, &buffer->u.handle.reg);
|
||||
/* Differently from other descriptors, constant buffers require an
|
||||
* additional index, used to index within the constant buffer itself. */
|
||||
src_param->reg.idx_count = 3;
|
||||
register_index_address_init(&src_param->reg.idx[2], operands[1], sm6);
|
||||
VKD3D_ASSERT(src_param->reg.idx_count == 3);
|
||||
|
||||
type = sm6_type_get_scalar_type(dst->type, 0);
|
||||
VKD3D_ASSERT(type);
|
||||
@ -4964,8 +4966,7 @@ static void sm6_parser_emit_dx_create_handle(struct sm6_parser *sm6, enum dx_int
|
||||
dst->u.handle.d = d;
|
||||
|
||||
reg = &dst->u.handle.reg;
|
||||
/* Set idx_count to 3 for use with load/store instructions. */
|
||||
vsir_register_init(reg, d->reg_type, d->reg_data_type, 3);
|
||||
vsir_register_init(reg, d->reg_type, d->reg_data_type, 2);
|
||||
reg->dimension = VSIR_DIMENSION_VEC4;
|
||||
reg->idx[0].offset = id;
|
||||
register_index_address_init(®->idx[1], operands[2], sm6);
|
||||
|
Loading…
Reference in New Issue
Block a user