Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index aed15b94..4ea0efeb 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5464,7 +5464,7 @@ static uint32_t vkd3d_dxbc_compiler_get_image_type_id(struct vkd3d_dxbc_compiler }
static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_dxbc_compiler *compiler, - const struct vkd3d_shader_register *resource, unsigned int resource_space, unsigned int resource_index, + const struct vkd3d_shader_register *resource, struct vkd3d_shader_register_range resource_range, enum vkd3d_shader_resource_type resource_type, enum vkd3d_shader_component_type sampled_type, unsigned int structure_stride, bool raw, const struct vkd3d_spirv_resource_type *resource_type_info) { @@ -5486,7 +5486,7 @@ static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_ { current = &shader_interface->combined_samplers[i];
- if (current->resource_space != resource_space || current->resource_index != resource_index) + if (current->resource_space != resource_range.space || current->resource_index != resource_range.first) continue;
if (!(current->flags & resource_type_flag)) @@ -5501,7 +5501,7 @@ static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_ vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_DESCRIPTOR_BINDING, "Combined descriptor binding for resource %u, space %u, " "and sampler %u, space %u has unsupported ‘count’ %u.", - resource_index, resource_space, current->sampler_index, + resource_range.first, resource_range.space, current->sampler_index, current->sampler_space, current->binding.count); }
@@ -5510,8 +5510,8 @@ static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_ depth = current->sampler_index != VKD3D_SHADER_DUMMY_SAMPLER_INDEX && (d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_SAMPLER_COMPARISON_MODE);
- image_type_id = vkd3d_dxbc_compiler_get_image_type_id(compiler, resource, resource_space, - resource_index, resource_type_info, sampled_type, structure_stride || raw, depth); + image_type_id = vkd3d_dxbc_compiler_get_image_type_id(compiler, resource, resource_range.space, + resource_range.first, resource_type_info, sampled_type, structure_stride || raw, depth); type_id = vkd3d_spirv_get_op_type_sampled_image(builder, image_type_id);
ptr_type_id = vkd3d_spirv_get_op_type_pointer(builder, storage_class, type_id); @@ -5521,17 +5521,17 @@ static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_ vkd3d_dxbc_compiler_emit_descriptor_binding(compiler, var_id, ¤t->binding);
if (current->sampler_index == VKD3D_SHADER_DUMMY_SAMPLER_INDEX) - vkd3d_spirv_build_op_name(builder, var_id, "t%u_%u_dummy_sampler", resource_space, resource_index); + vkd3d_spirv_build_op_name(builder, var_id, "t%u_%u_dummy_sampler", resource_range.space, + resource_range.first); else - vkd3d_spirv_build_op_name(builder, var_id, "t%u_%u_s%u_%u", resource_space, resource_index, + vkd3d_spirv_build_op_name(builder, var_id, "t%u_%u_s%u_%u", resource_range.space, resource_range.first, current->sampler_space, current->sampler_index);
vkd3d_symbol_make_combined_sampler(&symbol, resource, current->sampler_index == VKD3D_SHADER_DUMMY_SAMPLER_INDEX ? 0 : current->sampler_space, current->sampler_index); symbol.id = var_id; - symbol.info.resource.range.space = resource_space; - symbol.info.resource.range.first = resource_index; + symbol.info.resource.range = resource_range; symbol.info.resource.sampled_type = sampled_type; symbol.info.resource.type_id = image_type_id; symbol.info.resource.resource_type_info = resource_type_info; @@ -5569,8 +5569,8 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp
if (vkd3d_dxbc_compiler_has_combined_sampler(compiler, resource, NULL)) { - vkd3d_dxbc_compiler_emit_combined_sampler_declarations(compiler, reg, register_space, - register_index, resource_type, sampled_type, structure_stride, raw, resource_type_info); + vkd3d_dxbc_compiler_emit_combined_sampler_declarations(compiler, reg, resource->range, + resource_type, sampled_type, structure_stride, raw, resource_type_info); return; }
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 4ea0efeb..9401e8d4 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5439,7 +5439,7 @@ static const struct vkd3d_shader_descriptor_info *vkd3d_dxbc_compiler_get_descri }
static uint32_t vkd3d_dxbc_compiler_get_image_type_id(struct vkd3d_dxbc_compiler *compiler, - const struct vkd3d_shader_register *reg, unsigned int register_space, unsigned int register_index, + const struct vkd3d_shader_register *reg, struct vkd3d_shader_register_range range, const struct vkd3d_spirv_resource_type *resource_type_info, enum vkd3d_shader_component_type data_type, bool raw_structured, uint32_t depth) { @@ -5452,7 +5452,7 @@ static uint32_t vkd3d_dxbc_compiler_get_image_type_id(struct vkd3d_dxbc_compiler if (reg->type == VKD3DSPR_UAV) { d = vkd3d_dxbc_compiler_get_descriptor_info(compiler, - VKD3D_SHADER_DESCRIPTOR_TYPE_UAV, register_space, register_index); + VKD3D_SHADER_DESCRIPTOR_TYPE_UAV, range.space, range.first); if (raw_structured || (d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_READ)) format = image_format_for_image_read(data_type); } @@ -5510,8 +5510,8 @@ static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_ depth = current->sampler_index != VKD3D_SHADER_DUMMY_SAMPLER_INDEX && (d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_SAMPLER_COMPARISON_MODE);
- image_type_id = vkd3d_dxbc_compiler_get_image_type_id(compiler, resource, resource_range.space, - resource_range.first, resource_type_info, sampled_type, structure_stride || raw, depth); + image_type_id = vkd3d_dxbc_compiler_get_image_type_id(compiler, resource, resource_range, + resource_type_info, sampled_type, structure_stride || raw, depth); type_id = vkd3d_spirv_get_op_type_sampled_image(builder, image_type_id);
ptr_type_id = vkd3d_spirv_get_op_type_pointer(builder, storage_class, type_id); @@ -5592,8 +5592,8 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp } else { - type_id = vkd3d_dxbc_compiler_get_image_type_id(compiler, reg, register_space, - register_index, resource_type_info, sampled_type, structure_stride || raw, 0); + type_id = vkd3d_dxbc_compiler_get_image_type_id(compiler, reg, resource->range, + resource_type_info, sampled_type, structure_stride || raw, 0); }
ptr_type_id = vkd3d_spirv_get_op_type_pointer(builder, storage_class, type_id); @@ -7669,7 +7669,7 @@ static void vkd3d_dxbc_compiler_prepare_image(struct vkd3d_dxbc_compiler *compil image->image_type_id, image->id, SpvMemoryAccessMaskNone) : 0;
image->image_type_id = vkd3d_dxbc_compiler_get_image_type_id(compiler, resource_reg, - symbol->info.resource.range.space, symbol->info.resource.range.first, image->resource_type_info, + symbol->info.resource.range, image->resource_type_info, image->sampled_type, image->structure_stride || image->raw, depth_comparison);
if (sampled)
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 9401e8d4..35f1cc30 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5422,7 +5422,7 @@ static SpvImageFormat image_format_for_image_read(enum vkd3d_shader_component_ty
static const struct vkd3d_shader_descriptor_info *vkd3d_dxbc_compiler_get_descriptor_info( struct vkd3d_dxbc_compiler *compiler, enum vkd3d_shader_descriptor_type type, - unsigned int register_space, unsigned int register_index) + struct vkd3d_shader_register_range range) { const struct vkd3d_shader_scan_descriptor_info *descriptor_info = compiler->scan_descriptor_info; const struct vkd3d_shader_descriptor_info *d; @@ -5431,7 +5431,7 @@ static const struct vkd3d_shader_descriptor_info *vkd3d_dxbc_compiler_get_descri for (i = 0; i < descriptor_info->descriptor_count; ++i) { d = &descriptor_info->descriptors[i]; - if (d->type == type && d->register_space == register_space && d->register_index == register_index) + if (d->type == type && d->register_space == range.space && d->register_index == range.first) return d; }
@@ -5452,7 +5452,7 @@ static uint32_t vkd3d_dxbc_compiler_get_image_type_id(struct vkd3d_dxbc_compiler if (reg->type == VKD3DSPR_UAV) { d = vkd3d_dxbc_compiler_get_descriptor_info(compiler, - VKD3D_SHADER_DESCRIPTOR_TYPE_UAV, range.space, range.first); + VKD3D_SHADER_DESCRIPTOR_TYPE_UAV, range); if (raw_structured || (d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_READ)) format = image_format_for_image_read(data_type); } @@ -5484,6 +5484,8 @@ static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_
for (i = 0; i < shader_interface->combined_sampler_count; ++i) { + struct vkd3d_shader_register_range sampler_range; + current = &shader_interface->combined_samplers[i];
if (current->resource_space != resource_range.space || current->resource_index != resource_range.first) @@ -5505,8 +5507,11 @@ static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_ current->sampler_space, current->binding.count); }
+ sampler_range.space = current->sampler_space; + sampler_range.first = current->sampler_index; + sampler_range.last = current->sampler_index; d = vkd3d_dxbc_compiler_get_descriptor_info(compiler, - VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER, current->sampler_space, current->sampler_index); + VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER, sampler_range); depth = current->sampler_index != VKD3D_SHADER_DUMMY_SAMPLER_INDEX && (d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_SAMPLER_COMPARISON_MODE);
@@ -5610,7 +5615,7 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp const struct vkd3d_shader_descriptor_info *d;
d = vkd3d_dxbc_compiler_get_descriptor_info(compiler, - VKD3D_SHADER_DESCRIPTOR_TYPE_UAV, register_space, register_index); + VKD3D_SHADER_DESCRIPTOR_TYPE_UAV, resource->range);
if (!(d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_READ)) vkd3d_spirv_build_op_decorate(builder, var_id, SpvDecorationNonReadable, NULL, 0);
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 35f1cc30..b3f74685 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2581,13 +2581,13 @@ static void vkd3d_dxbc_compiler_emit_descriptor_binding(struct vkd3d_dxbc_compil }
static void vkd3d_dxbc_compiler_emit_descriptor_binding_for_reg(struct vkd3d_dxbc_compiler *compiler, - uint32_t variable_id, const struct vkd3d_shader_register *reg, unsigned int register_space, - unsigned int register_index, enum vkd3d_shader_resource_type resource_type, bool is_uav_counter) + uint32_t variable_id, const struct vkd3d_shader_register *reg, struct vkd3d_shader_register_range range, + enum vkd3d_shader_resource_type resource_type, bool is_uav_counter) { struct vkd3d_shader_descriptor_binding binding;
- binding = vkd3d_dxbc_compiler_get_descriptor_binding(compiler, reg, register_space, - register_index, resource_type, is_uav_counter); + binding = vkd3d_dxbc_compiler_get_descriptor_binding(compiler, reg, range.space, + range.first, resource_type, is_uav_counter); vkd3d_dxbc_compiler_emit_descriptor_binding(compiler, variable_id, &binding); }
@@ -5307,7 +5307,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->range.space, cb->range.first, VKD3D_SHADER_RESOURCE_BUFFER, false); + var_id, reg, cb->range, VKD3D_SHADER_RESOURCE_BUFFER, false);
vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg);
@@ -5373,7 +5373,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->range.space, sampler->range.first, VKD3D_SHADER_RESOURCE_NONE, false); + sampler->range, VKD3D_SHADER_RESOURCE_NONE, false);
vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg);
@@ -5556,8 +5556,6 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp SpvStorageClass storage_class = SpvStorageClassUniformConstant; const struct vkd3d_shader_register *reg = &resource->reg.reg; const struct vkd3d_spirv_resource_type *resource_type_info; - unsigned int register_space = resource->range.space; - unsigned int register_index = resource->range.first; enum vkd3d_shader_component_type sampled_type; struct vkd3d_symbol resource_symbol; bool is_uav; @@ -5606,7 +5604,7 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp ptr_type_id, storage_class, 0);
vkd3d_dxbc_compiler_emit_descriptor_binding_for_reg(compiler, var_id, reg, - register_space, register_index, resource_type, false); + resource->range, resource_type, false);
vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg);
@@ -5651,7 +5649,7 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp ptr_type_id, storage_class, 0);
vkd3d_dxbc_compiler_emit_descriptor_binding_for_reg(compiler, - counter_var_id, reg, register_space, register_index, resource_type, true); + counter_var_id, reg, resource->range, resource_type, true);
vkd3d_spirv_build_op_name(builder, counter_var_id, "u%u_counter", reg->idx[0].offset); }
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index b3f74685..14bc6fda 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2461,8 +2461,9 @@ static void VKD3D_PRINTF_FUNC(3, 4) vkd3d_dxbc_compiler_error(struct vkd3d_dxbc_ }
static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor_binding( - struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_register *reg, unsigned int register_space, - unsigned int reg_idx, enum vkd3d_shader_resource_type resource_type, bool is_uav_counter) + struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_register *reg, + struct vkd3d_shader_register_range range, enum vkd3d_shader_resource_type resource_type, + bool is_uav_counter) { const struct vkd3d_shader_interface_info *shader_interface = &compiler->shader_interface; enum vkd3d_shader_descriptor_type descriptor_type; @@ -2499,7 +2500,7 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor if (!vkd3d_dxbc_compiler_check_shader_visibility(compiler, current->shader_visibility)) continue;
- if (current->register_space != register_space || current->register_index != reg_idx) + if (current->register_space != range.space || current->register_index != range.first) continue;
if (current->offset) @@ -2507,7 +2508,7 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor FIXME("Atomic counter offsets are not supported yet.\n"); vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_DESCRIPTOR_BINDING, "Descriptor binding for UAV counter %u, space %u has unsupported ‘offset’ %u.", - reg_idx, register_space, current->offset); + range.first, range.space, current->offset); }
if (current->binding.count != 1) @@ -2515,16 +2516,16 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor FIXME("Descriptor arrays are not supported.\n"); vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_DESCRIPTOR_BINDING, "Descriptor binding for UAV counter %u, space %u has unsupported ‘count’ %u.", - reg_idx, register_space, current->binding.count); + range.first, range.space, current->binding.count); }
return current->binding; } if (shader_interface->uav_counter_count) { - FIXME("Could not find descriptor binding for UAV counter %u, space %u.\n", reg_idx, register_space); + FIXME("Could not find descriptor binding for UAV counter %u, space %u.\n", range.first, range.space); vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_DESCRIPTOR_BINDING_NOT_FOUND, - "Could not find descriptor binding for UAV counter %u, space %u.", reg_idx, register_space); + "Could not find descriptor binding for UAV counter %u, space %u.", range.first, range.space); } } else @@ -2539,8 +2540,8 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor if (!vkd3d_dxbc_compiler_check_shader_visibility(compiler, current->shader_visibility)) continue;
- if (current->type != descriptor_type || current->register_space != register_space - || current->register_index != reg_idx) + if (current->type != descriptor_type || current->register_space != range.space + || current->register_index != range.first) continue;
if (current->binding.count != 1) @@ -2549,7 +2550,7 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_DESCRIPTOR_BINDING, "Descriptor binding for type %#x, space %u, register %u, " "shader type %#x has unsupported ‘count’ %u.", - descriptor_type, register_space, reg_idx, compiler->shader_type, current->binding.count); + descriptor_type, range.space, range.first, compiler->shader_type, current->binding.count); }
return current->binding; @@ -2557,10 +2558,10 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor if (shader_interface->binding_count) { FIXME("Could not find binding for type %#x, space %u, register %u, shader type %#x.\n", - descriptor_type, register_space, reg_idx, compiler->shader_type); + descriptor_type, range.space, range.first, compiler->shader_type); vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_DESCRIPTOR_BINDING_NOT_FOUND, "Could not find descriptor binding for type %#x, space %u, register %u, shader type %#x.", - descriptor_type, register_space, reg_idx, compiler->shader_type); + descriptor_type, range.space, range.first, compiler->shader_type); } }
@@ -2586,8 +2587,7 @@ static void vkd3d_dxbc_compiler_emit_descriptor_binding_for_reg(struct vkd3d_dxb { struct vkd3d_shader_descriptor_binding binding;
- binding = vkd3d_dxbc_compiler_get_descriptor_binding(compiler, reg, range.space, - range.first, resource_type, is_uav_counter); + binding = vkd3d_dxbc_compiler_get_descriptor_binding(compiler, reg, range, resource_type, is_uav_counter); vkd3d_dxbc_compiler_emit_descriptor_binding(compiler, variable_id, &binding); }
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/vkd3d_shader_main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index a8dc3bfa..feca9f4f 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -580,7 +580,7 @@ static void vkd3d_shader_scan_record_uav_counter(struct vkd3d_shader_scan_contex }
static bool vkd3d_shader_scan_add_descriptor(struct vkd3d_shader_scan_context *context, - enum vkd3d_shader_descriptor_type type, unsigned int register_space, unsigned int register_index, + enum vkd3d_shader_descriptor_type type, struct vkd3d_shader_register_range range, enum vkd3d_shader_resource_type resource_type, enum vkd3d_shader_resource_data_type resource_data_type, unsigned int flags) { @@ -596,8 +596,8 @@ static bool vkd3d_shader_scan_add_descriptor(struct vkd3d_shader_scan_context *c
d = &info->descriptors[info->descriptor_count]; d->type = type; - d->register_space = register_space; - d->register_index = register_index; + d->register_space = range.space; + d->register_index = range.first; d->resource_type = resource_type; d->resource_data_type = resource_data_type; d->flags = flags; @@ -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->range.space, - cb->range.first, VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0); + vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_CBV, cb->range, + VKD3D_SHADER_RESOURCE_BUFFER, VKD3D_SHADER_RESOURCE_DATA_UINT, 0); }
static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_context *context, @@ -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->range.space, - sampler->range.first, VKD3D_SHADER_RESOURCE_NONE, VKD3D_SHADER_RESOURCE_DATA_UINT, flags); + vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER, sampler->range, + VKD3D_SHADER_RESOURCE_NONE, VKD3D_SHADER_RESOURCE_DATA_UINT, flags); }
static void vkd3d_shader_scan_resource_declaration(struct vkd3d_shader_scan_context *context, @@ -666,8 +666,7 @@ static void vkd3d_shader_scan_resource_declaration(struct vkd3d_shader_scan_cont type = VKD3D_SHADER_DESCRIPTOR_TYPE_UAV; else type = VKD3D_SHADER_DESCRIPTOR_TYPE_SRV; - vkd3d_shader_scan_add_descriptor(context, type, resource->range.space, - resource->range.first, resource_type, resource_data_type, 0); + vkd3d_shader_scan_add_descriptor(context, type, resource->range, resource_type, resource_data_type, 0); if (type == VKD3D_SHADER_DESCRIPTOR_TYPE_UAV) vkd3d_shader_scan_add_uav_range(context, resource->reg.reg.idx[0].offset, context->scan_descriptor_info->descriptor_count - 1);
On Fri, 25 Jun 2021 at 06:00, Conor McCarthy cmccarthy@codeweavers.com wrote:
static void vkd3d_dxbc_compiler_emit_combined_sampler_declarations(struct vkd3d_dxbc_compiler *compiler,
const struct vkd3d_shader_register *resource, unsigned int resource_space, unsigned int resource_index,
const struct vkd3d_shader_register *resource, struct vkd3d_shader_register_range resource_range, enum vkd3d_shader_resource_type resource_type, enum vkd3d_shader_component_type sampled_type, unsigned int structure_stride, bool raw, const struct vkd3d_spirv_resource_type *resource_type_info)
{
It's true that the vkd3d_shader_register structure is small enough that it doesn't really make a difference here, but as a matter of principle, I think we should pass structure arguments as (const) pointers. (Here and in subsequent patches.)