mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
486 lines
22 KiB
Diff
486 lines
22 KiB
Diff
From ae553edec2cdb5797a836135c652d39752b92769 Mon Sep 17 00:00:00 2001
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
Date: Wed, 11 Sep 2024 07:14:31 +1000
|
|
Subject: [PATCH] Updated vkd3d to 3b4e0ce8e94cd4091b9f2fe80d86588b64c88111.
|
|
|
|
---
|
|
libs/vkd3d/libs/vkd3d-shader/d3dbc.c | 10 ++-
|
|
libs/vkd3d/libs/vkd3d-shader/dxil.c | 2 +-
|
|
libs/vkd3d/libs/vkd3d-shader/fx.c | 8 ++-
|
|
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 15 ++++
|
|
libs/vkd3d/libs/vkd3d-shader/ir.c | 69 ++++++++++---------
|
|
libs/vkd3d/libs/vkd3d-shader/tpf.c | 19 +++++
|
|
.../libs/vkd3d-shader/vkd3d_shader_private.h | 4 +-
|
|
libs/vkd3d/libs/vkd3d/command.c | 20 ++++--
|
|
libs/vkd3d/libs/vkd3d/state.c | 2 +-
|
|
libs/vkd3d/libs/vkd3d/vkd3d_private.h | 1 -
|
|
10 files changed, 100 insertions(+), 50 deletions(-)
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d/libs/vkd3d-shader/d3dbc.c
|
|
index de5f28c1815..a41182e1f4a 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/d3dbc.c
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/d3dbc.c
|
|
@@ -1481,10 +1481,8 @@ struct d3dbc_compiler
|
|
|
|
static uint32_t sm1_version(enum vkd3d_shader_type type, unsigned int major, unsigned int minor)
|
|
{
|
|
- if (type == VKD3D_SHADER_TYPE_VERTEX)
|
|
- return D3DVS_VERSION(major, minor);
|
|
- else
|
|
- return D3DPS_VERSION(major, minor);
|
|
+ return vkd3d_make_u32(vkd3d_make_u16(minor, major),
|
|
+ type == VKD3D_SHADER_TYPE_VERTEX ? VKD3D_SM1_VS : VKD3D_SM1_PS);
|
|
}
|
|
|
|
D3DXPARAMETER_CLASS hlsl_sm1_class(const struct hlsl_type *type)
|
|
@@ -1867,8 +1865,8 @@ void write_sm1_uniforms(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buff
|
|
|
|
static uint32_t sm1_encode_register_type(enum vkd3d_shader_register_type type)
|
|
{
|
|
- return ((type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK)
|
|
- | ((type << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2);
|
|
+ return ((type << VKD3D_SM1_REGISTER_TYPE_SHIFT) & VKD3D_SM1_REGISTER_TYPE_MASK)
|
|
+ | ((type << VKD3D_SM1_REGISTER_TYPE_SHIFT2) & VKD3D_SM1_REGISTER_TYPE_MASK2);
|
|
}
|
|
|
|
struct sm1_instruction
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
index 4a17c62292b..1c62a305d30 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
@@ -3888,7 +3888,7 @@ static void sm6_parser_init_signature(struct sm6_parser *sm6, const struct shade
|
|
if (is_control_point)
|
|
{
|
|
if (reg_type == VKD3DSPR_OUTPUT)
|
|
- param->reg.idx[count].rel_addr = instruction_array_create_outpointid_param(&sm6->p.program->instructions);
|
|
+ param->reg.idx[count].rel_addr = vsir_program_create_outpointid_param(sm6->p.program);
|
|
param->reg.idx[count++].offset = 0;
|
|
}
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/fx.c b/libs/vkd3d/libs/vkd3d-shader/fx.c
|
|
index e3ab71fb386..2c2e486aa0e 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/fx.c
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/fx.c
|
|
@@ -38,6 +38,7 @@ struct type_entry
|
|
struct list entry;
|
|
const char *name;
|
|
uint32_t elements_count;
|
|
+ uint32_t modifiers;
|
|
uint32_t offset;
|
|
};
|
|
|
|
@@ -278,9 +279,9 @@ static void write_fx_4_state_block(struct hlsl_ir_var *var, unsigned int block_i
|
|
|
|
static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context *fx)
|
|
{
|
|
+ unsigned int elements_count, modifiers;
|
|
const struct hlsl_type *element_type;
|
|
struct type_entry *type_entry;
|
|
- unsigned int elements_count;
|
|
const char *name;
|
|
|
|
VKD3D_ASSERT(fx->ctx->profile->major_version >= 4);
|
|
@@ -297,6 +298,7 @@ static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context
|
|
}
|
|
|
|
name = get_fx_4_type_name(element_type);
|
|
+ modifiers = element_type->modifiers & HLSL_MODIFIERS_MAJORITY_MASK;
|
|
|
|
LIST_FOR_EACH_ENTRY(type_entry, &fx->types, struct type_entry, entry)
|
|
{
|
|
@@ -306,6 +308,9 @@ static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context
|
|
if (type_entry->elements_count != elements_count)
|
|
continue;
|
|
|
|
+ if (type_entry->modifiers != modifiers)
|
|
+ continue;
|
|
+
|
|
return type_entry->offset;
|
|
}
|
|
|
|
@@ -315,6 +320,7 @@ static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context
|
|
type_entry->offset = write_fx_4_type(type, fx);
|
|
type_entry->name = name;
|
|
type_entry->elements_count = elements_count;
|
|
+ type_entry->modifiers = modifiers;
|
|
|
|
list_add_tail(&fx->types, &type_entry->entry);
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
|
index 816d992afa8..38642025b52 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
|
@@ -4152,6 +4152,20 @@ static bool intrinsic_log2(struct hlsl_ctx *ctx,
|
|
return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_LOG2, arg, loc);
|
|
}
|
|
|
|
+static bool intrinsic_mad(struct hlsl_ctx *ctx,
|
|
+ const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
|
+{
|
|
+ struct hlsl_ir_node *args[HLSL_MAX_OPERANDS] = {0};
|
|
+
|
|
+ if (!elementwise_intrinsic_convert_args(ctx, params, loc))
|
|
+ return false;
|
|
+
|
|
+ args[0] = params->args[0];
|
|
+ args[1] = params->args[1];
|
|
+ args[2] = params->args[2];
|
|
+ return add_expr(ctx, params->instrs, HLSL_OP3_MAD, args, args[0]->data_type, loc);
|
|
+}
|
|
+
|
|
static bool intrinsic_max(struct hlsl_ctx *ctx,
|
|
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
|
{
|
|
@@ -5053,6 +5067,7 @@ intrinsic_functions[] =
|
|
{"log", 1, true, intrinsic_log},
|
|
{"log10", 1, true, intrinsic_log10},
|
|
{"log2", 1, true, intrinsic_log2},
|
|
+ {"mad", 3, true, intrinsic_mad},
|
|
{"max", 2, true, intrinsic_max},
|
|
{"min", 2, true, intrinsic_min},
|
|
{"mul", 2, true, intrinsic_mul},
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
|
index a483c25f3ad..68f2e2f795e 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
|
@@ -551,9 +551,11 @@ static const struct vkd3d_shader_varying_map *find_varying_map(
|
|
}
|
|
|
|
static enum vkd3d_result vsir_program_remap_output_signature(struct vsir_program *program,
|
|
- const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context)
|
|
+ struct vsir_normalisation_context *ctx)
|
|
{
|
|
- const struct vkd3d_shader_location location = {.source_name = compile_info->source_name};
|
|
+ const struct vkd3d_shader_location location = {.source_name = ctx->compile_info->source_name};
|
|
+ struct vkd3d_shader_message_context *message_context = ctx->message_context;
|
|
+ const struct vkd3d_shader_compile_info *compile_info = ctx->compile_info;
|
|
struct shader_signature *signature = &program->output_signature;
|
|
const struct vkd3d_shader_varying_map_info *varying_map;
|
|
unsigned int i;
|
|
@@ -862,9 +864,10 @@ static bool vsir_instruction_init_label(struct vkd3d_shader_instruction *ins,
|
|
return true;
|
|
}
|
|
|
|
-static enum vkd3d_result instruction_array_flatten_hull_shader_phases(struct vkd3d_shader_instruction_array *src_instructions)
|
|
+static enum vkd3d_result vsir_program_flatten_hull_shader_phases(struct vsir_program *program,
|
|
+ struct vsir_normalisation_context *ctx)
|
|
{
|
|
- struct hull_flattener flattener = {*src_instructions};
|
|
+ struct hull_flattener flattener = {program->instructions};
|
|
struct vkd3d_shader_instruction_array *instructions;
|
|
struct shader_phase_location_array locations;
|
|
enum vkd3d_result result = VKD3D_OK;
|
|
@@ -886,7 +889,7 @@ static enum vkd3d_result instruction_array_flatten_hull_shader_phases(struct vkd
|
|
vsir_instruction_init(&instructions->elements[instructions->count++], &flattener.last_ret_location, VKD3DSIH_RET);
|
|
}
|
|
|
|
- *src_instructions = flattener.instructions;
|
|
+ program->instructions = flattener.instructions;
|
|
return result;
|
|
}
|
|
|
|
@@ -902,9 +905,9 @@ static bool control_point_normaliser_is_in_control_point_phase(const struct cont
|
|
return normaliser->phase == VKD3DSIH_HS_CONTROL_POINT_PHASE;
|
|
}
|
|
|
|
-struct vkd3d_shader_src_param *instruction_array_create_outpointid_param(
|
|
- struct vkd3d_shader_instruction_array *instructions)
|
|
+struct vkd3d_shader_src_param *vsir_program_create_outpointid_param(struct vsir_program *program)
|
|
{
|
|
+ struct vkd3d_shader_instruction_array *instructions = &program->instructions;
|
|
struct vkd3d_shader_src_param *rel_addr;
|
|
|
|
if (instructions->outpointid_param)
|
|
@@ -1001,7 +1004,7 @@ static enum vkd3d_result control_point_normaliser_emit_hs_input(struct control_p
|
|
}
|
|
|
|
static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_io(
|
|
- struct vkd3d_shader_instruction_array *src_instructions, const struct shader_signature *input_signature)
|
|
+ struct vsir_program *program, struct vsir_normalisation_context *ctx)
|
|
{
|
|
struct vkd3d_shader_instruction_array *instructions;
|
|
struct control_point_normaliser normaliser;
|
|
@@ -1011,12 +1014,12 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
|
enum vkd3d_result ret;
|
|
unsigned int i, j;
|
|
|
|
- if (!(normaliser.outpointid_param = instruction_array_create_outpointid_param(src_instructions)))
|
|
+ if (!(normaliser.outpointid_param = vsir_program_create_outpointid_param(program)))
|
|
{
|
|
ERR("Failed to allocate src param.\n");
|
|
return VKD3D_ERROR_OUT_OF_MEMORY;
|
|
}
|
|
- normaliser.instructions = *src_instructions;
|
|
+ normaliser.instructions = program->instructions;
|
|
instructions = &normaliser.instructions;
|
|
normaliser.phase = VKD3DSIH_INVALID;
|
|
|
|
@@ -1053,22 +1056,22 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
|
input_control_point_count = ins->declaration.count;
|
|
break;
|
|
case VKD3DSIH_HS_CONTROL_POINT_PHASE:
|
|
- *src_instructions = normaliser.instructions;
|
|
+ program->instructions = normaliser.instructions;
|
|
return VKD3D_OK;
|
|
case VKD3DSIH_HS_FORK_PHASE:
|
|
case VKD3DSIH_HS_JOIN_PHASE:
|
|
/* ins may be relocated if the instruction array expands. */
|
|
location = ins->location;
|
|
- ret = control_point_normaliser_emit_hs_input(&normaliser, input_signature,
|
|
+ ret = control_point_normaliser_emit_hs_input(&normaliser, &program->input_signature,
|
|
input_control_point_count, i, &location);
|
|
- *src_instructions = normaliser.instructions;
|
|
+ program->instructions = normaliser.instructions;
|
|
return ret;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
- *src_instructions = normaliser.instructions;
|
|
+ program->instructions = normaliser.instructions;
|
|
return VKD3D_OK;
|
|
}
|
|
|
|
@@ -1398,6 +1401,8 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map
|
|
else
|
|
e->interpolation_mode = f->interpolation_mode;
|
|
}
|
|
+
|
|
+ vkd3d_free((void *)f->semantic_name);
|
|
}
|
|
}
|
|
element_count = new_count;
|
|
@@ -1425,6 +1430,12 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map
|
|
TRACE("Merging %s, base reg %u, count %u.\n", e->semantic_name, e->register_index, register_count);
|
|
e->register_count = register_count;
|
|
e->mask = signature_element_range_expand_mask(e, register_count, range_map);
|
|
+
|
|
+ for (j = 1; j < register_count; ++j)
|
|
+ {
|
|
+ f = &elements[i + j];
|
|
+ vkd3d_free((void *)f->semantic_name);
|
|
+ }
|
|
}
|
|
}
|
|
element_count = new_count;
|
|
@@ -1761,8 +1772,9 @@ static bool use_flat_interpolation(const struct vsir_program *program,
|
|
}
|
|
|
|
static enum vkd3d_result vsir_program_normalise_io_registers(struct vsir_program *program,
|
|
- struct vkd3d_shader_message_context *message_context)
|
|
+ struct vsir_normalisation_context *ctx)
|
|
{
|
|
+ struct vkd3d_shader_message_context *message_context = ctx->message_context;
|
|
struct io_normaliser normaliser = {program->instructions};
|
|
struct vkd3d_shader_instruction *ins;
|
|
unsigned int i;
|
|
@@ -1909,7 +1921,8 @@ static void shader_register_normalise_flat_constants(struct vkd3d_shader_src_par
|
|
param->reg.idx_count = 3;
|
|
}
|
|
|
|
-static enum vkd3d_result instruction_array_normalise_flat_constants(struct vsir_program *program)
|
|
+static enum vkd3d_result vsir_program_normalise_flat_constants(struct vsir_program *program,
|
|
+ struct vsir_normalisation_context *ctx)
|
|
{
|
|
struct flat_constants_normaliser normaliser = {0};
|
|
unsigned int i, j;
|
|
@@ -6657,30 +6670,20 @@ enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t
|
|
}
|
|
else
|
|
{
|
|
- if (ctx.result < 0)
|
|
- return ctx.result;
|
|
-
|
|
if (program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL)
|
|
- {
|
|
- if ((result = vsir_program_remap_output_signature(program, compile_info, message_context)) < 0)
|
|
- return result;
|
|
- }
|
|
+ vsir_transform(&ctx, vsir_program_remap_output_signature);
|
|
|
|
if (program->shader_version.type == VKD3D_SHADER_TYPE_HULL)
|
|
{
|
|
- if ((result = instruction_array_flatten_hull_shader_phases(&program->instructions)) < 0)
|
|
- return result;
|
|
-
|
|
- if ((result = instruction_array_normalise_hull_shader_control_point_io(&program->instructions,
|
|
- &program->input_signature)) < 0)
|
|
- return result;
|
|
+ vsir_transform(&ctx, vsir_program_flatten_hull_shader_phases);
|
|
+ vsir_transform(&ctx, instruction_array_normalise_hull_shader_control_point_io);
|
|
}
|
|
|
|
- if ((result = vsir_program_normalise_io_registers(program, message_context)) < 0)
|
|
- return result;
|
|
+ vsir_transform(&ctx, vsir_program_normalise_io_registers);
|
|
+ vsir_transform(&ctx, vsir_program_normalise_flat_constants);
|
|
|
|
- if ((result = instruction_array_normalise_flat_constants(program)) < 0)
|
|
- return result;
|
|
+ if (ctx.result < 0)
|
|
+ return ctx.result;
|
|
|
|
remove_dead_code(program);
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/tpf.c b/libs/vkd3d/libs/vkd3d-shader/tpf.c
|
|
index c61086419a6..b76a596bb60 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/tpf.c
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/tpf.c
|
|
@@ -2814,6 +2814,7 @@ bool sysval_semantic_from_hlsl(enum vkd3d_shader_sysval_semantic *semantic,
|
|
{"sv_isfrontface", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_IS_FRONT_FACE},
|
|
{"sv_rendertargetarrayindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX},
|
|
{"sv_viewportarrayindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX},
|
|
+ {"sv_sampleindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_SAMPLE_INDEX},
|
|
|
|
{"color", true, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_TARGET},
|
|
{"depth", true, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_DEPTH},
|
|
@@ -4461,6 +4462,7 @@ static void write_sm4_dcl_semantic(const struct tpf_writer *tpf, const struct hl
|
|
case VKD3D_SHADER_SV_INSTANCE_ID:
|
|
case VKD3D_SHADER_SV_PRIMITIVE_ID:
|
|
case VKD3D_SHADER_SV_VERTEX_ID:
|
|
+ case VKD3D_SHADER_SV_SAMPLE_INDEX:
|
|
instr.opcode = (profile->type == VKD3D_SHADER_TYPE_PIXEL)
|
|
? VKD3D_SM4_OP_DCL_INPUT_PS_SGV : VKD3D_SM4_OP_DCL_INPUT_SGV;
|
|
break;
|
|
@@ -5578,6 +5580,23 @@ static void write_sm4_expr(const struct tpf_writer *tpf, const struct hlsl_ir_ex
|
|
write_sm4_ternary_op(tpf, VKD3D_SM4_OP_MOVC, &expr->node, arg1, arg2, arg3);
|
|
break;
|
|
|
|
+ case HLSL_OP3_MAD:
|
|
+ switch (dst_type->e.numeric.type)
|
|
+ {
|
|
+ case HLSL_TYPE_FLOAT:
|
|
+ write_sm4_ternary_op(tpf, VKD3D_SM4_OP_MAD, &expr->node, arg1, arg2, arg3);
|
|
+ break;
|
|
+
|
|
+ case HLSL_TYPE_INT:
|
|
+ case HLSL_TYPE_UINT:
|
|
+ write_sm4_ternary_op(tpf, VKD3D_SM4_OP_IMAD, &expr->node, arg1, arg2, arg3);
|
|
+ break;
|
|
+
|
|
+ default:
|
|
+ hlsl_fixme(tpf->ctx, &expr->node.loc, "SM4 %s negation expression.", dst_type_string->buffer);
|
|
+ }
|
|
+ break;
|
|
+
|
|
default:
|
|
hlsl_fixme(tpf->ctx, &expr->node.loc, "SM4 %s expression.", debug_hlsl_expr_op(expr->op));
|
|
}
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
index 327461371a4..ffec48daa17 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
@@ -1354,8 +1354,6 @@ bool shader_instruction_array_add_icb(struct vkd3d_shader_instruction_array *ins
|
|
struct vkd3d_shader_immediate_constant_buffer *icb);
|
|
bool shader_instruction_array_clone_instruction(struct vkd3d_shader_instruction_array *instructions,
|
|
unsigned int dst, unsigned int src);
|
|
-struct vkd3d_shader_src_param *instruction_array_create_outpointid_param(
|
|
- struct vkd3d_shader_instruction_array *instructions);
|
|
void shader_instruction_array_destroy(struct vkd3d_shader_instruction_array *instructions);
|
|
|
|
enum vkd3d_shader_config_flags
|
|
@@ -1399,6 +1397,8 @@ enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t
|
|
const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context);
|
|
enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t config_flags,
|
|
const char *source_name, struct vkd3d_shader_message_context *message_context);
|
|
+struct vkd3d_shader_src_param *vsir_program_create_outpointid_param(
|
|
+ struct vsir_program *program);
|
|
bool vsir_instruction_init_with_params(struct vsir_program *program,
|
|
struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_location *location,
|
|
enum vkd3d_shader_opcode opcode, unsigned int dst_count, unsigned int src_count);
|
|
diff --git a/libs/vkd3d/libs/vkd3d/command.c b/libs/vkd3d/libs/vkd3d/command.c
|
|
index dcc7690876f..188162f9e6e 100644
|
|
--- a/libs/vkd3d/libs/vkd3d/command.c
|
|
+++ b/libs/vkd3d/libs/vkd3d/command.c
|
|
@@ -3078,7 +3078,7 @@ done:
|
|
vkd3d_free(vk_descriptor_writes);
|
|
}
|
|
|
|
-static void d3d12_command_list_update_descriptors(struct d3d12_command_list *list,
|
|
+static void d3d12_command_list_update_virtual_descriptors(struct d3d12_command_list *list,
|
|
enum vkd3d_pipeline_bind_point bind_point)
|
|
{
|
|
struct vkd3d_pipeline_bindings *bindings = &list->pipeline_bindings[bind_point];
|
|
@@ -3210,6 +3210,9 @@ static void command_list_flush_vk_heap_updates(struct d3d12_command_list *list)
|
|
|
|
static void command_list_add_descriptor_heap(struct d3d12_command_list *list, struct d3d12_descriptor_heap *heap)
|
|
{
|
|
+ if (!list->device->use_vk_heaps)
|
|
+ return;
|
|
+
|
|
if (!contains_heap(list->descriptor_heaps, list->descriptor_heap_count, heap))
|
|
{
|
|
if (list->descriptor_heap_count == ARRAY_SIZE(list->descriptor_heaps))
|
|
@@ -3296,6 +3299,15 @@ static void d3d12_command_list_update_heap_descriptors(struct d3d12_command_list
|
|
d3d12_command_list_bind_descriptor_heap(list, bind_point, sampler_heap);
|
|
}
|
|
|
|
+static void d3d12_command_list_update_descriptors(struct d3d12_command_list *list,
|
|
+ enum vkd3d_pipeline_bind_point bind_point)
|
|
+{
|
|
+ if (list->device->use_vk_heaps)
|
|
+ d3d12_command_list_update_heap_descriptors(list, bind_point);
|
|
+ else
|
|
+ d3d12_command_list_update_virtual_descriptors(list, bind_point);
|
|
+}
|
|
+
|
|
static bool d3d12_command_list_update_compute_state(struct d3d12_command_list *list)
|
|
{
|
|
d3d12_command_list_end_current_render_pass(list);
|
|
@@ -3303,7 +3315,7 @@ static bool d3d12_command_list_update_compute_state(struct d3d12_command_list *l
|
|
if (!d3d12_command_list_update_compute_pipeline(list))
|
|
return false;
|
|
|
|
- list->update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_COMPUTE);
|
|
+ d3d12_command_list_update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_COMPUTE);
|
|
|
|
return true;
|
|
}
|
|
@@ -3320,7 +3332,7 @@ static bool d3d12_command_list_begin_render_pass(struct d3d12_command_list *list
|
|
if (!d3d12_command_list_update_current_framebuffer(list))
|
|
return false;
|
|
|
|
- list->update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_GRAPHICS);
|
|
+ d3d12_command_list_update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_GRAPHICS);
|
|
|
|
if (list->current_render_pass != VK_NULL_HANDLE)
|
|
return true;
|
|
@@ -6189,8 +6201,6 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d
|
|
|
|
list->allocator = allocator;
|
|
|
|
- list->update_descriptors = device->use_vk_heaps ? d3d12_command_list_update_heap_descriptors
|
|
- : d3d12_command_list_update_descriptors;
|
|
list->descriptor_heap_count = 0;
|
|
|
|
if (SUCCEEDED(hr = d3d12_command_allocator_allocate_command_buffer(allocator, list)))
|
|
diff --git a/libs/vkd3d/libs/vkd3d/state.c b/libs/vkd3d/libs/vkd3d/state.c
|
|
index 682d488faa8..bc887fa2f33 100644
|
|
--- a/libs/vkd3d/libs/vkd3d/state.c
|
|
+++ b/libs/vkd3d/libs/vkd3d/state.c
|
|
@@ -738,7 +738,7 @@ static bool vkd3d_validate_descriptor_set_count(struct d3d12_device *device, uns
|
|
if (set_count > max_count)
|
|
{
|
|
/* NOTE: If maxBoundDescriptorSets is < 9, try VKD3D_CONFIG=virtual_heaps */
|
|
- ERR("Required descriptor set count exceeds maximum allowed count of %u.\n", max_count);
|
|
+ WARN("Required descriptor set count exceeds maximum allowed count of %u.\n", max_count);
|
|
return false;
|
|
}
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
|
|
index ba4e2e8488d..729b1baee18 100644
|
|
--- a/libs/vkd3d/libs/vkd3d/vkd3d_private.h
|
|
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
|
|
@@ -1271,7 +1271,6 @@ struct d3d12_command_list
|
|
VkBuffer so_counter_buffers[D3D12_SO_BUFFER_SLOT_COUNT];
|
|
VkDeviceSize so_counter_buffer_offsets[D3D12_SO_BUFFER_SLOT_COUNT];
|
|
|
|
- void (*update_descriptors)(struct d3d12_command_list *list, enum vkd3d_pipeline_bind_point bind_point);
|
|
struct d3d12_descriptor_heap *descriptor_heaps[64];
|
|
unsigned int descriptor_heap_count;
|
|
|
|
--
|
|
2.45.2
|
|
|