Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 5 ++--- libs/vkd3d-shader/spirv.c | 6 +++--- libs/vkd3d-shader/trace.c | 2 +- libs/vkd3d-shader/vkd3d_shader_main.c | 4 ++-- libs/vkd3d-shader/vkd3d_shader_private.h | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 89971477..ef5cf6d4 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -697,12 +697,10 @@ static void shader_sm4_read_dcl_constant_buffer(struct vkd3d_shader_instruction const DWORD *end = &tokens[token_count];
shader_sm4_read_src_param(priv, &tokens, end, VKD3D_DATA_FLOAT, &ins->declaration.cb.src); - ins->declaration.cb.register_index = shader_sm4_map_resource_idx(&ins->declaration.cb.src.reg, priv); if (opcode_token & VKD3D_SM4_INDEX_TYPE_MASK) ins->flags |= VKD3DSI_INDEXED_DYNAMIC;
ins->declaration.cb.size = ins->declaration.cb.src.reg.idx[2].offset; - ins->declaration.cb.register_space = 0;
if (shader_is_sm_5_1(priv)) { @@ -713,8 +711,9 @@ static void shader_sm4_read_dcl_constant_buffer(struct vkd3d_shader_instruction }
ins->declaration.cb.size = *tokens++; - shader_sm4_read_register_space(priv, &tokens, end, &ins->declaration.cb.register_space); } + shader_sm4_read_descriptor_register_range(priv, &tokens, end, &ins->declaration.cb.src.reg, + &ins->declaration.cb.range); }
static void shader_sm4_read_dcl_sampler(struct vkd3d_shader_instruction *ins, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index f34a6a1d..97737043 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2402,8 +2402,8 @@ static bool vkd3d_dxbc_compiler_check_shader_visibility(const struct vkd3d_dxbc_ static struct vkd3d_push_constant_buffer_binding *vkd3d_dxbc_compiler_find_push_constant_buffer( const struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_constant_buffer *cb) { - unsigned int register_space = cb->register_space; - unsigned int reg_idx = cb->register_index; + unsigned int register_space = cb->range.space; + unsigned int reg_idx = cb->range.first; unsigned int i;
for (i = 0; i < compiler->shader_interface.push_constant_buffer_count; ++i) @@ -5308,7 +5308,7 @@ static void vkd3d_dxbc_compiler_emit_dcl_constant_buffer(struct vkd3d_dxbc_compi pointer_type_id, storage_class, 0);
vkd3d_dxbc_compiler_emit_descriptor_binding_for_reg(compiler, - var_id, reg, cb->register_space, cb->register_index, VKD3D_SHADER_RESOURCE_BUFFER, false); + var_id, reg, cb->range.space, cb->range.first, VKD3D_SHADER_RESOURCE_BUFFER, false);
vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg);
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index c35179a8..a0cb1162 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -1438,7 +1438,7 @@ static void shader_dump_instruction(struct vkd3d_d3d_asm_compiler *compiler, shader_print_subscript(compiler, ins->declaration.cb.size, NULL); shader_addline(buffer, ", %s", ins->flags & VKD3DSI_INDEXED_DYNAMIC ? "dynamicIndexed" : "immediateIndexed"); - shader_dump_register_space(compiler, ins->declaration.cb.register_space); + shader_dump_register_space(compiler, ins->declaration.cb.range.space); break;
case VKD3DSIH_DCL_FUNCTION_BODY: diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index df811d37..5b5ea7ec 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -632,8 +632,8 @@ static void vkd3d_shader_scan_constant_buffer_declaration(struct vkd3d_shader_sc if (!context->scan_descriptor_info) return;
- vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_CBV, cb->register_space, - cb->register_index, VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0); + vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_CBV, cb->range.space, + cb->range.first, VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0); }
static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_context *context, diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index e4beef15..025e09b6 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -727,7 +727,7 @@ struct vkd3d_shader_constant_buffer { struct vkd3d_shader_src_param src; unsigned int size; - unsigned int register_space, register_index; + struct vkd3d_descriptor_register_range range; };
struct vkd3d_shader_structured_resource