You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Updated vkd3d-latest patchset
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
From 8e84e1a5750fac027178bb160050030e2786680b Mon Sep 17 00:00:00 2001
|
||||
From 7e86c25d99b4ebaa196bb0cfe1053d9d9a4cc9f8 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 21 Feb 2025 09:15:01 +1100
|
||||
Subject: [PATCH 1/2] Updated vkd3d to
|
||||
f576ecc9929dd98c900bb8bc0335b91a1a0d3bff.
|
||||
Subject: [PATCH] Updated vkd3d to f576ecc9929dd98c900bb8bc0335b91a1a0d3bff.
|
||||
|
||||
---
|
||||
libs/vkd3d/include/private/spirv_grammar.h | 10103 ++++++++++++++++
|
||||
|
@@ -1,8 +1,7 @@
|
||||
From d682beb0dff9eff34d01f2e517145d17d561ef01 Mon Sep 17 00:00:00 2001
|
||||
From 32c6084506f963100eb55be8df149437b5e8d4f0 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 10 Apr 2025 07:44:42 +1000
|
||||
Subject: [PATCH 2/2] Updated vkd3d to
|
||||
cbce3a8631116ec10895e6c9c4a00b89b051f6b0.
|
||||
Subject: [PATCH] Updated vkd3d to cbce3a8631116ec10895e6c9c4a00b89b051f6b0.
|
||||
|
||||
---
|
||||
libs/vkd3d/libs/vkd3d-shader/fx.c | 44 ++++++++++++++++-----
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,304 @@
|
||||
From 98ac96121b2336a832083bfdd833e93265291739 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 17 Apr 2025 08:02:13 +1000
|
||||
Subject: [PATCH] Updated vkd3d to c764f71cf58e3a8327b44c588ad3696b422cf8a3.
|
||||
|
||||
---
|
||||
libs/vkd3d/include/vkd3d_shader.h | 5 ++
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 44 ++++++++++++------
|
||||
libs/vkd3d/libs/vkd3d-shader/ir.c | 46 ++++++++++++++++++-
|
||||
.../libs/vkd3d-shader/vkd3d_shader_main.c | 10 +++-
|
||||
.../libs/vkd3d-shader/vkd3d_shader_private.h | 5 ++
|
||||
5 files changed, 92 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/include/vkd3d_shader.h b/libs/vkd3d/include/vkd3d_shader.h
|
||||
index 2e1f37f12e6..6b2805e8759 100644
|
||||
--- a/libs/vkd3d/include/vkd3d_shader.h
|
||||
+++ b/libs/vkd3d/include/vkd3d_shader.h
|
||||
@@ -2076,6 +2076,11 @@ enum vkd3d_shader_resource_type
|
||||
*/
|
||||
enum vkd3d_shader_resource_data_type
|
||||
{
|
||||
+ /**
|
||||
+ * The descriptor has no relevant data type. This value is returned for
|
||||
+ * samplers. \since 1.16
|
||||
+ */
|
||||
+ VKD3D_SHADER_RESOURCE_DATA_NONE = 0x0,
|
||||
/** Unsigned normalized integer. */
|
||||
VKD3D_SHADER_RESOURCE_DATA_UNORM = 0x1,
|
||||
/** Signed normalized integer. */
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
index 6086d018fdc..40fd142f58d 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
@@ -997,10 +997,24 @@ static void free_parse_variable_def(struct parse_variable_def *v)
|
||||
vkd3d_free(v->arrays.sizes);
|
||||
vkd3d_free(v->name);
|
||||
hlsl_cleanup_semantic(&v->semantic);
|
||||
- VKD3D_ASSERT(!v->state_blocks);
|
||||
+ if (v->state_block_count)
|
||||
+ {
|
||||
+ for (unsigned int i = 0; i < v->state_block_count; ++i)
|
||||
+ hlsl_free_state_block(v->state_blocks[i]);
|
||||
+ vkd3d_free(v->state_blocks);
|
||||
+ }
|
||||
vkd3d_free(v);
|
||||
}
|
||||
|
||||
+static void destroy_parse_variable_defs(struct list *defs)
|
||||
+{
|
||||
+ struct parse_variable_def *v, *v_next;
|
||||
+
|
||||
+ LIST_FOR_EACH_ENTRY_SAFE(v, v_next, defs, struct parse_variable_def, entry)
|
||||
+ free_parse_variable_def(v);
|
||||
+ vkd3d_free(defs);
|
||||
+}
|
||||
+
|
||||
static bool gen_struct_fields(struct hlsl_ctx *ctx, struct parse_fields *fields,
|
||||
struct hlsl_type *type, uint32_t modifiers, struct list *defs)
|
||||
{
|
||||
@@ -2618,11 +2632,7 @@ static struct hlsl_block *initialize_vars(struct hlsl_ctx *ctx, struct list *var
|
||||
|
||||
if (!(initializers = make_empty_block(ctx)))
|
||||
{
|
||||
- LIST_FOR_EACH_ENTRY_SAFE(v, v_next, var_list, struct parse_variable_def, entry)
|
||||
- {
|
||||
- free_parse_variable_def(v);
|
||||
- }
|
||||
- vkd3d_free(var_list);
|
||||
+ destroy_parse_variable_defs(var_list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -6551,7 +6561,6 @@ static void validate_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim,
|
||||
bool boolval;
|
||||
char *name;
|
||||
uint32_t modifiers;
|
||||
- struct hlsl_ir_node *instr;
|
||||
struct hlsl_block *block;
|
||||
struct list *list;
|
||||
struct parse_fields fields;
|
||||
@@ -6723,6 +6732,8 @@ static void validate_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim,
|
||||
%type <list> variables_def
|
||||
%type <list> variables_def_typed
|
||||
%type <list> switch_cases
|
||||
+%destructor { destroy_parse_variable_defs($$); } type_specs variables_def variables_def_typed;
|
||||
+%destructor { destroy_switch_cases($$); } switch_cases;
|
||||
|
||||
%token <name> VAR_IDENTIFIER
|
||||
%token <name> NEW_IDENTIFIER
|
||||
@@ -6766,9 +6777,9 @@ static void validate_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim,
|
||||
%type <block> selection_statement
|
||||
%type <block> statement
|
||||
%type <block> statement_list
|
||||
-%type <block> struct_declaration_without_vars
|
||||
%type <block> switch_statement
|
||||
%type <block> unary_expr
|
||||
+%destructor { destroy_block($$); } <block>
|
||||
|
||||
%type <boolval> boolean
|
||||
|
||||
@@ -6819,6 +6830,7 @@ static void validate_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim,
|
||||
%type <state_block_index> state_block_index_opt
|
||||
|
||||
%type <switch_case> switch_case
|
||||
+%destructor { hlsl_free_ir_switch_case($$); } <switch_case>
|
||||
|
||||
%type <type> base_optional
|
||||
%type <type> field_type
|
||||
@@ -6835,6 +6847,7 @@ static void validate_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim,
|
||||
%type <variable_def> variable_decl
|
||||
%type <variable_def> variable_def
|
||||
%type <variable_def> variable_def_typed
|
||||
+%destructor { free_parse_variable_def($$); } <variable_def>
|
||||
|
||||
%%
|
||||
|
||||
@@ -6988,6 +7001,9 @@ buffer_type:
|
||||
declaration_statement_list:
|
||||
%empty
|
||||
| declaration_statement_list declaration_statement
|
||||
+ {
|
||||
+ destroy_block($2);
|
||||
+ }
|
||||
|
||||
preproc_directive:
|
||||
PRE_LINE STRING
|
||||
@@ -7021,9 +7037,6 @@ struct_declaration_without_vars:
|
||||
if ($1)
|
||||
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
||||
"Modifiers are not allowed on struct type declarations.");
|
||||
-
|
||||
- if (!($$ = make_empty_block(ctx)))
|
||||
- YYABORT;
|
||||
}
|
||||
|
||||
struct_spec:
|
||||
@@ -8144,6 +8157,10 @@ type:
|
||||
declaration_statement:
|
||||
declaration
|
||||
| struct_declaration_without_vars
|
||||
+ {
|
||||
+ if (!($$ = make_empty_block(ctx)))
|
||||
+ YYABORT;
|
||||
+ }
|
||||
| typedef
|
||||
{
|
||||
if (!($$ = make_empty_block(ctx)))
|
||||
@@ -8157,15 +8174,12 @@ typedef_type:
|
||||
typedef:
|
||||
KW_TYPEDEF var_modifiers typedef_type type_specs ';'
|
||||
{
|
||||
- struct parse_variable_def *v, *v_next;
|
||||
uint32_t modifiers = $2;
|
||||
struct hlsl_type *type;
|
||||
|
||||
if (!(type = apply_type_modifiers(ctx, $3, &modifiers, false, &@2)))
|
||||
{
|
||||
- LIST_FOR_EACH_ENTRY_SAFE(v, v_next, $4, struct parse_variable_def, entry)
|
||||
- free_parse_variable_def(v);
|
||||
- vkd3d_free($4);
|
||||
+ destroy_parse_variable_defs($4);
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
index d25485ab004..95093102552 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
@@ -8357,8 +8357,11 @@ static void vsir_validate_src_param(struct validation_context *ctx,
|
||||
break;
|
||||
|
||||
case VKD3DSPR_NULL:
|
||||
+ case VKD3DSPR_DEPTHOUT:
|
||||
+ case VKD3DSPR_DEPTHOUTGE:
|
||||
+ case VKD3DSPR_DEPTHOUTLE:
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_REGISTER_TYPE,
|
||||
- "Invalid NULL register used as source parameter.");
|
||||
+ "Invalid register of type %#x used as source parameter.", src->reg.type);
|
||||
break;
|
||||
|
||||
case VKD3DSPR_INPUT:
|
||||
@@ -8857,6 +8860,45 @@ static void vsir_validate_signature(struct validation_context *ctx, const struct
|
||||
}
|
||||
}
|
||||
|
||||
+static void vsir_validate_descriptors(struct validation_context *ctx)
|
||||
+{
|
||||
+ const struct vkd3d_shader_scan_descriptor_info1 *descriptors = &ctx->program->descriptors;
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < descriptors->descriptor_count; ++i)
|
||||
+ {
|
||||
+ const struct vkd3d_shader_descriptor_info1 *descriptor = &descriptors->descriptors[i];
|
||||
+
|
||||
+ if (descriptor->type >= VKD3D_SHADER_DESCRIPTOR_TYPE_COUNT)
|
||||
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DESCRIPTOR_TYPE,
|
||||
+ "Descriptor %u has invalid type %#x.", i, descriptor->type);
|
||||
+
|
||||
+ if (descriptor->resource_type >= VKD3D_SHADER_RESOURCE_TYPE_COUNT)
|
||||
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_RESOURCE_TYPE,
|
||||
+ "Descriptor %u has invalid resource type %#x.", i, descriptor->resource_type);
|
||||
+ else if ((descriptor->resource_type == VKD3D_SHADER_RESOURCE_NONE)
|
||||
+ != (descriptor->type == VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER))
|
||||
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_RESOURCE_TYPE,
|
||||
+ "Descriptor %u has invalid resource type %#x for descriptor type %#x.",
|
||||
+ i, descriptor->resource_type, descriptor->type);
|
||||
+
|
||||
+ if (descriptor->resource_data_type >= VKD3D_DATA_COUNT)
|
||||
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ "Descriptor %u has invalid resource data type %#x.", i, descriptor->resource_data_type);
|
||||
+ else if ((descriptor->resource_data_type == VKD3D_DATA_UNUSED)
|
||||
+ != (descriptor->type == VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER))
|
||||
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ "Descriptor %u has invalid resource data type %#x for descriptor type %#x.",
|
||||
+ i, descriptor->resource_data_type, descriptor->type);
|
||||
+
|
||||
+ if (!descriptor->count || (descriptor->count > UINT_MAX - descriptor->register_index
|
||||
+ && descriptor->count != UINT_MAX))
|
||||
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DESCRIPTOR_COUNT,
|
||||
+ "Descriptor %u has invalid descriptor count %u starting at index %u.",
|
||||
+ i, descriptor->count, descriptor->register_index);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static const char *name_from_cf_type(enum vsir_control_flow_type type)
|
||||
{
|
||||
switch (type)
|
||||
@@ -9823,6 +9865,8 @@ enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t c
|
||||
}
|
||||
}
|
||||
|
||||
+ vsir_validate_descriptors(&ctx);
|
||||
+
|
||||
if (!(ctx.temps = vkd3d_calloc(ctx.program->temp_count, sizeof(*ctx.temps))))
|
||||
goto fail;
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
index a0c24eaf18a..4103cdc1ef9 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
@@ -1111,7 +1111,7 @@ static void vkd3d_shader_scan_sampler_declaration(struct vkd3d_shader_scan_conte
|
||||
struct vkd3d_shader_descriptor_info1 *d;
|
||||
|
||||
if (!(d = vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER,
|
||||
- &sampler->src.reg, &sampler->range, VKD3D_SHADER_RESOURCE_NONE, VKD3D_DATA_UINT)))
|
||||
+ &sampler->src.reg, &sampler->range, VKD3D_SHADER_RESOURCE_NONE, VKD3D_DATA_UNUSED)))
|
||||
return;
|
||||
|
||||
if (instruction->flags & VKD3DSI_SAMPLER_COMPARISON_MODE)
|
||||
@@ -1122,7 +1122,7 @@ static void vkd3d_shader_scan_combined_sampler_declaration(
|
||||
struct vkd3d_shader_scan_context *context, const struct vkd3d_shader_semantic *semantic)
|
||||
{
|
||||
vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER, &semantic->resource.reg.reg,
|
||||
- &semantic->resource.range, VKD3D_SHADER_RESOURCE_NONE, VKD3D_DATA_UINT);
|
||||
+ &semantic->resource.range, VKD3D_SHADER_RESOURCE_NONE, VKD3D_DATA_UNUSED);
|
||||
vkd3d_shader_scan_add_descriptor(context, VKD3D_SHADER_DESCRIPTOR_TYPE_SRV, &semantic->resource.reg.reg,
|
||||
&semantic->resource.range, semantic->resource_type, VKD3D_DATA_FLOAT);
|
||||
}
|
||||
@@ -1520,6 +1520,8 @@ static enum vkd3d_shader_resource_data_type vkd3d_resource_data_type_from_data_t
|
||||
return VKD3D_SHADER_RESOURCE_DATA_DOUBLE;
|
||||
case VKD3D_DATA_CONTINUED:
|
||||
return VKD3D_SHADER_RESOURCE_DATA_CONTINUED;
|
||||
+ case VKD3D_DATA_UNUSED:
|
||||
+ return VKD3D_SHADER_RESOURCE_DATA_NONE;
|
||||
default:
|
||||
ERR("Invalid resource data type %#x.\n", data_type);
|
||||
return VKD3D_SHADER_RESOURCE_DATA_FLOAT;
|
||||
@@ -1547,6 +1549,10 @@ static enum vkd3d_result convert_descriptor_info(struct vkd3d_shader_scan_contex
|
||||
dst->flags = src->flags;
|
||||
dst->count = src->count;
|
||||
|
||||
+ if (context->api_version <= VKD3D_SHADER_API_VERSION_1_15
|
||||
+ && dst->type == VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER)
|
||||
+ dst->resource_data_type = VKD3D_SHADER_RESOURCE_DATA_UINT;
|
||||
+
|
||||
if (context->api_version < VKD3D_SHADER_API_VERSION_1_3
|
||||
&& dst->resource_data_type >= VKD3D_SHADER_RESOURCE_DATA_MIXED)
|
||||
{
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
index 05ef8beeb9c..3b4fb626fcc 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
@@ -61,6 +61,8 @@
|
||||
|
||||
#define VKD3D_SHADER_COMPONENT_TYPE_COUNT (VKD3D_SHADER_COMPONENT_INT16 + 1)
|
||||
#define VKD3D_SHADER_MINIMUM_PRECISION_COUNT (VKD3D_SHADER_MINIMUM_PRECISION_UINT_16 + 1)
|
||||
+#define VKD3D_SHADER_DESCRIPTOR_TYPE_COUNT (VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER + 1)
|
||||
+#define VKD3D_SHADER_RESOURCE_TYPE_COUNT (VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY + 1)
|
||||
|
||||
#define VKD3D_MAX_STREAM_COUNT 4
|
||||
|
||||
@@ -257,6 +259,9 @@ enum vkd3d_shader_error
|
||||
VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC = 9021,
|
||||
VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE = 9022,
|
||||
VKD3D_SHADER_ERROR_VSIR_INVALID_RANGE = 9023,
|
||||
+ VKD3D_SHADER_ERROR_VSIR_INVALID_DESCRIPTOR_TYPE = 9024,
|
||||
+ VKD3D_SHADER_ERROR_VSIR_INVALID_RESOURCE_TYPE = 9025,
|
||||
+ VKD3D_SHADER_ERROR_VSIR_INVALID_DESCRIPTOR_COUNT = 9026,
|
||||
|
||||
VKD3D_SHADER_WARNING_VSIR_DYNAMIC_DESCRIPTOR_ARRAY = 9300,
|
||||
|
||||
--
|
||||
2.47.2
|
||||
|
Reference in New Issue
Block a user