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
Rebase against 8bbc65df51c7c62c9b62a7b92bfd288ba51a2d8f.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,338 +0,0 @@
|
||||
From c47787abcf2dc7c91ca0789a9024280ed88e9f39 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 14 Nov 2025 08:07:32 +1100
|
||||
Subject: [PATCH] Updated vkd3d to 7f377879fc526dfb69966ed1672d3036e807235c.
|
||||
|
||||
---
|
||||
libs/vkd3d/include/private/vkd3d_common.h | 20 +++++++-----
|
||||
libs/vkd3d/libs/vkd3d-common/debug.c | 9 +++---
|
||||
libs/vkd3d/libs/vkd3d-shader/d3d_asm.c | 31 ++++++++++++++++++-
|
||||
libs/vkd3d/libs/vkd3d-shader/dxil.c | 13 +++++---
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 8 +++--
|
||||
libs/vkd3d/libs/vkd3d-shader/spirv.c | 13 +++++---
|
||||
.../libs/vkd3d-shader/vkd3d_shader_main.c | 4 +--
|
||||
.../libs/vkd3d-shader/vkd3d_shader_private.h | 1 +
|
||||
.../vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c | 2 --
|
||||
libs/vkd3d/libs/vkd3d/vkd3d_main.c | 2 --
|
||||
10 files changed, 71 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/include/private/vkd3d_common.h b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
index c2e957a2fea..56f8ad4ee25 100644
|
||||
--- a/libs/vkd3d/include/private/vkd3d_common.h
|
||||
+++ b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
@@ -19,6 +19,11 @@
|
||||
#ifndef __VKD3D_COMMON_H
|
||||
#define __VKD3D_COMMON_H
|
||||
|
||||
+#ifndef VKD3D_DEBUG_ENV
|
||||
+#define VKD3D_DEBUG_ENV VKD3D_DEBUG
|
||||
+#endif
|
||||
+#define VKD3D_DEBUG_ENV_NAME VKD3D_EXPAND_AND_STRINGIFY(VKD3D_DEBUG_ENV)
|
||||
+
|
||||
#include "config.h"
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include "windows.h"
|
||||
@@ -149,9 +154,10 @@ enum vkd3d_dbg_level
|
||||
VKD3D_DBG_LEVEL_TRACE,
|
||||
};
|
||||
|
||||
-enum vkd3d_dbg_level vkd3d_dbg_get_level(void);
|
||||
+enum vkd3d_dbg_level vkd3d_dbg_get_level(const char *vkd3d_dbg_env_name);
|
||||
|
||||
-void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const char *fmt, ...) VKD3D_PRINTF_FUNC(3, 4);
|
||||
+void vkd3d_dbg_printf(const char *vkd3d_dbg_env_name, enum vkd3d_dbg_level level,
|
||||
+ const char *function, const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5);
|
||||
void vkd3d_dbg_set_log_callback(PFN_vkd3d_log callback);
|
||||
|
||||
const char *vkd3d_dbg_sprintf(const char *fmt, ...) VKD3D_PRINTF_FUNC(1, 2);
|
||||
@@ -174,7 +180,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
VKD3D_DBG_PRINTF_##level
|
||||
|
||||
#define VKD3D_DBG_PRINTF(...) \
|
||||
- vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
|
||||
|
||||
#define VKD3D_DBG_PRINTF_TRACE(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
|
||||
#define VKD3D_DBG_PRINTF_WARN(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
|
||||
@@ -183,7 +189,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
|
||||
#ifdef VKD3D_ABORT_ON_ERR
|
||||
#define VKD3D_DBG_PRINTF_ERR(...) \
|
||||
- vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); \
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#else
|
||||
@@ -217,19 +223,17 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
#endif
|
||||
|
||||
#ifndef TRACE_ON
|
||||
-#define TRACE_ON() (vkd3d_dbg_get_level() == VKD3D_DBG_LEVEL_TRACE)
|
||||
+#define TRACE_ON() (vkd3d_dbg_get_level(VKD3D_DEBUG_ENV_NAME) == VKD3D_DBG_LEVEL_TRACE)
|
||||
#endif
|
||||
|
||||
#ifndef WARN_ON
|
||||
-#define WARN_ON() (vkd3d_dbg_get_level() >= VKD3D_DBG_LEVEL_WARN)
|
||||
+#define WARN_ON() (vkd3d_dbg_get_level(VKD3D_DEBUG_ENV_NAME) >= VKD3D_DBG_LEVEL_WARN)
|
||||
#endif
|
||||
|
||||
#ifndef FIXME_ONCE
|
||||
#define FIXME_ONCE VKD3D_DBG_LOG_ONCE(FIXME, WARN)
|
||||
#endif
|
||||
|
||||
-#define VKD3D_DEBUG_ENV_NAME(name) const char *const vkd3d_dbg_env_name = name
|
||||
-
|
||||
static inline const char *debugstr_guid(const GUID *guid)
|
||||
{
|
||||
if (!guid)
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-common/debug.c b/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
index 32862024b90..b5d74ca3dc7 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
@@ -40,8 +40,6 @@
|
||||
#define VKD3D_DEBUG_BUFFER_COUNT 64
|
||||
#define VKD3D_DEBUG_BUFFER_SIZE 512
|
||||
|
||||
-extern const char *const vkd3d_dbg_env_name;
|
||||
-
|
||||
static const char *const debug_level_names[] =
|
||||
{
|
||||
[VKD3D_DBG_LEVEL_NONE ] = "none",
|
||||
@@ -52,7 +50,7 @@ static const char *const debug_level_names[] =
|
||||
[VKD3D_DBG_LEVEL_TRACE] = "trace",
|
||||
};
|
||||
|
||||
-enum vkd3d_dbg_level vkd3d_dbg_get_level(void)
|
||||
+enum vkd3d_dbg_level vkd3d_dbg_get_level(const char *vkd3d_dbg_env_name)
|
||||
{
|
||||
static unsigned int level = ~0u;
|
||||
const char *vkd3d_debug;
|
||||
@@ -108,11 +106,12 @@ static uint64_t get_pthread_threadid(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
-void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const char *fmt, ...)
|
||||
+void vkd3d_dbg_printf(const char *vkd3d_dbg_env_name,
|
||||
+ enum vkd3d_dbg_level level, const char *function, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
- if (vkd3d_dbg_get_level() < level)
|
||||
+ if (vkd3d_dbg_get_level(vkd3d_dbg_env_name) < level)
|
||||
return;
|
||||
|
||||
#ifdef _WIN32
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
index 4573cb67fb5..b316f6c8830 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
@@ -398,12 +398,41 @@ static void shader_dump_resource_data_type(struct vkd3d_d3d_asm_compiler *compil
|
||||
{
|
||||
int i;
|
||||
|
||||
+ /* We want the D3D names here, not the vsir ones. */
|
||||
+ static const char * const names[] =
|
||||
+ {
|
||||
+ [VSIR_DATA_BOOL ] = "bool",
|
||||
+ [VSIR_DATA_F16 ] = "half",
|
||||
+ [VSIR_DATA_F32 ] = "float",
|
||||
+ [VSIR_DATA_F64 ] = "double",
|
||||
+ [VSIR_DATA_I8 ] = "int8",
|
||||
+ [VSIR_DATA_I16 ] = "int16",
|
||||
+ [VSIR_DATA_I32 ] = "int",
|
||||
+ [VSIR_DATA_I64 ] = "int64",
|
||||
+ [VSIR_DATA_U8 ] = "uint8",
|
||||
+ [VSIR_DATA_U16 ] = "uint16",
|
||||
+ [VSIR_DATA_U32 ] = "uint",
|
||||
+ [VSIR_DATA_U64 ] = "uint64",
|
||||
+ [VSIR_DATA_SNORM ] = "snorm",
|
||||
+ [VSIR_DATA_UNORM ] = "unorm",
|
||||
+ [VSIR_DATA_OPAQUE ] = "opaque",
|
||||
+ [VSIR_DATA_MIXED ] = "mixed",
|
||||
+ [VSIR_DATA_CONTINUED] = "<continued>",
|
||||
+ [VSIR_DATA_UNUSED ] = "<unused>",
|
||||
+ };
|
||||
+
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "(");
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
+ size_t t = type[i];
|
||||
+
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "%s", i == 0 ? "" : ",");
|
||||
- shader_print_data_type(compiler, type[i]);
|
||||
+ if (t < ARRAY_SIZE(names) && names[t])
|
||||
+ vkd3d_string_buffer_printf(&compiler->buffer, "%s", names[t]);
|
||||
+ else
|
||||
+ vkd3d_string_buffer_printf(&compiler->buffer, "%s<unhandled data type %#zx>%s",
|
||||
+ compiler->colours.error, t, compiler->colours.reset);
|
||||
}
|
||||
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, ")");
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
index 8d803b91f7a..9f25ae8334b 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
@@ -6142,11 +6142,14 @@ static unsigned int sm6_value_get_texel_offset(const struct sm6_value *value, st
|
||||
}
|
||||
|
||||
static void instruction_set_texel_offset(struct vkd3d_shader_instruction *ins,
|
||||
- const struct sm6_value **operands, struct sm6_parser *sm6)
|
||||
+ const struct sm6_value **operands, unsigned int count, struct sm6_parser *sm6)
|
||||
{
|
||||
ins->texel_offset.u = sm6_value_get_texel_offset(operands[0], sm6);
|
||||
ins->texel_offset.v = sm6_value_get_texel_offset(operands[1], sm6);
|
||||
- ins->texel_offset.w = sm6_value_get_texel_offset(operands[2], sm6);
|
||||
+ if (count == 3)
|
||||
+ ins->texel_offset.w = sm6_value_get_texel_offset(operands[2], sm6);
|
||||
+ else
|
||||
+ ins->texel_offset.w = 0;
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_sample(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
@@ -6228,7 +6231,7 @@ static void sm6_parser_emit_dx_sample(struct sm6_parser *sm6, enum dx_intrinsic_
|
||||
src_param_init_vector_from_reg(&src_params[0], &coord);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[1], &resource->u.handle);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[2], &sampler->u.handle);
|
||||
- instruction_set_texel_offset(ins, &operands[6], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[6], 3, sm6);
|
||||
|
||||
instruction_dst_param_init_ssa_vector(ins, component_count, sm6);
|
||||
}
|
||||
@@ -6402,7 +6405,7 @@ static void sm6_parser_emit_dx_texture_gather(struct sm6_parser *sm6, enum dx_in
|
||||
if (extended_offset)
|
||||
src_param_init_vector_from_reg(&src_params[1], &offset);
|
||||
else
|
||||
- instruction_set_texel_offset(ins, &operands[6], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[6], 2, sm6);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[1 + extended_offset], &resource->u.handle);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[2 + extended_offset], &sampler->u.handle);
|
||||
/* Swizzle stored in the sampler parameter is the scalar component index to be gathered. */
|
||||
@@ -6448,7 +6451,7 @@ static void sm6_parser_emit_dx_texture_load(struct sm6_parser *sm6, enum dx_intr
|
||||
ins = state->ins;
|
||||
instruction_init_with_resource(ins, is_uav ? VSIR_OP_LD_UAV_TYPED
|
||||
: is_multisample ? VSIR_OP_LD2DMS : VSIR_OP_LD, resource, sm6);
|
||||
- instruction_set_texel_offset(ins, &operands[5], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[5], 3, sm6);
|
||||
|
||||
for (i = 0; i < VKD3D_VEC4_SIZE; ++i)
|
||||
ins->resource_data_type[i] = resource->u.handle.d->resource_data_type;
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
index 8bb23e0690d..f1368b151aa 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
@@ -5490,10 +5490,14 @@ static struct hlsl_ir_node *lower_casts_to_bool(struct hlsl_ctx *ctx,
|
||||
struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_block *instrs,
|
||||
struct hlsl_ir_node *condition, struct hlsl_ir_node *if_true, struct hlsl_ir_node *if_false)
|
||||
{
|
||||
+ struct hlsl_type *false_type = if_false->data_type;
|
||||
struct hlsl_type *cond_type = condition->data_type;
|
||||
struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS];
|
||||
+ struct hlsl_type *true_type = if_true->data_type;
|
||||
|
||||
- VKD3D_ASSERT(hlsl_types_are_equal(if_true->data_type, if_false->data_type));
|
||||
+ VKD3D_ASSERT(hlsl_types_are_equal(true_type, false_type)
|
||||
+ || (hlsl_is_vec1(true_type) && hlsl_is_vec1(false_type)
|
||||
+ && true_type->e.numeric.type == false_type->e.numeric.type));
|
||||
|
||||
if (cond_type->e.numeric.type != HLSL_TYPE_BOOL)
|
||||
{
|
||||
@@ -5505,7 +5509,7 @@ struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_bloc
|
||||
operands[0] = condition;
|
||||
operands[1] = if_true;
|
||||
operands[2] = if_false;
|
||||
- return hlsl_block_add_expr(ctx, instrs, HLSL_OP3_TERNARY, operands, if_true->data_type, &condition->loc);
|
||||
+ return hlsl_block_add_expr(ctx, instrs, HLSL_OP3_TERNARY, operands, true_type, &condition->loc);
|
||||
}
|
||||
|
||||
static struct hlsl_ir_node *lower_int_division_sm4(struct hlsl_ctx *ctx,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
index 3950021a2ef..87ec827b420 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
@@ -6668,13 +6668,18 @@ static void spirv_compiler_emit_cbv_declaration(struct spirv_compiler *compiler,
|
||||
/* Push constant buffers are handled in
|
||||
* spirv_compiler_emit_push_constant_buffers().
|
||||
*/
|
||||
- push_cb->reg = reg;
|
||||
- push_cb->size = size;
|
||||
if (size_in_bytes > push_cb->pc.size)
|
||||
{
|
||||
- WARN("Constant buffer size %u exceeds push constant size %u.\n",
|
||||
- size_in_bytes, push_cb->pc.size);
|
||||
+ spirv_compiler_warning(compiler, VKD3D_SHADER_WARNING_SPV_INVALID_SIZE,
|
||||
+ "Constant buffer cb%u, space %u, has size %u which exceeds the push constant size %u.",
|
||||
+ push_cb->pc.register_index, push_cb->pc.register_space, size_in_bytes, push_cb->pc.size);
|
||||
+ size_in_bytes = push_cb->pc.size;
|
||||
+ size = align(size_in_bytes, VKD3D_VEC4_SIZE * sizeof(uint32_t));
|
||||
+ size /= VKD3D_VEC4_SIZE * sizeof(uint32_t);
|
||||
}
|
||||
+
|
||||
+ push_cb->reg = reg;
|
||||
+ push_cb->size = size;
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
index c0faa30f14a..ee113f57736 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
@@ -23,8 +23,6 @@
|
||||
#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')
|
||||
@@ -268,7 +266,7 @@ void vkd3d_shader_trace_text_(const char *text, size_t size, const char *functio
|
||||
q = end;
|
||||
else
|
||||
++q;
|
||||
- vkd3d_dbg_printf(VKD3D_DBG_LEVEL_TRACE, function, "%.*s", (int)(q - p), p);
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, VKD3D_DBG_LEVEL_TRACE, function, "%.*s", (int)(q - p), p);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
index 763a4906919..97fe5238046 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
@@ -110,6 +110,7 @@ enum vkd3d_shader_error
|
||||
VKD3D_SHADER_WARNING_SPV_INVALID_SWIZZLE = 2300,
|
||||
VKD3D_SHADER_WARNING_SPV_INVALID_UAV_FLAGS = 2301,
|
||||
VKD3D_SHADER_WARNING_SPV_IGNORING_FLAG = 2302,
|
||||
+ VKD3D_SHADER_WARNING_SPV_INVALID_SIZE = 2303,
|
||||
|
||||
VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY = 3000,
|
||||
VKD3D_SHADER_ERROR_RS_INVALID_VERSION = 3001,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
index fea8c2440d1..6e90b48e877 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
@@ -19,8 +19,6 @@
|
||||
#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)
|
||||
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
index 5215cf8ef86..4c58f0a1787 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "vkd3d_private.h"
|
||||
|
||||
-VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG");
|
||||
-
|
||||
HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
||||
REFIID iid, void **device)
|
||||
{
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
From fc2b1881245242d66bd74a20436083324bb01398 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 19 Nov 2025 09:13:43 +1100
|
||||
Subject: [PATCH] Updated vkd3d to 06a503975f7808bcefff8bf2ca4e9605926e1ed9.
|
||||
|
||||
---
|
||||
libs/vkd3d/include/vkd3d_shader.h | 12 ++++++++++
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.c | 35 ++++++++++++++++++++---------
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.h | 2 ++
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 20 ++++++++---------
|
||||
4 files changed, 48 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/include/vkd3d_shader.h b/libs/vkd3d/include/vkd3d_shader.h
|
||||
index 50bcf6b292b..2ae30b94207 100644
|
||||
--- a/libs/vkd3d/include/vkd3d_shader.h
|
||||
+++ b/libs/vkd3d/include/vkd3d_shader.h
|
||||
@@ -2952,6 +2952,7 @@ VKD3D_SHADER_API const enum vkd3d_shader_target_type *vkd3d_shader_get_supported
|
||||
* - vkd3d_shader_scan_descriptor_info
|
||||
* - vkd3d_shader_scan_hull_shader_tessellation_info
|
||||
* - vkd3d_shader_scan_signature_info
|
||||
+ * - vkd3d_shader_scan_thread_group_size_info
|
||||
* - vkd3d_shader_spirv_domain_shader_target_info
|
||||
* - vkd3d_shader_spirv_target_info
|
||||
* - vkd3d_shader_transform_feedback_info
|
||||
@@ -3140,10 +3141,21 @@ VKD3D_SHADER_API int vkd3d_shader_convert_root_signature(struct vkd3d_shader_ver
|
||||
* \param compile_info A chained structure containing scan parameters.
|
||||
* \n
|
||||
* The scanner supports the following chained structures:
|
||||
+ * - vkd3d_shader_d3dbc_source_info
|
||||
+ * - vkd3d_shader_descriptor_offset_info
|
||||
+ * - vkd3d_shader_hlsl_source_info
|
||||
+ * - vkd3d_shader_interface_info
|
||||
+ * - vkd3d_shader_parameter_info
|
||||
+ * - vkd3d_shader_preprocess_info
|
||||
* - vkd3d_shader_scan_combined_resource_sampler_info
|
||||
* - vkd3d_shader_scan_descriptor_info
|
||||
* - vkd3d_shader_scan_hull_shader_tessellation_info
|
||||
* - vkd3d_shader_scan_signature_info
|
||||
+ * - vkd3d_shader_scan_thread_group_size_info
|
||||
+ * - vkd3d_shader_spirv_domain_shader_target_info
|
||||
+ * - vkd3d_shader_spirv_target_info
|
||||
+ * - vkd3d_shader_transform_feedback_info
|
||||
+ * - vkd3d_shader_varying_map_info
|
||||
* \n
|
||||
* Although the \a compile_info parameter is read-only, chained structures
|
||||
* passed to this function need not be, and may serve as output parameters,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.c b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
|
||||
index dc9886b5384..6558c4e9fb2 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
|
||||
@@ -153,6 +153,25 @@ void hlsl_free_state_block(struct hlsl_state_block *state_block)
|
||||
vkd3d_free(state_block);
|
||||
}
|
||||
|
||||
+void hlsl_free_default_value(struct hlsl_default_value *value)
|
||||
+{
|
||||
+ vkd3d_free((void *)value->string);
|
||||
+}
|
||||
+
|
||||
+void hlsl_free_default_values(struct hlsl_ir_var *decl)
|
||||
+{
|
||||
+ unsigned int component_count;
|
||||
+
|
||||
+ if (!decl->default_values)
|
||||
+ return;
|
||||
+
|
||||
+ component_count = hlsl_type_component_count(decl->data_type);
|
||||
+ for (size_t i = 0; i < component_count; ++i)
|
||||
+ hlsl_free_default_value(&decl->default_values[i]);
|
||||
+ vkd3d_free(decl->default_values);
|
||||
+ decl->default_values = NULL;
|
||||
+}
|
||||
+
|
||||
void hlsl_free_var(struct hlsl_ir_var *decl)
|
||||
{
|
||||
unsigned int k, i;
|
||||
@@ -162,14 +181,7 @@ void hlsl_free_var(struct hlsl_ir_var *decl)
|
||||
for (k = 0; k <= HLSL_REGSET_LAST_OBJECT; ++k)
|
||||
vkd3d_free((void *)decl->objects_usage[k]);
|
||||
|
||||
- if (decl->default_values)
|
||||
- {
|
||||
- unsigned int component_count = hlsl_type_component_count(decl->data_type);
|
||||
-
|
||||
- for (k = 0; k < component_count; ++k)
|
||||
- vkd3d_free((void *)decl->default_values[k].string);
|
||||
- vkd3d_free(decl->default_values);
|
||||
- }
|
||||
+ hlsl_free_default_values(decl);
|
||||
|
||||
for (i = 0; i < decl->state_block_count; ++i)
|
||||
hlsl_free_state_block(decl->state_blocks[i]);
|
||||
@@ -2187,9 +2199,12 @@ static struct hlsl_ir_resource_load *hlsl_new_resource_load(struct hlsl_ctx *ctx
|
||||
struct hlsl_ir_node *hlsl_block_add_resource_load(struct hlsl_ctx *ctx, struct hlsl_block *block,
|
||||
const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
- struct hlsl_ir_resource_load *load = hlsl_new_resource_load(ctx, params, loc);
|
||||
+ struct hlsl_ir_resource_load *load;
|
||||
+
|
||||
+ if (!(load = hlsl_new_resource_load(ctx, params, loc)))
|
||||
+ return NULL;
|
||||
|
||||
- if (load && load->sampling_dim == HLSL_SAMPLER_DIM_STRUCTURED_BUFFER)
|
||||
+ if (load->sampling_dim == HLSL_SAMPLER_DIM_STRUCTURED_BUFFER)
|
||||
hlsl_src_from_node(&load->byte_offset, hlsl_block_add_uint_constant(ctx, block, 0, loc));
|
||||
|
||||
return append_new_instr(ctx, block, &load->node);
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.h b/libs/vkd3d/libs/vkd3d-shader/hlsl.h
|
||||
index 0202d71cc23..e12915f9fe6 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.h
|
||||
@@ -1675,6 +1675,8 @@ void hlsl_free_ir_switch_case(struct hlsl_ir_switch_case *c);
|
||||
void hlsl_replace_node(struct hlsl_ir_node *old, struct hlsl_ir_node *new);
|
||||
|
||||
void hlsl_free_attribute(struct hlsl_attribute *attr);
|
||||
+void hlsl_free_default_value(struct hlsl_default_value *value);
|
||||
+void hlsl_free_default_values(struct hlsl_ir_var *decl);
|
||||
void hlsl_free_instr(struct hlsl_ir_node *node);
|
||||
void hlsl_free_instr_list(struct list *list);
|
||||
void hlsl_free_state_block(struct hlsl_state_block *state_block);
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
index 92bfd7040fc..e349029521a 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
@@ -2246,18 +2246,14 @@ static void initialize_var_components(struct hlsl_ctx *ctx, struct hlsl_block *i
|
||||
|
||||
if (src->type == HLSL_IR_COMPILE || src->type == HLSL_IR_SAMPLER_STATE)
|
||||
{
|
||||
- if (hlsl_is_numeric_type(dst_comp_type))
|
||||
+ /* Default values are discarded if they contain an object
|
||||
+ * literal expression for a numeric component. */
|
||||
+ if (hlsl_is_numeric_type(dst_comp_type) && dst->default_values)
|
||||
{
|
||||
- /* Default values are discarded if they contain an object
|
||||
- * literal expression for a numeric component. */
|
||||
- if (dst->default_values)
|
||||
- {
|
||||
- hlsl_warning(ctx, &src->loc, VKD3D_SHADER_WARNING_HLSL_IGNORED_DEFAULT_VALUE,
|
||||
- "Component %u in variable '%s' initializer is object literal. Default values discarded.",
|
||||
- k, dst->name);
|
||||
- vkd3d_free(dst->default_values);
|
||||
- dst->default_values = NULL;
|
||||
- }
|
||||
+ hlsl_warning(ctx, &src->loc, VKD3D_SHADER_WARNING_HLSL_IGNORED_DEFAULT_VALUE,
|
||||
+ "Component %u in variable '%s' initializer is object literal. Default values discarded.",
|
||||
+ k, dst->name);
|
||||
+ hlsl_free_default_values(dst);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2268,6 +2264,8 @@ static void initialize_var_components(struct hlsl_ctx *ctx, struct hlsl_block *i
|
||||
|
||||
if (dst->default_values)
|
||||
dst->default_values[*store_index] = default_value;
|
||||
+ else
|
||||
+ hlsl_free_default_value(&default_value);
|
||||
|
||||
hlsl_block_cleanup(&block);
|
||||
}
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1 +1 @@
|
||||
f49b8aec794913f94b30ffbe44dbbafc13eb723b
|
||||
8bbc65df51c7c62c9b62a7b92bfd288ba51a2d8f
|
||||
|
||||
Reference in New Issue
Block a user