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
176 lines
8.4 KiB
Diff
176 lines
8.4 KiB
Diff
From 154bd7a2207e5046788c9b5bf9419147fb01b6bb Mon Sep 17 00:00:00 2001
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
Date: Thu, 4 Sep 2025 07:55:34 +1000
|
|
Subject: [PATCH] Updated vkd3d to 2aefcf5d99cfb4836c3c6178be74061277b9d15c.
|
|
|
|
---
|
|
libs/vkd3d/libs/vkd3d-shader/d3d_asm.c | 6 ++---
|
|
libs/vkd3d/libs/vkd3d-shader/dxil.c | 22 ++++++++++---------
|
|
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 10 ++++++++-
|
|
.../libs/vkd3d-shader/vkd3d_shader_private.h | 2 +-
|
|
4 files changed, 25 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
|
index 58135e71f30..897803ecb56 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
|
@@ -834,7 +834,7 @@ static void shader_print_register(struct vkd3d_d3d_asm_compiler *compiler, const
|
|
&& reg->type != VKD3DSPR_NULL
|
|
&& reg->type != VKD3DSPR_DEPTHOUT)
|
|
{
|
|
- if (offset != ~0u)
|
|
+ if (reg->idx_count)
|
|
{
|
|
bool is_sm_5_1 = vkd3d_shader_ver_ge(&compiler->shader_version, 5, 1);
|
|
|
|
@@ -862,10 +862,10 @@ static void shader_print_register(struct vkd3d_d3d_asm_compiler *compiler, const
|
|
/* For descriptors in sm < 5.1 we move the reg->idx values up one slot
|
|
* to normalise with 5.1.
|
|
* Here we should ignore it if it's a descriptor in sm < 5.1. */
|
|
- if (reg->idx[1].offset != ~0u && (!is_descriptor || is_sm_5_1))
|
|
+ if (reg->idx_count > 1 && (!is_descriptor || is_sm_5_1))
|
|
shader_print_subscript(compiler, reg->idx[1].offset, reg->idx[1].rel_addr);
|
|
|
|
- if (reg->idx[2].offset != ~0u)
|
|
+ if (reg->idx_count > 2)
|
|
shader_print_subscript(compiler, reg->idx[2].offset, reg->idx[2].rel_addr);
|
|
}
|
|
}
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
index 172204f2226..1678128da83 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
|
@@ -2475,7 +2475,7 @@ static void register_init_with_id(struct vkd3d_shader_register *reg,
|
|
reg->idx[0].offset = id;
|
|
}
|
|
|
|
-static enum vsir_data_type vsir_data_type_from_dxil(const struct sm6_type *type)
|
|
+static enum vsir_data_type vsir_data_type_from_dxil(const struct sm6_type *type, struct sm6_parser *dxil)
|
|
{
|
|
if (type->class == TYPE_CLASS_INTEGER)
|
|
{
|
|
@@ -2492,7 +2492,8 @@ static enum vsir_data_type vsir_data_type_from_dxil(const struct sm6_type *type)
|
|
case 64:
|
|
return VSIR_DATA_U64;
|
|
default:
|
|
- FIXME("Unhandled width %u.\n", type->u.width);
|
|
+ vkd3d_shader_parser_error(&dxil->p, VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED,
|
|
+ "Unhandled integer width %u.", type->u.width);
|
|
return VSIR_DATA_U32;
|
|
}
|
|
}
|
|
@@ -2507,12 +2508,14 @@ static enum vsir_data_type vsir_data_type_from_dxil(const struct sm6_type *type)
|
|
case 64:
|
|
return VSIR_DATA_F64;
|
|
default:
|
|
- FIXME("Unhandled width %u.\n", type->u.width);
|
|
+ vkd3d_shader_parser_error(&dxil->p, VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED,
|
|
+ "Unhandled floating-point width %u.", type->u.width);
|
|
return VSIR_DATA_F32;
|
|
}
|
|
}
|
|
|
|
- FIXME("Unhandled type %u.\n", type->class);
|
|
+ vkd3d_shader_parser_error(&dxil->p, VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED,
|
|
+ "Unhandled type %#x.", type->class);
|
|
return VSIR_DATA_U32;
|
|
}
|
|
|
|
@@ -2599,7 +2602,7 @@ static void sm6_register_from_value(struct vkd3d_shader_register *reg, const str
|
|
enum vsir_data_type data_type;
|
|
|
|
scalar_type = sm6_type_get_scalar_type(value->type, 0);
|
|
- data_type = vsir_data_type_from_dxil(scalar_type);
|
|
+ data_type = vsir_data_type_from_dxil(scalar_type, sm6);
|
|
|
|
switch (value->value_type)
|
|
{
|
|
@@ -3239,7 +3242,7 @@ static enum vkd3d_result value_allocate_constant_array(struct sm6_value *dst, co
|
|
dst->u.data = icb;
|
|
|
|
icb->register_idx = sm6->icb_count++;
|
|
- icb->data_type = vsir_data_type_from_dxil(elem_type);
|
|
+ icb->data_type = vsir_data_type_from_dxil(elem_type, sm6);
|
|
icb->element_count = type->u.array.count;
|
|
icb->component_count = 1;
|
|
icb->is_null = !operands;
|
|
@@ -3693,7 +3696,7 @@ static void sm6_parser_declare_indexable_temp(struct sm6_parser *sm6, const stru
|
|
unsigned int count, unsigned int alignment, bool has_function_scope, unsigned int init,
|
|
struct vkd3d_shader_instruction *ins, struct sm6_value *dst)
|
|
{
|
|
- enum vsir_data_type data_type = vsir_data_type_from_dxil(elem_type);
|
|
+ enum vsir_data_type data_type = vsir_data_type_from_dxil(elem_type, sm6);
|
|
|
|
if (ins)
|
|
vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_DCL_INDEXABLE_TEMP);
|
|
@@ -4012,8 +4015,7 @@ static enum vkd3d_result sm6_parser_globals_init(struct sm6_parser *sm6)
|
|
return VKD3D_ERROR_INVALID_SHADER;
|
|
if ((version = record->operands[0]) != 1)
|
|
{
|
|
- FIXME("Unsupported format version %#"PRIx64".\n", version);
|
|
- vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED_BITCODE_FORMAT,
|
|
+ vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED,
|
|
"Bitcode format version %#"PRIx64" is unsupported.", version);
|
|
return VKD3D_ERROR_INVALID_SHADER;
|
|
}
|
|
@@ -5183,7 +5185,7 @@ static void sm6_parser_emit_dx_cbuffer_load(struct sm6_parser *sm6, enum dx_intr
|
|
|
|
type = sm6_type_get_scalar_type(dst->type, 0);
|
|
VKD3D_ASSERT(type);
|
|
- src_param->reg.data_type = vsir_data_type_from_dxil(type);
|
|
+ src_param->reg.data_type = vsir_data_type_from_dxil(type, sm6);
|
|
if (data_type_is_64_bit(src_param->reg.data_type))
|
|
src_param->swizzle = vsir_swizzle_64_from_32(src_param->swizzle);
|
|
else
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
|
index e20a12bb42d..41aeb7f22f6 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
|
@@ -4748,7 +4748,8 @@ static bool intrinsic_tex(struct hlsl_ctx *ctx, const struct parse_initializer *
|
|
}
|
|
|
|
if (!strcmp(name, "tex2Dbias")
|
|
- || !strcmp(name, "tex2Dlod"))
|
|
+ || !strcmp(name, "tex2Dlod")
|
|
+ || !strcmp(name, "texCUBEbias"))
|
|
{
|
|
struct hlsl_ir_node *lod, *c;
|
|
|
|
@@ -4900,6 +4901,12 @@ static bool intrinsic_texCUBE(struct hlsl_ctx *ctx,
|
|
return intrinsic_tex(ctx, params, loc, "texCUBE", HLSL_SAMPLER_DIM_CUBE);
|
|
}
|
|
|
|
+static bool intrinsic_texCUBEbias(struct hlsl_ctx *ctx,
|
|
+ const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
|
+{
|
|
+ return intrinsic_tex(ctx, params, loc, "texCUBEbias", HLSL_SAMPLER_DIM_CUBE);
|
|
+}
|
|
+
|
|
static bool intrinsic_texCUBEgrad(struct hlsl_ctx *ctx,
|
|
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
|
|
{
|
|
@@ -5375,6 +5382,7 @@ intrinsic_functions[] =
|
|
{"tex3Dgrad", 4, false, intrinsic_tex3Dgrad},
|
|
{"tex3Dproj", 2, false, intrinsic_tex3Dproj},
|
|
{"texCUBE", -1, false, intrinsic_texCUBE},
|
|
+ {"texCUBEbias", 2, false, intrinsic_texCUBEbias},
|
|
{"texCUBEgrad", 4, false, intrinsic_texCUBEgrad},
|
|
{"texCUBEproj", 2, false, intrinsic_texCUBEproj},
|
|
{"transpose", 1, true, intrinsic_transpose},
|
|
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
index 698ad541359..9bf196b1fe2 100644
|
|
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
|
@@ -213,7 +213,7 @@ enum vkd3d_shader_error
|
|
VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND_COUNT = 8005,
|
|
VKD3D_SHADER_ERROR_DXIL_INVALID_TYPE_TABLE = 8006,
|
|
VKD3D_SHADER_ERROR_DXIL_INVALID_VALUE_SYMTAB = 8007,
|
|
- VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED_BITCODE_FORMAT = 8008,
|
|
+ VKD3D_SHADER_ERROR_DXIL_UNSUPPORTED = 8008,
|
|
VKD3D_SHADER_ERROR_DXIL_INVALID_FUNCTION_DCL = 8009,
|
|
VKD3D_SHADER_ERROR_DXIL_INVALID_TYPE_ID = 8010,
|
|
VKD3D_SHADER_ERROR_DXIL_INVALID_MODULE = 8011,
|
|
--
|
|
2.51.0
|
|
|