You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b4006fc038 | ||
|
d1cc8d0fa5 | ||
|
ef72380f02 | ||
|
1b2e959b75 | ||
|
31a37e3f3c | ||
|
a3738434e0 | ||
|
554a64f6b3 | ||
|
7f2c4b8613 |
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
1
patches/kernel32-limit_heap_old_exe/definition
Normal file
1
patches/kernel32-limit_heap_old_exe/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [44931] kernel32: Limit old exe to 3MB available space
|
@@ -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();
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,308 @@
|
||||
From 86947d34ad20c2245de3b035fe15f116f4e00949 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, ®_symbol)))
|
||||
{
|
||||
spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_REGISTER_TYPE,
|
||||
- "Unrecognized register (%s).\n", debug_vkd3d_symbol(®_symbol));
|
||||
+ "Unrecognized register (%s).", debug_vkd3d_symbol(®_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
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
@@ -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(®_symbol, reg_type, element_idx);
|
||||
|
||||
- if ((entry = rb_get(&compiler->symbol_table, ®_symbol)))
|
||||
+ if (rb_get(&compiler->symbol_table, ®_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
|
||||
|
1
patches/vkd3d-latest/definition
Normal file
1
patches/vkd3d-latest/definition
Normal file
@@ -0,0 +1 @@
|
||||
# Keeping vkd3d to the latest git
|
@@ -1 +1 @@
|
||||
Wine Staging 10.8
|
||||
Wine Staging 10.9
|
||||
|
@@ -1 +1 @@
|
||||
7f833db11ffea4f3f4fa07be31d30559aff9c5fb
|
||||
ffcbbf8f0152cd6919eabe19f0a9d5e015fe1a80
|
||||
|
Reference in New Issue
Block a user