Compare commits

..

6 Commits
v9.18 ... v9.19

Author SHA1 Message Date
Alistair Leslie-Hughes
858bf979a1 Release v9.19 2024-10-06 08:54:49 +11:00
Alistair Leslie-Hughes
c2319432af Updated vkd3d-latest patchset 2024-10-05 11:28:16 +10:00
Alistair Leslie-Hughes
ff1bc55757 Rebase against 7ee99608f469723bafadb28ef0ebd20631f86e9d. 2024-10-05 11:27:49 +10:00
Alistair Leslie-Hughes
3695e09653 updated vkd3d-latest patchset 2024-10-03 12:54:36 +10:00
Alistair Leslie-Hughes
ef36ee4399 Rebase against 7c1fbc40b7ed0b9b1f2c96b99a592530eadae14f. 2024-10-03 12:53:12 +10:00
Elizabeth Figura
3dfacea342 Rebase against b6196159becb194a56434061fe3bba239863b783. 2024-09-24 11:33:47 -05:00
26 changed files with 15557 additions and 13189 deletions

View File

@@ -1,24 +0,0 @@
From 170a6d9df910f617585791df31aa72b79622ed0b Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Mon, 16 May 2016 13:20:39 +0200
Subject: d3dx9_36: Add format description for X8L8V8U8 for format conversions.
---
dlls/d3dx9_36/util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
index d8cd43a..12b9c2c 100644
--- a/dlls/d3dx9_36/util.c
+++ b/dlls/d3dx9_36/util.c
@@ -90,6 +90,7 @@ static const struct pixel_format_desc formats[] =
{D3DFMT_G32R32F, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, FORMAT_ARGBF, NULL, NULL },
{D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF, NULL, NULL },
{D3DFMT_P8, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, FORMAT_INDEX, NULL, index_to_rgba},
+ {D3DFMT_X8L8V8U8, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, FORMAT_ARGB, NULL, NULL },
/* marks last element */
{D3DFMT_UNKNOWN, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL },
};
--
2.8.0

View File

@@ -1 +0,0 @@
Fixes: Recognize bump luminance X8L8V8U8 when loading dds file

View File

@@ -1,2 +1,3 @@
Fixes: [34579] gdi32: fix for rotated Arc, ArcTo, Chord and Pie drawing problem
Fixes: [35331] gdi32: fix for rotated ellipse
Disabled: True

View File

@@ -1,24 +1,24 @@
From b617701d440a9b5210762503cf441e9fcb3132e1 Mon Sep 17 00:00:00 2001
From 4dfa7d8a06e20d9888398298e03c20fac89a9fdf Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 13 Jan 2017 01:59:13 +0100
Subject: kernel32: Always start debugger on WinSta0.
Subject: [PATCH] kernel32: Always start debugger on WinSta0.
---
dlls/kernelbase/debug.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c
index 016c21109..0681f726b 100644
index cbefc0c8733..b37faaa0003 100644
--- a/dlls/kernelbase/debug.c
+++ b/dlls/kernelbase/debug.c
@@ -640,6 +640,7 @@ static BOOL start_debugger( EXCEPTION_POINTERS *epointers, HANDLE event )
@@ -625,6 +625,7 @@ static BOOL start_debugger( EXCEPTION_POINTERS *epointers, HANDLE event )
TRACE( "Starting debugger %s\n", debugstr_w(cmdline) );
memset( &startup, 0, sizeof(startup) );
startup.cb = sizeof(startup);
+ startup.lpDesktop = (WCHAR*)L"WinSta0";
startup.dwFlags = STARTF_USESHOWWINDOW;
startup.wShowWindow = SW_SHOWNORMAL;
ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, 0, env, NULL, &startup, &info );
ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, env, NULL, &startup, &info );
--
2.23.0
2.45.2

View File

@@ -1,4 +1,4 @@
From ee26472916e2196456c0c59fb8ca04ee362f148a Mon Sep 17 00:00:00 2001
From d1f5c52e07bce357d3b471e839db2a6f7a72fa86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 3 Apr 2017 05:30:27 +0200
Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
2 files changed, 117 insertions(+)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 8b332e479e6..08cb3d3f8ce 100644
index 9b0f8f6bff2..747dfb0afa6 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -28,6 +28,7 @@
@@ -20,7 +20,7 @@ index 8b332e479e6..08cb3d3f8ce 100644
#include "wine/test.h"
#include "delayloadhandler.h"
@@ -4641,6 +4642,79 @@ static void test_Wow64Transition(void)
@@ -4651,6 +4652,79 @@ static void test_Wow64Transition(void)
debugstr_wn(name->SectionFileName.Buffer, name->SectionFileName.Length / sizeof(WCHAR)));
}
@@ -100,7 +100,7 @@ index 8b332e479e6..08cb3d3f8ce 100644
START_TEST(loader)
{
int argc;
@@ -4723,6 +4797,7 @@ START_TEST(loader)
@@ -4734,6 +4808,7 @@ START_TEST(loader)
test_InMemoryOrderModuleList();
test_LoadPackagedLibrary();
test_wow64_redirection();
@@ -109,7 +109,7 @@ index 8b332e479e6..08cb3d3f8ce 100644
test_dll_file( "kernel32.dll" );
test_dll_file( "advapi32.dll" );
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 5f84ca7e23b..4da48a82d74 100644
index 0ed37ad390c..94610a82a65 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -128,6 +128,9 @@ struct file_id
@@ -122,8 +122,8 @@ index 5f84ca7e23b..4da48a82d74 100644
/* internal representation of loaded modules */
typedef struct _wine_modref
{
@@ -556,6 +559,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
}
@@ -603,6 +606,33 @@ static int base_address_compare( const void *key, const RTL_BALANCED_NODE *entry
return 0;
}
+/*************************************************************************
@@ -156,12 +156,14 @@ index 5f84ca7e23b..4da48a82d74 100644
/*************************************************************************
* get_modref
*
@@ -1557,7 +1587,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
@@ -1599,9 +1629,14 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
&wm->ldr.InLoadOrderLinks);
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList,
&wm->ldr.InMemoryOrderLinks);
+ InsertTailList(&hash_table[hash_basename(wm->ldr.BaseDllName.Buffer)],
+ &wm->ldr.HashLinks);
if (rtl_rb_tree_put( &base_address_index_tree, wm->ldr.DllBase, &wm->ldr.BaseAddressIndexNode, base_address_compare ))
ERR( "rtl_rb_tree_put failed.\n" );
+
/* wait until init is called for inserting into InInitializationOrderModuleList */
+ wm->ldr.InInitializationOrderLinks.Flink = NULL;
@@ -169,23 +171,23 @@ index 5f84ca7e23b..4da48a82d74 100644
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
{
@@ -2253,6 +2288,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
@@ -2299,6 +2334,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
/* the module has only be inserted in the load & memory order lists */
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
+ RemoveEntryList(&wm->ldr.HashLinks);
RtlRbRemoveNode( &base_address_index_tree, &wm->ldr.BaseAddressIndexNode );
/* FIXME: there are several more dangling references
* left. Including dlls loaded by this dll before the
@@ -3916,6 +3952,7 @@ static void free_modref( WINE_MODREF *wm )
@@ -3963,6 +3999,7 @@ static void free_modref( WINE_MODREF *wm )
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
+ RemoveEntryList(&wm->ldr.HashLinks);
RtlRbRemoveNode( &base_address_index_tree, &wm->ldr.BaseAddressIndexNode );
if (wm->ldr.InInitializationOrderLinks.Flink)
RemoveEntryList(&wm->ldr.InInitializationOrderLinks);
@@ -4336,6 +4373,7 @@ void loader_init( CONTEXT *context, void **entry )
@@ -4384,6 +4421,7 @@ void loader_init( CONTEXT *context, void **entry )
ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" );
WINE_MODREF *kernel32;
PEB *peb = NtCurrentTeb()->Peb;
@@ -193,7 +195,7 @@ index 5f84ca7e23b..4da48a82d74 100644
peb->LdrData = &ldr;
peb->FastPebLock = &peb_lock;
@@ -4354,6 +4392,10 @@ void loader_init( CONTEXT *context, void **entry )
@@ -4402,6 +4440,10 @@ void loader_init( CONTEXT *context, void **entry )
if (!(tls_dirs = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, tls_module_count * sizeof(*tls_dirs) )))
NtTerminateProcess( GetCurrentProcess(), STATUS_NO_MEMORY );

View File

@@ -1,4 +1,4 @@
From 4aea41b4f635ab83ad6ac571b04ca0f8f00310ab Mon Sep 17 00:00:00 2001
From e062c6f139f716fe0e95a26e5016aa4f94087146 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 17 Jan 2016 00:50:50 +0100
Subject: [PATCH] ntdll/tests: Add basic tests for RtlQueryPackageIdentity.
@@ -20,20 +20,20 @@ index 3742968c415..084469a2820 100644
SOURCES = \
atom.c \
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
index e678f7f43a0..71a413d9f18 100644
index d013848c07a..f239575d13e 100644
--- a/dlls/ntdll/tests/rtl.c
+++ b/dlls/ntdll/tests/rtl.c
@@ -36,6 +36,9 @@
#include "ddk/ntifs.h"
@@ -37,6 +37,9 @@
#include "wine/test.h"
#include "wine/asm.h"
#include "wine/rbtree.h"
+#include "initguid.h"
+#define COBJMACROS
+#include "shobjidl.h"
#ifndef __WINE_WINTERNL_H
@@ -104,6 +107,9 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION
@@ -105,6 +108,9 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION
static NTSTATUS (WINAPI *pRtlInitializeCriticalSectionEx)(CRITICAL_SECTION *, ULONG, ULONG);
static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *);
static NTSTATUS (WINAPI *pLdrEnumerateLoadedModules)(void *, void *, void *);
@@ -43,7 +43,7 @@ index e678f7f43a0..71a413d9f18 100644
static NTSTATUS (WINAPI *pLdrRegisterDllNotification)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, void *, void **);
static NTSTATUS (WINAPI *pLdrUnregisterDllNotification)(void *);
static VOID (WINAPI *pRtlGetDeviceFamilyInfoEnum)(ULONGLONG *,DWORD *,DWORD *);
@@ -148,6 +154,9 @@ static void InitFunctionPtrs(void)
@@ -152,6 +158,9 @@ static void InitFunctionPtrs(void)
pRtlInitializeCriticalSectionEx = (void *)GetProcAddress(hntdll, "RtlInitializeCriticalSectionEx");
pRtlFindExportedRoutineByName = (void *)GetProcAddress(hntdll, "RtlFindExportedRoutineByName");
pLdrEnumerateLoadedModules = (void *)GetProcAddress(hntdll, "LdrEnumerateLoadedModules");
@@ -53,7 +53,7 @@ index e678f7f43a0..71a413d9f18 100644
pLdrRegisterDllNotification = (void *)GetProcAddress(hntdll, "LdrRegisterDllNotification");
pLdrUnregisterDllNotification = (void *)GetProcAddress(hntdll, "LdrUnregisterDllNotification");
pRtlGetDeviceFamilyInfoEnum = (void *)GetProcAddress(hntdll, "RtlGetDeviceFamilyInfoEnum");
@@ -3708,6 +3717,76 @@ static void test_RtlFirstFreeAce(void)
@@ -3714,6 +3723,76 @@ static void test_RtlFirstFreeAce(void)
HeapFree(GetProcessHeap(), 0, acl);
}
@@ -130,7 +130,7 @@ index e678f7f43a0..71a413d9f18 100644
static void test_RtlInitializeSid(void)
{
SID_IDENTIFIER_AUTHORITY sid_ident = { SECURITY_NT_AUTHORITY };
@@ -3823,6 +3902,7 @@ START_TEST(rtl)
@@ -3970,6 +4049,7 @@ START_TEST(rtl)
test_RtlInitializeCriticalSectionEx();
test_RtlLeaveCriticalSection();
test_LdrEnumerateLoadedModules();
@@ -139,5 +139,5 @@ index e678f7f43a0..71a413d9f18 100644
test_LdrRegisterDllNotification();
test_DbgPrint();
--
2.43.0
2.45.2

View File

@@ -1,4 +1,4 @@
From d3a25a9ead93caf3d25ad34591683675b3d1ae0b Mon Sep 17 00:00:00 2001
From 8e45c14f92426d1a9610ef21f0f3223b7276b13f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 8 Mar 2024 11:15:57 +0100
Subject: [PATCH] winex11: Add support for absolute position in RawMotion
@@ -9,7 +9,7 @@ Subject: [PATCH] winex11: Add support for absolute position in RawMotion
1 file changed, 35 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 45619d4970d..d3c97468fdb 100644
index b596ec546b4..59fbd2bbe52 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -30,6 +30,7 @@
@@ -52,7 +52,7 @@ index 45619d4970d..d3c97468fdb 100644
thread_data->x_valuator.value = 0;
thread_data->y_valuator.value = 0;
@@ -1670,6 +1681,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
@@ -1669,6 +1680,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
{
struct x11drv_thread_data *thread_data = x11drv_thread_data();
XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator;
@@ -60,11 +60,11 @@ index 45619d4970d..d3c97468fdb 100644
double x_value = 0, y_value = 0, x_scale, y_scale;
const double *values = event->valuators.values;
RECT virtual_rect;
@@ -1680,7 +1692,15 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
@@ -1679,7 +1691,15 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
if (!xinput2_available) return FALSE;
if (event->deviceid != thread_data->xinput2_pointer) return FALSE;
- virtual_rect = NtUserGetVirtualScreenRect();
- virtual_rect = NtUserGetVirtualScreenRect( MDT_DEFAULT );
+ if (x->mode == XIModeRelative && y->mode == XIModeRelative)
+ input->mi.dwFlags &= ~absolute_flags;
+ else if (x->mode == XIModeAbsolute && y->mode == XIModeAbsolute)
@@ -73,11 +73,11 @@ index 45619d4970d..d3c97468fdb 100644
+ FIXME( "Unsupported relative/absolute X/Y axis mismatch\n." );
+
+ if (input->mi.dwFlags & MOUSEEVENTF_VIRTUALDESK) SetRect( &virtual_rect, 0, 0, UINT16_MAX, UINT16_MAX );
+ else virtual_rect = NtUserGetVirtualScreenRect();
+ else virtual_rect = NtUserGetVirtualScreenRect( MDT_DEFAULT );
if (x->max <= x->min) x_scale = 1;
else x_scale = (virtual_rect.right - virtual_rect.left) / (x->max - x->min);
@@ -1693,17 +1713,26 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
@@ -1692,17 +1712,26 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
if (i == x->number)
{
x_value = *values;
@@ -108,5 +108,5 @@ index 45619d4970d..d3c97468fdb 100644
TRACE( "event %f,%f value %f,%f, accumulating motion\n", x_value, y_value, x->value, y->value );
input->mi.dwFlags &= ~MOUSEEVENTF_MOVE;
--
2.43.0
2.45.2

View File

@@ -0,0 +1,303 @@
From 3bca6a7e645ca8f48f2ec73a13b63a412cb7f2be Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 25 Sep 2024 07:29:36 +1000
Subject: [PATCH] Updated vkd3d to e8b14d765dbebae32d83aa5d2a7521932d9943f9.
---
libs/vkd3d/libs/vkd3d-shader/glsl.c | 38 ++++++++++++++++++++
libs/vkd3d/libs/vkd3d-shader/ir.c | 5 +--
libs/vkd3d/libs/vkd3d-shader/msl.c | 50 ++++++++++++++++++++++++--
libs/vkd3d/libs/vkd3d-shader/preproc.l | 2 +-
libs/vkd3d/libs/vkd3d-shader/spirv.c | 25 ++++---------
libs/vkd3d/libs/vkd3d/vkd3d_main.c | 1 +
6 files changed, 96 insertions(+), 25 deletions(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/glsl.c b/libs/vkd3d/libs/vkd3d-shader/glsl.c
index b29f13f2b19..a8cc6d87c40 100644
--- a/libs/vkd3d/libs/vkd3d-shader/glsl.c
+++ b/libs/vkd3d/libs/vkd3d-shader/glsl.c
@@ -379,6 +379,9 @@ static void VKD3D_PRINTF_FUNC(3, 4) shader_glsl_print_assignment(
case VKD3D_DATA_FLOAT:
close = false;
break;
+ case VKD3D_DATA_INT:
+ vkd3d_string_buffer_printf(buffer, "intBitsToFloat(");
+ break;
case VKD3D_DATA_UINT:
vkd3d_string_buffer_printf(buffer, "uintBitsToFloat(");
break;
@@ -457,6 +460,28 @@ static void shader_glsl_relop(struct vkd3d_glsl_generator *gen,
glsl_dst_cleanup(&dst, &gen->string_buffers);
}
+static void shader_glsl_cast(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins,
+ const char *scalar_constructor, const char *vector_constructor)
+{
+ unsigned int component_count;
+ struct glsl_src src;
+ struct glsl_dst dst;
+ uint32_t mask;
+
+ mask = glsl_dst_init(&dst, gen, ins, &ins->dst[0]);
+ glsl_src_init(&src, gen, &ins->src[0], mask);
+
+ if ((component_count = vsir_write_mask_component_count(mask)) > 1)
+ shader_glsl_print_assignment(gen, &dst, "%s%u(%s)",
+ vector_constructor, component_count, src.str->buffer);
+ else
+ shader_glsl_print_assignment(gen, &dst, "%s(%s)",
+ scalar_constructor, src.str->buffer);
+
+ glsl_src_cleanup(&src, &gen->string_buffers);
+ glsl_dst_cleanup(&dst, &gen->string_buffers);
+}
+
static void shader_glsl_mov(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
{
struct glsl_src src;
@@ -658,6 +683,12 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_FRC:
shader_glsl_intrinsic(gen, ins, "fract");
break;
+ case VKD3DSIH_FTOI:
+ shader_glsl_cast(gen, ins, "int", "ivec");
+ break;
+ case VKD3DSIH_FTOU:
+ shader_glsl_cast(gen, ins, "uint", "uvec");
+ break;
case VKD3DSIH_GEO:
shader_glsl_relop(gen, ins, ">=", "greaterThanEqual");
break;
@@ -665,6 +696,10 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_NEU:
shader_glsl_relop(gen, ins, "!=", "notEqual");
break;
+ case VKD3DSIH_ITOF:
+ case VKD3DSIH_UTOF:
+ shader_glsl_cast(gen, ins, "float", "vec");
+ break;
case VKD3DSIH_MOV:
shader_glsl_mov(gen, ins);
break;
@@ -680,6 +715,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_RET:
shader_glsl_ret(gen, ins);
break;
+ case VKD3DSIH_ROUND_PI:
+ shader_glsl_intrinsic(gen, ins, "ceil");
+ break;
default:
shader_glsl_unhandled(gen, ins);
break;
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
index db9992d9715..0bbe13ad7d8 100644
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
@@ -1211,12 +1211,13 @@ static bool io_normaliser_is_in_control_point_phase(const struct io_normaliser *
static bool shader_signature_find_element_for_reg(const struct shader_signature *signature,
unsigned int reg_idx, unsigned int write_mask, unsigned int *element_idx)
{
+ const struct signature_element *e;
unsigned int i, base_write_mask;
for (i = 0; i < signature->element_count; ++i)
{
- struct signature_element *e = &signature->elements[i];
- if (e->register_index <= reg_idx && e->register_index + e->register_count > reg_idx
+ e = &signature->elements[i];
+ if (e->register_index <= reg_idx && e->register_count > reg_idx - e->register_index
&& (e->mask & write_mask) == write_mask)
{
*element_idx = i;
diff --git a/libs/vkd3d/libs/vkd3d-shader/msl.c b/libs/vkd3d/libs/vkd3d-shader/msl.c
index 7d2e713cddc..6b41363d60e 100644
--- a/libs/vkd3d/libs/vkd3d-shader/msl.c
+++ b/libs/vkd3d/libs/vkd3d-shader/msl.c
@@ -55,12 +55,44 @@ static void msl_print_indent(struct vkd3d_string_buffer *buffer, unsigned int in
vkd3d_string_buffer_printf(buffer, "%*s", 4 * indent, "");
}
+static void msl_print_register_datatype(struct vkd3d_string_buffer *buffer,
+ struct msl_generator *gen, const struct vkd3d_shader_register *reg)
+{
+ vkd3d_string_buffer_printf(buffer, ".");
+ switch (reg->data_type)
+ {
+ case VKD3D_DATA_FLOAT:
+ vkd3d_string_buffer_printf(buffer, "f");
+ break;
+ case VKD3D_DATA_INT:
+ vkd3d_string_buffer_printf(buffer, "i");
+ break;
+ case VKD3D_DATA_UINT:
+ vkd3d_string_buffer_printf(buffer, "u");
+ break;
+ default:
+ msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
+ "Internal compiler error: Unhandled register datatype %#x.", reg->data_type);
+ vkd3d_string_buffer_printf(buffer, "<unrecognised register datatype %#x>", reg->data_type);
+ break;
+ }
+}
+
static void msl_print_register_name(struct vkd3d_string_buffer *buffer,
struct msl_generator *gen, const struct vkd3d_shader_register *reg)
{
- msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
- "Internal compiler error: Unhandled register type %#x.", reg->type);
- vkd3d_string_buffer_printf(buffer, "<unrecognised register %#x>", reg->type);
+ switch (reg->type)
+ {
+ case VKD3DSPR_TEMP:
+ vkd3d_string_buffer_printf(buffer, "r[%u]", reg->idx[0].offset);
+ msl_print_register_datatype(buffer, gen, reg);
+ break;
+ default:
+ msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
+ "Internal compiler error: Unhandled register type %#x.", reg->type);
+ vkd3d_string_buffer_printf(buffer, "<unrecognised register %#x>", reg->type);
+ break;
+ }
}
static void msl_print_swizzle(struct vkd3d_string_buffer *buffer, uint32_t swizzle, uint32_t mask)
@@ -221,9 +253,21 @@ static void msl_generator_generate(struct msl_generator *gen)
vkd3d_string_buffer_printf(gen->buffer, "/* Generated by %s. */\n\n", vkd3d_shader_get_version(NULL, NULL));
+ vkd3d_string_buffer_printf(gen->buffer, "union vkd3d_vec4\n{\n");
+ vkd3d_string_buffer_printf(gen->buffer, " uint4 u;\n");
+ vkd3d_string_buffer_printf(gen->buffer, " int4 i;\n");
+ vkd3d_string_buffer_printf(gen->buffer, " float4 f;\n};\n\n");
+
vkd3d_string_buffer_printf(gen->buffer, "void shader_main()\n{\n");
++gen->indent;
+
+ if (gen->program->temp_count)
+ {
+ msl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "vkd3d_vec4 r[%u];\n\n", gen->program->temp_count);
+ }
+
for (i = 0; i < instructions->count; ++i)
{
msl_handle_instruction(gen, &instructions->elements[i]);
diff --git a/libs/vkd3d/libs/vkd3d-shader/preproc.l b/libs/vkd3d/libs/vkd3d-shader/preproc.l
index 7fc963192cf..41c21cca1f5 100644
--- a/libs/vkd3d/libs/vkd3d-shader/preproc.l
+++ b/libs/vkd3d/libs/vkd3d-shader/preproc.l
@@ -67,7 +67,7 @@ static void update_location(struct preproc_ctx *ctx);
NEWLINE \r?\n
WS [ \t\r]
-IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
+IDENTIFIER (::)?[A-Za-z_]((::)?[A-Za-z0-9_]+)*
INT_SUFFIX [uUlL]{0,2}
%%
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
index 1876ad38653..0278a6ca232 100644
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
@@ -6354,7 +6354,7 @@ static SpvImageFormat image_format_for_image_read(enum vkd3d_shader_component_ty
static uint32_t spirv_compiler_get_image_type_id(struct spirv_compiler *compiler,
const struct vkd3d_shader_register *reg, const struct vkd3d_shader_register_range *range,
const struct vkd3d_spirv_resource_type *resource_type_info, enum vkd3d_shader_component_type data_type,
- bool raw_structured, uint32_t depth)
+ bool raw_structured)
{
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
const struct vkd3d_shader_descriptor_info1 *d;
@@ -6377,7 +6377,7 @@ static uint32_t spirv_compiler_get_image_type_id(struct spirv_compiler *compiler
sampled_type_id = vkd3d_spirv_get_type_id(builder, data_type, 1);
return vkd3d_spirv_get_op_type_image(builder, sampled_type_id, resource_type_info->dim,
- depth, resource_type_info->arrayed, resource_type_info->ms,
+ 2, resource_type_info->arrayed, resource_type_info->ms,
reg->type == VKD3DSPR_UAV ? 2 : 1, format);
}
@@ -6392,18 +6392,14 @@ static void spirv_compiler_emit_combined_sampler_declarations(struct spirv_compi
const struct vkd3d_shader_combined_resource_sampler *current;
uint32_t image_type_id, type_id, ptr_type_id, var_id;
enum vkd3d_shader_binding_flag resource_type_flag;
- const struct vkd3d_shader_descriptor_info1 *d;
struct vkd3d_symbol symbol;
unsigned int i;
- bool depth;
resource_type_flag = resource_type == VKD3D_SHADER_RESOURCE_BUFFER
? VKD3D_SHADER_BINDING_FLAG_BUFFER : VKD3D_SHADER_BINDING_FLAG_IMAGE;
for (i = 0; i < shader_interface->combined_sampler_count; ++i)
{
- struct vkd3d_shader_register_range sampler_range;
-
current = &shader_interface->combined_samplers[i];
if (current->resource_space != resource_range->space || current->resource_index != resource_range->first)
@@ -6425,16 +6421,8 @@ static void spirv_compiler_emit_combined_sampler_declarations(struct spirv_compi
current->sampler_space, current->binding.count);
}
- sampler_range.space = current->sampler_space;
- sampler_range.first = current->sampler_index;
- sampler_range.last = current->sampler_index;
- d = spirv_compiler_get_descriptor_info(compiler,
- VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER, &sampler_range);
- depth = current->sampler_index != VKD3D_SHADER_DUMMY_SAMPLER_INDEX
- && (d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_SAMPLER_COMPARISON_MODE);
-
image_type_id = spirv_compiler_get_image_type_id(compiler, resource, resource_range,
- resource_type_info, sampled_type, structure_stride || raw, depth);
+ resource_type_info, sampled_type, structure_stride || raw);
type_id = vkd3d_spirv_get_op_type_sampled_image(builder, image_type_id);
ptr_type_id = vkd3d_spirv_get_op_type_pointer(builder, storage_class, type_id);
@@ -6528,7 +6516,7 @@ static void spirv_compiler_emit_resource_declaration(struct spirv_compiler *comp
else
{
type_id = spirv_compiler_get_image_type_id(compiler, &reg, range,
- resource_type_info, sampled_type, structure_stride || raw, 0);
+ resource_type_info, sampled_type, structure_stride || raw);
}
var_id = spirv_compiler_build_descriptor_variable(compiler, storage_class,
@@ -8440,11 +8428,10 @@ static void spirv_compiler_prepare_image(struct spirv_compiler *compiler,
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
uint32_t sampler_var_id, sampler_id, sampled_image_type_id;
const struct vkd3d_symbol *symbol = NULL;
- bool load, sampled, depth_comparison;
+ bool load, sampled;
load = !(flags & VKD3D_IMAGE_FLAG_NO_LOAD);
sampled = flags & VKD3D_IMAGE_FLAG_SAMPLED;
- depth_comparison = flags & VKD3D_IMAGE_FLAG_DEPTH;
if (resource_reg->type == VKD3DSPR_RESOURCE)
symbol = spirv_compiler_find_combined_sampler(compiler, resource_reg, sampler_reg);
@@ -8498,7 +8485,7 @@ static void spirv_compiler_prepare_image(struct spirv_compiler *compiler,
image->image_type_id = spirv_compiler_get_image_type_id(compiler, resource_reg,
&symbol->info.resource.range, image->resource_type_info,
- image->sampled_type, image->structure_stride || image->raw, depth_comparison);
+ image->sampled_type, image->structure_stride || image->raw);
if (sampled)
{
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
index 9eccec111c7..5215cf8ef86 100644
--- a/libs/vkd3d/libs/vkd3d/vkd3d_main.c
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
@@ -415,6 +415,7 @@ HRESULT vkd3d_create_versioned_root_signature_deserializer(const void *data, SIZ
if (FAILED(hr = d3d12_versioned_root_signature_deserializer_init(object, &dxbc)))
{
vkd3d_free(object);
+ *deserializer = NULL;
return hr;
}
--
2.45.2

View File

@@ -1,485 +0,0 @@
From 974ebb67f03cda95a36c014378acd627f913f47b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 11 Sep 2024 07:14:31 +1000
Subject: [PATCH] Updated vkd3d to 3b4e0ce8e94cd4091b9f2fe80d86588b64c88111.
---
libs/vkd3d/libs/vkd3d-shader/d3dbc.c | 10 ++-
libs/vkd3d/libs/vkd3d-shader/dxil.c | 2 +-
libs/vkd3d/libs/vkd3d-shader/fx.c | 8 ++-
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 15 ++++
libs/vkd3d/libs/vkd3d-shader/ir.c | 69 ++++++++++---------
libs/vkd3d/libs/vkd3d-shader/tpf.c | 19 +++++
.../libs/vkd3d-shader/vkd3d_shader_private.h | 4 +-
libs/vkd3d/libs/vkd3d/command.c | 20 ++++--
libs/vkd3d/libs/vkd3d/state.c | 2 +-
libs/vkd3d/libs/vkd3d/vkd3d_private.h | 1 -
10 files changed, 100 insertions(+), 50 deletions(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d/libs/vkd3d-shader/d3dbc.c
index de5f28c1815..a41182e1f4a 100644
--- a/libs/vkd3d/libs/vkd3d-shader/d3dbc.c
+++ b/libs/vkd3d/libs/vkd3d-shader/d3dbc.c
@@ -1481,10 +1481,8 @@ struct d3dbc_compiler
static uint32_t sm1_version(enum vkd3d_shader_type type, unsigned int major, unsigned int minor)
{
- if (type == VKD3D_SHADER_TYPE_VERTEX)
- return D3DVS_VERSION(major, minor);
- else
- return D3DPS_VERSION(major, minor);
+ return vkd3d_make_u32(vkd3d_make_u16(minor, major),
+ type == VKD3D_SHADER_TYPE_VERTEX ? VKD3D_SM1_VS : VKD3D_SM1_PS);
}
D3DXPARAMETER_CLASS hlsl_sm1_class(const struct hlsl_type *type)
@@ -1867,8 +1865,8 @@ void write_sm1_uniforms(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buff
static uint32_t sm1_encode_register_type(enum vkd3d_shader_register_type type)
{
- return ((type << D3DSP_REGTYPE_SHIFT) & D3DSP_REGTYPE_MASK)
- | ((type << D3DSP_REGTYPE_SHIFT2) & D3DSP_REGTYPE_MASK2);
+ return ((type << VKD3D_SM1_REGISTER_TYPE_SHIFT) & VKD3D_SM1_REGISTER_TYPE_MASK)
+ | ((type << VKD3D_SM1_REGISTER_TYPE_SHIFT2) & VKD3D_SM1_REGISTER_TYPE_MASK2);
}
struct sm1_instruction
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
index 4a17c62292b..1c62a305d30 100644
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
@@ -3888,7 +3888,7 @@ static void sm6_parser_init_signature(struct sm6_parser *sm6, const struct shade
if (is_control_point)
{
if (reg_type == VKD3DSPR_OUTPUT)
- param->reg.idx[count].rel_addr = instruction_array_create_outpointid_param(&sm6->p.program->instructions);
+ param->reg.idx[count].rel_addr = vsir_program_create_outpointid_param(sm6->p.program);
param->reg.idx[count++].offset = 0;
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/fx.c b/libs/vkd3d/libs/vkd3d-shader/fx.c
index e3ab71fb386..2c2e486aa0e 100644
--- a/libs/vkd3d/libs/vkd3d-shader/fx.c
+++ b/libs/vkd3d/libs/vkd3d-shader/fx.c
@@ -38,6 +38,7 @@ struct type_entry
struct list entry;
const char *name;
uint32_t elements_count;
+ uint32_t modifiers;
uint32_t offset;
};
@@ -278,9 +279,9 @@ static void write_fx_4_state_block(struct hlsl_ir_var *var, unsigned int block_i
static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context *fx)
{
+ unsigned int elements_count, modifiers;
const struct hlsl_type *element_type;
struct type_entry *type_entry;
- unsigned int elements_count;
const char *name;
VKD3D_ASSERT(fx->ctx->profile->major_version >= 4);
@@ -297,6 +298,7 @@ static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context
}
name = get_fx_4_type_name(element_type);
+ modifiers = element_type->modifiers & HLSL_MODIFIERS_MAJORITY_MASK;
LIST_FOR_EACH_ENTRY(type_entry, &fx->types, struct type_entry, entry)
{
@@ -306,6 +308,9 @@ static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context
if (type_entry->elements_count != elements_count)
continue;
+ if (type_entry->modifiers != modifiers)
+ continue;
+
return type_entry->offset;
}
@@ -315,6 +320,7 @@ static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context
type_entry->offset = write_fx_4_type(type, fx);
type_entry->name = name;
type_entry->elements_count = elements_count;
+ type_entry->modifiers = modifiers;
list_add_tail(&fx->types, &type_entry->entry);
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
index 816d992afa8..38642025b52 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
@@ -4152,6 +4152,20 @@ static bool intrinsic_log2(struct hlsl_ctx *ctx,
return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_LOG2, arg, loc);
}
+static bool intrinsic_mad(struct hlsl_ctx *ctx,
+ const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
+{
+ struct hlsl_ir_node *args[HLSL_MAX_OPERANDS] = {0};
+
+ if (!elementwise_intrinsic_convert_args(ctx, params, loc))
+ return false;
+
+ args[0] = params->args[0];
+ args[1] = params->args[1];
+ args[2] = params->args[2];
+ return add_expr(ctx, params->instrs, HLSL_OP3_MAD, args, args[0]->data_type, loc);
+}
+
static bool intrinsic_max(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{
@@ -5053,6 +5067,7 @@ intrinsic_functions[] =
{"log", 1, true, intrinsic_log},
{"log10", 1, true, intrinsic_log10},
{"log2", 1, true, intrinsic_log2},
+ {"mad", 3, true, intrinsic_mad},
{"max", 2, true, intrinsic_max},
{"min", 2, true, intrinsic_min},
{"mul", 2, true, intrinsic_mul},
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
index a483c25f3ad..68f2e2f795e 100644
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
@@ -551,9 +551,11 @@ static const struct vkd3d_shader_varying_map *find_varying_map(
}
static enum vkd3d_result vsir_program_remap_output_signature(struct vsir_program *program,
- const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context)
+ struct vsir_normalisation_context *ctx)
{
- const struct vkd3d_shader_location location = {.source_name = compile_info->source_name};
+ const struct vkd3d_shader_location location = {.source_name = ctx->compile_info->source_name};
+ struct vkd3d_shader_message_context *message_context = ctx->message_context;
+ const struct vkd3d_shader_compile_info *compile_info = ctx->compile_info;
struct shader_signature *signature = &program->output_signature;
const struct vkd3d_shader_varying_map_info *varying_map;
unsigned int i;
@@ -862,9 +864,10 @@ static bool vsir_instruction_init_label(struct vkd3d_shader_instruction *ins,
return true;
}
-static enum vkd3d_result instruction_array_flatten_hull_shader_phases(struct vkd3d_shader_instruction_array *src_instructions)
+static enum vkd3d_result vsir_program_flatten_hull_shader_phases(struct vsir_program *program,
+ struct vsir_normalisation_context *ctx)
{
- struct hull_flattener flattener = {*src_instructions};
+ struct hull_flattener flattener = {program->instructions};
struct vkd3d_shader_instruction_array *instructions;
struct shader_phase_location_array locations;
enum vkd3d_result result = VKD3D_OK;
@@ -886,7 +889,7 @@ static enum vkd3d_result instruction_array_flatten_hull_shader_phases(struct vkd
vsir_instruction_init(&instructions->elements[instructions->count++], &flattener.last_ret_location, VKD3DSIH_RET);
}
- *src_instructions = flattener.instructions;
+ program->instructions = flattener.instructions;
return result;
}
@@ -902,9 +905,9 @@ static bool control_point_normaliser_is_in_control_point_phase(const struct cont
return normaliser->phase == VKD3DSIH_HS_CONTROL_POINT_PHASE;
}
-struct vkd3d_shader_src_param *instruction_array_create_outpointid_param(
- struct vkd3d_shader_instruction_array *instructions)
+struct vkd3d_shader_src_param *vsir_program_create_outpointid_param(struct vsir_program *program)
{
+ struct vkd3d_shader_instruction_array *instructions = &program->instructions;
struct vkd3d_shader_src_param *rel_addr;
if (instructions->outpointid_param)
@@ -1001,7 +1004,7 @@ static enum vkd3d_result control_point_normaliser_emit_hs_input(struct control_p
}
static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_io(
- struct vkd3d_shader_instruction_array *src_instructions, const struct shader_signature *input_signature)
+ struct vsir_program *program, struct vsir_normalisation_context *ctx)
{
struct vkd3d_shader_instruction_array *instructions;
struct control_point_normaliser normaliser;
@@ -1011,12 +1014,12 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
enum vkd3d_result ret;
unsigned int i, j;
- if (!(normaliser.outpointid_param = instruction_array_create_outpointid_param(src_instructions)))
+ if (!(normaliser.outpointid_param = vsir_program_create_outpointid_param(program)))
{
ERR("Failed to allocate src param.\n");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
- normaliser.instructions = *src_instructions;
+ normaliser.instructions = program->instructions;
instructions = &normaliser.instructions;
normaliser.phase = VKD3DSIH_INVALID;
@@ -1053,22 +1056,22 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
input_control_point_count = ins->declaration.count;
break;
case VKD3DSIH_HS_CONTROL_POINT_PHASE:
- *src_instructions = normaliser.instructions;
+ program->instructions = normaliser.instructions;
return VKD3D_OK;
case VKD3DSIH_HS_FORK_PHASE:
case VKD3DSIH_HS_JOIN_PHASE:
/* ins may be relocated if the instruction array expands. */
location = ins->location;
- ret = control_point_normaliser_emit_hs_input(&normaliser, input_signature,
+ ret = control_point_normaliser_emit_hs_input(&normaliser, &program->input_signature,
input_control_point_count, i, &location);
- *src_instructions = normaliser.instructions;
+ program->instructions = normaliser.instructions;
return ret;
default:
break;
}
}
- *src_instructions = normaliser.instructions;
+ program->instructions = normaliser.instructions;
return VKD3D_OK;
}
@@ -1398,6 +1401,8 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map
else
e->interpolation_mode = f->interpolation_mode;
}
+
+ vkd3d_free((void *)f->semantic_name);
}
}
element_count = new_count;
@@ -1425,6 +1430,12 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map
TRACE("Merging %s, base reg %u, count %u.\n", e->semantic_name, e->register_index, register_count);
e->register_count = register_count;
e->mask = signature_element_range_expand_mask(e, register_count, range_map);
+
+ for (j = 1; j < register_count; ++j)
+ {
+ f = &elements[i + j];
+ vkd3d_free((void *)f->semantic_name);
+ }
}
}
element_count = new_count;
@@ -1761,8 +1772,9 @@ static bool use_flat_interpolation(const struct vsir_program *program,
}
static enum vkd3d_result vsir_program_normalise_io_registers(struct vsir_program *program,
- struct vkd3d_shader_message_context *message_context)
+ struct vsir_normalisation_context *ctx)
{
+ struct vkd3d_shader_message_context *message_context = ctx->message_context;
struct io_normaliser normaliser = {program->instructions};
struct vkd3d_shader_instruction *ins;
unsigned int i;
@@ -1909,7 +1921,8 @@ static void shader_register_normalise_flat_constants(struct vkd3d_shader_src_par
param->reg.idx_count = 3;
}
-static enum vkd3d_result instruction_array_normalise_flat_constants(struct vsir_program *program)
+static enum vkd3d_result vsir_program_normalise_flat_constants(struct vsir_program *program,
+ struct vsir_normalisation_context *ctx)
{
struct flat_constants_normaliser normaliser = {0};
unsigned int i, j;
@@ -6657,30 +6670,20 @@ enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t
}
else
{
- if (ctx.result < 0)
- return ctx.result;
-
if (program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL)
- {
- if ((result = vsir_program_remap_output_signature(program, compile_info, message_context)) < 0)
- return result;
- }
+ vsir_transform(&ctx, vsir_program_remap_output_signature);
if (program->shader_version.type == VKD3D_SHADER_TYPE_HULL)
{
- if ((result = instruction_array_flatten_hull_shader_phases(&program->instructions)) < 0)
- return result;
-
- if ((result = instruction_array_normalise_hull_shader_control_point_io(&program->instructions,
- &program->input_signature)) < 0)
- return result;
+ vsir_transform(&ctx, vsir_program_flatten_hull_shader_phases);
+ vsir_transform(&ctx, instruction_array_normalise_hull_shader_control_point_io);
}
- if ((result = vsir_program_normalise_io_registers(program, message_context)) < 0)
- return result;
+ vsir_transform(&ctx, vsir_program_normalise_io_registers);
+ vsir_transform(&ctx, vsir_program_normalise_flat_constants);
- if ((result = instruction_array_normalise_flat_constants(program)) < 0)
- return result;
+ if (ctx.result < 0)
+ return ctx.result;
remove_dead_code(program);
diff --git a/libs/vkd3d/libs/vkd3d-shader/tpf.c b/libs/vkd3d/libs/vkd3d-shader/tpf.c
index c61086419a6..b76a596bb60 100644
--- a/libs/vkd3d/libs/vkd3d-shader/tpf.c
+++ b/libs/vkd3d/libs/vkd3d-shader/tpf.c
@@ -2814,6 +2814,7 @@ bool sysval_semantic_from_hlsl(enum vkd3d_shader_sysval_semantic *semantic,
{"sv_isfrontface", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_IS_FRONT_FACE},
{"sv_rendertargetarrayindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX},
{"sv_viewportarrayindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX},
+ {"sv_sampleindex", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_SAMPLE_INDEX},
{"color", true, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_TARGET},
{"depth", true, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_DEPTH},
@@ -4461,6 +4462,7 @@ static void write_sm4_dcl_semantic(const struct tpf_writer *tpf, const struct hl
case VKD3D_SHADER_SV_INSTANCE_ID:
case VKD3D_SHADER_SV_PRIMITIVE_ID:
case VKD3D_SHADER_SV_VERTEX_ID:
+ case VKD3D_SHADER_SV_SAMPLE_INDEX:
instr.opcode = (profile->type == VKD3D_SHADER_TYPE_PIXEL)
? VKD3D_SM4_OP_DCL_INPUT_PS_SGV : VKD3D_SM4_OP_DCL_INPUT_SGV;
break;
@@ -5578,6 +5580,23 @@ static void write_sm4_expr(const struct tpf_writer *tpf, const struct hlsl_ir_ex
write_sm4_ternary_op(tpf, VKD3D_SM4_OP_MOVC, &expr->node, arg1, arg2, arg3);
break;
+ case HLSL_OP3_MAD:
+ switch (dst_type->e.numeric.type)
+ {
+ case HLSL_TYPE_FLOAT:
+ write_sm4_ternary_op(tpf, VKD3D_SM4_OP_MAD, &expr->node, arg1, arg2, arg3);
+ break;
+
+ case HLSL_TYPE_INT:
+ case HLSL_TYPE_UINT:
+ write_sm4_ternary_op(tpf, VKD3D_SM4_OP_IMAD, &expr->node, arg1, arg2, arg3);
+ break;
+
+ default:
+ hlsl_fixme(tpf->ctx, &expr->node.loc, "SM4 %s negation expression.", dst_type_string->buffer);
+ }
+ break;
+
default:
hlsl_fixme(tpf->ctx, &expr->node.loc, "SM4 %s expression.", debug_hlsl_expr_op(expr->op));
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
index 327461371a4..ffec48daa17 100644
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -1354,8 +1354,6 @@ bool shader_instruction_array_add_icb(struct vkd3d_shader_instruction_array *ins
struct vkd3d_shader_immediate_constant_buffer *icb);
bool shader_instruction_array_clone_instruction(struct vkd3d_shader_instruction_array *instructions,
unsigned int dst, unsigned int src);
-struct vkd3d_shader_src_param *instruction_array_create_outpointid_param(
- struct vkd3d_shader_instruction_array *instructions);
void shader_instruction_array_destroy(struct vkd3d_shader_instruction_array *instructions);
enum vkd3d_shader_config_flags
@@ -1399,6 +1397,8 @@ enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t
const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context);
enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t config_flags,
const char *source_name, struct vkd3d_shader_message_context *message_context);
+struct vkd3d_shader_src_param *vsir_program_create_outpointid_param(
+ struct vsir_program *program);
bool vsir_instruction_init_with_params(struct vsir_program *program,
struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_location *location,
enum vkd3d_shader_opcode opcode, unsigned int dst_count, unsigned int src_count);
diff --git a/libs/vkd3d/libs/vkd3d/command.c b/libs/vkd3d/libs/vkd3d/command.c
index dcc7690876f..188162f9e6e 100644
--- a/libs/vkd3d/libs/vkd3d/command.c
+++ b/libs/vkd3d/libs/vkd3d/command.c
@@ -3078,7 +3078,7 @@ done:
vkd3d_free(vk_descriptor_writes);
}
-static void d3d12_command_list_update_descriptors(struct d3d12_command_list *list,
+static void d3d12_command_list_update_virtual_descriptors(struct d3d12_command_list *list,
enum vkd3d_pipeline_bind_point bind_point)
{
struct vkd3d_pipeline_bindings *bindings = &list->pipeline_bindings[bind_point];
@@ -3210,6 +3210,9 @@ static void command_list_flush_vk_heap_updates(struct d3d12_command_list *list)
static void command_list_add_descriptor_heap(struct d3d12_command_list *list, struct d3d12_descriptor_heap *heap)
{
+ if (!list->device->use_vk_heaps)
+ return;
+
if (!contains_heap(list->descriptor_heaps, list->descriptor_heap_count, heap))
{
if (list->descriptor_heap_count == ARRAY_SIZE(list->descriptor_heaps))
@@ -3296,6 +3299,15 @@ static void d3d12_command_list_update_heap_descriptors(struct d3d12_command_list
d3d12_command_list_bind_descriptor_heap(list, bind_point, sampler_heap);
}
+static void d3d12_command_list_update_descriptors(struct d3d12_command_list *list,
+ enum vkd3d_pipeline_bind_point bind_point)
+{
+ if (list->device->use_vk_heaps)
+ d3d12_command_list_update_heap_descriptors(list, bind_point);
+ else
+ d3d12_command_list_update_virtual_descriptors(list, bind_point);
+}
+
static bool d3d12_command_list_update_compute_state(struct d3d12_command_list *list)
{
d3d12_command_list_end_current_render_pass(list);
@@ -3303,7 +3315,7 @@ static bool d3d12_command_list_update_compute_state(struct d3d12_command_list *l
if (!d3d12_command_list_update_compute_pipeline(list))
return false;
- list->update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_COMPUTE);
+ d3d12_command_list_update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_COMPUTE);
return true;
}
@@ -3320,7 +3332,7 @@ static bool d3d12_command_list_begin_render_pass(struct d3d12_command_list *list
if (!d3d12_command_list_update_current_framebuffer(list))
return false;
- list->update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_GRAPHICS);
+ d3d12_command_list_update_descriptors(list, VKD3D_PIPELINE_BIND_POINT_GRAPHICS);
if (list->current_render_pass != VK_NULL_HANDLE)
return true;
@@ -6189,8 +6201,6 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d
list->allocator = allocator;
- list->update_descriptors = device->use_vk_heaps ? d3d12_command_list_update_heap_descriptors
- : d3d12_command_list_update_descriptors;
list->descriptor_heap_count = 0;
if (SUCCEEDED(hr = d3d12_command_allocator_allocate_command_buffer(allocator, list)))
diff --git a/libs/vkd3d/libs/vkd3d/state.c b/libs/vkd3d/libs/vkd3d/state.c
index 682d488faa8..bc887fa2f33 100644
--- a/libs/vkd3d/libs/vkd3d/state.c
+++ b/libs/vkd3d/libs/vkd3d/state.c
@@ -738,7 +738,7 @@ static bool vkd3d_validate_descriptor_set_count(struct d3d12_device *device, uns
if (set_count > max_count)
{
/* NOTE: If maxBoundDescriptorSets is < 9, try VKD3D_CONFIG=virtual_heaps */
- ERR("Required descriptor set count exceeds maximum allowed count of %u.\n", max_count);
+ WARN("Required descriptor set count exceeds maximum allowed count of %u.\n", max_count);
return false;
}
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
index ba4e2e8488d..729b1baee18 100644
--- a/libs/vkd3d/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
@@ -1271,7 +1271,6 @@ struct d3d12_command_list
VkBuffer so_counter_buffers[D3D12_SO_BUFFER_SLOT_COUNT];
VkDeviceSize so_counter_buffer_offsets[D3D12_SO_BUFFER_SLOT_COUNT];
- void (*update_descriptors)(struct d3d12_command_list *list, enum vkd3d_pipeline_bind_point bind_point);
struct d3d12_descriptor_heap *descriptor_heaps[64];
unsigned int descriptor_heap_count;
--
2.45.2

Some files were not shown because too many files have changed in this diff Show More