Compare commits

...

15 Commits

Author SHA1 Message Date
Alistair Leslie-Hughes
c37f9f5091 Release v10.10 2025-06-14 16:15:47 +10:00
Alistair Leslie-Hughes
b3f1bf0856 Rebase against 885446556ce443b496e368b8f2c68807dcc7df0f. 2025-06-14 15:22:25 +10:00
Alistair Leslie-Hughes
4de57fff29 Updated vkd3d-latest patchset 2025-06-13 08:26:56 +10:00
Alistair Leslie-Hughes
52ba925f90 Rebase against 19441ac8046556a0118d6b59838dfd408fa56fdd. 2025-06-13 07:55:01 +10:00
Alistair Leslie-Hughes
cc517dd949 Updated vkd3d-latest patchset 2025-06-11 07:54:27 +10:00
Alistair Leslie-Hughes
a9be5cf2b0 Updated vkd3d-latest patchset 2025-06-06 07:11:56 +10:00
Elizabeth Figura
df97d6c328 Rebase against 5063ab8a805e77b9b9dfe5587fb38981923e422d. 2025-06-02 16:03:11 -05:00
Alistair Leslie-Hughes
b4006fc038 Release v10.9 2025-06-02 08:14:05 +10:00
Alistair Leslie-Hughes
d1cc8d0fa5 Added kernel32-limit_heap_old_exe patchset 2025-06-02 07:48:53 +10:00
Alistair Leslie-Hughes
ef72380f02 Rebase against e0bb1dba3d6fdff61a6f98a4ca7d6af4438e21d4. 2025-05-29 10:06:53 +10:00
Alistair Leslie-Hughes
1b2e959b75 Updated vkd3d-latest patchset 2025-05-28 07:36:25 +10:00
Alistair Leslie-Hughes
31a37e3f3c Rebase against 371929471ddcac9358d6de238296ba115170a3fa. 2025-05-28 07:36:03 +10:00
Alistair Leslie-Hughes
a3738434e0 Rebase against 22af42ac22279e6c0c671f033661f95c1761b4bb. 2025-05-24 07:53:59 +10:00
Alistair Leslie-Hughes
554a64f6b3 Rebase against 8f91df4c4e4fb8b32c737bb02e82dcddfb71a114. 2025-05-22 07:44:21 +10:00
Alistair Leslie-Hughes
7f2c4b8613 Rebase against a550040d94de646c65f4013337b5cce89383b634. 2025-05-21 07:45:33 +10:00
26 changed files with 7554 additions and 32500 deletions

View File

@@ -1,4 +1,4 @@
From 5f5cfac7099cf4e5be912f07a66665f8217f57f3 Mon Sep 17 00:00:00 2001
From 50f9168ed92d261de21615b250dfac115160cc2e Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 17:17:31 -0500
Subject: [PATCH] ntdll, server: Implement alertable waits.
@@ -15,10 +15,10 @@ Subject: [PATCH] ntdll, server: Implement alertable waits.
8 files changed, 109 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
index 2844f9f760c..aeeea1731ce 100644
index f805af251bb..a80019b76dd 100644
--- a/dlls/ntdll/unix/esync.c
+++ b/dlls/ntdll/unix/esync.c
@@ -599,17 +599,42 @@ static void update_grabbed_object( struct esync *obj )
@@ -601,17 +601,42 @@ static void update_grabbed_object( struct esync *obj )
static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any,
BOOLEAN alertable, const LARGE_INTEGER *timeout )
{
@@ -62,7 +62,7 @@ index 2844f9f760c..aeeea1731ce 100644
NtQuerySystemTime( &now );
if (timeout)
{
@@ -648,6 +673,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
@@ -650,6 +675,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
if (msgwait)
TRACE(" or driver events");
@@ -71,7 +71,7 @@ index 2844f9f760c..aeeea1731ce 100644
if (!timeout)
TRACE(", timeout = INFINITE.\n");
@@ -684,12 +711,27 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
@@ -686,12 +713,27 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
fds[i].fd = obj ? obj->fd : -1;
fds[i].events = POLLIN;
}
@@ -100,7 +100,7 @@ index 2844f9f760c..aeeea1731ce 100644
/* Find out which object triggered the wait. */
for (i = 0; i < count; i++)
{
@@ -763,6 +805,14 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
@@ -765,6 +807,14 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
tryagain:
/* First step: try to poll on each object in sequence. */
fds[0].events = POLLIN;
@@ -115,7 +115,7 @@ index 2844f9f760c..aeeea1731ce 100644
for (i = 0; i < count; i++)
{
struct esync *obj = objs[i];
@@ -778,9 +828,11 @@ tryagain:
@@ -780,9 +830,11 @@ tryagain:
continue;
}
@@ -128,7 +128,7 @@ index 2844f9f760c..aeeea1731ce 100644
if (fds[0].revents & (POLLHUP | POLLERR | POLLNVAL))
{
@@ -796,10 +848,12 @@ tryagain:
@@ -798,10 +850,12 @@ tryagain:
fds[i].fd = objs[i] ? objs[i]->fd : -1;
fds[i].events = POLLIN;
}
@@ -143,7 +143,7 @@ index 2844f9f760c..aeeea1731ce 100644
{
/* Quick, grab everything. */
for (i = 0; i < count; i++)
@@ -865,6 +919,19 @@ err:
@@ -867,6 +921,19 @@ err:
ERR("ppoll failed: %s\n", strerror(errno));
return errno_to_status( errno );
}
@@ -164,22 +164,22 @@ index 2844f9f760c..aeeea1731ce 100644
/* We need to let the server know when we are doing a message wait, and when we
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index b278ab8df84..a3f0368b731 100644
index b9043351d57..283fd7d7ff6 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -93,6 +93,7 @@ struct ntdll_thread_data
{
void *cpu_data[16]; /* reserved for CPU-specific data */
void *kernel_stack; /* stack for thread startup and kernel syscalls */
+ int esync_apc_fd; /* fd to wait on for user APCs */
int request_fd; /* fd for sending server requests */
int reply_fd; /* fd for receiving server replies */
int wait_fd[2]; /* fd for sleeping server requests */
@@ -105,6 +105,7 @@ struct ntdll_thread_data
SYSTEM_SERVICE_TABLE *syscall_table; /* 214/0370 syscall table */
struct syscall_frame *syscall_frame; /* 218/0378 current syscall frame */
int syscall_trace; /* 21c/0380 syscall trace flag */
+ int esync_apc_fd; /* fd to wait on for user APCs */
int request_fd; /* fd for sending server requests */
int reply_fd; /* fd for receiving server replies */
int wait_fd[2]; /* fd for sleeping server requests */
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 2116b677adb..a7d0bb7e8c8 100644
index c797c89952f..0778ad73984 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -3646,6 +3646,7 @@ static TEB *init_teb( void *ptr, BOOL is_wow )
@@ -4014,6 +4014,7 @@ static TEB *init_teb( void *ptr, BOOL is_wow )
teb->StaticUnicodeString.Buffer = teb->StaticUnicodeBuffer;
teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer);
thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch;
@@ -244,10 +244,10 @@ index 689d8569b73..e1588d205d9 100644
void esync_clear( int fd );
diff --git a/server/protocol.def b/server/protocol.def
index 8c728080d05..3ea700054c6 100644
index 807298b6bab..a2dcdd37204 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3935,3 +3935,7 @@ enum esync_type
@@ -4148,3 +4148,7 @@ enum esync_type
@REPLY
int enable; /* previous state of auto-repeat enable */
@END
@@ -256,10 +256,10 @@ index 8c728080d05..3ea700054c6 100644
+@REQ(get_esync_apc_fd)
+@END
diff --git a/server/thread.c b/server/thread.c
index fd6b91b228a..8d7c520ced7 100644
index 11c36e49ae4..3a771838a98 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -232,6 +232,7 @@ static inline void init_thread_structure( struct thread *thread )
@@ -400,6 +400,7 @@ static inline void init_thread_structure( struct thread *thread )
thread->teb = 0;
thread->entry_point = 0;
thread->esync_fd = -1;
@@ -267,7 +267,7 @@ index fd6b91b228a..8d7c520ced7 100644
thread->system_regs = 0;
thread->queue = NULL;
thread->wait = NULL;
@@ -380,7 +381,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
@@ -550,7 +551,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
}
if (do_esync())
@@ -278,7 +278,7 @@ index fd6b91b228a..8d7c520ced7 100644
set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */
add_process_thread( thread->process, thread );
@@ -1174,8 +1178,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
@@ -1384,8 +1388,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
grab_object( apc );
list_add_tail( queue, &apc->entry );
if (!list_prev( queue, &apc->entry )) /* first one */
@@ -292,7 +292,7 @@ index fd6b91b228a..8d7c520ced7 100644
return 1;
}
@@ -1221,6 +1230,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system
@@ -1431,6 +1440,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system
apc = LIST_ENTRY( ptr, struct thread_apc, entry );
list_remove( ptr );
}
@@ -304,10 +304,10 @@ index fd6b91b228a..8d7c520ced7 100644
}
diff --git a/server/thread.h b/server/thread.h
index 9129e473ba9..10e9e28b432 100644
index e826a7a25de..c320ac83af7 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -56,6 +56,7 @@ struct thread
@@ -57,6 +57,7 @@ struct thread
thread_id_t id; /* thread id */
struct list mutex_list; /* list of currently owned mutexes */
int esync_fd; /* esync file descriptor (signalled on exit) */
@@ -316,5 +316,5 @@ index 9129e473ba9..10e9e28b432 100644
struct msg_queue *queue; /* message queue */
struct thread_wait *wait; /* current wait condition if sleeping */
--
2.43.0
2.47.2

View File

@@ -0,0 +1,36 @@
From 764a3b19afc7519fa9568a402e094a944d56055c Mon Sep 17 00:00:00 2001
From: Akihiro Sagawa <sagawa.aki@gmail.com>
Date: Sun, 1 Jun 2025 15:42:40 +1000
Subject: [PATCH] kernel32: Limit old exe to 3MB available space
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=44931
---
dlls/kernel32/heap.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c
index 1ec2f5cce0d..834f4d07e9b 100644
--- a/dlls/kernel32/heap.c
+++ b/dlls/kernel32/heap.c
@@ -475,12 +475,15 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer )
if ( lpBuffer->dwAvailPhys + lpBuffer->dwAvailPageFile >= 2U*1024*1024*1024)
lpBuffer->dwAvailPageFile = 2U*1024*1024*1024 - lpBuffer->dwAvailPhys - 1;
- /* limit page file size for really old binaries */
+ /* limit value for really old binaries */
+ /* use MAXLONG/2, so that dwAvailPhys + dwAvailPageFile < MAXLONG */
if (nt->OptionalHeader.MajorSubsystemVersion < 4 ||
nt->OptionalHeader.MajorOperatingSystemVersion < 4)
{
- if (lpBuffer->dwTotalPageFile > MAXLONG) lpBuffer->dwTotalPageFile = MAXLONG;
- if (lpBuffer->dwAvailPageFile > MAXLONG) lpBuffer->dwAvailPageFile = MAXLONG;
+ lpBuffer->dwTotalPhys = min(lpBuffer->dwTotalPhys, MAXLONG / 2);
+ lpBuffer->dwAvailPhys = min(lpBuffer->dwAvailPhys, MAXLONG / 2);
+ lpBuffer->dwTotalPageFile = min(lpBuffer->dwTotalPageFile, MAXLONG / 2);
+ lpBuffer->dwAvailPageFile = min(lpBuffer->dwAvailPageFile, MAXLONG / 2);
}
#endif
--
2.47.2

View File

@@ -0,0 +1 @@
Fixes: [44931] kernel32: Limit old exe to 3MB available space

View File

@@ -1,7 +1,7 @@
From a34c3f550b16e84f907c637514f0645456420d65 Mon Sep 17 00:00:00 2001
From 00991099552d2c3e24ef04d379755bdea2a80941 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 12:46:30 -0700
Subject: [PATCH] kernelbase: Add support for moving reparse points with
Subject: [PATCH 1/1] kernelbase: Add support for moving reparse points with
MoveFile*.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
@@ -13,10 +13,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
4 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index b7d16410d75..dccae6cb565 100644
index 266d59ef58d..d1fcf22f0d9 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -2514,7 +2514,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH MoveFileWithProgressW( const WCHAR *source, const
@@ -2535,7 +2535,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH MoveFileWithProgressW( const WCHAR *source, const
InitializeObjectAttributes( &attr, &nt_name, OBJ_CASE_INSENSITIVE, 0, NULL );
status = NtOpenFile( &source_handle, DELETE | SYNCHRONIZE, &attr, &io,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
@@ -26,10 +26,10 @@ index b7d16410d75..dccae6cb565 100644
if (!set_ntstatus( status )) goto error;
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 8b561e162e8..7b6e2776947 100644
index 8d4de8ae29a..ddc0e024b2e 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -6021,7 +6021,8 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, ULONG flags,
@@ -6025,7 +6025,8 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, ULONG flags,
static void test_reparse_points(void)
{
@@ -39,7 +39,7 @@ index 8b561e162e8..7b6e2776947 100644
static const WCHAR reparseW[] = {'\\','r','e','p','a','r','s','e',0};
static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0};
static const WCHAR parentW[] = {'\\','.','.','\\',0};
@@ -6392,6 +6393,15 @@ static void test_reparse_points(void)
@@ -6396,6 +6397,15 @@ static void test_reparse_points(void)
wine_dbgstr_w(dest), wine_dbgstr_w(rel_target));
CloseHandle(handle);
@@ -56,21 +56,19 @@ index 8b561e162e8..7b6e2776947 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index d3045c6c936..49afb57b2b6 100644
index 681a9cf4c6f..7f8974c9b04 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5556,8 +5556,10 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
{
FILE_RENAME_INFORMATION *info = ptr;
@@ -5581,6 +5581,8 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
unsigned int flags;
+ REPARSE_DATA_BUFFER *buffer = NULL;
UNICODE_STRING name_str, redir;
OBJECT_ATTRIBUTES attr;
+ REPARSE_DATA_BUFFER *buffer = NULL;
+ ULONG buffer_len = 0;
char *unix_name;
if (class == FileRenameInformation)
@@ -5574,6 +5576,19 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
if (class == FileLinkInformation)
@@ -5597,6 +5599,19 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
InitializeObjectAttributes( &attr, &name_str, OBJ_CASE_INSENSITIVE, info->RootDirectory, NULL );
get_redirect( &attr, &redir );
@@ -90,7 +88,7 @@ index d3045c6c936..49afb57b2b6 100644
status = nt_to_unix_file_name( &attr, &unix_name, FILE_OPEN_IF );
if (status == STATUS_SUCCESS || status == STATUS_NO_SUCH_FILE)
{
@@ -5590,9 +5605,14 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
@@ -5613,9 +5628,14 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
}
SERVER_END_REQ;

View File

@@ -1,4 +1,4 @@
From 8b9d023ce5ef1a063fe1db248255c7d774976890 Mon Sep 17 00:00:00 2001
From 74faace74b9343d64ff88b16577773bd08513eca 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,10 +20,10 @@ index 3742968c415..084469a2820 100644
SOURCES = \
atom.c \
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
index e3f3efa5bfc..1066bfdbdec 100644
index f5db5cdc6e2..0bd086c71fb 100644
--- a/dlls/ntdll/tests/rtl.c
+++ b/dlls/ntdll/tests/rtl.c
@@ -38,6 +38,9 @@
@@ -39,6 +39,9 @@
#include "wine/test.h"
#include "wine/asm.h"
#include "wine/rbtree.h"
@@ -33,7 +33,7 @@ index e3f3efa5bfc..1066bfdbdec 100644
#ifndef __WINE_WINTERNL_H
@@ -121,6 +124,9 @@ static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *);
@@ -122,6 +125,9 @@ static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *);
static void * (WINAPI *pRtlLookupElementGenericTable)(PRTL_GENERIC_TABLE, void *);
static ULONG (WINAPI *pRtlNumberGenericTableElements)(PRTL_GENERIC_TABLE);
static NTSTATUS (WINAPI *pLdrEnumerateLoadedModules)(void *, void *, void *);
@@ -43,7 +43,7 @@ index e3f3efa5bfc..1066bfdbdec 100644
static NTSTATUS (WINAPI *pLdrRegisterDllNotification)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, void *, void **);
static NTSTATUS (WINAPI *pLdrUnregisterDllNotification)(void *);
static VOID (WINAPI *pRtlGetDeviceFamilyInfoEnum)(ULONGLONG *,DWORD *,DWORD *);
@@ -192,6 +198,9 @@ static void InitFunctionPtrs(void)
@@ -194,6 +200,9 @@ static void InitFunctionPtrs(void)
pRtlLookupElementGenericTable = (void *)GetProcAddress(hntdll, "RtlLookupElementGenericTable");
pRtlNumberGenericTableElements = (void *)GetProcAddress(hntdll, "RtlNumberGenericTableElements");
pLdrEnumerateLoadedModules = (void *)GetProcAddress(hntdll, "LdrEnumerateLoadedModules");
@@ -52,8 +52,8 @@ index e3f3efa5bfc..1066bfdbdec 100644
+ pRtlAbsoluteToSelfRelativeSD = (void *)GetProcAddress(hntdll, "RtlAbsoluteToSelfRelativeSD");
pLdrRegisterDllNotification = (void *)GetProcAddress(hntdll, "LdrRegisterDllNotification");
pLdrUnregisterDllNotification = (void *)GetProcAddress(hntdll, "LdrUnregisterDllNotification");
pRtlDeriveCapabilitySidsFromName = (void *)GetProcAddress(hntdll, "RtlDeriveCapabilitySidsFromName");
@@ -3764,6 +3773,76 @@ static void test_RtlFirstFreeAce(void)
pRtlCreateServiceSid = (void *)GetProcAddress(hntdll, "RtlCreateServiceSid");
@@ -3767,6 +3776,76 @@ static void test_RtlFirstFreeAce(void)
HeapFree(GetProcessHeap(), 0, acl);
}
@@ -130,7 +130,7 @@ index e3f3efa5bfc..1066bfdbdec 100644
static void test_RtlInitializeSid(void)
{
SID_IDENTIFIER_AUTHORITY sid_ident = { SECURITY_NT_AUTHORITY };
@@ -5487,6 +5566,7 @@ START_TEST(rtl)
@@ -5515,6 +5594,7 @@ START_TEST(rtl)
test_RtlInitializeCriticalSectionEx();
test_RtlLeaveCriticalSection();
test_LdrEnumerateLoadedModules();

View File

@@ -64,7 +64,7 @@ index fb5259d8714..93020158d0b 100644
+static void sigsys_handler( int signal, siginfo_t *siginfo, void *sigcontext )
+{
+ extern const void *__wine_syscall_dispatcher_prolog_end_ptr;
+ struct syscall_frame *frame = amd64_thread_data()->syscall_frame;
+ struct syscall_frame *frame = get_syscall_frame();
+ ucontext_t *ctx = sigcontext;
+
+ TRACE_(seh)("SIGSYS, rax %#llx, rip %#llx.\n", ctx->uc_mcontext.gregs[REG_RAX],
@@ -171,7 +171,7 @@ index fb5259d8714..93020158d0b 100644
+ BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
+ };
+ long (*test_syscall)(long sc_number);
+ struct syscall_frame *frame = amd64_thread_data()->syscall_frame;
+ struct syscall_frame *frame = get_syscall_frame();
+ struct sock_fprog prog;
+ NTSTATUS status;
+
@@ -189,7 +189,7 @@ index fb5259d8714..93020158d0b 100644
+
+ sigaction(SIGSYS, sig_act, NULL);
+
+ frame->syscall_flags = syscall_flags;
+
+
+
+ test_syscall = mmap((void *)0x600000000000, 0x1000, PROT_EXEC | PROT_READ | PROT_WRITE,

View File

@@ -1,4 +1,4 @@
From 1fbb361023f9474a3522762aae32ad64d056e37e Mon Sep 17 00:00:00 2001
From 537fd63e028ce58f4b5dfead7a9fc2a64692fa1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= <gabrielopcode@gmail.com>
Date: Fri, 24 May 2019 15:09:35 +0300
Subject: [PATCH] ntdll/server: Mark drive_c as case-insensitive when created
@@ -13,7 +13,7 @@ Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
1 file changed, 43 insertions(+)
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index ab9d99c4f47..f40897757e3 100644
index 159b62f268d..66685f4a87b 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -49,6 +49,10 @@
@@ -27,9 +27,9 @@ index ab9d99c4f47..f40897757e3 100644
#ifdef HAVE_SYS_PRCTL_H
# include <sys/prctl.h>
#endif
@@ -83,6 +87,22 @@
@@ -85,6 +89,22 @@
WINE_DEFAULT_DEBUG_CHANNEL(server);
WINE_DECLARE_DEBUG_CHANNEL(syscall);
+/* just in case... */
+#undef EXT2_IOC_GETFLAGS
@@ -50,7 +50,7 @@ index ab9d99c4f47..f40897757e3 100644
#ifndef MSG_CMSG_CLOEXEC
#define MSG_CMSG_CLOEXEC 0
#endif
@@ -1137,6 +1157,28 @@ static const char *init_server_dir( dev_t dev, ino_t ino )
@@ -1291,6 +1311,28 @@ static const char *init_server_dir( dev_t dev, ino_t ino )
}
@@ -79,7 +79,7 @@ index ab9d99c4f47..f40897757e3 100644
/***********************************************************************
* setup_config_dir
*
@@ -1173,6 +1215,7 @@ static int setup_config_dir(void)
@@ -1327,6 +1369,7 @@ static int setup_config_dir(void)
if (!mkdir( "dosdevices", 0777 ))
{
mkdir( "drive_c", 0777 );
@@ -88,5 +88,5 @@ index ab9d99c4f47..f40897757e3 100644
symlink( "/", "dosdevices/z:" );
}
--
2.34.1
2.47.2

View File

@@ -1,4 +1,4 @@
From 2b9d0c9e955f188d5e5ba2311ed96ff9821f7d44 Mon Sep 17 00:00:00 2001
From 40a771ea3f017a017f949063e7fbe8d1c8d5cf0c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 30 Mar 2015 12:32:34 +0200
Subject: [PATCH] server: Add a helper function set_sd_from_token_internal to
@@ -10,10 +10,10 @@ Subject: [PATCH] server: Add a helper function set_sd_from_token_internal to
2 files changed, 40 insertions(+), 22 deletions(-)
diff --git a/server/object.c b/server/object.c
index 1a3bff65969..d46dbf01b6f 100644
index 4f34d2979dc..fe9df4b2882 100644
--- a/server/object.c
+++ b/server/object.c
@@ -563,8 +563,9 @@ struct security_descriptor *default_get_sd( struct object *obj )
@@ -652,8 +652,9 @@ struct security_descriptor *default_get_sd( struct object *obj )
return obj->sd;
}
@@ -25,7 +25,7 @@ index 1a3bff65969..d46dbf01b6f 100644
{
struct security_descriptor new_sd, *new_sd_ptr;
int present;
@@ -573,8 +574,6 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
@@ -662,8 +663,6 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
struct acl *replaced_sacl = NULL;
char *ptr;
@@ -34,7 +34,7 @@ index 1a3bff65969..d46dbf01b6f 100644
new_sd.control = sd->control & ~SE_SELF_RELATIVE;
if (set_info & OWNER_SECURITY_INFORMATION && sd->owner_len)
@@ -582,10 +581,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
@@ -671,10 +670,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
owner = sd_get_owner( sd );
new_sd.owner_len = sd->owner_len;
}
@@ -48,7 +48,7 @@ index 1a3bff65969..d46dbf01b6f 100644
}
else if (token)
{
@@ -599,10 +598,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
@@ -688,10 +687,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
group = sd_get_group( sd );
new_sd.group_len = sd->group_len;
}
@@ -62,7 +62,7 @@ index 1a3bff65969..d46dbf01b6f 100644
}
else if (token)
{
@@ -620,20 +619,20 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
@@ -709,20 +708,20 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
else if (set_info & LABEL_SECURITY_INFORMATION && present)
{
const struct acl *old_sacl = NULL;
@@ -88,7 +88,7 @@ index 1a3bff65969..d46dbf01b6f 100644
}
else
new_sd.sacl_len = 0;
@@ -647,12 +646,12 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
@@ -736,12 +735,12 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
}
else
{
@@ -104,7 +104,7 @@ index 1a3bff65969..d46dbf01b6f 100644
}
else if (token)
{
@@ -668,7 +667,7 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
@@ -757,7 +756,7 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
if (!ptr)
{
free( replaced_sacl );
@@ -113,7 +113,7 @@ index 1a3bff65969..d46dbf01b6f 100644
}
new_sd_ptr = (struct security_descriptor*)ptr;
@@ -679,9 +678,25 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
@@ -768,9 +767,25 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
mem_append( ptr, dacl, new_sd.dacl_len );
free( replaced_sacl );
@@ -143,7 +143,7 @@ index 1a3bff65969..d46dbf01b6f 100644
/** Set the security descriptor using the current primary token for defaults. */
diff --git a/server/object.h b/server/object.h
index e38913d430d..e61d29d91ea 100644
index ecdac2669e1..7cf84ed281e 100644
--- a/server/object.h
+++ b/server/object.h
@@ -175,6 +175,9 @@ extern struct fd *no_get_fd( struct object *obj );
@@ -155,7 +155,7 @@ index e38913d430d..e61d29d91ea 100644
+ unsigned int set_info, struct token *token );
extern int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd,
unsigned int set_info, struct token *token );
extern WCHAR *no_get_full_name( struct object *obj, data_size_t *ret_len );
extern WCHAR *no_get_full_name( struct object *obj, data_size_t max, data_size_t *ret_len );
--
2.45.2
2.47.2

View File

@@ -1,4 +1,4 @@
From 3b4b41d03d84560e9da893815d5f4b820bdb8be9 Mon Sep 17 00:00:00 2001
From 1adf055005de5589212c1936d80cb676a899e4cf Mon Sep 17 00:00:00 2001
From: Mark Jansen <learn0more+wine@gmail.com>
Date: Fri, 27 Feb 2015 21:24:58 +0100
Subject: [PATCH] version: Test for VerQueryValueA (try 2)
@@ -18,10 +18,10 @@ suggested by nsivov from #winehackers.
1 file changed, 124 insertions(+)
diff --git a/dlls/version/tests/info.c b/dlls/version/tests/info.c
index 31d4a8d11dc..586e02d4a85 100644
index b498f5331c8..c56c98d6b15 100644
--- a/dlls/version/tests/info.c
+++ b/dlls/version/tests/info.c
@@ -715,6 +715,129 @@ static void test_VerQueryValue_EmptyData(void)
@@ -723,6 +723,129 @@ static void test_VerQueryValue_EmptyData(void)
HeapFree(GetProcessHeap(), 0, ver);
}
@@ -151,14 +151,14 @@ index 31d4a8d11dc..586e02d4a85 100644
static void test_extra_block(void)
{
WORD extra_block[] = {
@@ -875,6 +998,7 @@ START_TEST(info)
@@ -983,6 +1106,7 @@ START_TEST(info)
test_32bit_win();
test_VerQueryValueA();
test_VerQueryValue_EmptyData();
+ test_VerQueryValue_InvalidLength();
test_extra_block();
test_GetFileVersionInfoEx();
}
test_wow64_redirection();
--
2.47.2

View File

@@ -0,0 +1,308 @@
From 96b79c613055cef6f2da2015081adf61bd88becd Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 28 May 2025 07:14:59 +1000
Subject: [PATCH] Updated vkd3d to 87ec2d98973432531d7d9d08dfc837376f91844c.
---
libs/vkd3d/libs/vkd3d-shader/dxbc.c | 10 +-
libs/vkd3d/libs/vkd3d-shader/dxil.c | 8 +-
libs/vkd3d/libs/vkd3d-shader/fx.c | 106 ++++++++++++++++----
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 2 +-
libs/vkd3d/libs/vkd3d-shader/spirv.c | 2 +-
libs/vkd3d/libs/vkd3d-shader/tpf.c | 4 +-
6 files changed, 100 insertions(+), 32 deletions(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxbc.c b/libs/vkd3d/libs/vkd3d-shader/dxbc.c
index 9e3a57132a1..45a45c3ad4a 100644
--- a/libs/vkd3d/libs/vkd3d-shader/dxbc.c
+++ b/libs/vkd3d/libs/vkd3d-shader/dxbc.c
@@ -388,7 +388,7 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
{
WARN("Invalid data size %#zx.\n", section->data.size);
vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_SIGNATURE,
- "Section size %zu is smaller than the minimum signature header size.\n", section->data.size);
+ "Section size %zu is smaller than the minimum signature header size.", section->data.size);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -402,7 +402,7 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
{
WARN("Invalid header size %#x.\n", header_size);
vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_SIGNATURE,
- "Signature header size %#x is invalid.\n", header_size);
+ "Signature header size %#x is invalid.", header_size);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
skip_dword_unknown(&ptr, i - 2);
@@ -438,7 +438,7 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
|| !(e[i].semantic_name = vkd3d_strdup(name)))
{
vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_STRING_REFERENCE,
- "Element %u has invalid semantic name reference %#zx (data size %#zx).\n",
+ "Element %u has invalid semantic name reference %#zx (data size %#zx).",
i, name_offset, section->data.size);
fail = true;
}
@@ -447,7 +447,7 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
if ((e[i].component_type = read_u32(&ptr)) > VKD3D_SHADER_COMPONENT_FLOAT)
{
vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_COMPONENT_TYPE,
- "Element %u has invalid component type %#x.\n", i, e[i].component_type);
+ "Element %u has invalid component type %#x.", i, e[i].component_type);
fail = true;
}
e[i].register_index = read_u32(&ptr);
@@ -531,7 +531,7 @@ static int shdr_parse_features(const struct vkd3d_shader_dxbc_section_desc *sect
{
WARN("Invalid data size %#zx.\n", section->data.size);
vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_SIZE,
- "SFI0 section size %zu is too small to contain flags.\n", section->data.size);
+ "SFI0 section size %zu is too small to contain flags.", section->data.size);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
flags = read_u64(&ptr);
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
index c9e99c6a9ba..9a4d194586b 100644
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
@@ -6343,7 +6343,7 @@ static enum vkd3d_shader_opcode sm6_dx_map_wave_bit_op(enum dxil_wave_bit_op_kin
default:
FIXME("Unhandled wave bit op %u.\n", op);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_UNHANDLED_INTRINSIC,
- "Wave bit operation %u is unhandled.\n", op);
+ "Wave bit operation %u is unhandled.", op);
return VKD3DSIH_INVALID;
}
}
@@ -6389,7 +6389,7 @@ static enum vkd3d_shader_opcode sm6_dx_map_wave_op(enum dxil_wave_op_kind op, bo
default:
FIXME("Unhandled wave op %u.\n", op);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_UNHANDLED_INTRINSIC,
- "Wave operation %u is unhandled.\n", op);
+ "Wave operation %u is unhandled.", op);
return VKD3DSIH_INVALID;
}
}
@@ -6892,7 +6892,7 @@ static enum vkd3d_shader_opcode sm6_map_cast_op(uint64_t code, const struct sm6_
default:
FIXME("Unhandled cast op %"PRIu64".\n", code);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
- "Cast operation %"PRIu64" is unhandled.\n", code);
+ "Cast operation %"PRIu64" is unhandled.", code);
return VKD3DSIH_INVALID;
}
@@ -6900,7 +6900,7 @@ static enum vkd3d_shader_opcode sm6_map_cast_op(uint64_t code, const struct sm6_
{
FIXME("Invalid types %u and/or %u for op %"PRIu64".\n", from->class, to->class, code);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
- "Cast operation %"PRIu64" from type class %u, width %u to type class %u, width %u is invalid.\n",
+ "Cast operation %"PRIu64" from type class %u, width %u to type class %u, width %u is invalid.",
code, from->class, from->u.width, to->class, to->u.width);
return VKD3DSIH_INVALID;
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/fx.c b/libs/vkd3d/libs/vkd3d-shader/fx.c
index c475a46da42..1d5f95fa988 100644
--- a/libs/vkd3d/libs/vkd3d-shader/fx.c
+++ b/libs/vkd3d/libs/vkd3d-shader/fx.c
@@ -1547,12 +1547,33 @@ static uint32_t get_fx_2_type_class(const struct hlsl_type *type)
return hlsl_sm1_class(type);
}
-static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *name,
- const struct hlsl_semantic *semantic, bool is_combined_sampler, struct fx_write_context *fx)
+struct fx_2_write_type_context
{
- struct vkd3d_bytecode_buffer *buffer = &fx->unstructured;
- uint32_t semantic_offset, offset, elements_count = 0, name_offset;
- size_t i;
+ uint32_t *names;
+ uint32_t *semantics;
+ uint32_t count;
+
+ uint32_t offset;
+
+ bool is_combined_sampler;
+ struct fx_write_context *fx;
+};
+
+static void count_type_iter(const struct hlsl_type *type, const char *name,
+ const struct hlsl_semantic *semantic, void *context)
+{
+ struct fx_2_write_type_context *ctx = context;
+
+ ++ctx->count;
+}
+
+static void write_fx_2_type_iter(const struct hlsl_type *type, const char *name,
+ const struct hlsl_semantic *semantic, void *context)
+{
+ struct fx_2_write_type_context *ctx = context;
+ struct fx_write_context *fx = ctx->fx;
+ struct vkd3d_bytecode_buffer *buffer;
+ uint32_t offset, elements_count = 0;
/* Resolve arrays to element type and number of elements. */
if (type->class == HLSL_CLASS_ARRAY)
@@ -1561,13 +1582,11 @@ static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *n
type = hlsl_get_multiarray_element_type(type);
}
- name_offset = write_string(name, fx);
- semantic_offset = semantic->raw_name ? write_string(semantic->raw_name, fx) : 0;
-
- offset = put_u32(buffer, hlsl_sm1_base_type(type, is_combined_sampler));
+ buffer = &fx->unstructured;
+ offset = put_u32(buffer, hlsl_sm1_base_type(type, ctx->is_combined_sampler));
put_u32(buffer, get_fx_2_type_class(type));
- put_u32(buffer, name_offset);
- put_u32(buffer, semantic_offset);
+ *ctx->names++ = put_u32(buffer, 0);
+ *ctx->semantics++ = put_u32(buffer, 0);
put_u32(buffer, elements_count);
switch (type->class)
@@ -1592,19 +1611,68 @@ static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *n
;
}
+ /* Save the offset of the top level type. */
+ if (!ctx->offset)
+ ctx->offset = offset;
+}
+
+static void write_fx_2_type_strings_iter(const struct hlsl_type *type, const char *name,
+ const struct hlsl_semantic *semantic, void *context)
+{
+ struct fx_2_write_type_context *ctx = context;
+ struct fx_write_context *fx = ctx->fx;
+ struct vkd3d_bytecode_buffer *buffer;
+
+ buffer = &fx->unstructured;
+ set_u32(buffer, *ctx->names++, write_string(name, fx));
+ set_u32(buffer, *ctx->semantics++, semantic->raw_name ? write_string(semantic->raw_name, fx) : 0);
+}
+
+static void foreach_type(const struct hlsl_type *type, const char *name, const struct hlsl_semantic *semantic,
+ void (*iter_func)(const struct hlsl_type *type, const char *name, const struct hlsl_semantic *semantic, void *context),
+ void *context)
+{
+ iter_func(type, name, semantic, context);
+
+ type = hlsl_get_multiarray_element_type(type);
if (type->class == HLSL_CLASS_STRUCT)
{
- for (i = 0; i < type->e.record.field_count; ++i)
+ for (size_t i = 0; i < type->e.record.field_count; ++i)
{
const struct hlsl_struct_field *field = &type->e.record.fields[i];
-
- /* Validated in check_invalid_object_fields(). */
- VKD3D_ASSERT(hlsl_is_numeric_type(field->type));
- write_fx_2_parameter(field->type, field->name, &field->semantic, false, fx);
+ foreach_type(field->type, field->name, &field->semantic, iter_func, context);
}
}
+}
- return offset;
+static uint32_t write_fx_2_parameter(const struct hlsl_ir_var *var, struct fx_write_context *fx)
+{
+ struct fx_2_write_type_context ctx = { .fx = fx, .is_combined_sampler = var->is_combined_sampler };
+ uint32_t *offsets;
+
+ /* Parameter type information has to be stored in a contiguous segment, so
+ * that any structure fields come right after each other. To achieve that
+ * the variable length string data is written after the type data. */
+
+ /* Calculate the number of string entries needed for this type. */
+ foreach_type(var->data_type, var->name, &var->semantic, count_type_iter, &ctx);
+
+ if (!(offsets = calloc(ctx.count, 2 * sizeof(*offsets))))
+ return 0;
+
+ /* Writing type information also sets string offsets. */
+ ctx.names = offsets;
+ ctx.semantics = &offsets[ctx.count];
+ foreach_type(var->data_type, var->name, &var->semantic, write_fx_2_type_iter, &ctx);
+
+ /* Now the final pass to write the string data. */
+ ctx.names = offsets;
+ ctx.semantics = &offsets[ctx.count];
+ foreach_type(var->data_type, var->name, &var->semantic, write_fx_2_type_strings_iter, &ctx);
+
+ free(offsets);
+
+ return ctx.offset;
}
static void write_fx_2_technique(struct hlsl_ir_var *var, struct fx_write_context *fx)
@@ -1876,7 +1944,7 @@ static void write_fx_2_parameters(struct fx_write_context *fx)
if (!is_type_supported_fx_2(ctx, var->data_type, &var->loc))
continue;
- desc_offset = write_fx_2_parameter(var->data_type, var->name, &var->semantic, var->is_combined_sampler, fx);
+ desc_offset = write_fx_2_parameter(var, fx);
value_offset = write_fx_2_initial_value(var, fx);
flags = 0;
@@ -1899,7 +1967,7 @@ static void write_fx_2_annotation(struct hlsl_ir_var *var, struct fx_write_conte
struct vkd3d_bytecode_buffer *buffer = &fx->structured;
uint32_t desc_offset, value_offset;
- desc_offset = write_fx_2_parameter(var->data_type, var->name, &var->semantic, var->is_combined_sampler, fx);
+ desc_offset = write_fx_2_parameter(var, fx);
value_offset = write_fx_2_initial_value(var, fx);
put_u32(buffer, desc_offset);
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
index f8f5f65517b..e9d3d2ec8dd 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
@@ -3919,7 +3919,7 @@ static bool lower_separate_samples(struct hlsl_ctx *ctx, struct hlsl_ir_node *in
if (load->texel_offset.node)
{
hlsl_error(ctx, &instr->loc, VKD3D_SHADER_ERROR_HLSL_INCOMPATIBLE_PROFILE,
- "Texel offsets are not supported on profiles lower than 4.0.\n");
+ "Texel offsets are not supported on profiles lower than 4.0.");
return false;
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
index 1f967c22406..a6f34703c2d 100644
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
@@ -4239,7 +4239,7 @@ static bool spirv_compiler_get_register_info(struct spirv_compiler *compiler,
if (!(entry = rb_get(&compiler->symbol_table, &reg_symbol)))
{
spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_REGISTER_TYPE,
- "Unrecognized register (%s).\n", debug_vkd3d_symbol(&reg_symbol));
+ "Unrecognized register (%s).", debug_vkd3d_symbol(&reg_symbol));
memset(register_info, 0, sizeof(*register_info));
return false;
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/tpf.c b/libs/vkd3d/libs/vkd3d-shader/tpf.c
index 59dca87c57d..6042a76c3c4 100644
--- a/libs/vkd3d/libs/vkd3d-shader/tpf.c
+++ b/libs/vkd3d/libs/vkd3d-shader/tpf.c
@@ -1169,7 +1169,7 @@ static void shader_sm4_read_dcl_input_ps(struct vkd3d_shader_instruction *ins, u
WARN("No matching signature element for input register %u with mask %#x.\n",
dst->reg.idx[dst->reg.idx_count - 1].offset, dst->write_mask);
vkd3d_shader_parser_error(&priv->p, VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_DCL,
- "No matching signature element for input register %u with mask %#x.\n",
+ "No matching signature element for input register %u with mask %#x.",
dst->reg.idx[dst->reg.idx_count - 1].offset, dst->write_mask);
}
else
@@ -1195,7 +1195,7 @@ static void shader_sm4_read_dcl_input_ps_siv(struct vkd3d_shader_instruction *in
WARN("No matching signature element for input register %u with mask %#x.\n",
dst->reg.idx[dst->reg.idx_count - 1].offset, dst->write_mask);
vkd3d_shader_parser_error(&priv->p, VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_DCL,
- "No matching signature element for input register %u with mask %#x.\n",
+ "No matching signature element for input register %u with mask %#x.",
dst->reg.idx[dst->reg.idx_count - 1].offset, dst->write_mask);
}
else
--
2.47.2

View File

@@ -1,323 +0,0 @@
From 7827f274ee640bba481bf0092d5ac65b09c90965 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 13 May 2025 07:32:01 +1000
Subject: [PATCH] Updated vkd3d to 3c8fd8a2f273aec73e02ce65260c54290a9739d6.
---
libs/vkd3d/libs/vkd3d-shader/dxil.c | 116 ++++++++++++++++++----------
libs/vkd3d/libs/vkd3d-shader/hlsl.c | 2 +-
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 2 +-
3 files changed, 77 insertions(+), 43 deletions(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
index da872afc265..ca79939a39b 100644
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
@@ -645,9 +645,12 @@ enum sm6_value_type
{
VALUE_TYPE_FUNCTION,
VALUE_TYPE_REG,
- VALUE_TYPE_ICB,
+ VALUE_TYPE_DATA,
VALUE_TYPE_HANDLE,
VALUE_TYPE_SSA,
+ VALUE_TYPE_ICB,
+ VALUE_TYPE_IDXTEMP,
+ VALUE_TYPE_GROUPSHAREDMEM,
VALUE_TYPE_UNDEFINED,
VALUE_TYPE_INVALID,
};
@@ -671,6 +674,22 @@ struct sm6_ssa_data
unsigned int id;
};
+struct sm6_icb_data
+{
+ unsigned int data_id;
+ unsigned int id;
+};
+
+struct sm6_idxtemp_data
+{
+ unsigned int id;
+};
+
+struct sm6_groupsharedmem_data
+{
+ unsigned int id;
+};
+
struct sm6_value
{
const struct sm6_type *type;
@@ -680,9 +699,12 @@ struct sm6_value
union
{
struct sm6_function_data function;
- const struct vkd3d_shader_immediate_constant_buffer *icb;
+ const struct vkd3d_shader_immediate_constant_buffer *data;
struct sm6_handle_data handle;
struct sm6_ssa_data ssa;
+ struct sm6_icb_data icb;
+ struct sm6_idxtemp_data idxtemp;
+ struct sm6_groupsharedmem_data groupsharedmem;
} u;
struct vkd3d_shader_register reg;
};
@@ -2244,6 +2266,9 @@ static inline bool sm6_value_is_register(const struct sm6_value *value)
{
case VALUE_TYPE_REG:
case VALUE_TYPE_SSA:
+ case VALUE_TYPE_ICB:
+ case VALUE_TYPE_IDXTEMP:
+ case VALUE_TYPE_GROUPSHAREDMEM:
case VALUE_TYPE_UNDEFINED:
case VALUE_TYPE_INVALID:
return true;
@@ -2283,9 +2308,9 @@ static bool sm6_value_vector_is_constant_or_undef(const struct sm6_value **value
return true;
}
-static bool sm6_value_is_icb(const struct sm6_value *value)
+static bool sm6_value_is_data(const struct sm6_value *value)
{
- return value->value_type == VALUE_TYPE_ICB;
+ return value->value_type == VALUE_TYPE_DATA;
}
static bool sm6_value_is_ssa(const struct sm6_value *value)
@@ -2425,6 +2450,18 @@ static void sm6_register_from_value(struct vkd3d_shader_register *reg, const str
reg->dimension = sm6_type_is_scalar(value->type) ? VSIR_DIMENSION_SCALAR : VSIR_DIMENSION_VEC4;
break;
+ case VALUE_TYPE_ICB:
+ register_init_with_id(reg, VKD3DSPR_IMMCONSTBUFFER, data_type, value->u.icb.id);
+ break;
+
+ case VALUE_TYPE_IDXTEMP:
+ register_init_with_id(reg, VKD3DSPR_IDXTEMP, data_type, value->u.idxtemp.id);
+ break;
+
+ case VALUE_TYPE_GROUPSHAREDMEM:
+ register_init_with_id(reg, VKD3DSPR_GROUPSHAREDMEM, data_type, value->u.groupsharedmem.id);
+ break;
+
case VALUE_TYPE_UNDEFINED:
case VALUE_TYPE_INVALID:
vsir_register_init(reg, VKD3DSPR_UNDEF, data_type, 0);
@@ -2432,7 +2469,7 @@ static void sm6_register_from_value(struct vkd3d_shader_register *reg, const str
case VALUE_TYPE_FUNCTION:
case VALUE_TYPE_HANDLE:
- case VALUE_TYPE_ICB:
+ case VALUE_TYPE_DATA:
vkd3d_unreachable();
}
}
@@ -3021,13 +3058,6 @@ static float register_get_float_value(const struct vkd3d_shader_register *reg)
return bitcast_uint_to_float(reg->u.immconst_u32[0]);
}
-static inline float sm6_value_get_constant_float(const struct sm6_value *value)
-{
- if (!sm6_value_is_constant(value))
- return UINT_MAX;
- return register_get_float_value(&value->reg);
-}
-
static enum vkd3d_result value_allocate_constant_array(struct sm6_value *dst, const struct sm6_type *type,
const uint64_t *operands, struct sm6_parser *sm6)
{
@@ -3072,8 +3102,8 @@ static enum vkd3d_result value_allocate_constant_array(struct sm6_value *dst, co
return VKD3D_ERROR_OUT_OF_MEMORY;
}
- dst->value_type = VALUE_TYPE_ICB;
- dst->u.icb = icb;
+ dst->value_type = VALUE_TYPE_DATA;
+ dst->u.data = icb;
icb->register_idx = sm6->icb_count++;
icb->data_type = vkd3d_data_type_from_sm6_type(elem_type);
@@ -3477,13 +3507,13 @@ static struct vkd3d_shader_instruction *sm6_parser_add_instruction(struct sm6_pa
static void sm6_parser_declare_icb(struct sm6_parser *sm6, const struct sm6_type *elem_type, unsigned int count,
unsigned int alignment, unsigned int init, struct sm6_value *dst)
{
- enum vkd3d_data_type data_type = vkd3d_data_type_from_sm6_type(elem_type);
struct vkd3d_shader_instruction *ins;
ins = sm6_parser_add_instruction(sm6, VKD3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER);
/* The icb value index will be resolved later so forward references can be handled. */
ins->declaration.icb = (void *)(intptr_t)init;
- register_init_with_id(&dst->reg, VKD3DSPR_IMMCONSTBUFFER, data_type, init);
+ dst->value_type = VALUE_TYPE_ICB;
+ dst->u.icb.data_id = init;
}
static void sm6_parser_declare_indexable_temp(struct sm6_parser *sm6, const struct sm6_type *elem_type,
@@ -3505,21 +3535,24 @@ static void sm6_parser_declare_indexable_temp(struct sm6_parser *sm6, const stru
/* The initialiser value index will be resolved later so forward references can be handled. */
ins->declaration.indexable_temp.initialiser = (void *)(uintptr_t)init;
- register_init_with_id(&dst->reg, VKD3DSPR_IDXTEMP, data_type, ins->declaration.indexable_temp.register_idx);
+ dst->value_type = VALUE_TYPE_IDXTEMP;
+ dst->u.idxtemp.id = ins->declaration.indexable_temp.register_idx;
+ sm6_register_from_value(&dst->reg, dst);
}
static void sm6_parser_declare_tgsm_raw(struct sm6_parser *sm6, const struct sm6_type *elem_type,
unsigned int alignment, unsigned int init, struct sm6_value *dst)
{
- enum vkd3d_data_type data_type = vkd3d_data_type_from_sm6_type(elem_type);
struct vkd3d_shader_instruction *ins;
unsigned int byte_count;
ins = sm6_parser_add_instruction(sm6, VKD3DSIH_DCL_TGSM_RAW);
dst_param_init(&ins->declaration.tgsm_raw.reg);
- register_init_with_id(&ins->declaration.tgsm_raw.reg.reg, VKD3DSPR_GROUPSHAREDMEM, data_type, sm6->tgsm_count++);
- dst->reg = ins->declaration.tgsm_raw.reg.reg;
+ dst->value_type = VALUE_TYPE_GROUPSHAREDMEM;
+ dst->u.groupsharedmem.id = sm6->tgsm_count++;
dst->structure_stride = 0;
+ sm6_register_from_value(&dst->reg, dst);
+ sm6_register_from_value(&ins->declaration.tgsm_raw.reg.reg, dst);
ins->declaration.tgsm_raw.alignment = alignment;
byte_count = elem_type->u.width / 8u;
if (byte_count != 4)
@@ -3536,25 +3569,23 @@ static void sm6_parser_declare_tgsm_raw(struct sm6_parser *sm6, const struct sm6
static void sm6_parser_declare_tgsm_structured(struct sm6_parser *sm6, const struct sm6_type *elem_type,
unsigned int count, unsigned int alignment, unsigned int init, struct sm6_value *dst)
{
- enum vkd3d_data_type data_type = vkd3d_data_type_from_sm6_type(elem_type);
struct vkd3d_shader_instruction *ins;
- unsigned int structure_stride;
ins = sm6_parser_add_instruction(sm6, VKD3DSIH_DCL_TGSM_STRUCTURED);
dst_param_init(&ins->declaration.tgsm_structured.reg);
- register_init_with_id(&ins->declaration.tgsm_structured.reg.reg, VKD3DSPR_GROUPSHAREDMEM,
- data_type, sm6->tgsm_count++);
- dst->reg = ins->declaration.tgsm_structured.reg.reg;
- structure_stride = elem_type->u.width / 8u;
- if (structure_stride != 4)
+ dst->value_type = VALUE_TYPE_GROUPSHAREDMEM;
+ dst->u.groupsharedmem.id = sm6->tgsm_count++;
+ dst->structure_stride = elem_type->u.width / 8u;
+ sm6_register_from_value(&dst->reg, dst);
+ sm6_register_from_value(&ins->declaration.tgsm_structured.reg.reg, dst);
+ if (dst->structure_stride != 4)
{
- FIXME("Unsupported structure stride %u.\n", structure_stride);
+ FIXME("Unsupported structure stride %u.\n", dst->structure_stride);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
- "Structured TGSM byte stride %u is not supported.", structure_stride);
+ "Structured TGSM byte stride %u is not supported.", dst->structure_stride);
}
- dst->structure_stride = structure_stride;
ins->declaration.tgsm_structured.alignment = alignment;
- ins->declaration.tgsm_structured.byte_stride = structure_stride;
+ ins->declaration.tgsm_structured.byte_stride = dst->structure_stride;
ins->declaration.tgsm_structured.structure_count = count;
/* The initialiser value index will be resolved later when forward references can be handled. */
ins->flags = init;
@@ -3717,16 +3748,16 @@ static const struct vkd3d_shader_immediate_constant_buffer *resolve_forward_init
VKD3D_ASSERT(index);
--index;
- if (!(value = sm6_parser_get_value_safe(sm6, index)) || (!sm6_value_is_icb(value) && !sm6_value_is_undef(value)))
+ if (!(value = sm6_parser_get_value_safe(sm6, index)) || (!sm6_value_is_data(value) && !sm6_value_is_undef(value)))
{
WARN("Invalid initialiser index %zu.\n", index);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
"Global variable initialiser value index %zu is invalid.", index);
return NULL;
}
- else if (sm6_value_is_icb(value))
+ else if (sm6_value_is_data(value))
{
- return value->u.icb;
+ return value->u.data;
}
/* In VSIR, initialisation with undefined values of objects is implied, not explicit. */
return NULL;
@@ -3741,14 +3772,14 @@ static bool resolve_forward_zero_initialiser(size_t index, struct sm6_parser *sm
--index;
if (!(value = sm6_parser_get_value_safe(sm6, index))
- || (!sm6_value_is_icb(value) && !sm6_value_is_constant(value) && !sm6_value_is_undef(value)))
+ || (!sm6_value_is_data(value) && !sm6_value_is_constant(value) && !sm6_value_is_undef(value)))
{
WARN("Invalid initialiser index %zu.\n", index);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
"TGSM initialiser value index %zu is invalid.", index);
return false;
}
- else if ((sm6_value_is_icb(value) && value->u.icb->is_null) || sm6_value_is_constant_zero(value))
+ else if ((sm6_value_is_data(value) && value->u.data->is_null) || sm6_value_is_constant_zero(value))
{
return true;
}
@@ -3853,11 +3884,14 @@ static enum vkd3d_result sm6_parser_globals_init(struct sm6_parser *sm6)
const struct vkd3d_shader_immediate_constant_buffer *icb;
struct sm6_value *value = &sm6->values[i];
- if (!sm6_value_is_register(value) || value->reg.type != VKD3DSPR_IMMCONSTBUFFER)
+ if (value->value_type != VALUE_TYPE_ICB)
continue;
- if ((icb = resolve_forward_initialiser(value->reg.idx[0].offset, sm6)))
- value->reg.idx[0].offset = icb->register_idx;
+ if ((icb = resolve_forward_initialiser(value->u.icb.data_id, sm6)))
+ value->u.icb.id = icb->register_idx;
+ else
+ value->u.icb.id = 0;
+ sm6_register_from_value(&value->reg, value);
}
return VKD3D_OK;
@@ -7732,7 +7766,7 @@ static bool sm6_metadata_get_float_value(const struct sm6_parser *sm6,
if (!sm6_type_is_floating_point(value->type))
return false;
- *f = sm6_value_get_constant_float(value);
+ *f = register_get_float_value(&value->reg);
return true;
}
@@ -8610,7 +8644,7 @@ static enum vkd3d_result sm6_parser_metadata_init(struct sm6_parser *sm6, const
if (!(value = sm6_parser_get_value_safe(sm6, value_idx)))
return VKD3D_ERROR_INVALID_SHADER;
- if (!sm6_value_is_constant(value) && !sm6_value_is_undef(value) && !sm6_value_is_icb(value)
+ if (!sm6_value_is_constant(value) && !sm6_value_is_undef(value) && !sm6_value_is_data(value)
&& !sm6_value_is_function_dcl(value))
{
WARN("Value at index %u is not a constant or a function declaration.\n", value_idx);
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.c b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
index 0f9aafbe13e..36c79f4c076 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.c
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
@@ -2687,7 +2687,7 @@ static struct hlsl_ir_node *clone_interlocked(struct hlsl_ctx *ctx,
if (!(dst = hlsl_alloc(ctx, sizeof(*dst))))
return NULL;
- init_node(&dst->node, HLSL_IR_INTERLOCKED, NULL, &src->node.loc);
+ init_node(&dst->node, HLSL_IR_INTERLOCKED, src->node.data_type, &src->node.loc);
dst->op = src->op;
if (!clone_deref(ctx, map, &dst->dst, &src->dst))
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
index 05657d27b38..24c7ae6b00b 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
@@ -4932,7 +4932,7 @@ static bool intrinsic_GetRenderTargetSampleCount(struct hlsl_ctx *ctx,
"GetRenderTargetSampleCount() can only be used from a pixel shader using version 4.1 or higher.");
hlsl_block_add_expr(ctx, params->instrs, HLSL_OP0_RASTERIZER_SAMPLE_COUNT,
- operands, hlsl_get_scalar_type(ctx, HLSL_TYPE_UINT), loc);
+ operands, hlsl_get_vector_type(ctx, HLSL_TYPE_UINT, 1), loc);
return true;
}
--
2.47.2

View File

@@ -0,0 +1,323 @@
From e30c5257409bcdeb321524dc3459cb9e64165a91 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 5 Jun 2025 07:25:40 +1000
Subject: [PATCH] Updated vkd3d to f1b36edc076117970b5a6d05a924b6c4248e082f.
---
libs/vkd3d/libs/vkd3d-shader/dxil.c | 69 ++++++++++++---------
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 55 +++++++++-------
libs/vkd3d/libs/vkd3d-shader/tpf.c | 36 ++++++-----
3 files changed, 91 insertions(+), 69 deletions(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
index c85b644df15..ff56cd6284f 100644
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
@@ -6805,6 +6805,7 @@ static enum vkd3d_shader_opcode sm6_map_cast_op(uint64_t code, const struct sm6_
{
enum vkd3d_shader_opcode op = VKD3DSIH_INVALID;
bool from_int, to_int, from_fp, to_fp;
+ unsigned int from_width, to_width;
bool is_valid = false;
from_int = sm6_type_is_integer(from);
@@ -6828,66 +6829,58 @@ static enum vkd3d_shader_opcode sm6_map_cast_op(uint64_t code, const struct sm6_
return VKD3DSIH_INVALID;
}
- /* DXC emits minimum precision types as 16-bit. These must be emitted
- * as 32-bit in VSIR, so all width extensions to 32 bits are no-ops. */
switch (code)
{
case CAST_TRUNC:
- /* nop or min precision. TODO: native 16-bit */
- if (to->u.width == from->u.width || (to->u.width == 16 && from->u.width == 32))
- op = VKD3DSIH_NOP;
- else
- op = VKD3DSIH_UTOU;
+ op = VKD3DSIH_UTOU;
is_valid = from_int && to_int && to->u.width <= from->u.width;
break;
+
case CAST_ZEXT:
+ op = VKD3DSIH_UTOU;
+ is_valid = from_int && to_int && to->u.width >= from->u.width;
+ break;
+
case CAST_SEXT:
- /* nop or min precision. TODO: native 16-bit.
- * Extension instructions could be emitted for min precision, but in Windows
- * the AMD RX 580 simply drops such instructions, which makes sense as no
- * assumptions should be made about any behaviour which depends on bit width. */
- if (to->u.width == from->u.width || (to->u.width == 32 && from->u.width == 16))
- {
- op = VKD3DSIH_NOP;
- is_valid = from_int && to_int;
- }
- else if (to->u.width > from->u.width)
- {
- op = (code == CAST_ZEXT) ? VKD3DSIH_UTOU : VKD3DSIH_ITOI;
- VKD3D_ASSERT(from->u.width == 1 || to->u.width == 64);
- is_valid = from_int && to_int;
- }
+ op = VKD3DSIH_ITOI;
+ is_valid = from_int && to_int && to->u.width >= from->u.width;
break;
+
case CAST_FPTOUI:
op = VKD3DSIH_FTOU;
is_valid = from_fp && to_int && to->u.width > 1;
break;
+
case CAST_FPTOSI:
op = VKD3DSIH_FTOI;
is_valid = from_fp && to_int && to->u.width > 1;
break;
+
case CAST_UITOFP:
op = VKD3DSIH_UTOF;
is_valid = from_int && to_fp;
break;
+
case CAST_SITOFP:
op = VKD3DSIH_ITOF;
is_valid = from_int && to_fp;
break;
+
case CAST_FPTRUNC:
- /* TODO: native 16-bit */
- op = (from->u.width == 64) ? VKD3DSIH_DTOF : VKD3DSIH_NOP;
- is_valid = from_fp && to_fp;
+ op = VKD3DSIH_DTOF;
+ is_valid = from_fp && to_fp && to->u.width <= from->u.width;
break;
+
case CAST_FPEXT:
- /* TODO: native 16-bit */
- op = (to->u.width == 64) ? VKD3DSIH_FTOD : VKD3DSIH_NOP;
- is_valid = from_fp && to_fp;
+ op = VKD3DSIH_FTOD;
+ is_valid = from_fp && to_fp && to->u.width >= from->u.width;
break;
+
case CAST_BITCAST:
op = VKD3DSIH_MOV;
is_valid = to->u.width == from->u.width;
break;
+
default:
FIXME("Unhandled cast op %"PRIu64".\n", code);
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
@@ -6904,6 +6897,20 @@ static enum vkd3d_shader_opcode sm6_map_cast_op(uint64_t code, const struct sm6_
return VKD3DSIH_INVALID;
}
+ /* 16-bit values are currently treated as 32-bit, because 16-bit is
+ * interpreted as a minimum precision hint in SM 6.0, and we don't handle
+ * SM > 6.0 yet. */
+ from_width = from->u.width;
+ if (from_width == 16)
+ from_width = 32;
+
+ to_width = to->u.width;
+ if (to_width == 16)
+ to_width = 32;
+
+ if (from->class == to->class && from_width == to_width)
+ op = VKD3DSIH_NOP;
+
return op;
}
@@ -6955,9 +6962,11 @@ static void sm6_parser_emit_cast(struct sm6_parser *sm6, const struct dxil_recor
instruction_dst_param_init_ssa_scalar(ins, sm6);
- /* bitcast */
+ /* VSIR bitcasts are represented by source registers with types different
+ * from the types they were written with, rather than with different types
+ * for the MOV source and destination. */
if (handler_idx == VKD3DSIH_MOV)
- src_param->reg.data_type = dst->reg.data_type;
+ src_param->reg.data_type = ins->dst[0].reg.data_type;
}
struct sm6_cmp_info
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
index d4cd338f15a..d4e29e16b7c 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
@@ -12114,14 +12114,11 @@ static void sm4_generate_vsir_add_dcl_texture(struct hlsl_ctx *ctx,
bool uav)
{
enum hlsl_regset regset = uav ? HLSL_REGSET_UAVS : HLSL_REGSET_TEXTURES;
- struct vkd3d_shader_structured_resource *structured_resource;
- struct vkd3d_shader_dst_param *dst_param;
- struct vkd3d_shader_semantic *semantic;
struct vkd3d_shader_instruction *ins;
struct hlsl_type *component_type;
enum vkd3d_shader_opcode opcode;
bool multisampled;
- unsigned int i, j;
+ unsigned int i;
VKD3D_ASSERT(resource->regset == regset);
VKD3D_ASSERT(hlsl_version_lt(ctx, 5, 1) || resource->bind_count == 1);
@@ -12132,6 +12129,7 @@ static void sm4_generate_vsir_add_dcl_texture(struct hlsl_ctx *ctx,
{
unsigned int array_first = resource->index + i;
unsigned int array_last = resource->index + i; /* FIXME: array end. */
+ struct vkd3d_shader_resource *vsir_resource;
if (resource->var && !resource->var->objects_usage[regset][i].used)
continue;
@@ -12169,13 +12167,16 @@ static void sm4_generate_vsir_add_dcl_texture(struct hlsl_ctx *ctx,
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
return;
}
- semantic = &ins->declaration.semantic;
- structured_resource = &ins->declaration.structured_resource;
- dst_param = &semantic->resource.reg;
- vsir_dst_param_init(dst_param, uav ? VKD3DSPR_UAV : VKD3DSPR_RESOURCE, VKD3D_DATA_UNUSED, 0);
- if (uav && component_type->sampler_dim == HLSL_SAMPLER_DIM_STRUCTURED_BUFFER)
- structured_resource->byte_stride = 4 * component_type->e.resource.format->reg_size[HLSL_REGSET_NUMERIC];
+ if (component_type->sampler_dim == HLSL_SAMPLER_DIM_RAW_BUFFER)
+ vsir_resource = &ins->declaration.raw_resource.resource;
+ else if (component_type->sampler_dim == HLSL_SAMPLER_DIM_STRUCTURED_BUFFER)
+ vsir_resource = &ins->declaration.structured_resource.resource;
+ else
+ vsir_resource = &ins->declaration.semantic.resource;
+
+ vsir_dst_param_init(&vsir_resource->reg, uav ? VKD3DSPR_UAV : VKD3DSPR_RESOURCE, VKD3D_DATA_UNUSED, 0);
+
if (uav && component_type->e.resource.rasteriser_ordered)
ins->flags = VKD3DSUF_RASTERISER_ORDERED_VIEW;
@@ -12189,29 +12190,35 @@ static void sm4_generate_vsir_add_dcl_texture(struct hlsl_ctx *ctx,
ctx->profile->major_version, ctx->profile->minor_version);
}
- for (j = 0; j < 4; ++j)
- semantic->resource_data_type[j] = sm4_generate_vsir_get_format_type(component_type);
+ vsir_resource->range.first = array_first;
+ vsir_resource->range.last = array_last;
+ vsir_resource->range.space = resource->space;
- semantic->resource.range.first = array_first;
- semantic->resource.range.last = array_last;
- semantic->resource.range.space = resource->space;
-
- dst_param->reg.idx[0].offset = resource->id;
- dst_param->reg.idx[1].offset = array_first;
- dst_param->reg.idx[2].offset = array_last;
- dst_param->reg.idx_count = 3;
+ vsir_resource->reg.reg.idx[0].offset = resource->id;
+ vsir_resource->reg.reg.idx[1].offset = array_first;
+ vsir_resource->reg.reg.idx[2].offset = array_last;
+ vsir_resource->reg.reg.idx_count = 3;
ins->resource_type = sm4_generate_vsir_get_resource_type(resource->component_type);
- if (resource->component_type->sampler_dim == HLSL_SAMPLER_DIM_RAW_BUFFER)
+
+ if (component_type->sampler_dim == HLSL_SAMPLER_DIM_RAW_BUFFER)
+ {
ins->raw = true;
- if (resource->component_type->sampler_dim == HLSL_SAMPLER_DIM_STRUCTURED_BUFFER)
+ }
+ else if (component_type->sampler_dim == HLSL_SAMPLER_DIM_STRUCTURED_BUFFER)
{
ins->structured = true;
ins->resource_stride = 4 * component_type->e.resource.format->reg_size[HLSL_REGSET_NUMERIC];
+ ins->declaration.structured_resource.byte_stride = ins->resource_stride;
}
+ else
+ {
+ for (unsigned int j = 0; j < 4; ++j)
+ ins->declaration.semantic.resource_data_type[j] = sm4_generate_vsir_get_format_type(component_type);
- if (multisampled)
- semantic->sample_count = component_type->sample_count;
+ if (multisampled)
+ ins->declaration.semantic.sample_count = component_type->sample_count;
+ }
}
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/tpf.c b/libs/vkd3d/libs/vkd3d-shader/tpf.c
index 08bdc3e645a..ae3fa1650bf 100644
--- a/libs/vkd3d/libs/vkd3d-shader/tpf.c
+++ b/libs/vkd3d/libs/vkd3d-shader/tpf.c
@@ -3859,9 +3859,8 @@ static uint32_t pack_resource_data_type(const enum vkd3d_data_type *resource_dat
static void tpf_dcl_texture(const struct tpf_compiler *tpf, const struct vkd3d_shader_instruction *ins)
{
- const struct vkd3d_shader_structured_resource *structured_resource = &ins->declaration.structured_resource;
- const struct vkd3d_shader_semantic *semantic = &ins->declaration.semantic;
const struct vkd3d_shader_version *version = &tpf->program->shader_version;
+ const struct vkd3d_shader_resource *resource;
const struct vkd3d_sm4_opcode_info *info;
struct sm4_instruction instr = {0};
bool uav;
@@ -3875,27 +3874,38 @@ static void tpf_dcl_texture(const struct tpf_compiler *tpf, const struct vkd3d_s
instr.opcode = info->opcode;
- instr.dsts[0] = semantic->resource.reg;
- instr.dst_count = 1;
-
if (ins->opcode == VKD3DSIH_DCL || ins->opcode == VKD3DSIH_DCL_UAV_TYPED)
{
- instr.idx[0] = pack_resource_data_type(semantic->resource_data_type);
+ instr.idx[0] = pack_resource_data_type(ins->declaration.semantic.resource_data_type);
instr.idx_count = 1;
+ instr.extra_bits |= ins->declaration.semantic.sample_count << VKD3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT;
+ resource = &ins->declaration.semantic.resource;
+ }
+ else if (ins->opcode == VKD3DSIH_DCL_RESOURCE_RAW || ins->opcode == VKD3DSIH_DCL_UAV_RAW)
+ {
+ resource = &ins->declaration.raw_resource.resource;
+ }
+ else
+ {
+ instr.byte_stride = ins->declaration.structured_resource.byte_stride;
+ resource = &ins->declaration.structured_resource.resource;
}
+ instr.dsts[0] = resource->reg;
+ instr.dst_count = 1;
+
if (vkd3d_shader_ver_ge(version, 5, 1))
{
- instr.dsts[0].reg.idx[0].offset = semantic->resource.reg.reg.idx[0].offset;
- instr.dsts[0].reg.idx[1].offset = semantic->resource.range.first;
- instr.dsts[0].reg.idx[2].offset = semantic->resource.range.last;
+ instr.dsts[0].reg.idx[0].offset = resource->reg.reg.idx[0].offset;
+ instr.dsts[0].reg.idx[1].offset = resource->range.first;
+ instr.dsts[0].reg.idx[2].offset = resource->range.last;
instr.dsts[0].reg.idx_count = 3;
- instr.idx[instr.idx_count++] = semantic->resource.range.space;
+ instr.idx[instr.idx_count++] = resource->range.space;
}
else
{
- instr.dsts[0].reg.idx[0].offset = semantic->resource.range.first;
+ instr.dsts[0].reg.idx[0].offset = resource->range.first;
instr.dsts[0].reg.idx_count = 1;
}
@@ -3903,10 +3913,6 @@ static void tpf_dcl_texture(const struct tpf_compiler *tpf, const struct vkd3d_s
instr.extra_bits |= ins->flags << VKD3D_SM5_UAV_FLAGS_SHIFT;
instr.extra_bits |= (sm4_resource_dimension(ins->resource_type) << VKD3D_SM4_RESOURCE_TYPE_SHIFT);
- instr.extra_bits |= semantic->sample_count << VKD3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT;
-
- if (ins->structured)
- instr.byte_stride = structured_resource->byte_stride;
write_sm4_instruction(tpf, &instr);
}
--
2.47.2

View File

@@ -1,448 +0,0 @@
From 9520c6e767ef9d5e1c1024f56a20383c5692078b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 15 May 2025 06:43:50 +1000
Subject: [PATCH] Updated vkd3d to f5a26fd2b881d0fe602022c446ecfee45e1252b3.
---
libs/vkd3d/include/private/vkd3d_version.h | 2 +-
libs/vkd3d/include/vkd3d_shader.h | 5 +++
libs/vkd3d/libs/vkd3d-shader/hlsl.c | 43 +++++++++++++++++++
libs/vkd3d/libs/vkd3d-shader/hlsl.h | 4 ++
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 14 ++++--
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 42 ++++++------------
.../libs/vkd3d-shader/hlsl_constant_ops.c | 9 ++--
libs/vkd3d/libs/vkd3d-shader/ir.c | 10 ++++-
libs/vkd3d/libs/vkd3d-shader/spirv.c | 14 +++---
9 files changed, 92 insertions(+), 51 deletions(-)
diff --git a/libs/vkd3d/include/private/vkd3d_version.h b/libs/vkd3d/include/private/vkd3d_version.h
index fb2e2f11f8b..f71f90e6b78 100644
--- a/libs/vkd3d/include/private/vkd3d_version.h
+++ b/libs/vkd3d/include/private/vkd3d_version.h
@@ -1 +1 @@
-#define VKD3D_VCS_ID " (git 4289ec60)"
+#define VKD3D_VCS_ID " (git f5a26fd2)"
diff --git a/libs/vkd3d/include/vkd3d_shader.h b/libs/vkd3d/include/vkd3d_shader.h
index 6b2805e8759..1b7bdd196bb 100644
--- a/libs/vkd3d/include/vkd3d_shader.h
+++ b/libs/vkd3d/include/vkd3d_shader.h
@@ -2740,6 +2740,10 @@ VKD3D_SHADER_API const enum vkd3d_shader_target_type *vkd3d_shader_get_supported
* source code or byte code.
*
* This version of vkd3d-shader supports the following transformations:
+ * - VKD3D_SHADER_SOURCE_DXBC_DXIL to VKD3D_SHADER_TARGET_SPIRV_BINARY
+ * - VKD3D_SHADER_SOURCE_DXBC_DXIL to VKD3D_SHADER_TARGET_SPIRV_TEXT
+ * (if vkd3d was compiled with SPIRV-Tools)
+ * - VKD3D_SHADER_SOURCE_DXBC_DXIL to VKD3D_SHADER_TARGET_D3D_ASM
* - VKD3D_SHADER_SOURCE_DXBC_TPF to VKD3D_SHADER_TARGET_SPIRV_BINARY
* - VKD3D_SHADER_SOURCE_DXBC_TPF to VKD3D_SHADER_TARGET_SPIRV_TEXT
* (if vkd3d was compiled with SPIRV-Tools)
@@ -2952,6 +2956,7 @@ VKD3D_SHADER_API int vkd3d_shader_convert_root_signature(struct vkd3d_shader_ver
* VKD3D_SHADER_RESOURCE_DATA_FLOAT.)
*
* Currently this function supports the following code types:
+ * - VKD3D_SHADER_SOURCE_DXBC_DXIL
* - VKD3D_SHADER_SOURCE_DXBC_TPF
* - VKD3D_SHADER_SOURCE_D3D_BYTECODE
*
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.c b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
index 36c79f4c076..653ddd2e8be 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.c
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.c
@@ -319,6 +319,28 @@ bool hlsl_type_is_shader(const struct hlsl_type *type)
return false;
}
+bool hlsl_type_is_minimum_precision(const struct hlsl_type *type)
+{
+ if (!hlsl_is_numeric_type(type))
+ return false;
+
+ switch (type->e.numeric.type)
+ {
+ case HLSL_TYPE_BOOL:
+ case HLSL_TYPE_DOUBLE:
+ case HLSL_TYPE_FLOAT:
+ case HLSL_TYPE_HALF:
+ case HLSL_TYPE_INT:
+ case HLSL_TYPE_UINT:
+ return false;
+
+ case HLSL_TYPE_MIN16UINT:
+ return true;
+ }
+
+ vkd3d_unreachable();
+}
+
bool hlsl_type_is_patch_array(const struct hlsl_type *type)
{
return type->class == HLSL_CLASS_ARRAY && (type->e.array.array_type == HLSL_ARRAY_PATCH_INPUT
@@ -350,6 +372,27 @@ bool hlsl_base_type_is_integer(enum hlsl_base_type type)
vkd3d_unreachable();
}
+bool hlsl_type_is_signed_integer(const struct hlsl_type *type)
+{
+ VKD3D_ASSERT(hlsl_is_numeric_type(type));
+
+ switch (type->e.numeric.type)
+ {
+ case HLSL_TYPE_INT:
+ return true;
+
+ case HLSL_TYPE_BOOL:
+ case HLSL_TYPE_DOUBLE:
+ case HLSL_TYPE_FLOAT:
+ case HLSL_TYPE_HALF:
+ case HLSL_TYPE_MIN16UINT:
+ case HLSL_TYPE_UINT:
+ return false;
+ }
+
+ vkd3d_unreachable();
+}
+
bool hlsl_type_is_integer(const struct hlsl_type *type)
{
VKD3D_ASSERT(hlsl_is_numeric_type(type));
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.h b/libs/vkd3d/libs/vkd3d-shader/hlsl.h
index 9eb86534f81..58f579cd9f9 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.h
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.h
@@ -234,6 +234,8 @@ struct hlsl_type
/* Offset where the type's description starts in the output bytecode, in bytes. */
size_t bytecode_offset;
+ bool is_typedef;
+
uint32_t is_minimum_precision : 1;
};
@@ -1771,10 +1773,12 @@ unsigned int hlsl_type_get_component_offset(struct hlsl_ctx *ctx, struct hlsl_ty
bool hlsl_type_is_integer(const struct hlsl_type *type);
bool hlsl_type_is_floating_point(const struct hlsl_type *type);
bool hlsl_type_is_row_major(const struct hlsl_type *type);
+bool hlsl_type_is_signed_integer(const struct hlsl_type *type);
unsigned int hlsl_type_minor_size(const struct hlsl_type *type);
unsigned int hlsl_type_major_size(const struct hlsl_type *type);
unsigned int hlsl_type_element_count(const struct hlsl_type *type);
bool hlsl_type_is_integer(const struct hlsl_type *type);
+bool hlsl_type_is_minimum_precision(const struct hlsl_type *type);
bool hlsl_type_is_resource(const struct hlsl_type *type);
bool hlsl_type_is_shader(const struct hlsl_type *type);
bool hlsl_type_is_patch_array(const struct hlsl_type *type);
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
index 24c7ae6b00b..5aee1e701cd 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
@@ -1183,6 +1183,7 @@ static bool add_typedef(struct hlsl_ctx *ctx, struct hlsl_type *const orig_type,
vkd3d_free((void *)type->name);
type->name = v->name;
+ type->is_typedef = true;
ret = hlsl_scope_add_type(ctx->cur_scope, type);
if (!ret)
@@ -3189,6 +3190,11 @@ static bool elementwise_intrinsic_uint_convert_args(struct hlsl_ctx *ctx,
static bool intrinsic_abs(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{
+ const struct hlsl_type *type = params->args[0]->data_type;
+
+ if (!hlsl_type_is_floating_point(type) && !hlsl_type_is_signed_integer(type))
+ return true;
+
return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_ABS, params->args[0], loc);
}
@@ -8177,14 +8183,14 @@ type_no_void:
| TYPE_IDENTIFIER
{
$$ = hlsl_get_type(ctx->cur_scope, $1, true, true);
- if ($$->is_minimum_precision)
+ if ($$->is_minimum_precision || hlsl_type_is_minimum_precision($$))
{
if (hlsl_version_lt(ctx, 4, 0))
{
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
"Target profile doesn't support minimum-precision types.");
}
- else
+ else if ($$->is_minimum_precision)
{
FIXME("Reinterpreting type %s.\n", $$->name);
}
@@ -8214,8 +8220,8 @@ type_no_void:
| KW_STRUCT TYPE_IDENTIFIER
{
$$ = hlsl_get_type(ctx->cur_scope, $2, true, true);
- if ($$->class != HLSL_CLASS_STRUCT)
- hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_REDEFINED, "\"%s\" redefined as a structure.", $2);
+ if ($$->class != HLSL_CLASS_STRUCT || $$->is_typedef)
+ hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_REDEFINED, "\"%s\" is not a structure.", $2);
vkd3d_free($2);
}
| KW_RENDERTARGETVIEW
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
index 9c3affda534..38d5c55c26b 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
@@ -7154,7 +7154,7 @@ struct hlsl_reg hlsl_reg_from_deref(struct hlsl_ctx *ctx, const struct hlsl_dere
}
static bool get_integral_argument_value(struct hlsl_ctx *ctx, const struct hlsl_attribute *attr,
- unsigned int i, enum hlsl_base_type *base_type, int *value)
+ unsigned int i, int *value)
{
const struct hlsl_ir_node *instr = attr->args[i].node;
const struct hlsl_type *type = instr->data_type;
@@ -7178,7 +7178,6 @@ static bool get_integral_argument_value(struct hlsl_ctx *ctx, const struct hlsl_
return false;
}
- *base_type = type->e.numeric.type;
*value = hlsl_ir_constant(instr)->value.u[0].i;
return true;
}
@@ -7205,6 +7204,7 @@ static const char *get_string_argument_value(struct hlsl_ctx *ctx, const struct
static void parse_numthreads_attribute(struct hlsl_ctx *ctx, const struct hlsl_attribute *attr)
{
+ static const unsigned int limits[3] = {1024, 1024, 64};
unsigned int i;
ctx->found_numthreads = 1;
@@ -7218,18 +7218,21 @@ static void parse_numthreads_attribute(struct hlsl_ctx *ctx, const struct hlsl_a
for (i = 0; i < attr->args_count; ++i)
{
- enum hlsl_base_type base_type;
int value;
- if (!get_integral_argument_value(ctx, attr, i, &base_type, &value))
+ if (!get_integral_argument_value(ctx, attr, i, &value))
return;
- if ((base_type == HLSL_TYPE_INT && value <= 0) || (base_type == HLSL_TYPE_UINT && !value))
+ if (value < 1 || value > limits[i])
hlsl_error(ctx, &attr->args[i].node->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_THREAD_COUNT,
- "Thread count must be a positive integer.");
+ "Dimension %u of the thread count must be between 1 and %u.", i, limits[i]);
ctx->thread_count[i] = value;
}
+
+ if (ctx->thread_count[0] * ctx->thread_count[1] * ctx->thread_count[2] > 1024)
+ hlsl_error(ctx, &attr->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_THREAD_COUNT,
+ "Product of thread count parameters cannot exceed 1024.");
}
static void parse_domain_attribute(struct hlsl_ctx *ctx, const struct hlsl_attribute *attr)
@@ -7260,7 +7263,6 @@ static void parse_domain_attribute(struct hlsl_ctx *ctx, const struct hlsl_attri
static void parse_outputcontrolpoints_attribute(struct hlsl_ctx *ctx, const struct hlsl_attribute *attr)
{
- enum hlsl_base_type base_type;
int value;
if (attr->args_count != 1)
@@ -7270,7 +7272,7 @@ static void parse_outputcontrolpoints_attribute(struct hlsl_ctx *ctx, const stru
return;
}
- if (!get_integral_argument_value(ctx, attr, 0, &base_type, &value))
+ if (!get_integral_argument_value(ctx, attr, 0, &value))
return;
if (value < 0 || value > 32)
@@ -7373,7 +7375,6 @@ static void parse_patchconstantfunc_attribute(struct hlsl_ctx *ctx, const struct
static void parse_maxvertexcount_attribute(struct hlsl_ctx *ctx, const struct hlsl_attribute *attr)
{
- enum hlsl_base_type base_type;
int value;
if (attr->args_count != 1)
@@ -7383,7 +7384,7 @@ static void parse_maxvertexcount_attribute(struct hlsl_ctx *ctx, const struct hl
return;
}
- if (!get_integral_argument_value(ctx, attr, 0, &base_type, &value))
+ if (!get_integral_argument_value(ctx, attr, 0, &value))
return;
if (value < 1 || value > 1024)
@@ -11838,25 +11839,6 @@ static void generate_vsir_scan_required_features(struct hlsl_ctx *ctx, struct vs
* STENCIL_REF, and TYPED_UAV_LOAD_ADDITIONAL_FORMATS. */
}
-static bool is_minimum_precision(enum hlsl_base_type type)
-{
- switch (type)
- {
- case HLSL_TYPE_BOOL:
- case HLSL_TYPE_DOUBLE:
- case HLSL_TYPE_FLOAT:
- case HLSL_TYPE_HALF:
- case HLSL_TYPE_INT:
- case HLSL_TYPE_UINT:
- return false;
-
- case HLSL_TYPE_MIN16UINT:
- return true;
- }
-
- vkd3d_unreachable();
-}
-
static void generate_vsir_scan_global_flags(struct hlsl_ctx *ctx,
struct vsir_program *program, const struct hlsl_ir_function_decl *entry_func)
{
@@ -11894,7 +11876,7 @@ static void generate_vsir_scan_global_flags(struct hlsl_ctx *ctx,
/* Note that it doesn't matter if the semantic is unused or doesn't
* generate a signature element (e.g. SV_DispatchThreadID). */
if ((var->is_input_semantic || var->is_output_semantic)
- && (type->is_minimum_precision || is_minimum_precision(type->e.numeric.type)))
+ && (type->is_minimum_precision || hlsl_type_is_minimum_precision(type)))
{
program->global_flags |= VKD3DSGF_ENABLE_MINIMUM_PRECISION;
break;
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_constant_ops.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_constant_ops.c
index f74ecffcd4b..d339a06e6c7 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_constant_ops.c
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_constant_ops.c
@@ -51,14 +51,11 @@ static bool fold_abs(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst,
dst->u[k].i = abs(src->value.u[k].i);
break;
+ case HLSL_TYPE_BOOL:
case HLSL_TYPE_MIN16UINT:
case HLSL_TYPE_UINT:
- dst->u[k].u = src->value.u[k].u;
- break;
-
- default:
- FIXME("Fold abs() for type %s.\n", debug_hlsl_type(ctx, dst_type));
- return false;
+ /* Should not occur. */
+ vkd3d_unreachable();
}
}
return true;
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
index 4101e92e91f..7466f7a2da1 100644
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
@@ -862,12 +862,14 @@ static enum vkd3d_result vsir_program_lower_tex(struct vsir_program *program,
}
else if (tex->flags == VKD3DSI_TEXLD_BIAS)
{
+ enum vkd3d_shader_swizzle_component w = vsir_swizzle_get_component(srcs[0].swizzle, 3);
+
tex->opcode = VKD3DSIH_SAMPLE_B;
tex->src = srcs;
tex->src_count = 4;
srcs[3] = tex->src[0];
- srcs[3].swizzle = VKD3D_SHADER_SWIZZLE(W, W, W, W);
+ srcs[3].swizzle = vkd3d_shader_create_swizzle(w, w, w, w);
}
else
{
@@ -2048,23 +2050,27 @@ static enum vkd3d_result shader_signature_map_patch_constant_index_ranges(struct
for (i = 0; i < s->element_count; i += register_count)
{
+ uint32_t used_mask;
+
e = &s->elements[i];
register_count = 1;
if (!e->sysval_semantic)
continue;
+ used_mask = e->used_mask;
for (j = i + 1; j < s->element_count; ++j, ++register_count)
{
f = &s->elements[j];
if (f->register_index != e->register_index + register_count || !sysval_semantics_should_merge(e, f))
break;
+ used_mask |= f->used_mask;
}
if (register_count < 2)
continue;
if ((ret = range_map_set_register_range(normaliser, range_map,
- e->register_index, register_count, e->mask, e->used_mask, false)) < 0)
+ e->register_index, register_count, e->mask, used_mask, false)) < 0)
return ret;
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
index 6a393c5f35d..4297d656e51 100644
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
@@ -5775,7 +5775,7 @@ static unsigned int shader_signature_next_location(const struct shader_signature
return max_row;
}
-static uint32_t spirv_compiler_emit_input(struct spirv_compiler *compiler,
+static void spirv_compiler_emit_input(struct spirv_compiler *compiler,
enum vkd3d_shader_register_type reg_type, unsigned int element_idx)
{
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
@@ -5786,12 +5786,10 @@ static uint32_t spirv_compiler_emit_input(struct spirv_compiler *compiler,
const struct vkd3d_spirv_builtin *builtin;
enum vkd3d_shader_sysval_semantic sysval;
uint32_t write_mask, reg_write_mask;
- struct vkd3d_symbol *symbol = NULL;
uint32_t val_id, input_id, var_id;
uint32_t type_id, float_type_id;
struct vkd3d_symbol reg_symbol;
SpvStorageClass storage_class;
- struct rb_entry *entry = NULL;
bool use_private_var = false;
unsigned int array_sizes[2];
@@ -5806,6 +5804,9 @@ static uint32_t spirv_compiler_emit_input(struct spirv_compiler *compiler,
if (compiler->shader_type == VKD3D_SHADER_TYPE_DOMAIN && reg_type != VKD3DSPR_PATCHCONST)
sysval = VKD3D_SHADER_SV_NONE;
+ if (!signature_element->used_mask)
+ return;
+
builtin = get_spirv_builtin_for_sysval(compiler, sysval);
array_sizes[0] = signature_element->register_count;
@@ -5846,7 +5847,7 @@ static uint32_t spirv_compiler_emit_input(struct spirv_compiler *compiler,
vkd3d_symbol_make_io(&reg_symbol, reg_type, element_idx);
- if ((entry = rb_get(&compiler->symbol_table, &reg_symbol)))
+ if (rb_get(&compiler->symbol_table, &reg_symbol))
{
/* Except for vicp there should be one declaration per signature element. Sources of
* duplicate declarations are: a single register split into multiple declarations having
@@ -5854,8 +5855,7 @@ static uint32_t spirv_compiler_emit_input(struct spirv_compiler *compiler,
* being repeated in another (i.e. vcp/vocp), which should have been deleted. */
if (reg_type != VKD3DSPR_INPUT || !is_in_fork_or_join_phase(compiler))
FIXME("Duplicate input definition found.\n");
- symbol = RB_ENTRY_VALUE(entry, struct vkd3d_symbol, entry);
- return symbol->id;
+ return;
}
if (builtin)
@@ -5927,8 +5927,6 @@ static uint32_t spirv_compiler_emit_input(struct spirv_compiler *compiler,
spirv_compiler_emit_store_reg(compiler, &dst_reg, signature_element->mask, val_id);
}
-
- return input_id;
}
static void spirv_compiler_emit_io_register(struct spirv_compiler *compiler,
--
2.47.2

View File

@@ -0,0 +1,138 @@
From ec08bb5bfc8d67b975516a5a2dc34e9eaf7306ae Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 10 Jun 2025 07:48:09 +1000
Subject: [PATCH] Updated vkd3d to 8da518f2cd4021ef8d642bbb8050881d7ff490c1.
---
libs/vkd3d/libs/vkd3d-shader/msl.c | 45 +++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/msl.c b/libs/vkd3d/libs/vkd3d-shader/msl.c
index 62981811ee4..b3e251eff28 100644
--- a/libs/vkd3d/libs/vkd3d-shader/msl.c
+++ b/libs/vkd3d/libs/vkd3d-shader/msl.c
@@ -382,6 +382,19 @@ static enum msl_data_type msl_print_register_name(struct vkd3d_string_buffer *bu
return MSL_DATA_UNION;
}
+ case VKD3DSPR_IDXTEMP:
+ vkd3d_string_buffer_printf(buffer, "x%u", reg->idx[0].offset);
+ msl_print_subscript(buffer, gen, reg->idx[1].rel_addr, reg->idx[1].offset);
+ return MSL_DATA_UNION;
+
+ case VKD3DSPR_SAMPLEMASK:
+ if (gen->program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL)
+ msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
+ "Internal compiler error: Unhandled sample coverage mask in shader type #%x.",
+ gen->program->shader_version.type);
+ vkd3d_string_buffer_printf(buffer, "o_mask");
+ return MSL_DATA_FLOAT;
+
default:
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
"Internal compiler error: Unhandled register type %#x.", reg->type);
@@ -901,6 +914,14 @@ static void msl_ret(struct msl_generator *gen, const struct vkd3d_shader_instruc
vkd3d_string_buffer_printf(gen->buffer, "return;\n");
}
+static void msl_dcl_indexable_temp(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
+{
+ msl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "vkd3d_vec4 x%u[%u];\n",
+ ins->declaration.indexable_temp.register_idx,
+ ins->declaration.indexable_temp.register_size);
+}
+
static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
{
gen->location = ins->location;
@@ -908,11 +929,15 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
switch (ins->opcode)
{
case VKD3DSIH_ADD:
+ case VKD3DSIH_IADD:
msl_binop(gen, ins, "+");
break;
case VKD3DSIH_AND:
msl_binop(gen, ins, "&");
break;
+ case VKD3DSIH_DCL_INDEXABLE_TEMP:
+ msl_dcl_indexable_temp(gen, ins);
+ break;
case VKD3DSIH_NOP:
break;
case VKD3DSIH_DIV:
@@ -933,6 +958,7 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
case VKD3DSIH_ENDIF:
msl_end_block(gen);
break;
+ case VKD3DSIH_EQO:
case VKD3DSIH_IEQ:
msl_relop(gen, ins, "==");
break;
@@ -949,6 +975,7 @@ static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d
msl_cast(gen, ins, "uint");
break;
case VKD3DSIH_GEO:
+ case VKD3DSIH_IGE:
msl_relop(gen, ins, ">=");
break;
case VKD3DSIH_IF:
@@ -1276,6 +1303,12 @@ static void msl_generate_output_struct_declarations(struct msl_generator *gen)
vkd3d_string_buffer_printf(buffer, "float shader_out_depth [[depth(any)]];\n");
}
+ if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_SAMPLEMASK))
+ {
+ msl_print_indent(gen->buffer, 1);
+ vkd3d_string_buffer_printf(buffer, "uint shader_out_mask [[sample_mask]];\n");
+ }
+
vkd3d_string_buffer_printf(buffer, "};\n\n");
}
@@ -1371,6 +1404,9 @@ static void msl_generate_entrypoint_epilogue(struct msl_generator *gen)
}
vkd3d_string_buffer_printf(buffer, ";\n");
}
+
+ if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_SAMPLEMASK))
+ vkd3d_string_buffer_printf(gen->buffer, " output.shader_out_mask = as_type<uint>(o_mask);\n");
}
static void msl_generate_entrypoint(struct msl_generator *gen)
@@ -1414,6 +1450,9 @@ static void msl_generate_entrypoint(struct msl_generator *gen)
vkd3d_string_buffer_printf(gen->buffer, " vkd3d_vec4 %s_in[%u];\n", gen->prefix, 32);
vkd3d_string_buffer_printf(gen->buffer, " vkd3d_vec4 %s_out[%u];\n", gen->prefix, 32);
vkd3d_string_buffer_printf(gen->buffer, " vkd3d_%s_out output;\n", gen->prefix);
+ if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_SAMPLEMASK))
+ vkd3d_string_buffer_printf(gen->buffer, " float o_mask;\n");
+ vkd3d_string_buffer_printf(gen->buffer, "\n");
msl_generate_entrypoint_prologue(gen);
@@ -1422,9 +1461,11 @@ static void msl_generate_entrypoint(struct msl_generator *gen)
vkd3d_string_buffer_printf(gen->buffer, ", vertex_id");
if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_DEPTHOUT))
vkd3d_string_buffer_printf(gen->buffer, ", output.shader_out_depth");
+ if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_SAMPLEMASK))
+ vkd3d_string_buffer_printf(gen->buffer, ", o_mask");
if (gen->program->descriptors.descriptor_count)
vkd3d_string_buffer_printf(gen->buffer, ", descriptors");
- vkd3d_string_buffer_printf(gen->buffer, ");\n");
+ vkd3d_string_buffer_printf(gen->buffer, ");\n\n");
msl_generate_entrypoint_epilogue(gen);
@@ -1486,6 +1527,8 @@ static int msl_generator_generate(struct msl_generator *gen, struct vkd3d_shader
vkd3d_string_buffer_printf(gen->buffer, ", uint vertex_id");
if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_DEPTHOUT))
vkd3d_string_buffer_printf(gen->buffer, ", thread float &o_depth");
+ if (bitmap_is_set(gen->program->io_dcls, VKD3DSPR_SAMPLEMASK))
+ vkd3d_string_buffer_printf(gen->buffer, ", thread float &o_mask");
if (gen->program->descriptors.descriptor_count)
vkd3d_string_buffer_printf(gen->buffer, ", constant descriptor *descriptors");
vkd3d_string_buffer_printf(gen->buffer, ")\n{\n");
--
2.47.2

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