vkd3d-shader: Store a vkd3d_shader_register_range structure in struct vkd3d_shader_sampler.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy 2021-06-24 14:03:47 +10:00 committed by Alexandre Julliard
parent af2714832b
commit 1b716f8c28
5 changed files with 11 additions and 11 deletions

View File

@ -716,8 +716,8 @@ static void shader_sm4_read_dcl_sampler(struct vkd3d_shader_instruction *ins,
if (ins->flags & ~VKD3D_SM4_SAMPLER_COMPARISON)
FIXME("Unhandled sampler mode %#x.\n", ins->flags);
shader_sm4_read_src_param(priv, &tokens, end, VKD3D_DATA_SAMPLER, &ins->declaration.sampler.src);
ins->declaration.sampler.register_index = shader_sm4_map_resource_idx(&ins->declaration.sampler.src.reg, priv);
shader_sm4_read_register_space(priv, &tokens, end, &ins->declaration.sampler.register_space);
ins->declaration.sampler.range.first = shader_sm4_map_resource_idx(&ins->declaration.sampler.src.reg, priv);
shader_sm4_read_register_space(priv, &tokens, end, &ins->declaration.sampler.range.space);
}
static void shader_sm4_read_dcl_index_range(struct vkd3d_shader_instruction *ins,

View File

@ -2443,8 +2443,8 @@ static bool vkd3d_dxbc_compiler_has_combined_sampler(const struct vkd3d_dxbc_com
if ((!resource || (combined_sampler->resource_space == resource->range.space
&& combined_sampler->resource_index == resource->range.first))
&& (!sampler || (combined_sampler->sampler_space == sampler->register_space
&& combined_sampler->sampler_index == sampler->register_index)))
&& (!sampler || (combined_sampler->sampler_space == sampler->range.space
&& combined_sampler->sampler_index == sampler->range.first)))
return true;
}
@ -5363,8 +5363,8 @@ static void vkd3d_dxbc_compiler_emit_dcl_sampler(struct vkd3d_dxbc_compiler *com
struct vkd3d_symbol reg_symbol;
vkd3d_symbol_make_sampler(&reg_symbol, reg);
reg_symbol.info.sampler.register_space = sampler->register_space;
reg_symbol.info.sampler.register_index = sampler->register_index;
reg_symbol.info.sampler.register_space = sampler->range.space;
reg_symbol.info.sampler.register_index = sampler->range.first;
vkd3d_dxbc_compiler_put_symbol(compiler, &reg_symbol);
if (vkd3d_dxbc_compiler_has_combined_sampler(compiler, NULL, sampler))
@ -5376,7 +5376,7 @@ static void vkd3d_dxbc_compiler_emit_dcl_sampler(struct vkd3d_dxbc_compiler *com
ptr_type_id, storage_class, 0);
vkd3d_dxbc_compiler_emit_descriptor_binding_for_reg(compiler, var_id, reg,
sampler->register_space, sampler->register_index, VKD3D_SHADER_RESOURCE_NONE, false);
sampler->range.space, sampler->range.first, VKD3D_SHADER_RESOURCE_NONE, false);
vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg);

View File

@ -1546,7 +1546,7 @@ static void shader_dump_instruction(struct vkd3d_d3d_asm_compiler *compiler,
shader_dump_register(compiler, &ins->declaration.sampler.src.reg);
if (ins->flags == VKD3DSI_SAMPLER_COMPARISON_MODE)
shader_addline(buffer, ", comparisonMode");
shader_dump_register_space(compiler, ins->declaration.sampler.register_space);
shader_dump_register_space(compiler, ins->declaration.sampler.range.space);
break;
case VKD3DSIH_DCL_TEMPS:

View File

@ -649,8 +649,8 @@ static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_conte
flags = VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_SAMPLER_COMPARISON_MODE;
else
flags = 0;
vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER, sampler->register_space,
sampler->register_index, VKD3D_SHADER_RESOURCE_NONE, VKD3D_SHADER_RESOURCE_DATA_UINT, flags);
vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER, sampler->range.space,
sampler->range.first, VKD3D_SHADER_RESOURCE_NONE, VKD3D_SHADER_RESOURCE_DATA_UINT, flags);
}
static void vkd3d_shader_scan_resource_declaration(struct vkd3d_shader_scan_context *context,

View File

@ -720,7 +720,7 @@ struct vkd3d_shader_register_semantic
struct vkd3d_shader_sampler
{
struct vkd3d_shader_src_param src;
unsigned int register_space, register_index;
struct vkd3d_shader_register_range range;
};
struct vkd3d_shader_constant_buffer