mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Updated vkd3d-latest
This commit is contained in:
parent
4f83c2f614
commit
2f87552459
@ -1,4 +1,4 @@
|
||||
From caa0d7f0cafae8a67fb79dd7426839126285a092 Mon Sep 17 00:00:00 2001
|
||||
From 37be48827f00f33b78d769de7935076c6a2840e5 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 29 Nov 2024 07:14:57 +1100
|
||||
Subject: [PATCH] Updated vkd3d to 9619582d1b6a54720e17a148a72b446fda2fd41f.
|
||||
|
@ -1,4 +1,4 @@
|
||||
From f5513fb3ce1827645b74a43d1486c60d4dcdfe9b Mon Sep 17 00:00:00 2001
|
||||
From c5b9e806ed3c3535916aba32bf267f2eac2a4780 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 3 Dec 2024 09:14:28 +1100
|
||||
Subject: [PATCH] Updated vkd3d to 39cbef9e018ee760ffd175fdd6729e470529fb77.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,302 @@
|
||||
From fa35dd1156e8acc109be7fcc8e0c2fc79ee19974 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 5 Dec 2024 09:55:52 +1100
|
||||
Subject: [PATCH] Updated vkd3d to 01117c716dea0e934ac594a7596d90ad94895d65.
|
||||
|
||||
---
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.c | 3 --
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.h | 3 --
|
||||
libs/vkd3d/libs/vkd3d-shader/ir.c | 16 +++++-
|
||||
libs/vkd3d/libs/vkd3d-shader/msl.c | 78 +++++++++++++++++++++++++++--
|
||||
4 files changed, 90 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.c b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
|
||||
index f0d24b835e5..e7518404aa0 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
|
||||
@@ -3203,13 +3203,11 @@ const char *debug_hlsl_expr_op(enum hlsl_ir_expr_op op)
|
||||
[HLSL_OP1_LOG2] = "log2",
|
||||
[HLSL_OP1_LOGIC_NOT] = "!",
|
||||
[HLSL_OP1_NEG] = "-",
|
||||
- [HLSL_OP1_NRM] = "nrm",
|
||||
[HLSL_OP1_RCP] = "rcp",
|
||||
[HLSL_OP1_REINTERPRET] = "reinterpret",
|
||||
[HLSL_OP1_ROUND] = "round",
|
||||
[HLSL_OP1_RSQ] = "rsq",
|
||||
[HLSL_OP1_SAT] = "sat",
|
||||
- [HLSL_OP1_SIGN] = "sign",
|
||||
[HLSL_OP1_SIN] = "sin",
|
||||
[HLSL_OP1_SIN_REDUCED] = "sin_reduced",
|
||||
[HLSL_OP1_SQRT] = "sqrt",
|
||||
@@ -3219,7 +3217,6 @@ const char *debug_hlsl_expr_op(enum hlsl_ir_expr_op op)
|
||||
[HLSL_OP2_BIT_AND] = "&",
|
||||
[HLSL_OP2_BIT_OR] = "|",
|
||||
[HLSL_OP2_BIT_XOR] = "^",
|
||||
- [HLSL_OP2_CRS] = "crs",
|
||||
[HLSL_OP2_DIV] = "/",
|
||||
[HLSL_OP2_DOT] = "dot",
|
||||
[HLSL_OP2_EQUAL] = "==",
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.h b/libs/vkd3d/libs/vkd3d-shader/hlsl.h
|
||||
index addc98d5a43..b899c16357c 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.h
|
||||
@@ -714,13 +714,11 @@ enum hlsl_ir_expr_op
|
||||
HLSL_OP1_LOG2,
|
||||
HLSL_OP1_LOGIC_NOT,
|
||||
HLSL_OP1_NEG,
|
||||
- HLSL_OP1_NRM,
|
||||
HLSL_OP1_RCP,
|
||||
HLSL_OP1_REINTERPRET,
|
||||
HLSL_OP1_ROUND,
|
||||
HLSL_OP1_RSQ,
|
||||
HLSL_OP1_SAT,
|
||||
- HLSL_OP1_SIGN,
|
||||
HLSL_OP1_SIN,
|
||||
HLSL_OP1_SIN_REDUCED, /* Reduced range [-pi, pi], writes to .y */
|
||||
HLSL_OP1_SQRT,
|
||||
@@ -730,7 +728,6 @@ enum hlsl_ir_expr_op
|
||||
HLSL_OP2_BIT_AND,
|
||||
HLSL_OP2_BIT_OR,
|
||||
HLSL_OP2_BIT_XOR,
|
||||
- HLSL_OP2_CRS,
|
||||
HLSL_OP2_DIV,
|
||||
HLSL_OP2_DOT,
|
||||
HLSL_OP2_EQUAL,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
index 64c9585af52..fbc3ac0f49d 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
@@ -7195,6 +7195,7 @@ static void vsir_validate_register_without_indices(struct validation_context *ct
|
||||
static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
const struct vkd3d_shader_register *reg)
|
||||
{
|
||||
+ unsigned int control_point_count = 0, control_point_index;
|
||||
const struct shader_signature *signature;
|
||||
bool has_control_point = false;
|
||||
|
||||
@@ -7209,6 +7210,7 @@ static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
case VKD3D_SHADER_TYPE_HULL:
|
||||
case VKD3D_SHADER_TYPE_DOMAIN:
|
||||
has_control_point = true;
|
||||
+ control_point_count = ctx->program->input_control_point_count;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -7225,6 +7227,7 @@ static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
{
|
||||
signature = &ctx->program->output_signature;
|
||||
has_control_point = ctx->program->normalisation_level >= VSIR_NORMALISED_HULL_CONTROL_POINT_IO;
|
||||
+ control_point_count = ctx->program->output_control_point_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7241,11 +7244,13 @@ static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
case VKD3DSPR_INCONTROLPOINT:
|
||||
signature = &ctx->program->input_signature;
|
||||
has_control_point = true;
|
||||
+ control_point_count = ctx->program->input_control_point_count;
|
||||
break;
|
||||
|
||||
case VKD3DSPR_OUTCONTROLPOINT:
|
||||
signature = &ctx->program->output_signature;
|
||||
has_control_point = true;
|
||||
+ control_point_count = ctx->program->output_control_point_count;
|
||||
break;
|
||||
|
||||
case VKD3DSPR_PATCHCONST:
|
||||
@@ -7262,6 +7267,8 @@ static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
* allowed to have a relative address. */
|
||||
unsigned int expected_idx_count = 1 + !!has_control_point;
|
||||
|
||||
+ control_point_index = 0;
|
||||
+
|
||||
if (reg->idx_count != expected_idx_count)
|
||||
{
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_INDEX_COUNT,
|
||||
@@ -7280,7 +7287,7 @@ static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
/* If the signature element is not an array, indices are
|
||||
* [signature] or [control point, signature]. If the signature
|
||||
* element is an array, indices are [array, signature] or
|
||||
- * [control point, array, signature]. In any case `signature' is
|
||||
+ * [array, control point, signature]. In any case `signature' is
|
||||
* not allowed to have a relative address, while the others are.
|
||||
*/
|
||||
if (reg->idx_count < 1)
|
||||
@@ -7314,6 +7321,7 @@ static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
is_array = true;
|
||||
|
||||
expected_idx_count = 1 + !!has_control_point + !!is_array;
|
||||
+ control_point_index = !!is_array;
|
||||
|
||||
if (reg->idx_count != expected_idx_count)
|
||||
{
|
||||
@@ -7323,6 +7331,12 @@ static void vsir_validate_io_register(struct validation_context *ctx,
|
||||
return;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (has_control_point && !reg->idx[control_point_index].rel_addr
|
||||
+ && reg->idx[control_point_index].offset >= control_point_count)
|
||||
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_INDEX,
|
||||
+ "Control point index %u exceeds the control point count %u in a register of type %#x.",
|
||||
+ reg->idx[control_point_index].offset, control_point_count, reg->type);
|
||||
}
|
||||
|
||||
static void vsir_validate_temp_register(struct validation_context *ctx,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/msl.c b/libs/vkd3d/libs/vkd3d-shader/msl.c
|
||||
index 0406b8fbd51..f1ca581f1d2 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/msl.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/msl.c
|
||||
@@ -422,16 +422,25 @@ static void msl_dot(struct msl_generator *gen, const struct vkd3d_shader_instruc
|
||||
|
||||
static void msl_intrinsic(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *op)
|
||||
{
|
||||
+ struct vkd3d_string_buffer *args;
|
||||
struct msl_src src;
|
||||
struct msl_dst dst;
|
||||
+ unsigned int i;
|
||||
uint32_t mask;
|
||||
|
||||
mask = msl_dst_init(&dst, gen, ins, &ins->dst[0]);
|
||||
- msl_src_init(&src, gen, &ins->src[0], mask);
|
||||
+ args = vkd3d_string_buffer_get(&gen->string_buffers);
|
||||
|
||||
- msl_print_assignment(gen, &dst, "%s(%s)", op, src.str->buffer);
|
||||
+ for (i = 0; i < ins->src_count; ++i)
|
||||
+ {
|
||||
+ msl_src_init(&src, gen, &ins->src[i], mask);
|
||||
+ vkd3d_string_buffer_printf(args, "%s%s", i ? ", " : "", src.str->buffer);
|
||||
+ msl_src_cleanup(&src, &gen->string_buffers);
|
||||
+ }
|
||||
|
||||
- msl_src_cleanup(&src, &gen->string_buffers);
|
||||
+ msl_print_assignment(gen, &dst, "%s(%s)", op, args->buffer);
|
||||
+
|
||||
+ vkd3d_string_buffer_release(&gen->string_buffers, args);
|
||||
msl_dst_cleanup(&dst, &gen->string_buffers);
|
||||
}
|
||||
|
||||
@@ -477,6 +486,31 @@ static void msl_cast(struct msl_generator *gen, const struct vkd3d_shader_instru
|
||||
msl_dst_cleanup(&dst, &gen->string_buffers);
|
||||
}
|
||||
|
||||
+static void msl_if(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
|
||||
+{
|
||||
+ const char *condition;
|
||||
+ struct msl_src src;
|
||||
+
|
||||
+ msl_src_init(&src, gen, &ins->src[0], VKD3DSP_WRITEMASK_0);
|
||||
+
|
||||
+ msl_print_indent(gen->buffer, gen->indent);
|
||||
+ condition = ins->flags == VKD3D_SHADER_CONDITIONAL_OP_NZ ? "bool" : "!bool";
|
||||
+ vkd3d_string_buffer_printf(gen->buffer, "if (%s(%s))\n", condition, src.str->buffer);
|
||||
+
|
||||
+ msl_src_cleanup(&src, &gen->string_buffers);
|
||||
+
|
||||
+ msl_print_indent(gen->buffer, gen->indent);
|
||||
+ vkd3d_string_buffer_printf(gen->buffer, "{\n");
|
||||
+ ++gen->indent;
|
||||
+}
|
||||
+
|
||||
+static void msl_endif(struct msl_generator *gen)
|
||||
+{
|
||||
+ --gen->indent;
|
||||
+ msl_print_indent(gen->buffer, gen->indent);
|
||||
+ vkd3d_string_buffer_printf(gen->buffer, "}\n");
|
||||
+}
|
||||
+
|
||||
static void msl_mov(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
|
||||
{
|
||||
struct msl_src src;
|
||||
@@ -549,6 +583,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
|
||||
case VKD3DSIH_DP4:
|
||||
msl_dot(gen, ins, VKD3DSP_WRITEMASK_ALL);
|
||||
break;
|
||||
+ case VKD3DSIH_ENDIF:
|
||||
+ msl_endif(gen);
|
||||
+ break;
|
||||
case VKD3DSIH_IEQ:
|
||||
msl_relop(gen, ins, "==");
|
||||
break;
|
||||
@@ -567,9 +604,18 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
|
||||
case VKD3DSIH_GEO:
|
||||
msl_relop(gen, ins, ">=");
|
||||
break;
|
||||
+ case VKD3DSIH_IF:
|
||||
+ msl_if(gen, ins);
|
||||
+ break;
|
||||
case VKD3DSIH_LTO:
|
||||
msl_relop(gen, ins, "<");
|
||||
break;
|
||||
+ case VKD3DSIH_MAX:
|
||||
+ msl_intrinsic(gen, ins, "max");
|
||||
+ break;
|
||||
+ case VKD3DSIH_MIN:
|
||||
+ msl_intrinsic(gen, ins, "min");
|
||||
+ break;
|
||||
case VKD3DSIH_INE:
|
||||
case VKD3DSIH_NEU:
|
||||
msl_relop(gen, ins, "!=");
|
||||
@@ -578,6 +624,9 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
|
||||
case VKD3DSIH_UTOF:
|
||||
msl_cast(gen, ins, "float");
|
||||
break;
|
||||
+ case VKD3DSIH_LOG:
|
||||
+ msl_intrinsic(gen, ins, "log2");
|
||||
+ break;
|
||||
case VKD3DSIH_MOV:
|
||||
msl_mov(gen, ins);
|
||||
break;
|
||||
@@ -593,12 +642,21 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
|
||||
case VKD3DSIH_RET:
|
||||
msl_ret(gen, ins);
|
||||
break;
|
||||
+ case VKD3DSIH_ROUND_NE:
|
||||
+ msl_intrinsic(gen, ins, "rint");
|
||||
+ break;
|
||||
+ case VKD3DSIH_ROUND_NI:
|
||||
+ msl_intrinsic(gen, ins, "floor");
|
||||
+ break;
|
||||
case VKD3DSIH_ROUND_PI:
|
||||
msl_intrinsic(gen, ins, "ceil");
|
||||
break;
|
||||
case VKD3DSIH_ROUND_Z:
|
||||
msl_intrinsic(gen, ins, "trunc");
|
||||
break;
|
||||
+ case VKD3DSIH_RSQ:
|
||||
+ msl_intrinsic(gen, ins, "rsqrt");
|
||||
+ break;
|
||||
case VKD3DSIH_SQRT:
|
||||
msl_intrinsic(gen, ins, "sqrt");
|
||||
break;
|
||||
@@ -765,6 +823,16 @@ static void msl_generate_input_struct_declarations(struct msl_generator *gen)
|
||||
|
||||
if (e->sysval_semantic)
|
||||
{
|
||||
+ if (e->sysval_semantic == VKD3D_SHADER_SV_IS_FRONT_FACE)
|
||||
+ {
|
||||
+ if (type != VKD3D_SHADER_TYPE_PIXEL)
|
||||
+ msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
|
||||
+ "Internal compiler error: Unhandled SV_IS_FRONT_FACE in shader type #%x.", type);
|
||||
+
|
||||
+ msl_print_indent(gen->buffer, 1);
|
||||
+ vkd3d_string_buffer_printf(buffer, "bool is_front_face [[front_facing]];\n");
|
||||
+ continue;
|
||||
+ }
|
||||
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
|
||||
"Internal compiler error: Unhandled system value %#x.", e->sysval_semantic);
|
||||
continue;
|
||||
@@ -979,6 +1047,10 @@ static void msl_generate_entrypoint_prologue(struct msl_generator *gen)
|
||||
vkd3d_string_buffer_printf(buffer, " = input.shader_in_%u", i);
|
||||
msl_print_write_mask(buffer, e->mask);
|
||||
}
|
||||
+ else if (e->sysval_semantic == VKD3D_SHADER_SV_IS_FRONT_FACE)
|
||||
+ {
|
||||
+ vkd3d_string_buffer_printf(buffer, ".u = uint4(input.is_front_face ? 0xffffffffu : 0u, 0, 0, 0)");
|
||||
+ }
|
||||
else
|
||||
{
|
||||
vkd3d_string_buffer_printf(buffer, " = <unhandled sysval %#x>", e->sysval_semantic);
|
||||
--
|
||||
2.45.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user