You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-12-15 08:03:15 -08:00
vkd3d-latest patchset
Squash
This commit is contained in:
@@ -1,102 +0,0 @@
|
||||
From 52953d19dee2161be20f9afb641e9b3d01cb8f2e Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Mon, 26 May 2025 07:03:34 +1000
|
||||
Subject: [PATCH] Updated vkd3d to 44fffee5e1331e1c7e10489d84723c3b9dad7e17.
|
||||
|
||||
---
|
||||
dlls/msado15/tests/msado15.c | 2 +-
|
||||
libs/vkd3d/include/private/vkd3d_common.h | 2 +-
|
||||
libs/vkd3d/include/private/vkd3d_version.h | 2 +-
|
||||
libs/vkd3d/libs/vkd3d-common/blob.c | 1 +
|
||||
libs/vkd3d/libs/vkd3d-shader/preproc.l | 1 +
|
||||
libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c | 2 ++
|
||||
libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c | 2 ++
|
||||
7 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
|
||||
index 03eaab92b39..3f4b55d2916 100644
|
||||
--- a/dlls/msado15/tests/msado15.c
|
||||
+++ b/dlls/msado15/tests/msado15.c
|
||||
@@ -2023,8 +2023,8 @@ START_TEST(msado15)
|
||||
setup_database();
|
||||
|
||||
test_Connection();
|
||||
- test_Connection_Open();
|
||||
test_ConnectionPoint();
|
||||
+ test_Connection_Open();
|
||||
test_ADORecordsetConstruction(FALSE);
|
||||
test_ADORecordsetConstruction(TRUE);
|
||||
test_Fields();
|
||||
diff --git a/libs/vkd3d/include/private/vkd3d_common.h b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
index 08341304eea..0501e6a06c2 100644
|
||||
--- a/libs/vkd3d/include/private/vkd3d_common.h
|
||||
+++ b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
@@ -279,7 +279,7 @@ static inline unsigned int vkd3d_popcount(unsigned int v)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return __popcnt(v);
|
||||
-#elif defined(__MINGW32__)
|
||||
+#elif defined(HAVE_BUILTIN_POPCOUNT)
|
||||
return __builtin_popcount(v);
|
||||
#else
|
||||
v -= (v >> 1) & 0x55555555;
|
||||
diff --git a/libs/vkd3d/include/private/vkd3d_version.h b/libs/vkd3d/include/private/vkd3d_version.h
|
||||
index 0edc4428022..687751d6a5f 100644
|
||||
--- a/libs/vkd3d/include/private/vkd3d_version.h
|
||||
+++ b/libs/vkd3d/include/private/vkd3d_version.h
|
||||
@@ -1 +1 @@
|
||||
-#define VKD3D_VCS_ID " (Wine bundled)"
|
||||
+#define VKD3D_VCS_ID " (git a8ca1f95)"
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-common/blob.c b/libs/vkd3d/libs/vkd3d-common/blob.c
|
||||
index f60ef7db769..c2c6ad67804 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-common/blob.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-common/blob.c
|
||||
@@ -20,6 +20,7 @@
|
||||
#define WIDL_C_INLINE_WRAPPERS
|
||||
#endif
|
||||
#define COBJMACROS
|
||||
+
|
||||
#define CONST_VTABLE
|
||||
#include "vkd3d.h"
|
||||
#include "vkd3d_blob.h"
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/preproc.l b/libs/vkd3d/libs/vkd3d-shader/preproc.l
|
||||
index a8c0db358bc..5c56fba0229 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/preproc.l
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/preproc.l
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
%{
|
||||
|
||||
+#include "preproc.h"
|
||||
#include "preproc.tab.h"
|
||||
|
||||
#undef ERROR /* defined in wingdi.h */
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
index 5fcc836aae1..d1992c9d446 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
+/* VKD3D_DEBUG_ENV_NAME("VKD3D_SHADER_DEBUG"); */
|
||||
+
|
||||
static inline int char_to_int(char c)
|
||||
{
|
||||
if ('0' <= c && c <= '9')
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
index f2967835b62..f804c1f0c24 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "vkd3d_utils_private.h"
|
||||
#undef D3D12CreateDevice
|
||||
|
||||
+/* VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG"); */
|
||||
+
|
||||
static const char *debug_d3d_blob_part(D3D_BLOB_PART part)
|
||||
{
|
||||
switch (part)
|
||||
--
|
||||
2.51.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,133 +0,0 @@
|
||||
From 38b9415c7e850a1774d508232dd0e5e97e505eab Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 23 Aug 2025 07:27:59 +1000
|
||||
Subject: [PATCH] Updated vkd3d to d0098b0d5968d1969ec622b91fd360fd0aec2328.
|
||||
|
||||
---
|
||||
libs/vkd3d/libs/vkd3d-shader/glsl.c | 9 +--------
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.l | 2 +-
|
||||
libs/vkd3d/libs/vkd3d-shader/preproc.l | 12 ++----------
|
||||
libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c | 7 ++++++-
|
||||
libs/vkd3d/libs/vkd3d/utils.c | 3 ++-
|
||||
5 files changed, 12 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/glsl.c b/libs/vkd3d/libs/vkd3d-shader/glsl.c
|
||||
index 5988e7b3a30..acc30b998f6 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/glsl.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/glsl.c
|
||||
@@ -2329,7 +2329,6 @@ static int vkd3d_glsl_generator_generate(struct vkd3d_glsl_generator *gen, struc
|
||||
struct vkd3d_string_buffer *buffer = gen->buffer;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
struct vsir_program_iterator it;
|
||||
- void *code;
|
||||
|
||||
MESSAGE("Generating a GLSL shader. This is unsupported; you get to keep all the pieces if it breaks.\n");
|
||||
|
||||
@@ -2358,13 +2357,7 @@ static int vkd3d_glsl_generator_generate(struct vkd3d_glsl_generator *gen, struc
|
||||
if (gen->failed)
|
||||
return VKD3D_ERROR_INVALID_SHADER;
|
||||
|
||||
- if ((code = vkd3d_malloc(buffer->buffer_size)))
|
||||
- {
|
||||
- memcpy(code, buffer->buffer, buffer->content_size);
|
||||
- out->size = buffer->content_size;
|
||||
- out->code = code;
|
||||
- }
|
||||
- else return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
+ vkd3d_shader_code_from_string_buffer(out, buffer);
|
||||
|
||||
return VKD3D_OK;
|
||||
}
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.l b/libs/vkd3d/libs/vkd3d-shader/hlsl.l
|
||||
index 0cdebb8a657..da9f0d39136 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.l
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.l
|
||||
@@ -346,7 +346,7 @@ while {return KW_WHILE; }
|
||||
<pp>{ANY} {}
|
||||
|
||||
{ANY} {
|
||||
- return yytext[0];
|
||||
+ return (unsigned char)yytext[0];
|
||||
}
|
||||
|
||||
%%
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/preproc.l b/libs/vkd3d/libs/vkd3d-shader/preproc.l
|
||||
index 5c56fba0229..f9b1d67ac36 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/preproc.l
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/preproc.l
|
||||
@@ -824,7 +824,6 @@ int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
|
||||
static const struct vkd3d_shader_preprocess_info default_preprocess_info = {0};
|
||||
struct preproc_ctx ctx = {0};
|
||||
char *source_name = NULL;
|
||||
- void *output_code;
|
||||
unsigned int i;
|
||||
|
||||
vkd3d_string_buffer_init(&ctx.buffer);
|
||||
@@ -901,16 +900,9 @@ int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
|
||||
return VKD3D_ERROR_INVALID_SHADER;
|
||||
}
|
||||
|
||||
- if (!(output_code = vkd3d_malloc(ctx.buffer.content_size)))
|
||||
- {
|
||||
- vkd3d_string_buffer_cleanup(&ctx.buffer);
|
||||
- return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
- }
|
||||
- memcpy(output_code, ctx.buffer.buffer, ctx.buffer.content_size);
|
||||
- out->size = ctx.buffer.content_size;
|
||||
- out->code = output_code;
|
||||
vkd3d_string_buffer_trace(&ctx.buffer);
|
||||
- vkd3d_string_buffer_cleanup(&ctx.buffer);
|
||||
+
|
||||
+ vkd3d_shader_code_from_string_buffer(out, &ctx.buffer);
|
||||
return VKD3D_OK;
|
||||
|
||||
fail:
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
index 75b7f9aa769..08450b4cf85 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
@@ -2266,6 +2266,7 @@ int vkd3d_shader_preprocess(const struct vkd3d_shader_compile_info *compile_info
|
||||
struct vkd3d_shader_code *out, char **messages)
|
||||
{
|
||||
struct vkd3d_shader_message_context message_context;
|
||||
+ struct shader_dump_data dump_data;
|
||||
int ret;
|
||||
|
||||
TRACE("compile_info %p, out %p, messages %p.\n", compile_info, out, messages);
|
||||
@@ -2278,7 +2279,11 @@ int vkd3d_shader_preprocess(const struct vkd3d_shader_compile_info *compile_info
|
||||
|
||||
vkd3d_shader_message_context_init(&message_context, compile_info->log_level);
|
||||
|
||||
- ret = preproc_lexer_parse(compile_info, out, &message_context);
|
||||
+ fill_shader_dump_data(compile_info, &dump_data);
|
||||
+ vkd3d_shader_dump_shader(&dump_data, compile_info->source.code, compile_info->source.size, SHADER_DUMP_TYPE_SOURCE);
|
||||
+
|
||||
+ if ((ret = preproc_lexer_parse(compile_info, out, &message_context)) >= 0)
|
||||
+ vkd3d_shader_dump_shader(&dump_data, out->code, out->size, SHADER_DUMP_TYPE_PREPROC);
|
||||
|
||||
vkd3d_shader_message_context_trace_messages(&message_context);
|
||||
if (!vkd3d_shader_message_context_copy_messages(&message_context, messages))
|
||||
diff --git a/libs/vkd3d/libs/vkd3d/utils.c b/libs/vkd3d/libs/vkd3d/utils.c
|
||||
index c2832a61f67..2d0510e5456 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d/utils.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d/utils.c
|
||||
@@ -703,7 +703,7 @@ const char *debug_vk_extent_3d(VkExtent3D extent)
|
||||
|
||||
const char *debug_vk_queue_flags(VkQueueFlags flags)
|
||||
{
|
||||
- char buffer[191];
|
||||
+ char buffer[222];
|
||||
|
||||
buffer[0] = '\0';
|
||||
#define FLAG_TO_STR(f) if (flags & f) { strcat(buffer, " | "#f); flags &= ~f; }
|
||||
@@ -716,6 +716,7 @@ const char *debug_vk_queue_flags(VkQueueFlags flags)
|
||||
#define FLAG_TO_STR(f, n) if (flags & f) { strcat(buffer, " | "#n); flags &= ~f; }
|
||||
FLAG_TO_STR(0x20, VK_QUEUE_VIDEO_DECODE_BIT_KHR)
|
||||
FLAG_TO_STR(0x40, VK_QUEUE_VIDEO_ENCODE_BIT_KHR)
|
||||
+ FLAG_TO_STR(0x100, VK_QUEUE_OPTICAL_FLOW_BIT_NV)
|
||||
#undef FLAG_TO_STR
|
||||
if (flags)
|
||||
FIXME("Unrecognized flag(s) %#x.\n", flags);
|
||||
--
|
||||
2.51.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,365 +0,0 @@
|
||||
From f6510f66601eba7d3dbe69168831429c930aa494 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 2 Sep 2025 07:37:13 +1000
|
||||
Subject: [PATCH] Updated vkd3d to 979d7e4b85f2fb8db60219f4a2673fc807142ebd.
|
||||
|
||||
---
|
||||
libs/vkd3d/libs/vkd3d-shader/glsl.c | 26 ++++++++++++++++
|
||||
libs/vkd3d/libs/vkd3d-shader/ir.c | 44 ++++++++++++++--------------
|
||||
libs/vkd3d/libs/vkd3d-shader/spirv.c | 29 +++++++++---------
|
||||
3 files changed, 63 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/glsl.c b/libs/vkd3d/libs/vkd3d-shader/glsl.c
|
||||
index 7325661ea7b..b2679beff9f 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/glsl.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/glsl.c
|
||||
@@ -288,6 +288,14 @@ static void shader_glsl_print_register_name(struct vkd3d_string_buffer *buffer,
|
||||
shader_glsl_print_subscript(buffer, gen, reg->idx[1].rel_addr, reg->idx[1].offset);
|
||||
break;
|
||||
|
||||
+ case VKD3DSPR_SAMPLEMASK:
|
||||
+ if (gen->program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL)
|
||||
+ vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL,
|
||||
+ "Internal compiler error: Unhandled sample coverage mask in shader type #%x.",
|
||||
+ gen->program->shader_version.type);
|
||||
+ vkd3d_string_buffer_printf(buffer, "o_mask");
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL,
|
||||
"Internal compiler error: Unhandled register type %#x.", reg->type);
|
||||
@@ -1286,6 +1294,13 @@ static void shader_glsl_print_sysval_name(struct vkd3d_string_buffer *buffer, st
|
||||
vkd3d_string_buffer_printf(buffer, "intBitsToFloat(ivec4(gl_VertexID, 0, 0, 0))");
|
||||
break;
|
||||
|
||||
+ case VKD3D_SHADER_SV_INSTANCE_ID:
|
||||
+ if (version->type != VKD3D_SHADER_TYPE_VERTEX)
|
||||
+ vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL,
|
||||
+ "Internal compiler error: Unhandled SV_INSTANCE_ID in shader type #%x.", version->type);
|
||||
+ vkd3d_string_buffer_printf(buffer, "intBitsToFloat(ivec4(gl_InstanceID, 0, 0, 0))");
|
||||
+ break;
|
||||
+
|
||||
case VKD3D_SHADER_SV_IS_FRONT_FACE:
|
||||
if (version->type != VKD3D_SHADER_TYPE_PIXEL)
|
||||
vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL,
|
||||
@@ -1434,6 +1449,12 @@ static void shader_glsl_shader_epilogue(struct vkd3d_glsl_generator *gen)
|
||||
shader_glsl_print_write_mask(buffer, e->mask);
|
||||
vkd3d_string_buffer_printf(buffer, ";\n");
|
||||
}
|
||||
+
|
||||
+ if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_SAMPLEMASK))
|
||||
+ {
|
||||
+ shader_glsl_print_indent(buffer, gen->indent);
|
||||
+ vkd3d_string_buffer_printf(gen->buffer, "gl_SampleMask[0] = floatBitsToInt(o_mask);\n");
|
||||
+ }
|
||||
}
|
||||
|
||||
static void shader_glsl_ret(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
|
||||
@@ -1650,6 +1671,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
|
||||
case VSIR_OP_UDIV_SIMPLE:
|
||||
shader_glsl_binop(gen, ins, "/");
|
||||
break;
|
||||
+ case VSIR_OP_UREM:
|
||||
+ shader_glsl_binop(gen, ins, "%");
|
||||
+ break;
|
||||
case VSIR_OP_XOR:
|
||||
shader_glsl_binop(gen, ins, "^");
|
||||
break;
|
||||
@@ -2339,6 +2363,8 @@ static void shader_glsl_generate_declarations(struct vkd3d_glsl_generator *gen)
|
||||
vkd3d_string_buffer_printf(buffer, "vec4 %s_in[%u];\n", gen->prefix, gen->limits.input_count);
|
||||
if (gen->limits.output_count)
|
||||
vkd3d_string_buffer_printf(buffer, "vec4 %s_out[%u];\n", gen->prefix, gen->limits.output_count);
|
||||
+ if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_SAMPLEMASK))
|
||||
+ vkd3d_string_buffer_printf(gen->buffer, "float o_mask;\n");
|
||||
if (program->temp_count)
|
||||
vkd3d_string_buffer_printf(buffer, "vec4 r[%u];\n", program->temp_count);
|
||||
vkd3d_string_buffer_printf(buffer, "\n");
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
index 396562e65e4..1ab406a9d84 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
@@ -1750,6 +1750,8 @@ static enum vkd3d_result vsir_program_lower_instructions(struct vsir_program *pr
|
||||
case VSIR_OP_DCL:
|
||||
case VSIR_OP_DCL_CONSTANT_BUFFER:
|
||||
case VSIR_OP_DCL_GLOBAL_FLAGS:
|
||||
+ case VSIR_OP_DCL_INPUT_PRIMITIVE:
|
||||
+ case VSIR_OP_DCL_OUTPUT_TOPOLOGY:
|
||||
case VSIR_OP_DCL_SAMPLER:
|
||||
case VSIR_OP_DCL_TEMPS:
|
||||
case VSIR_OP_DCL_TESSELLATOR_DOMAIN:
|
||||
@@ -7167,7 +7169,6 @@ static enum vkd3d_result vsir_program_insert_clip_planes(struct vsir_program *pr
|
||||
unsigned int low_signature_idx = ~0u, high_signature_idx = ~0u;
|
||||
const struct vkd3d_shader_parameter1 *mask_parameter = NULL;
|
||||
uint32_t position_signature_idx, position_temp, mask;
|
||||
- static const struct vkd3d_shader_location no_loc;
|
||||
struct signature_element *clip_element;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
unsigned int plane_count;
|
||||
@@ -7189,13 +7190,13 @@ static enum vkd3d_result vsir_program_insert_clip_planes(struct vsir_program *pr
|
||||
|
||||
if (mask_parameter->type != VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
+ vkd3d_shader_error(ctx->message_context, NULL, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
"Unsupported clip plane mask parameter type %#x.", mask_parameter->type);
|
||||
return VKD3D_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
if (mask_parameter->data_type != VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ vkd3d_shader_error(ctx->message_context, NULL, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid clip plane mask parameter data type %#x.", mask_parameter->data_type);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7208,7 +7209,7 @@ static enum vkd3d_result vsir_program_insert_clip_planes(struct vsir_program *pr
|
||||
{
|
||||
if (signature->elements[i].sysval_semantic == VKD3D_SHADER_SV_CLIP_DISTANCE)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_PARAMETER,
|
||||
+ vkd3d_shader_error(ctx->message_context, &ctx->null_location, VKD3D_SHADER_ERROR_VSIR_INVALID_PARAMETER,
|
||||
"Clip planes cannot be used if the shader writes clip distance.");
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7216,7 +7217,7 @@ static enum vkd3d_result vsir_program_insert_clip_planes(struct vsir_program *pr
|
||||
|
||||
if (!vsir_signature_find_sysval(signature, VKD3D_SHADER_SV_POSITION, 0, &position_signature_idx))
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC,
|
||||
+ vkd3d_shader_error(ctx->message_context, &ctx->null_location, VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC,
|
||||
"Shader does not write position.");
|
||||
return VKD3D_ERROR_INVALID_SHADER;
|
||||
}
|
||||
@@ -7306,7 +7307,6 @@ static enum vkd3d_result vsir_program_insert_point_size(struct vsir_program *pro
|
||||
{
|
||||
struct vsir_program_iterator it = vsir_program_iterator(&program->instructions);
|
||||
const struct vkd3d_shader_parameter1 *size_parameter = NULL;
|
||||
- static const struct vkd3d_shader_location no_loc;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
|
||||
if (program->has_point_size)
|
||||
@@ -7328,7 +7328,7 @@ static enum vkd3d_result vsir_program_insert_point_size(struct vsir_program *pro
|
||||
|
||||
if (size_parameter->data_type != VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ vkd3d_shader_error(ctx->message_context, NULL, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid point size parameter data type %#x.", size_parameter->data_type);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7355,7 +7355,6 @@ static enum vkd3d_result vsir_program_insert_point_size_clamp(struct vsir_progra
|
||||
{
|
||||
const struct vkd3d_shader_parameter1 *min_parameter = NULL, *max_parameter = NULL;
|
||||
struct vsir_program_iterator it = vsir_program_iterator(&program->instructions);
|
||||
- static const struct vkd3d_shader_location no_loc;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
|
||||
if (!program->has_point_size)
|
||||
@@ -7379,14 +7378,14 @@ static enum vkd3d_result vsir_program_insert_point_size_clamp(struct vsir_progra
|
||||
|
||||
if (min_parameter && min_parameter->data_type != VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ vkd3d_shader_error(ctx->message_context, NULL, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid minimum point size parameter data type %#x.", min_parameter->data_type);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (max_parameter && max_parameter->data_type != VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ vkd3d_shader_error(ctx->message_context, NULL, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid maximum point size parameter data type %#x.", max_parameter->data_type);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7529,7 +7528,7 @@ static enum vkd3d_result vsir_program_insert_point_coord(struct vsir_program *pr
|
||||
{
|
||||
struct vsir_program_iterator it = vsir_program_iterator(&program->instructions), it2;
|
||||
const struct vkd3d_shader_parameter1 *sprite_parameter = NULL;
|
||||
- static const struct vkd3d_shader_location no_loc;
|
||||
+ struct vkd3d_shader_location loc = ctx->null_location;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
bool used_texcoord = false;
|
||||
unsigned int coord_temp;
|
||||
@@ -7551,13 +7550,13 @@ static enum vkd3d_result vsir_program_insert_point_coord(struct vsir_program *pr
|
||||
|
||||
if (sprite_parameter->type != VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
+ vkd3d_shader_error(ctx->message_context, NULL, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
"Unsupported point sprite parameter type %#x.", sprite_parameter->type);
|
||||
return VKD3D_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
if (sprite_parameter->data_type != VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32)
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ vkd3d_shader_error(ctx->message_context, NULL, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid point sprite parameter data type %#x.", sprite_parameter->data_type);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7577,7 +7576,10 @@ static enum vkd3d_result vsir_program_insert_point_coord(struct vsir_program *pr
|
||||
for (ins = vsir_program_iterator_head(&it); ins; ins = vsir_program_iterator_next(&it))
|
||||
{
|
||||
if (!vsir_instruction_is_dcl(ins) && ins->opcode != VSIR_OP_LABEL && ins->opcode != VSIR_OP_NOP)
|
||||
+ {
|
||||
+ loc = ins->location;
|
||||
break;
|
||||
+ }
|
||||
}
|
||||
|
||||
it2 = it;
|
||||
@@ -7615,7 +7617,7 @@ static enum vkd3d_result vsir_program_insert_point_coord(struct vsir_program *pr
|
||||
if (!(ins = vsir_program_iterator_insert_before_and_move(&it, 2)))
|
||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
- vsir_instruction_init_with_params(program, ins, &no_loc, VSIR_OP_MOV, 1, 1);
|
||||
+ vsir_instruction_init_with_params(program, ins, &loc, VSIR_OP_MOV, 1, 1);
|
||||
dst_param_init_temp_float4(&ins->dst[0], coord_temp);
|
||||
ins->dst[0].write_mask = VKD3DSP_WRITEMASK_0 | VKD3DSP_WRITEMASK_1;
|
||||
vsir_src_param_init(&ins->src[0], VKD3DSPR_POINT_COORD, VSIR_DATA_F32, 0);
|
||||
@@ -7623,7 +7625,7 @@ static enum vkd3d_result vsir_program_insert_point_coord(struct vsir_program *pr
|
||||
ins->src[0].swizzle = VKD3D_SHADER_NO_SWIZZLE;
|
||||
ins = vsir_program_iterator_next(&it);
|
||||
|
||||
- vsir_instruction_init_with_params(program, ins, &no_loc, VSIR_OP_MOV, 1, 1);
|
||||
+ vsir_instruction_init_with_params(program, ins, &loc, VSIR_OP_MOV, 1, 1);
|
||||
dst_param_init_temp_float4(&ins->dst[0], coord_temp);
|
||||
ins->dst[0].write_mask = VKD3DSP_WRITEMASK_2 | VKD3DSP_WRITEMASK_3;
|
||||
vsir_src_param_init(&ins->src[0], VKD3DSPR_IMMCONST, VSIR_DATA_F32, 0);
|
||||
@@ -7804,7 +7806,6 @@ static enum vkd3d_result vsir_program_insert_fragment_fog(struct vsir_program *p
|
||||
struct vkd3d_shader_message_context *message_context = ctx->message_context;
|
||||
uint32_t colour_signature_idx, fog_signature_idx, colour_temp;
|
||||
const struct vkd3d_shader_parameter1 *mode_parameter = NULL;
|
||||
- static const struct vkd3d_shader_location no_loc;
|
||||
const struct signature_element *fog_element;
|
||||
enum vkd3d_shader_fog_fragment_mode mode;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
@@ -7821,13 +7822,13 @@ static enum vkd3d_result vsir_program_insert_fragment_fog(struct vsir_program *p
|
||||
|
||||
if (mode_parameter->type != VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT)
|
||||
{
|
||||
- vkd3d_shader_error(message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
"Unsupported fog fragment mode parameter type %#x.", mode_parameter->type);
|
||||
return VKD3D_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
if (mode_parameter->data_type != VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32)
|
||||
{
|
||||
- vkd3d_shader_error(message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid fog fragment mode parameter data type %#x.", mode_parameter->data_type);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7951,7 +7952,6 @@ static enum vkd3d_result vsir_program_insert_vertex_fog(struct vsir_program *pro
|
||||
struct vkd3d_shader_message_context *message_context = ctx->message_context;
|
||||
const struct vkd3d_shader_parameter1 *source_parameter = NULL;
|
||||
uint32_t fog_signature_idx, source_signature_idx, temp;
|
||||
- static const struct vkd3d_shader_location no_loc;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
enum vkd3d_shader_fog_source source;
|
||||
const struct signature_element *e;
|
||||
@@ -7964,13 +7964,13 @@ static enum vkd3d_result vsir_program_insert_vertex_fog(struct vsir_program *pro
|
||||
|
||||
if (source_parameter->type != VKD3D_SHADER_PARAMETER_TYPE_IMMEDIATE_CONSTANT)
|
||||
{
|
||||
- vkd3d_shader_error(message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED,
|
||||
"Unsupported fog source parameter type %#x.", source_parameter->type);
|
||||
return VKD3D_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
if (source_parameter->data_type != VKD3D_SHADER_PARAMETER_DATA_TYPE_UINT32)
|
||||
{
|
||||
- vkd3d_shader_error(message_context, &no_loc, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE,
|
||||
"Invalid fog source parameter data type %#x.", source_parameter->data_type);
|
||||
return VKD3D_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
@@ -7992,7 +7992,7 @@ static enum vkd3d_result vsir_program_insert_vertex_fog(struct vsir_program *pro
|
||||
if (!vsir_signature_find_sysval(&program->output_signature,
|
||||
VKD3D_SHADER_SV_POSITION, 0, &source_signature_idx))
|
||||
{
|
||||
- vkd3d_shader_error(ctx->message_context, &no_loc,
|
||||
+ vkd3d_shader_error(ctx->message_context, &ctx->null_location,
|
||||
VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC, "Shader does not write position.");
|
||||
return VKD3D_ERROR_INVALID_SHADER;
|
||||
}
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
index 97c0d0e73a8..a57c42b167d 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
@@ -7209,10 +7209,9 @@ static void spirv_compiler_emit_output_vertex_count(struct spirv_compiler *compi
|
||||
SpvExecutionModeOutputVertices, instruction->declaration.count);
|
||||
}
|
||||
|
||||
-static void spirv_compiler_emit_dcl_input_primitive(struct spirv_compiler *compiler,
|
||||
- const struct vkd3d_shader_instruction *instruction)
|
||||
+static void spirv_compiler_emit_input_primitive(struct spirv_compiler *compiler)
|
||||
{
|
||||
- enum vkd3d_primitive_type primitive_type = instruction->declaration.primitive_type.type;
|
||||
+ enum vkd3d_primitive_type primitive_type = compiler->program->input_primitive;
|
||||
SpvExecutionMode mode;
|
||||
|
||||
switch (primitive_type)
|
||||
@@ -7233,7 +7232,8 @@ static void spirv_compiler_emit_dcl_input_primitive(struct spirv_compiler *compi
|
||||
mode = SpvExecutionModeInputTrianglesAdjacency;
|
||||
break;
|
||||
default:
|
||||
- FIXME("Unhandled primitive type %#x.\n", primitive_type);
|
||||
+ spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_NOT_IMPLEMENTED,
|
||||
+ "Unhandled input primitive type %#x.", primitive_type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7263,10 +7263,9 @@ static void spirv_compiler_emit_point_size(struct spirv_compiler *compiler)
|
||||
}
|
||||
}
|
||||
|
||||
-static void spirv_compiler_emit_dcl_output_topology(struct spirv_compiler *compiler,
|
||||
- const struct vkd3d_shader_instruction *instruction)
|
||||
+static void spirv_compiler_emit_output_topology(struct spirv_compiler *compiler)
|
||||
{
|
||||
- enum vkd3d_primitive_type primitive_type = instruction->declaration.primitive_type.type;
|
||||
+ enum vkd3d_primitive_type primitive_type = compiler->program->output_topology;
|
||||
SpvExecutionMode mode;
|
||||
|
||||
switch (primitive_type)
|
||||
@@ -7282,7 +7281,8 @@ static void spirv_compiler_emit_dcl_output_topology(struct spirv_compiler *compi
|
||||
mode = SpvExecutionModeOutputTriangleStrip;
|
||||
break;
|
||||
default:
|
||||
- ERR("Unexpected primitive type %#x.\n", primitive_type);
|
||||
+ spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_NOT_IMPLEMENTED,
|
||||
+ "Unhandled output topology %#x.", primitive_type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10608,12 +10608,6 @@ static int spirv_compiler_handle_instruction(struct spirv_compiler *compiler,
|
||||
case VSIR_OP_DCL_VERTICES_OUT:
|
||||
spirv_compiler_emit_output_vertex_count(compiler, instruction);
|
||||
break;
|
||||
- case VSIR_OP_DCL_INPUT_PRIMITIVE:
|
||||
- spirv_compiler_emit_dcl_input_primitive(compiler, instruction);
|
||||
- break;
|
||||
- case VSIR_OP_DCL_OUTPUT_TOPOLOGY:
|
||||
- spirv_compiler_emit_dcl_output_topology(compiler, instruction);
|
||||
- break;
|
||||
case VSIR_OP_DCL_GS_INSTANCES:
|
||||
spirv_compiler_emit_dcl_gs_instances(compiler, instruction);
|
||||
break;
|
||||
@@ -11066,7 +11060,14 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
|
||||
if (program->ssa_count)
|
||||
spirv_compiler_allocate_ssa_register_ids(compiler, program->ssa_count);
|
||||
if (compiler->shader_type == VKD3D_SHADER_TYPE_COMPUTE)
|
||||
+ {
|
||||
spirv_compiler_emit_thread_group_size(compiler, &program->thread_group_size);
|
||||
+ }
|
||||
+ else if (compiler->shader_type == VKD3D_SHADER_TYPE_GEOMETRY)
|
||||
+ {
|
||||
+ spirv_compiler_emit_input_primitive(compiler);
|
||||
+ spirv_compiler_emit_output_topology(compiler);
|
||||
+ }
|
||||
spirv_compiler_emit_global_flags(compiler, program->global_flags);
|
||||
|
||||
spirv_compiler_emit_descriptor_declarations(compiler);
|
||||
--
|
||||
2.51.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,175 +0,0 @@
|
||||
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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,126 +0,0 @@
|
||||
From 847e0c6da106b68aa30bf48575ad204f547b913a Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 9 Sep 2025 12:15:35 +1000
|
||||
Subject: [PATCH] Updated vkd3d to 6607b94ad7ce77907a912923f39e6371d23e339b.
|
||||
|
||||
---
|
||||
libs/vkd3d/libs/vkd3d-shader/d3d_asm.c | 17 +++++++++++++++++
|
||||
libs/vkd3d/libs/vkd3d-shader/dxil.c | 8 ++++++++
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 3 +--
|
||||
libs/vkd3d/libs/vkd3d-shader/msl.c | 6 ++++++
|
||||
.../libs/vkd3d-shader/vkd3d_shader_private.h | 6 ++++--
|
||||
5 files changed, 36 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
index 897803ecb56..e2fb8b12998 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
@@ -957,6 +957,22 @@ static void shader_print_reg_type(struct vkd3d_d3d_asm_compiler *compiler,
|
||||
vkd3d_string_buffer_printf(buffer, ">%s", suffix);
|
||||
}
|
||||
|
||||
+static void shader_print_indexable_temp_data_type(struct vkd3d_d3d_asm_compiler *compiler,
|
||||
+ const struct vkd3d_shader_indexable_temp *t)
|
||||
+{
|
||||
+ struct vkd3d_string_buffer *buffer = &compiler->buffer;
|
||||
+
|
||||
+ if (!(compiler->flags & VSIR_ASM_FLAG_DUMP_TYPES))
|
||||
+ return;
|
||||
+
|
||||
+ if (t->component_count > 1)
|
||||
+ vkd3d_string_buffer_printf(buffer, " <v%u:", t->component_count);
|
||||
+ else
|
||||
+ vkd3d_string_buffer_printf(buffer, " <s:");
|
||||
+ shader_print_data_type(compiler, t->data_type);
|
||||
+ vkd3d_string_buffer_printf(buffer, ">");
|
||||
+}
|
||||
+
|
||||
static void shader_print_write_mask(struct vkd3d_d3d_asm_compiler *compiler,
|
||||
const char *prefix, uint32_t mask, const char *suffix)
|
||||
{
|
||||
@@ -1511,6 +1527,7 @@ static void shader_dump_instruction(struct vkd3d_d3d_asm_compiler *compiler,
|
||||
vkd3d_string_buffer_printf(buffer, " %sx%u%s", compiler->colours.reg,
|
||||
ins->declaration.indexable_temp.register_idx, compiler->colours.reset);
|
||||
shader_print_subscript(compiler, ins->declaration.indexable_temp.register_size, NULL);
|
||||
+ shader_print_indexable_temp_data_type(compiler, &ins->declaration.indexable_temp);
|
||||
shader_print_uint_literal(compiler, ", ", ins->declaration.indexable_temp.component_count, "");
|
||||
if (ins->declaration.indexable_temp.alignment)
|
||||
shader_print_uint_literal(compiler, ", align ", ins->declaration.indexable_temp.alignment, "");
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
index 1678128da83..fb2cde4501a 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
@@ -3698,6 +3698,14 @@ static void sm6_parser_declare_indexable_temp(struct sm6_parser *sm6, const stru
|
||||
{
|
||||
enum vsir_data_type data_type = vsir_data_type_from_dxil(elem_type, sm6);
|
||||
|
||||
+ if (!(sm6->program->global_flags & VKD3DSGF_FORCE_NATIVE_LOW_PRECISION))
|
||||
+ {
|
||||
+ if (data_type == VSIR_DATA_F16)
|
||||
+ data_type = VSIR_DATA_F32;
|
||||
+ else if (data_type == VSIR_DATA_U16)
|
||||
+ data_type = VSIR_DATA_U32;
|
||||
+ }
|
||||
+
|
||||
if (ins)
|
||||
vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_DCL_INDEXABLE_TEMP);
|
||||
else
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
index 9a682a7550d..ee21207a855 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
@@ -8817,9 +8817,8 @@ static enum vsir_data_type vsir_data_type_from_hlsl_type(struct hlsl_ctx *ctx, c
|
||||
case HLSL_TYPE_DOUBLE:
|
||||
return VSIR_DATA_F64;
|
||||
case HLSL_TYPE_FLOAT:
|
||||
- return VSIR_DATA_F32;
|
||||
case HLSL_TYPE_HALF:
|
||||
- return VSIR_DATA_F16;
|
||||
+ return VSIR_DATA_F32;
|
||||
case HLSL_TYPE_INT:
|
||||
return VSIR_DATA_I32;
|
||||
case HLSL_TYPE_UINT:
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/msl.c b/libs/vkd3d/libs/vkd3d-shader/msl.c
|
||||
index fc8d482e08a..d9e22abdfc3 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/msl.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/msl.c
|
||||
@@ -1414,6 +1414,12 @@ static void msl_ret(struct msl_generator *gen, const struct vkd3d_shader_instruc
|
||||
static void msl_dcl_indexable_temp(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
|
||||
{
|
||||
const char *type = ins->declaration.indexable_temp.component_count == 4 ? "vkd3d_vec4" : "vkd3d_scalar";
|
||||
+
|
||||
+ if (ins->declaration.indexable_temp.initialiser)
|
||||
+ msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
|
||||
+ "Internal compiler error: Unhandled initialiser for indexable temporary %u.",
|
||||
+ ins->declaration.indexable_temp.register_idx);
|
||||
+
|
||||
msl_print_indent(gen->buffer, gen->indent);
|
||||
vkd3d_string_buffer_printf(gen->buffer, "%s x%u[%u];\n", type,
|
||||
ins->declaration.indexable_temp.register_idx,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
index 9bf196b1fe2..ae88d97f461 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
@@ -1863,7 +1863,8 @@ static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_ty
|
||||
{
|
||||
case VSIR_DATA_BOOL:
|
||||
return VKD3D_SHADER_COMPONENT_BOOL;
|
||||
- case VSIR_DATA_F16: /* Minimum precision. TODO: native 16-bit */
|
||||
+ case VSIR_DATA_F16:
|
||||
+ return VKD3D_SHADER_COMPONENT_FLOAT16;
|
||||
case VSIR_DATA_F32:
|
||||
case VSIR_DATA_SNORM:
|
||||
case VSIR_DATA_UNORM:
|
||||
@@ -1872,7 +1873,8 @@ static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_ty
|
||||
return VKD3D_SHADER_COMPONENT_DOUBLE;
|
||||
case VSIR_DATA_I32:
|
||||
return VKD3D_SHADER_COMPONENT_INT;
|
||||
- case VSIR_DATA_U16: /* Minimum precision. TODO: native 16-bit */
|
||||
+ case VSIR_DATA_U16:
|
||||
+ return VKD3D_SHADER_COMPONENT_UINT16;
|
||||
case VSIR_DATA_U32:
|
||||
return VKD3D_SHADER_COMPONENT_UINT;
|
||||
case VSIR_DATA_U64:
|
||||
--
|
||||
2.51.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user