You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-12-15 08:03:15 -08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be758e634e | ||
|
|
c8cf8c5b8d | ||
|
|
b6ba963ad0 | ||
|
|
8ea0f4968f | ||
|
|
217f208541 | ||
|
|
54f4c57fd6 | ||
|
|
0c0b6c45da | ||
|
|
da6c42770b | ||
|
|
b7f859e90d | ||
|
|
463f0b7936 | ||
|
|
959925fc2f | ||
|
|
3e92d6c89c | ||
|
|
3bb1cddffc | ||
|
|
4741f1abc6 |
@@ -1,117 +0,0 @@
|
||||
From 51373e0350ff1b507d7b47d6e5acd84b8af9d328 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
|
||||
MoveFile*.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/kernelbase/file.c | 2 +-
|
||||
dlls/ntdll/unix/file.c | 24 ++++++++++++++++++++++--
|
||||
server/fd.c | 6 ++++--
|
||||
3 files changed, 27 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
|
||||
index 36045116e43..f1b1326353f 100644
|
||||
--- a/dlls/kernelbase/file.c
|
||||
+++ b/dlls/kernelbase/file.c
|
||||
@@ -2597,7 +2597,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,
|
||||
- FILE_SYNCHRONOUS_IO_NONALERT );
|
||||
+ FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT );
|
||||
RtlFreeUnicodeString( &nt_name );
|
||||
if (!set_ntstatus( status )) goto error;
|
||||
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 3c341a6d702..9076da9f763 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -5572,6 +5572,8 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
unsigned int flags;
|
||||
UNICODE_STRING name_str, nt_name;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
+ REPARSE_DATA_BUFFER *buffer = NULL;
|
||||
+ ULONG buffer_len = 0;
|
||||
char *unix_name;
|
||||
|
||||
if (class == FileRenameInformation)
|
||||
@@ -5586,6 +5588,20 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
name_str.Length = info->FileNameLength;
|
||||
name_str.MaximumLength = info->FileNameLength + sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &name_str, OBJ_CASE_INSENSITIVE, info->RootDirectory, NULL );
|
||||
+
|
||||
+ /* obtain all the data from the reparse point (if applicable) */
|
||||
+ status = get_reparse_point( handle, NULL, &buffer_len );
|
||||
+ if (status == STATUS_BUFFER_TOO_SMALL)
|
||||
+ {
|
||||
+ buffer = malloc( buffer_len );
|
||||
+ status = get_reparse_point( handle, buffer, &buffer_len );
|
||||
+ if (status != STATUS_SUCCESS)
|
||||
+ {
|
||||
+ free( buffer );
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
status = get_nt_and_unix_names( &attr, &nt_name, &unix_name, FILE_OPEN_IF );
|
||||
if (status == STATUS_SUCCESS || status == STATUS_NO_SUCH_FILE)
|
||||
{
|
||||
@@ -5602,8 +5618,13 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
+ /* rebuild reparse point in new location (if applicable) */
|
||||
+ if (buffer && status == STATUS_SUCCESS)
|
||||
+ status = create_reparse_point( handle, buffer );
|
||||
+
|
||||
+ free( unix_name );
|
||||
}
|
||||
- free( unix_name );
|
||||
+ free( buffer );
|
||||
free( nt_name.Buffer );
|
||||
}
|
||||
else status = STATUS_INVALID_PARAMETER_3;
|
||||
@@ -5646,7 +5667,6 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
status = wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
-
|
||||
}
|
||||
free( unix_name );
|
||||
free( nt_name.Buffer );
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 466259ae567..7f88fcd6e33 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -2771,7 +2771,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
goto failed;
|
||||
}
|
||||
|
||||
- if (!stat( name, &st ))
|
||||
+ if (!lstat( name, &st ))
|
||||
{
|
||||
if (!fstat( fd->unix_fd, &st2 ) && st.st_ino == st2.st_ino && st.st_dev == st2.st_dev)
|
||||
{
|
||||
@@ -2787,7 +2787,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
}
|
||||
|
||||
/* can't replace directories or special files */
|
||||
- if (!S_ISREG( st.st_mode ))
|
||||
+ if (!S_ISREG( st.st_mode ) && !S_ISLNK( st.st_mode ))
|
||||
{
|
||||
set_error( STATUS_ACCESS_DENIED );
|
||||
goto failed;
|
||||
@@ -2853,6 +2853,8 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
fd->nt_name = dup_nt_name( root, nt_name, &fd->nt_namelen );
|
||||
free( fd->unix_name );
|
||||
fd->closed->unix_name = fd->unix_name = realpath( name, NULL );
|
||||
+ if (!fd->unix_name)
|
||||
+ fd->closed->unix_name = fd->unix_name = dup_fd_name( root, name ); /* dangling symlink */
|
||||
free( name );
|
||||
if (!fd->unix_name)
|
||||
set_error( STATUS_NO_MEMORY );
|
||||
--
|
||||
2.47.2
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
From 09318135fc87cd27e9df660958dcda6fe7d6f997 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Sat, 12 Dec 2020 17:28:31 -0700
|
||||
Subject: [PATCH] kernel32: Advertise reparse point support.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/mountmgr.sys/device.c | 33 ++++++++++++-
|
||||
dlls/mountmgr.sys/unixlib.c | 97 +++++++++++++++++++++++++++++++++++++
|
||||
dlls/mountmgr.sys/unixlib.h | 8 +++
|
||||
3 files changed, 137 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
|
||||
index 6c62ac78c76..1ee82e92c97 100644
|
||||
--- a/dlls/mountmgr.sys/device.c
|
||||
+++ b/dlls/mountmgr.sys/device.c
|
||||
@@ -177,6 +177,36 @@ static void get_filesystem_serial( struct volume *volume )
|
||||
volume->serial = strtoul( buffer, NULL, 16 );
|
||||
}
|
||||
|
||||
+/* get the flags for the volume by looking at the type of underlying filesystem */
|
||||
+static DWORD get_filesystem_flags( struct volume *volume )
|
||||
+{
|
||||
+ char fstypename[256];
|
||||
+ ULONG size = sizeof(fstypename);
|
||||
+ struct get_volume_filesystem_params params = { volume->device->unix_mount, fstypename, &size };
|
||||
+
|
||||
+ if (!volume->device->unix_mount) return 0;
|
||||
+ if (MOUNTMGR_CALL( get_volume_filesystem, ¶ms )) return 0;
|
||||
+
|
||||
+ if (!strcmp("apfs", fstypename) ||
|
||||
+ !strcmp("nfs", fstypename) ||
|
||||
+ !strcmp("cifs", fstypename) ||
|
||||
+ !strcmp("ncpfs", fstypename) ||
|
||||
+ !strcmp("tmpfs", fstypename) ||
|
||||
+ !strcmp("cramfs", fstypename) ||
|
||||
+ !strcmp("devfs", fstypename) ||
|
||||
+ !strcmp("procfs", fstypename) ||
|
||||
+ !strcmp("ext2", fstypename) ||
|
||||
+ !strcmp("ext3", fstypename) ||
|
||||
+ !strcmp("ext4", fstypename) ||
|
||||
+ !strcmp("hfs", fstypename) ||
|
||||
+ !strcmp("hpfs", fstypename) ||
|
||||
+ !strcmp("ntfs", fstypename))
|
||||
+ {
|
||||
+ return FILE_SUPPORTS_REPARSE_POINTS;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
||||
/******************************************************************
|
||||
* VOLUME_FindCdRomDataBestVoldesc
|
||||
@@ -1704,7 +1734,8 @@ static NTSTATUS WINAPI harddisk_query_volume( DEVICE_OBJECT *device, IRP *irp )
|
||||
break;
|
||||
default:
|
||||
fsname = L"NTFS";
|
||||
- info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS;
|
||||
+ info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS
|
||||
+ | get_filesystem_flags( volume );
|
||||
info->MaximumComponentNameLength = 255;
|
||||
break;
|
||||
}
|
||||
diff --git a/dlls/mountmgr.sys/unixlib.c b/dlls/mountmgr.sys/unixlib.c
|
||||
index 80e7c850854..55489d9965b 100644
|
||||
--- a/dlls/mountmgr.sys/unixlib.c
|
||||
+++ b/dlls/mountmgr.sys/unixlib.c
|
||||
@@ -38,6 +38,21 @@
|
||||
#endif
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
+#ifdef HAVE_SYS_STATFS_H
|
||||
+# include <sys/statfs.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_SYSCALL_H
|
||||
+# include <sys/syscall.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_VFS_H
|
||||
+# include <sys/vfs.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_PARAM_H
|
||||
+#include <sys/param.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_SYS_MOUNT_H
|
||||
+#include <sys/mount.h>
|
||||
+#endif
|
||||
|
||||
#include "unixlib.h"
|
||||
#include "wine/debug.h"
|
||||
@@ -463,6 +478,87 @@ static NTSTATUS read_volume_file( void *args )
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+static NTSTATUS get_volume_filesystem( void *args )
|
||||
+{
|
||||
+#if defined(__NR_renameat2) || defined(RENAME_SWAP)
|
||||
+ const struct get_volume_filesystem_params *params = args;
|
||||
+#if defined(HAVE_FSTATFS)
|
||||
+ struct statfs stfs;
|
||||
+#elif defined(HAVE_FSTATVFS)
|
||||
+ struct statvfs stfs;
|
||||
+#endif
|
||||
+ const char *fstypename = "unknown";
|
||||
+ int fd = -1;
|
||||
+
|
||||
+ if (params->volume[0] != '/')
|
||||
+ {
|
||||
+ char *path = get_dosdevices_path( params->volume );
|
||||
+ if (path) fd = open( path, O_RDONLY );
|
||||
+ free( path );
|
||||
+ }
|
||||
+ else fd = open( params->volume, O_RDONLY );
|
||||
+ if (fd == -1) return STATUS_NO_SUCH_FILE;
|
||||
+
|
||||
+#if defined(HAVE_FSTATFS)
|
||||
+ if (fstatfs(fd, &stfs))
|
||||
+ return STATUS_NO_SUCH_FILE;
|
||||
+#elif defined(HAVE_FSTATVFS)
|
||||
+ if (fstatvfs(fd, &stfs))
|
||||
+ return STATUS_NO_SUCH_FILE;
|
||||
+#endif
|
||||
+ close( fd );
|
||||
+#if defined(HAVE_FSTATFS) && defined(linux)
|
||||
+ switch (stfs.f_type)
|
||||
+ {
|
||||
+ case 0x6969: /* nfs */
|
||||
+ fstypename = "nfs";
|
||||
+ break;
|
||||
+ case 0xff534d42: /* cifs */
|
||||
+ fstypename = "cifs";
|
||||
+ break;
|
||||
+ case 0x564c: /* ncpfs */
|
||||
+ fstypename = "ncpfs";
|
||||
+ break;
|
||||
+ case 0x01021994: /* tmpfs */
|
||||
+ fstypename = "tmpfs";
|
||||
+ break;
|
||||
+ case 0x28cd3d45: /* cramfs */
|
||||
+ fstypename = "cramfs";
|
||||
+ break;
|
||||
+ case 0x1373: /* devfs */
|
||||
+ fstypename = "devfs";
|
||||
+ break;
|
||||
+ case 0x9fa0: /* procfs */
|
||||
+ fstypename = "procfs";
|
||||
+ break;
|
||||
+ case 0xef51: /* old ext2 */
|
||||
+ fstypename = "ext2";
|
||||
+ break;
|
||||
+ case 0xef53: /* ext2/3/4 */
|
||||
+ fstypename = "ext2";
|
||||
+ break;
|
||||
+ case 0x4244: /* hfs */
|
||||
+ fstypename = "hfs";
|
||||
+ break;
|
||||
+ case 0xf995e849: /* hpfs */
|
||||
+ fstypename = "hpfs";
|
||||
+ break;
|
||||
+ case 0x5346544e: /* ntfs */
|
||||
+ fstypename = "ntfs";
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) || defined(__NetBSD__)
|
||||
+ fstypename = stfs.f_fstypename;
|
||||
+#endif
|
||||
+ lstrcpynA( params->fstypename, fstypename, *params->size );
|
||||
+ return STATUS_SUCCESS;
|
||||
+#else
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
static NTSTATUS match_unixdev( void *args )
|
||||
{
|
||||
const struct match_unixdev_params *params = args;
|
||||
@@ -607,6 +703,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
|
||||
write_credential,
|
||||
delete_credential,
|
||||
enumerate_credentials,
|
||||
+ get_volume_filesystem,
|
||||
};
|
||||
|
||||
C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
|
||||
diff --git a/dlls/mountmgr.sys/unixlib.h b/dlls/mountmgr.sys/unixlib.h
|
||||
index 7a3d0038512..ac7e6a553c7 100644
|
||||
--- a/dlls/mountmgr.sys/unixlib.h
|
||||
+++ b/dlls/mountmgr.sys/unixlib.h
|
||||
@@ -107,6 +107,13 @@ struct read_volume_file_params
|
||||
ULONG *size;
|
||||
};
|
||||
|
||||
+struct get_volume_filesystem_params
|
||||
+{
|
||||
+ const char *volume;
|
||||
+ void *fstypename;
|
||||
+ ULONG *size;
|
||||
+};
|
||||
+
|
||||
struct match_unixdev_params
|
||||
{
|
||||
const char *device;
|
||||
@@ -173,6 +180,7 @@ enum mountmgr_funcs
|
||||
unix_write_credential,
|
||||
unix_delete_credential,
|
||||
unix_enumerate_credentials,
|
||||
+ unix_get_volume_filesystem,
|
||||
unix_funcs_count
|
||||
};
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,48 +0,0 @@
|
||||
From 4039b5b7bd3e8df9052006c5755a63aab93d52ef Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 15:11:42 -0600
|
||||
Subject: kernel32: Add reparse support to FindNextFile.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/kernelbase/file.c | 24 ++++++++++++++++++++++++
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
|
||||
index bf6e9e17c9e..26d3dde5ad6 100644
|
||||
--- a/dlls/kernelbase/file.c
|
||||
+++ b/dlls/kernelbase/file.c
|
||||
@@ -1508,6 +1508,30 @@ BOOL WINAPI DECLSPEC_HOTPATCH FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *da
|
||||
memcpy( data->cFileName, dir_info->FileName, dir_info->FileNameLength );
|
||||
data->cFileName[dir_info->FileNameLength/sizeof(WCHAR)] = 0;
|
||||
|
||||
+ /* get reparse tag */
|
||||
+ if (dir_info->FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
||||
+ {
|
||||
+ INT path_len = info->path.Length + dir_info->FileNameLength + sizeof(WCHAR);
|
||||
+ WCHAR *path = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, path_len );
|
||||
+ FILE_ATTRIBUTE_TAG_INFORMATION taginfo;
|
||||
+ IO_STATUS_BLOCK iosb;
|
||||
+ NTSTATUS status;
|
||||
+ HANDLE hlink;
|
||||
+
|
||||
+ if (!path) break;
|
||||
+
|
||||
+ lstrcpynW( path, info->path.Buffer, info->path.Length/sizeof(WCHAR) + 1 );
|
||||
+ lstrcatW( path, data->cFileName );
|
||||
+
|
||||
+ hlink = CreateFileW( path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0 );
|
||||
+ HeapFree( GetProcessHeap(), 0, path );
|
||||
+ status = NtQueryInformationFile( hlink, &iosb, &taginfo, sizeof(taginfo),
|
||||
+ FileAttributeTagInformation );
|
||||
+ if (status == STATUS_SUCCESS) data->dwReserved0 = taginfo.ReparseTag;
|
||||
+ CloseHandle( hlink );
|
||||
+ }
|
||||
+
|
||||
if (info->level != FindExInfoBasic)
|
||||
{
|
||||
memcpy( data->cAlternateFileName, dir_info->ShortName, dir_info->ShortNameLength );
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
From 8ceb056ccdf36bdf8a8692bd5882fc686aace5f6 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 15:18:50 -0600
|
||||
Subject: wcmd: Display reparse point type in directory listings.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
programs/cmd/directory.c | 26 ++++++++++++++++++++++++++
|
||||
1 file changed, 26 insertions(+)
|
||||
|
||||
diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c
|
||||
index 8417687939a..a849807c76e 100644
|
||||
--- a/programs/cmd/directory.c
|
||||
+++ b/programs/cmd/directory.c
|
||||
@@ -395,6 +395,32 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
|
||||
WCMD_output(L"%1!*s!", cur_width - tmp_width, L"");
|
||||
}
|
||||
|
||||
+ } else if (fd[i].dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
|
||||
+ if (!bare) {
|
||||
+ const WCHAR *type;
|
||||
+
|
||||
+ switch(fd[i].dwReserved0) {
|
||||
+ case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
+ type = L"<JUNCTION>";
|
||||
+ break;
|
||||
+ case IO_REPARSE_TAG_SYMLINK:
|
||||
+ default:
|
||||
+ type = (fd[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? L"<SYMLINKD>" : L"<SYMLINK>";
|
||||
+ break;
|
||||
+ }
|
||||
+ WCMD_output (L"%1!10s! %2!8s! %3!-14s!", datestring, timestring, type);
|
||||
+ if (shortname) WCMD_output (L"%1!-13s!", fd[i].cAlternateFileName);
|
||||
+ if (usernames) WCMD_output (L"%1!-23s!", username);
|
||||
+ WCMD_output(L"%1",fd[i].cFileName);
|
||||
+ } else {
|
||||
+ if (!((lstrcmpW(fd[i].cFileName, L".") == 0) ||
|
||||
+ (lstrcmpW(fd[i].cFileName, L"..") == 0))) {
|
||||
+ WCMD_output (L"%1%2", recurse?inputparms->dirName : L"", fd[i].cFileName);
|
||||
+ } else {
|
||||
+ addNewLine = FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
} else if (fd[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
dir_count++;
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
From 563bc2fc3c48b2341a08a662e27e27a904702121 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 15:38:30 -0600
|
||||
Subject: wcmd: Show reparse point target in directory listing.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
programs/cmd/directory.c | 35 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 35 insertions(+)
|
||||
|
||||
diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c
|
||||
index a849807c76e..5b0a19b442d 100644
|
||||
--- a/programs/cmd/directory.c
|
||||
+++ b/programs/cmd/directory.c
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "wcmd.h"
|
||||
#include "wine/debug.h"
|
||||
+#include "winioctl.h"
|
||||
+#include "ddk/ntifs.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
|
||||
|
||||
@@ -412,6 +414,39 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
|
||||
if (shortname) WCMD_output (L"%1!-13s!", fd[i].cAlternateFileName);
|
||||
if (usernames) WCMD_output (L"%1!-23s!", username);
|
||||
WCMD_output(L"%1",fd[i].cFileName);
|
||||
+ if (fd[i].dwReserved0) {
|
||||
+ REPARSE_DATA_BUFFER *buffer = NULL;
|
||||
+ WCHAR *target = NULL;
|
||||
+ INT buffer_len;
|
||||
+ HANDLE hlink;
|
||||
+ DWORD dwret;
|
||||
+ BOOL bret;
|
||||
+
|
||||
+ lstrcpyW(string, inputparms->dirName);
|
||||
+ lstrcatW(string, fd[i].cFileName);
|
||||
+ hlink = CreateFileW(string, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
|
||||
+ buffer_len = sizeof(*buffer) + 2*MAX_PATH*sizeof(WCHAR);
|
||||
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buffer_len);
|
||||
+ bret = DeviceIoControl(hlink, FSCTL_GET_REPARSE_POINT, NULL, 0, (LPVOID)buffer,
|
||||
+ buffer_len, &dwret, 0);
|
||||
+ if (bret) {
|
||||
+ INT offset;
|
||||
+ switch(buffer->ReparseTag) {
|
||||
+ case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
+ offset = buffer->MountPointReparseBuffer.PrintNameOffset/sizeof(WCHAR);
|
||||
+ target = &buffer->MountPointReparseBuffer.PathBuffer[offset];
|
||||
+ break;
|
||||
+ case IO_REPARSE_TAG_SYMLINK:
|
||||
+ offset = buffer->SymbolicLinkReparseBuffer.PrintNameOffset/sizeof(WCHAR);
|
||||
+ target = &buffer->SymbolicLinkReparseBuffer.PathBuffer[offset];
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ CloseHandle(hlink);
|
||||
+ if (target) WCMD_output(L" [%1]", target);
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ }
|
||||
} else {
|
||||
if (!((lstrcmpW(fd[i].cFileName, L".") == 0) ||
|
||||
(lstrcmpW(fd[i].cFileName, L"..") == 0))) {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From be1665ad0d88598c409f6a1d699562c2dd0d525a Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 29 May 2019 16:01:45 -0600
|
||||
Subject: [PATCH] wcmd: Add junction point support to mklink.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
programs/cmd/builtins.c | 48 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 47 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
|
||||
index 5b15c0f397a..6d7512275ce 100644
|
||||
--- a/programs/cmd/builtins.c
|
||||
+++ b/programs/cmd/builtins.c
|
||||
@@ -31,6 +31,9 @@
|
||||
#include "wcmd.h"
|
||||
#include <shellapi.h>
|
||||
#include "wine/debug.h"
|
||||
+#include "winternl.h"
|
||||
+#include "winioctl.h"
|
||||
+#include "ddk/ntifs.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
|
||||
|
||||
@@ -4091,6 +4094,49 @@ RETURN_CODE WCMD_color(void)
|
||||
return errorlevel = return_code;
|
||||
}
|
||||
|
||||
+BOOL WCMD_create_junction(WCHAR *link, WCHAR *target) {
|
||||
+ static INT struct_size = offsetof(REPARSE_DATA_BUFFER, SymbolicLinkReparseBuffer.PathBuffer[0]);
|
||||
+ static INT header_size = offsetof(REPARSE_DATA_BUFFER, GenericReparseBuffer);
|
||||
+ INT buffer_size, data_size, string_len, prefix_len;
|
||||
+ WCHAR *subst_dest, *print_dest, *string;
|
||||
+ REPARSE_DATA_BUFFER *buffer;
|
||||
+ UNICODE_STRING nt_name;
|
||||
+ NTSTATUS status;
|
||||
+ HANDLE hlink;
|
||||
+ DWORD dwret;
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ if (!CreateDirectoryW(link, NULL ))
|
||||
+ return FALSE;
|
||||
+ hlink = CreateFileW(link, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
|
||||
+ if (hlink == INVALID_HANDLE_VALUE)
|
||||
+ return FALSE;
|
||||
+ status = RtlDosPathNameToNtPathName_U_WithStatus(target, &nt_name, NULL, NULL);
|
||||
+ if (status)
|
||||
+ return FALSE;
|
||||
+ prefix_len = strlen("\\??\\");
|
||||
+ string = nt_name.Buffer;
|
||||
+ string_len = lstrlenW( &string[prefix_len] );
|
||||
+ data_size = (prefix_len + 2 * string_len + 2) * sizeof(WCHAR);
|
||||
+ buffer_size = struct_size + data_size;
|
||||
+ buffer = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, buffer_size );
|
||||
+ buffer->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
|
||||
+ buffer->ReparseDataLength = struct_size - header_size + data_size;
|
||||
+ buffer->MountPointReparseBuffer.SubstituteNameLength = (prefix_len + string_len) * sizeof(WCHAR);
|
||||
+ buffer->MountPointReparseBuffer.PrintNameOffset = (prefix_len + string_len + 1) * sizeof(WCHAR);
|
||||
+ buffer->MountPointReparseBuffer.PrintNameLength = string_len * sizeof(WCHAR);
|
||||
+ subst_dest = &buffer->MountPointReparseBuffer.PathBuffer[0];
|
||||
+ print_dest = &buffer->MountPointReparseBuffer.PathBuffer[prefix_len + string_len + 1];
|
||||
+ lstrcpyW(subst_dest, string);
|
||||
+ lstrcpyW(print_dest, &string[prefix_len]);
|
||||
+ RtlFreeUnicodeString(&nt_name );
|
||||
+ ret = DeviceIoControl(hlink, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_size, NULL, 0,
|
||||
+ &dwret, 0 );
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/****************************************************************************
|
||||
* WCMD_mklink
|
||||
*/
|
||||
@@ -4141,7 +4187,7 @@ RETURN_CODE WCMD_mklink(WCHAR *args)
|
||||
else if(!junction)
|
||||
ret = CreateSymbolicLinkW(file1, file2, isdir);
|
||||
else
|
||||
- TRACE("Junction links currently not supported.\n");
|
||||
+ ret = WCMD_create_junction(file1, file2);
|
||||
}
|
||||
|
||||
if (ret) return errorlevel = NO_ERROR;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0eda0c4092b0673e4b4e646388c53e2a8ecc2379 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Wed, 18 May 2016 18:08:24 +0800
|
||||
Subject: user32: Add a workaround for Windows 3.1 apps which call
|
||||
LoadImage(LR_LOADFROMFILE) with a resource id. (v2)
|
||||
|
||||
Fixes #24963.
|
||||
---
|
||||
dlls/user32/cursoricon.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
|
||||
index 4f93195..95cc410 100644
|
||||
--- a/dlls/user32/cursoricon.c
|
||||
+++ b/dlls/user32/cursoricon.c
|
||||
@@ -1404,7 +1404,12 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
|
||||
hInstance, debugstr_w(name), width, height, depth, fCursor, loadflags);
|
||||
|
||||
if ( loadflags & LR_LOADFROMFILE ) /* Load from file */
|
||||
- return CURSORICON_LoadFromFile( name, width, height, depth, fCursor, loadflags );
|
||||
+ {
|
||||
+ if (IS_INTRESOURCE(name) && GetProcessVersion(0) < 0x40000)
|
||||
+ WARN("Windows 3.1 app set LR_LOADFROMFILE without a name, fallback to loading from resource\n");
|
||||
+ else
|
||||
+ return CURSORICON_LoadFromFile( name, width, height, depth, fCursor, loadflags );
|
||||
+ }
|
||||
|
||||
if (!hInstance) hInstance = user32_module; /* Load OEM cursor/icon */
|
||||
|
||||
--
|
||||
2.8.0
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Fixes: [24963] Workaround for Windows 3.1 apps which call LoadImage(LR_LOADFROMFILE) with a resource id
|
||||
@@ -1,4 +1,4 @@
|
||||
From 6c90ff9b852f02712c34de1ca23125bdb2c9284b Mon Sep 17 00:00:00 2001
|
||||
From 702653b1539507e6033d123a57f16f7206d78bb0 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 6 Mar 2024 20:21:36 +1100
|
||||
Subject: [PATCH] user32/msgbox: Support WM_COPY Message
|
||||
@@ -13,7 +13,7 @@ Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
3 files changed, 257 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
|
||||
index 12eea8e92d7..9534656378d 100644
|
||||
index 009f3858c60..a21f210a2fd 100644
|
||||
--- a/dlls/user32/msgbox.c
|
||||
+++ b/dlls/user32/msgbox.c
|
||||
@@ -41,6 +41,11 @@ struct ThreadWindows
|
||||
@@ -130,10 +130,10 @@ index 12eea8e92d7..9534656378d 100644
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
|
||||
index 49b8f1968a0..a3004cf9443 100644
|
||||
index 20e21bea0bc..c3ba83c4893 100644
|
||||
--- a/dlls/user32/tests/dialog.c
|
||||
+++ b/dlls/user32/tests/dialog.c
|
||||
@@ -2068,6 +2068,171 @@ static void test_MessageBoxFontTest(void)
|
||||
@@ -2081,6 +2081,171 @@ static void test_MessageBoxFontTest(void)
|
||||
DestroyWindow(hDlg);
|
||||
}
|
||||
|
||||
@@ -305,9 +305,9 @@ index 49b8f1968a0..a3004cf9443 100644
|
||||
static void test_SaveRestoreFocus(void)
|
||||
{
|
||||
HWND hDlg;
|
||||
@@ -2440,6 +2605,7 @@ START_TEST(dialog)
|
||||
|
||||
if (!RegisterWindowClasses()) assert(0);
|
||||
@@ -2536,6 +2701,7 @@ START_TEST(dialog)
|
||||
return;
|
||||
}
|
||||
|
||||
+ test_MessageBox_WM_COPY_Test();
|
||||
test_dialog_custom_data();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2f2480806c4c431aeb75308e570a317da43f3508 Mon Sep 17 00:00:00 2001
|
||||
From 26240eeb2925918d8c75a251fde5fd5ed9f9bfcf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= <gabrielopcode@gmail.com>
|
||||
Date: Mon, 22 Jul 2019 15:29:25 +0300
|
||||
Subject: [PATCH] user32/focus: Prevent a recursive loop with the activation
|
||||
@@ -20,10 +20,10 @@ Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
|
||||
2 files changed, 30 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
|
||||
index a4834b740d8..123a0ff9a94 100644
|
||||
index f431ab98a9f..9e07052d612 100644
|
||||
--- a/dlls/win32u/input.c
|
||||
+++ b/dlls/win32u/input.c
|
||||
@@ -1966,7 +1966,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -1992,7 +1992,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
{
|
||||
HWND previous = get_active_window();
|
||||
BOOL ret;
|
||||
@@ -32,7 +32,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
CBTACTIVATESTRUCT cbt;
|
||||
|
||||
if (previous == hwnd)
|
||||
@@ -1975,16 +1975,24 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2001,16 +2001,24 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
{
|
||||
- send_message( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd );
|
||||
- send_message( previous, WM_ACTIVATE,
|
||||
- MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ), (LPARAM)hwnd );
|
||||
- MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ? 0x20 : 0 ), (LPARAM)hwnd );
|
||||
+ ret = FALSE;
|
||||
+
|
||||
+ /* call CBT hook chain */
|
||||
@@ -57,16 +57,16 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
+ if (call_hooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hwnd, (LPARAM)&cbt, sizeof(cbt) ))
|
||||
+ goto clear_flags;
|
||||
+
|
||||
+ if (is_window(previous))
|
||||
+ if (is_window( previous ))
|
||||
+ {
|
||||
+ send_message( previous, WM_NCACTIVATE, FALSE, (LPARAM)hwnd );
|
||||
+ send_message( previous, WM_ACTIVATE,
|
||||
+ MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ), (LPARAM)hwnd );
|
||||
+ MAKEWPARAM( WA_INACTIVE, is_iconic(previous) ? 0x20 : 0 ), (LPARAM)hwnd );
|
||||
+ }
|
||||
}
|
||||
|
||||
SERVER_START_REQ( set_active_window )
|
||||
@@ -2006,7 +2014,11 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2032,7 +2040,11 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
if (send_message( hwnd, WM_QUERYNEWPALETTE, 0, 0 ))
|
||||
send_message_timeout( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
|
||||
SMTO_ABORTIFHUNG, 2000, FALSE );
|
||||
@@ -79,7 +79,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
}
|
||||
|
||||
old_thread = previous ? get_window_thread( previous, NULL ) : 0;
|
||||
@@ -2039,7 +2051,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2065,7 +2077,7 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
{
|
||||
send_message( hwnd, WM_NCACTIVATE, hwnd == NtUserGetForegroundWindow(), (LPARAM)previous );
|
||||
send_message( hwnd, WM_ACTIVATE,
|
||||
@@ -2064,13 +2076,17 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
@@ -2090,13 +2102,17 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,10 +108,10 @@ index a4834b740d8..123a0ff9a94 100644
|
||||
|
||||
/**********************************************************************
|
||||
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
|
||||
index 2f3bbdf91c0..74f5b07bd46 100644
|
||||
index c38b6d0e029..bec513cfadb 100644
|
||||
--- a/dlls/win32u/ntuser_private.h
|
||||
+++ b/dlls/win32u/ntuser_private.h
|
||||
@@ -92,6 +92,7 @@ typedef struct tagWND
|
||||
@@ -86,6 +86,7 @@ typedef struct tagWND
|
||||
#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0020 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
|
||||
#define WIN_CHILDREN_MOVED 0x0040 /* children may have moved, ignore stored positions */
|
||||
#define WIN_HAS_IME_WIN 0x0080 /* the window has been registered with imm32 */
|
||||
@@ -120,5 +120,5 @@ index 2f3bbdf91c0..74f5b07bd46 100644
|
||||
#define WND_OTHER_PROCESS ((WND *)1) /* returned by get_win_ptr on unknown window handles */
|
||||
#define WND_DESKTOP ((WND *)2) /* returned by get_win_ptr on the desktop window */
|
||||
--
|
||||
2.47.2
|
||||
2.51.0
|
||||
|
||||
|
||||
@@ -1,51 +1,24 @@
|
||||
From 4274d901461697a7fb05b0d1e0b06216061166f1 Mon Sep 17 00:00:00 2001
|
||||
From 3f2c89666f2eee64db4b634c0bfc420dfbbacc57 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Shefte <shefben@gmail.com>
|
||||
Date: Wed, 1 Mar 2023 07:37:52 +1100
|
||||
Subject: [PATCH] vcomp: Implement _vcomp_for_dynamic_init_i8
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52012
|
||||
---
|
||||
dlls/vcomp/main.c | 135 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/vcomp/vcomp.spec | 6 +-
|
||||
dlls/vcomp100/vcomp100.spec | 6 +-
|
||||
dlls/vcomp110/vcomp110.spec | 6 +-
|
||||
dlls/vcomp120/vcomp120.spec | 6 +-
|
||||
dlls/vcomp140/vcomp140.spec | 6 +-
|
||||
dlls/vcomp90/vcomp90.spec | 6 +-
|
||||
7 files changed, 153 insertions(+), 18 deletions(-)
|
||||
dlls/vcomp/main.c | 115 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/vcomp/vcomp.spec | 4 +-
|
||||
dlls/vcomp100/vcomp100.spec | 4 +-
|
||||
dlls/vcomp110/vcomp110.spec | 4 +-
|
||||
dlls/vcomp120/vcomp120.spec | 4 +-
|
||||
dlls/vcomp140/vcomp140.spec | 4 +-
|
||||
dlls/vcomp90/vcomp90.spec | 4 +-
|
||||
7 files changed, 127 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
|
||||
index 63ec0502b9b..4cde0381693 100644
|
||||
index 6a12da8d458..3b93926a405 100644
|
||||
--- a/dlls/vcomp/main.c
|
||||
+++ b/dlls/vcomp/main.c
|
||||
@@ -1034,6 +1034,26 @@ double CDECL omp_get_wtime(void)
|
||||
return GetTickCount() / 1000.0;
|
||||
}
|
||||
|
||||
+/*****************************************************
|
||||
+* omp_get_wtick - Taken from:
|
||||
+* https://gist.github.com/Randl/45bcca59720f661fa033a67d5f44bff0
|
||||
+*/
|
||||
+double CDECL omp_get_wtick (void)
|
||||
+{
|
||||
+ /*return GetTickCount();*/
|
||||
+ FILETIME createTime;
|
||||
+ FILETIME exitTime;
|
||||
+ FILETIME kernelTime;
|
||||
+ FILETIME userTime;
|
||||
+ ULARGE_INTEGER li;
|
||||
+
|
||||
+ GetProcessTimes(GetCurrentProcess(), &createTime, &exitTime, &kernelTime, &userTime);
|
||||
+ li.LowPart = userTime.dwLowDateTime;
|
||||
+ li.HighPart = userTime.dwHighDateTime;
|
||||
+
|
||||
+ return (double)li.QuadPart / 10000000.0;
|
||||
+}
|
||||
+
|
||||
void CDECL omp_set_dynamic(int val)
|
||||
{
|
||||
TRACE("(%d): stub\n", val);
|
||||
@@ -1486,6 +1506,77 @@ void CDECL _vcomp_for_dynamic_init(unsigned int flags, unsigned int first, unsig
|
||||
@@ -1341,6 +1341,77 @@ void CDECL _vcomp_for_dynamic_init(unsigned int flags, unsigned int first, unsig
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +96,7 @@ index 63ec0502b9b..4cde0381693 100644
|
||||
int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end)
|
||||
{
|
||||
struct vcomp_thread_data *thread_data = vcomp_init_thread_data();
|
||||
@@ -1530,6 +1621,50 @@ int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end)
|
||||
@@ -1385,6 +1456,50 @@ int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -175,7 +148,7 @@ index 63ec0502b9b..4cde0381693 100644
|
||||
{
|
||||
TRACE("()\n");
|
||||
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
|
||||
index fb67146e058..09bf45550d5 100644
|
||||
index 1a981a6c6c1..09bf45550d5 100644
|
||||
--- a/dlls/vcomp/vcomp.spec
|
||||
+++ b/dlls/vcomp/vcomp.spec
|
||||
@@ -56,9 +56,9 @@
|
||||
@@ -190,17 +163,8 @@ index fb67146e058..09bf45550d5 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -96,7 +96,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick()
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec
|
||||
index fb67146e058..9aa43e3ba4b 100644
|
||||
index 1a981a6c6c1..c38fae6d27d 100644
|
||||
--- a/dlls/vcomp100/vcomp100.spec
|
||||
+++ b/dlls/vcomp100/vcomp100.spec
|
||||
@@ -56,9 +56,9 @@
|
||||
@@ -215,17 +179,8 @@ index fb67146e058..9aa43e3ba4b 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -96,7 +96,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp110/vcomp110.spec b/dlls/vcomp110/vcomp110.spec
|
||||
index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
index d39aeb1f347..0475980a109 100644
|
||||
--- a/dlls/vcomp110/vcomp110.spec
|
||||
+++ b/dlls/vcomp110/vcomp110.spec
|
||||
@@ -57,9 +57,9 @@
|
||||
@@ -240,17 +195,8 @@ index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -97,7 +97,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp120/vcomp120.spec b/dlls/vcomp120/vcomp120.spec
|
||||
index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
index d39aeb1f347..0475980a109 100644
|
||||
--- a/dlls/vcomp120/vcomp120.spec
|
||||
+++ b/dlls/vcomp120/vcomp120.spec
|
||||
@@ -57,9 +57,9 @@
|
||||
@@ -265,17 +211,8 @@ index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -97,7 +97,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp140/vcomp140.spec b/dlls/vcomp140/vcomp140.spec
|
||||
index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
index d39aeb1f347..0475980a109 100644
|
||||
--- a/dlls/vcomp140/vcomp140.spec
|
||||
+++ b/dlls/vcomp140/vcomp140.spec
|
||||
@@ -57,9 +57,9 @@
|
||||
@@ -290,17 +227,8 @@ index e1cb8ab9931..d8b4d3e3f16 100644
|
||||
@ cdecl _vcomp_for_static_end()
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
|
||||
@@ -97,7 +97,7 @@
|
||||
@ cdecl omp_get_num_procs()
|
||||
@ cdecl omp_get_num_threads()
|
||||
@ cdecl omp_get_thread_num()
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime()
|
||||
@ cdecl omp_in_parallel()
|
||||
@ cdecl omp_init_lock(ptr)
|
||||
diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec
|
||||
index 9fac400ea0e..563f5391ed9 100644
|
||||
index a751e0b3da4..563f5391ed9 100644
|
||||
--- a/dlls/vcomp90/vcomp90.spec
|
||||
+++ b/dlls/vcomp90/vcomp90.spec
|
||||
@@ -56,9 +56,9 @@
|
||||
@@ -315,15 +243,6 @@ index 9fac400ea0e..563f5391ed9 100644
|
||||
@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end
|
||||
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init
|
||||
@ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init_i8
|
||||
@@ -96,7 +96,7 @@
|
||||
@ cdecl omp_get_num_procs() vcomp.omp_get_num_procs
|
||||
@ cdecl omp_get_num_threads() vcomp.omp_get_num_threads
|
||||
@ cdecl omp_get_thread_num() vcomp.omp_get_thread_num
|
||||
-@ stub omp_get_wtick
|
||||
+@ cdecl omp_get_wtick() vcomp.omp_get_wtick
|
||||
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
|
||||
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
|
||||
@ cdecl omp_init_lock(ptr) vcomp.omp_init_lock
|
||||
--
|
||||
2.43.0
|
||||
2.51.0
|
||||
|
||||
|
||||
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,434 @@
|
||||
From 008de2881eae289c65ee8409f6bc2597d36a71a6 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 9 Dec 2025 07:21:23 +1100
|
||||
Subject: [PATCH] Updated vkd3d to d0318ca14bc58390847e29e5581dbe6165872770.
|
||||
|
||||
---
|
||||
libs/vkd3d/libs/vkd3d-shader/dxil.c | 101 +++++++++++++-------
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl.y | 30 +++++-
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 30 +++---
|
||||
libs/vkd3d/libs/vkd3d-shader/ir.c | 42 ++++++++
|
||||
4 files changed, 148 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
index 7a056775a16..f73106d79b2 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
@@ -5021,7 +5021,7 @@ static bool sm6_parser_emit_reg_composite_construct(struct sm6_parser *sm6,
|
||||
const struct vkd3d_shader_register *operand_regs, unsigned int component_count,
|
||||
struct function_emission_state *state, struct vkd3d_shader_register *reg)
|
||||
{
|
||||
- struct vkd3d_shader_instruction *ins = state->ins;
|
||||
+ struct vkd3d_shader_instruction *ins;
|
||||
struct vsir_src_operand *src_params;
|
||||
struct vsir_dst_operand *dst_param;
|
||||
bool all_constant = true;
|
||||
@@ -5050,27 +5050,33 @@ static bool sm6_parser_emit_reg_composite_construct(struct sm6_parser *sm6,
|
||||
register_init_with_id(reg, VKD3DSPR_TEMP, operand_regs[0].data_type, state->temp_idx++);
|
||||
reg->dimension = VSIR_DIMENSION_VEC4;
|
||||
|
||||
- for (i = 0; i < component_count; ++i, ++ins)
|
||||
+ for (i = 0; i < component_count; ++i)
|
||||
{
|
||||
+ if (!(ins = sm6_parser_add_function_instruction(sm6, state)))
|
||||
+ return false;
|
||||
+
|
||||
+ state->ins = ins + 1;
|
||||
+
|
||||
vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_MOV);
|
||||
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 1, sm6)))
|
||||
- return false;
|
||||
+ goto error;
|
||||
|
||||
src_param_init(&src_params[0]);
|
||||
src_params[0].reg = operand_regs[i];
|
||||
|
||||
if (!(dst_param = instruction_dst_params_alloc(ins, 1, sm6)))
|
||||
- return false;
|
||||
+ goto error;
|
||||
|
||||
dst_param_init_scalar(dst_param, i);
|
||||
dst_param->reg = *reg;
|
||||
}
|
||||
|
||||
- state->ins = ins;
|
||||
- state->function->instructions.count += component_count;
|
||||
-
|
||||
return true;
|
||||
+
|
||||
+error:
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
static bool sm6_parser_emit_composite_construct(struct sm6_parser *sm6, const struct sm6_value **operands,
|
||||
@@ -5417,7 +5423,7 @@ static void sm6_parser_emit_dx_barrier(struct sm6_parser *dxil, enum dx_intrinsi
|
||||
static void sm6_parser_emit_dx_buffer_update_counter(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
const struct sm6_value **operands, struct function_emission_state *state)
|
||||
{
|
||||
- struct vkd3d_shader_instruction *ins = state->ins;
|
||||
+ struct vkd3d_shader_instruction *ins;
|
||||
struct vsir_src_operand *src_params;
|
||||
const struct sm6_value *resource;
|
||||
unsigned int i;
|
||||
@@ -5435,19 +5441,27 @@ static void sm6_parser_emit_dx_buffer_update_counter(struct sm6_parser *sm6, enu
|
||||
}
|
||||
i = sm6_value_get_constant_uint(operands[1], sm6);
|
||||
if (i != 1 && i != 255)
|
||||
- {
|
||||
- WARN("Unexpected update value %#x.\n", i);
|
||||
vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_IGNORING_OPERANDS,
|
||||
"Update value %#x for a UAV counter operation is not supported.", i);
|
||||
- }
|
||||
inc = i;
|
||||
|
||||
+ if (!(ins = sm6_parser_add_function_instruction(sm6, state)))
|
||||
+ return;
|
||||
+
|
||||
+ state->pushed_instruction = true;
|
||||
+
|
||||
vsir_instruction_init(ins, &sm6->p.location, (inc < 0) ? VSIR_OP_IMM_ATOMIC_CONSUME : VSIR_OP_IMM_ATOMIC_ALLOC);
|
||||
+
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 1, sm6)))
|
||||
+ {
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
return;
|
||||
+ }
|
||||
+
|
||||
src_param_init_vector_from_handle(sm6, &src_params[0], &resource->u.handle);
|
||||
|
||||
- instruction_dst_param_init_ssa_scalar(ins, 0, sm6);
|
||||
+ if (!instruction_dst_param_init_ssa_scalar(ins, 0, sm6))
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_calculate_lod(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
@@ -5463,32 +5477,40 @@ static void sm6_parser_emit_dx_calculate_lod(struct sm6_parser *sm6, enum dx_int
|
||||
sampler = operands[1];
|
||||
if (!sm6_value_validate_is_texture_handle(resource, op, sm6)
|
||||
|| !sm6_value_validate_is_sampler_handle(sampler, op, sm6))
|
||||
- {
|
||||
return;
|
||||
- }
|
||||
|
||||
if (!sm6_parser_emit_coordinate_construct(sm6, &operands[2], 3, NULL, state, &coord))
|
||||
return;
|
||||
|
||||
clamp = sm6_value_get_constant_uint(operands[5], sm6);
|
||||
|
||||
- ins = state->ins;
|
||||
+ if (!(ins = sm6_parser_add_function_instruction(sm6, state)))
|
||||
+ return;
|
||||
+
|
||||
+ state->pushed_instruction = true;
|
||||
+
|
||||
vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_LOD);
|
||||
+
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 3, sm6)))
|
||||
+ {
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
return;
|
||||
+ }
|
||||
+
|
||||
src_param_init_vector_from_reg(&src_params[0], &coord);
|
||||
sm6_register_from_handle(sm6, &resource->u.handle, &src_params[1].reg);
|
||||
src_param_init_scalar(&src_params[1], !clamp);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[2], &sampler->u.handle);
|
||||
|
||||
- instruction_dst_param_init_ssa_scalar(ins, 0, sm6);
|
||||
+ if (!instruction_dst_param_init_ssa_scalar(ins, 0, sm6))
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_cbuffer_load(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
const struct sm6_value **operands, struct function_emission_state *state)
|
||||
{
|
||||
struct sm6_value *dst = sm6_parser_get_current_value(sm6);
|
||||
- struct vkd3d_shader_instruction *ins = state->ins;
|
||||
+ struct vkd3d_shader_instruction *ins;
|
||||
struct vsir_src_operand *src_param;
|
||||
const struct sm6_value *buffer;
|
||||
const struct sm6_type *type;
|
||||
@@ -5497,10 +5519,19 @@ static void sm6_parser_emit_dx_cbuffer_load(struct sm6_parser *sm6, enum dx_intr
|
||||
if (!sm6_value_validate_is_handle(buffer, sm6))
|
||||
return;
|
||||
|
||||
+ if (!(ins = sm6_parser_add_function_instruction(sm6, state)))
|
||||
+ return;
|
||||
+
|
||||
+ state->pushed_instruction = true;
|
||||
+
|
||||
vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_MOV);
|
||||
|
||||
if (!(src_param = instruction_src_params_alloc(ins, 1, sm6)))
|
||||
+ {
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
return;
|
||||
+ }
|
||||
+
|
||||
src_param_init_vector_from_handle(sm6, src_param, &buffer->u.handle);
|
||||
/* Differently from other descriptors, constant buffers require an
|
||||
* additional index, used to index within the constant buffer itself. */
|
||||
@@ -5515,7 +5546,8 @@ static void sm6_parser_emit_dx_cbuffer_load(struct sm6_parser *sm6, enum dx_intr
|
||||
else
|
||||
register_convert_to_minimum_precision(&src_param->reg);
|
||||
|
||||
- instruction_dst_param_init_ssa_vector(ins, sm6_type_max_vector_size(type), sm6);
|
||||
+ if (!instruction_dst_param_init_ssa_vector(ins, sm6_type_max_vector_size(type), sm6))
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
}
|
||||
|
||||
static void sm6_parser_dcl_register_builtin(struct sm6_parser *dxil, enum vkd3d_shader_opcode opcode,
|
||||
@@ -6289,29 +6321,23 @@ static void sm6_parser_emit_dx_buffer_store(struct sm6_parser *sm6, enum dx_intr
|
||||
|
||||
if (resource->u.handle.d->kind == RESOURCE_KIND_RAWBUFFER
|
||||
|| resource->u.handle.d->kind == RESOURCE_KIND_STRUCTUREDBUFFER)
|
||||
- {
|
||||
return sm6_parser_emit_dx_raw_buffer_store(sm6, op, operands, state);
|
||||
- }
|
||||
|
||||
if (resource->u.handle.d->kind != RESOURCE_KIND_TYPEDBUFFER)
|
||||
- {
|
||||
- WARN("Resource is not a typed buffer.\n");
|
||||
vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_INVALID_OPERATION,
|
||||
"Resource for a typed buffer store is not a typed buffer.");
|
||||
- }
|
||||
|
||||
write_mask = sm6_value_get_constant_uint(operands[7], sm6);
|
||||
if (!write_mask || write_mask > VKD3DSP_WRITEMASK_ALL)
|
||||
{
|
||||
- WARN("Invalid write mask %#x.\n", write_mask);
|
||||
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
|
||||
"Write mask %#x for a typed buffer store operation is invalid.", write_mask);
|
||||
return;
|
||||
}
|
||||
else if (write_mask & (write_mask + 1))
|
||||
{
|
||||
- /* In this case, it is unclear which source operands will be defined unless we encounter it in a shader. */
|
||||
- FIXME("Unhandled write mask %#x.\n", write_mask);
|
||||
+ /* In this case, it is unclear which source operands will be defined
|
||||
+ * unless we encounter it in a shader. */
|
||||
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
|
||||
"Write mask %#x for a typed buffer store operation is unhandled.", write_mask);
|
||||
}
|
||||
@@ -6320,22 +6346,33 @@ static void sm6_parser_emit_dx_buffer_store(struct sm6_parser *sm6, enum dx_intr
|
||||
if (!sm6_parser_emit_composite_construct(sm6, &operands[3], component_count, state, &texel))
|
||||
return;
|
||||
|
||||
- ins = state->ins;
|
||||
+ if (!(ins = sm6_parser_add_function_instruction(sm6, state)))
|
||||
+ return;
|
||||
+
|
||||
+ state->pushed_instruction = true;
|
||||
+
|
||||
vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_STORE_UAV_TYPED);
|
||||
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 2, sm6)))
|
||||
+ {
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
return;
|
||||
+ }
|
||||
+
|
||||
src_param_init_from_value(&src_params[0], operands[1], 0, sm6);
|
||||
if (!sm6_value_is_undef(operands[2]))
|
||||
- {
|
||||
- /* Constant zero would have no effect, but is not worth checking for unless it shows up. */
|
||||
- WARN("Ignoring structure offset.\n");
|
||||
+ /* Constant zero would have no effect, but is not worth checking for
|
||||
+ * unless it shows up. */
|
||||
vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_IGNORING_OPERANDS,
|
||||
"Ignoring structure offset for a typed buffer store.");
|
||||
- }
|
||||
src_param_init_vector_from_reg(&src_params[1], &texel);
|
||||
|
||||
- dst_param = instruction_dst_params_alloc(ins, 1, sm6);
|
||||
+ if (!(dst_param = instruction_dst_params_alloc(ins, 1, sm6)))
|
||||
+ {
|
||||
+ vkd3d_shader_instruction_make_nop(ins);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
dst_param_init_with_mask(dst_param, write_mask);
|
||||
sm6_register_from_handle(sm6, &resource->u.handle, &dst_param->reg);
|
||||
}
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
index 4efa1cd2873..d5dcc775a00 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
|
||||
@@ -2410,6 +2410,21 @@ static void check_invalid_object_fields(struct hlsl_ctx *ctx, const struct hlsl_
|
||||
"Target profile doesn't support objects as struct members in uniform variables.");
|
||||
}
|
||||
|
||||
+static void validate_groupshared_var(struct hlsl_ctx *ctx, const struct hlsl_ir_var *var)
|
||||
+{
|
||||
+ if (type_has_object_components(var->data_type))
|
||||
+ {
|
||||
+ struct vkd3d_string_buffer *string;
|
||||
+
|
||||
+ if ((string = hlsl_type_to_string(ctx, var->data_type)))
|
||||
+ {
|
||||
+ hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
|
||||
+ "Groupshared type %s is not numeric.", string->buffer);
|
||||
+ hlsl_release_string_buffer(ctx, string);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void declare_var(struct hlsl_ctx *ctx, struct parse_variable_def *v)
|
||||
{
|
||||
uint32_t modifiers = v->modifiers | v->semantic.modifiers;
|
||||
@@ -2564,11 +2579,18 @@ static void declare_var(struct hlsl_ctx *ctx, struct parse_variable_def *v)
|
||||
hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
||||
"Variable '%s' is declared as both \"uniform\" and \"static\".", var->name);
|
||||
|
||||
- if ((modifiers & HLSL_STORAGE_GROUPSHARED) && ctx->profile->type != VKD3D_SHADER_TYPE_COMPUTE)
|
||||
+ if ((modifiers & HLSL_STORAGE_GROUPSHARED))
|
||||
{
|
||||
- modifiers &= ~HLSL_STORAGE_GROUPSHARED;
|
||||
- hlsl_warning(ctx, &var->loc, VKD3D_SHADER_WARNING_HLSL_IGNORED_MODIFIER,
|
||||
- "Ignoring the 'groupshared' modifier in a non-compute shader.");
|
||||
+ /* d3dcompiler/fxc always validates global groupshared variables,
|
||||
+ * regardless of whether the groupshared modifier is ignored. */
|
||||
+ validate_groupshared_var(ctx, var);
|
||||
+
|
||||
+ if (ctx->profile->type != VKD3D_SHADER_TYPE_COMPUTE)
|
||||
+ {
|
||||
+ modifiers &= ~HLSL_STORAGE_GROUPSHARED;
|
||||
+ hlsl_warning(ctx, &var->loc, VKD3D_SHADER_WARNING_HLSL_IGNORED_MODIFIER,
|
||||
+ "Ignoring the 'groupshared' modifier in a non-compute shader.");
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Mark it as uniform. We need to do this here since synthetic
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
index 55d7f1f7c55..7adaeaa4c1e 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
@@ -3715,25 +3715,20 @@ static struct hlsl_ir_node *fold_redundant_casts(struct hlsl_ctx *ctx,
|
||||
* split_array_copies(), split_struct_copies() and
|
||||
* split_matrix_copies(). Inserts new instructions right before
|
||||
* "store". */
|
||||
-static bool split_copy(struct hlsl_ctx *ctx, struct hlsl_ir_store *store,
|
||||
+static void split_copy(struct hlsl_ctx *ctx, struct hlsl_ir_store *store,
|
||||
const struct hlsl_ir_load *load, const unsigned int idx, struct hlsl_type *type)
|
||||
{
|
||||
- struct hlsl_ir_node *split_store, *c;
|
||||
- struct hlsl_ir_load *split_load;
|
||||
+ struct hlsl_ir_node *c, *split_load;
|
||||
+ struct hlsl_block block;
|
||||
|
||||
- if (!(c = hlsl_new_uint_constant(ctx, idx, &store->node.loc)))
|
||||
- return false;
|
||||
- list_add_before(&store->node.entry, &c->entry);
|
||||
+ hlsl_block_init(&block);
|
||||
|
||||
- if (!(split_load = hlsl_new_load_index(ctx, &load->src, c, &store->node.loc)))
|
||||
- return false;
|
||||
- list_add_before(&store->node.entry, &split_load->node.entry);
|
||||
+ c = hlsl_block_add_uint_constant(ctx, &block, idx, &store->node.loc);
|
||||
+ split_load = hlsl_block_add_load_index(ctx, &block, &load->src, c, &store->node.loc);
|
||||
|
||||
- if (!(split_store = hlsl_new_store_index(ctx, &store->lhs, c, &split_load->node, 0, &store->node.loc)))
|
||||
- return false;
|
||||
- list_add_before(&store->node.entry, &split_store->entry);
|
||||
+ hlsl_block_add_store_index(ctx, &block, &store->lhs, c, split_load, 0, &store->node.loc);
|
||||
|
||||
- return true;
|
||||
+ list_move_before(&store->node.entry, &block.instrs);
|
||||
}
|
||||
|
||||
static bool split_array_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
|
||||
@@ -3762,8 +3757,7 @@ static bool split_array_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr,
|
||||
|
||||
for (i = 0; i < type->e.array.elements_count; ++i)
|
||||
{
|
||||
- if (!split_copy(ctx, store, hlsl_ir_load(rhs), i, element_type))
|
||||
- return false;
|
||||
+ split_copy(ctx, store, hlsl_ir_load(rhs), i, element_type);
|
||||
}
|
||||
|
||||
/* Remove the store instruction, so that we can split structs which contain
|
||||
@@ -3800,8 +3794,7 @@ static bool split_struct_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr
|
||||
{
|
||||
const struct hlsl_struct_field *field = &type->e.record.fields[i];
|
||||
|
||||
- if (!split_copy(ctx, store, hlsl_ir_load(rhs), i, field->type))
|
||||
- return false;
|
||||
+ split_copy(ctx, store, hlsl_ir_load(rhs), i, field->type);
|
||||
}
|
||||
|
||||
/* Remove the store instruction, so that we can split structs which contain
|
||||
@@ -3933,8 +3926,7 @@ static bool split_matrix_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr
|
||||
{
|
||||
for (i = 0; i < hlsl_type_major_size(type); ++i)
|
||||
{
|
||||
- if (!split_copy(ctx, store, hlsl_ir_load(rhs), i, element_type))
|
||||
- return false;
|
||||
+ split_copy(ctx, store, hlsl_ir_load(rhs), i, element_type);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
index 0261ba88989..1be88479cee 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
|
||||
@@ -1270,6 +1270,44 @@ static enum vkd3d_result vsir_program_normalize_addr(struct vsir_program *progra
|
||||
return VKD3D_OK;
|
||||
}
|
||||
|
||||
+static enum vkd3d_result vsir_program_lower_dp2add(struct vsir_program *program, struct vsir_program_iterator *dp2add)
|
||||
+{
|
||||
+ struct vkd3d_shader_instruction *ins = vsir_program_iterator_current(dp2add);
|
||||
+ const struct vkd3d_shader_location location = ins->location;
|
||||
+ const struct vsir_src_operand *src = ins->src;
|
||||
+ const struct vsir_dst_operand *dst = ins->dst;
|
||||
+ struct vsir_program_iterator it;
|
||||
+ unsigned int dot_id;
|
||||
+
|
||||
+ /* dp2add DST, SRC0, SRC1, SRC2
|
||||
+ * ->
|
||||
+ * dp2 srDOT, SRC0, SRC1
|
||||
+ * add DST, srDOT, SRC2 */
|
||||
+
|
||||
+ if (!(ins = vsir_program_iterator_insert_before(dp2add, &it, 1)))
|
||||
+ return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
+ if (!vsir_instruction_init_with_params(program, ins, &location, VSIR_OP_DP2, 1, 2))
|
||||
+ goto fail;
|
||||
+ dot_id = program->ssa_count++;
|
||||
+ vsir_dst_operand_init_ssa(&ins->dst[0], dot_id, src[0].reg.data_type, VSIR_DIMENSION_SCALAR);
|
||||
+ ins->src[0] = src[0];
|
||||
+ ins->src[1] = src[1];
|
||||
+
|
||||
+ ins = vsir_program_iterator_next(&it);
|
||||
+ if (!vsir_instruction_init_with_params(program, ins, &location, VSIR_OP_ADD, 1, 2))
|
||||
+ goto fail;
|
||||
+ ins->dst[0] = dst[0];
|
||||
+ vsir_src_operand_init_ssa(&ins->src[0], dot_id, src[0].reg.data_type, VSIR_DIMENSION_SCALAR);
|
||||
+ ins->src[1] = src[2];
|
||||
+
|
||||
+ return VKD3D_OK;
|
||||
+
|
||||
+fail:
|
||||
+ vsir_program_iterator_nop_range(&it, dp2add, &location);
|
||||
+
|
||||
+ return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
+}
|
||||
+
|
||||
static enum vkd3d_result vsir_program_lower_ifc(struct vsir_program *program,
|
||||
struct vsir_program_iterator *it, unsigned int *tmp_idx,
|
||||
struct vkd3d_shader_message_context *message_context)
|
||||
@@ -2470,6 +2508,10 @@ static enum vkd3d_result vsir_program_lower_d3dbc_instructions(struct vsir_progr
|
||||
ret = vsir_program_lower_bem(program, &it);
|
||||
break;
|
||||
|
||||
+ case VSIR_OP_DP2ADD:
|
||||
+ ret = vsir_program_lower_dp2add(program, &it);
|
||||
+ break;
|
||||
+
|
||||
case VSIR_OP_IFC:
|
||||
ret = vsir_program_lower_ifc(program, &it, &tmp_idx, message_context);
|
||||
break;
|
||||
--
|
||||
2.51.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,338 +0,0 @@
|
||||
From 1c19b515adc2181cff5be945b742fbd357330bbe Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 14 Nov 2025 08:07:32 +1100
|
||||
Subject: [PATCH] Updated vkd3d to 7f377879fc526dfb69966ed1672d3036e807235c.
|
||||
|
||||
---
|
||||
libs/vkd3d/include/private/vkd3d_common.h | 20 +++++++-----
|
||||
libs/vkd3d/libs/vkd3d-common/debug.c | 9 +++---
|
||||
libs/vkd3d/libs/vkd3d-shader/d3d_asm.c | 31 ++++++++++++++++++-
|
||||
libs/vkd3d/libs/vkd3d-shader/dxil.c | 13 +++++---
|
||||
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 8 +++--
|
||||
libs/vkd3d/libs/vkd3d-shader/spirv.c | 13 +++++---
|
||||
.../libs/vkd3d-shader/vkd3d_shader_main.c | 4 +--
|
||||
.../libs/vkd3d-shader/vkd3d_shader_private.h | 1 +
|
||||
.../vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c | 2 --
|
||||
libs/vkd3d/libs/vkd3d/vkd3d_main.c | 2 --
|
||||
10 files changed, 71 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/libs/vkd3d/include/private/vkd3d_common.h b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
index c2e957a2fea..56f8ad4ee25 100644
|
||||
--- a/libs/vkd3d/include/private/vkd3d_common.h
|
||||
+++ b/libs/vkd3d/include/private/vkd3d_common.h
|
||||
@@ -19,6 +19,11 @@
|
||||
#ifndef __VKD3D_COMMON_H
|
||||
#define __VKD3D_COMMON_H
|
||||
|
||||
+#ifndef VKD3D_DEBUG_ENV
|
||||
+#define VKD3D_DEBUG_ENV VKD3D_DEBUG
|
||||
+#endif
|
||||
+#define VKD3D_DEBUG_ENV_NAME VKD3D_EXPAND_AND_STRINGIFY(VKD3D_DEBUG_ENV)
|
||||
+
|
||||
#include "config.h"
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include "windows.h"
|
||||
@@ -149,9 +154,10 @@ enum vkd3d_dbg_level
|
||||
VKD3D_DBG_LEVEL_TRACE,
|
||||
};
|
||||
|
||||
-enum vkd3d_dbg_level vkd3d_dbg_get_level(void);
|
||||
+enum vkd3d_dbg_level vkd3d_dbg_get_level(const char *vkd3d_dbg_env_name);
|
||||
|
||||
-void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const char *fmt, ...) VKD3D_PRINTF_FUNC(3, 4);
|
||||
+void vkd3d_dbg_printf(const char *vkd3d_dbg_env_name, enum vkd3d_dbg_level level,
|
||||
+ const char *function, const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5);
|
||||
void vkd3d_dbg_set_log_callback(PFN_vkd3d_log callback);
|
||||
|
||||
const char *vkd3d_dbg_sprintf(const char *fmt, ...) VKD3D_PRINTF_FUNC(1, 2);
|
||||
@@ -174,7 +180,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
VKD3D_DBG_PRINTF_##level
|
||||
|
||||
#define VKD3D_DBG_PRINTF(...) \
|
||||
- vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
|
||||
|
||||
#define VKD3D_DBG_PRINTF_TRACE(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
|
||||
#define VKD3D_DBG_PRINTF_WARN(...) VKD3D_DBG_PRINTF(__VA_ARGS__)
|
||||
@@ -183,7 +189,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
|
||||
#ifdef VKD3D_ABORT_ON_ERR
|
||||
#define VKD3D_DBG_PRINTF_ERR(...) \
|
||||
- vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); \
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#else
|
||||
@@ -217,19 +223,17 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
|
||||
#endif
|
||||
|
||||
#ifndef TRACE_ON
|
||||
-#define TRACE_ON() (vkd3d_dbg_get_level() == VKD3D_DBG_LEVEL_TRACE)
|
||||
+#define TRACE_ON() (vkd3d_dbg_get_level(VKD3D_DEBUG_ENV_NAME) == VKD3D_DBG_LEVEL_TRACE)
|
||||
#endif
|
||||
|
||||
#ifndef WARN_ON
|
||||
-#define WARN_ON() (vkd3d_dbg_get_level() >= VKD3D_DBG_LEVEL_WARN)
|
||||
+#define WARN_ON() (vkd3d_dbg_get_level(VKD3D_DEBUG_ENV_NAME) >= VKD3D_DBG_LEVEL_WARN)
|
||||
#endif
|
||||
|
||||
#ifndef FIXME_ONCE
|
||||
#define FIXME_ONCE VKD3D_DBG_LOG_ONCE(FIXME, WARN)
|
||||
#endif
|
||||
|
||||
-#define VKD3D_DEBUG_ENV_NAME(name) const char *const vkd3d_dbg_env_name = name
|
||||
-
|
||||
static inline const char *debugstr_guid(const GUID *guid)
|
||||
{
|
||||
if (!guid)
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-common/debug.c b/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
index 32862024b90..b5d74ca3dc7 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-common/debug.c
|
||||
@@ -40,8 +40,6 @@
|
||||
#define VKD3D_DEBUG_BUFFER_COUNT 64
|
||||
#define VKD3D_DEBUG_BUFFER_SIZE 512
|
||||
|
||||
-extern const char *const vkd3d_dbg_env_name;
|
||||
-
|
||||
static const char *const debug_level_names[] =
|
||||
{
|
||||
[VKD3D_DBG_LEVEL_NONE ] = "none",
|
||||
@@ -52,7 +50,7 @@ static const char *const debug_level_names[] =
|
||||
[VKD3D_DBG_LEVEL_TRACE] = "trace",
|
||||
};
|
||||
|
||||
-enum vkd3d_dbg_level vkd3d_dbg_get_level(void)
|
||||
+enum vkd3d_dbg_level vkd3d_dbg_get_level(const char *vkd3d_dbg_env_name)
|
||||
{
|
||||
static unsigned int level = ~0u;
|
||||
const char *vkd3d_debug;
|
||||
@@ -108,11 +106,12 @@ static uint64_t get_pthread_threadid(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
-void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const char *fmt, ...)
|
||||
+void vkd3d_dbg_printf(const char *vkd3d_dbg_env_name,
|
||||
+ enum vkd3d_dbg_level level, const char *function, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
- if (vkd3d_dbg_get_level() < level)
|
||||
+ if (vkd3d_dbg_get_level(vkd3d_dbg_env_name) < level)
|
||||
return;
|
||||
|
||||
#ifdef _WIN32
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
index 4573cb67fb5..b316f6c8830 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/d3d_asm.c
|
||||
@@ -398,12 +398,41 @@ static void shader_dump_resource_data_type(struct vkd3d_d3d_asm_compiler *compil
|
||||
{
|
||||
int i;
|
||||
|
||||
+ /* We want the D3D names here, not the vsir ones. */
|
||||
+ static const char * const names[] =
|
||||
+ {
|
||||
+ [VSIR_DATA_BOOL ] = "bool",
|
||||
+ [VSIR_DATA_F16 ] = "half",
|
||||
+ [VSIR_DATA_F32 ] = "float",
|
||||
+ [VSIR_DATA_F64 ] = "double",
|
||||
+ [VSIR_DATA_I8 ] = "int8",
|
||||
+ [VSIR_DATA_I16 ] = "int16",
|
||||
+ [VSIR_DATA_I32 ] = "int",
|
||||
+ [VSIR_DATA_I64 ] = "int64",
|
||||
+ [VSIR_DATA_U8 ] = "uint8",
|
||||
+ [VSIR_DATA_U16 ] = "uint16",
|
||||
+ [VSIR_DATA_U32 ] = "uint",
|
||||
+ [VSIR_DATA_U64 ] = "uint64",
|
||||
+ [VSIR_DATA_SNORM ] = "snorm",
|
||||
+ [VSIR_DATA_UNORM ] = "unorm",
|
||||
+ [VSIR_DATA_OPAQUE ] = "opaque",
|
||||
+ [VSIR_DATA_MIXED ] = "mixed",
|
||||
+ [VSIR_DATA_CONTINUED] = "<continued>",
|
||||
+ [VSIR_DATA_UNUSED ] = "<unused>",
|
||||
+ };
|
||||
+
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "(");
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
+ size_t t = type[i];
|
||||
+
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "%s", i == 0 ? "" : ",");
|
||||
- shader_print_data_type(compiler, type[i]);
|
||||
+ if (t < ARRAY_SIZE(names) && names[t])
|
||||
+ vkd3d_string_buffer_printf(&compiler->buffer, "%s", names[t]);
|
||||
+ else
|
||||
+ vkd3d_string_buffer_printf(&compiler->buffer, "%s<unhandled data type %#zx>%s",
|
||||
+ compiler->colours.error, t, compiler->colours.reset);
|
||||
}
|
||||
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, ")");
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
index 8d803b91f7a..9f25ae8334b 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
|
||||
@@ -6142,11 +6142,14 @@ static unsigned int sm6_value_get_texel_offset(const struct sm6_value *value, st
|
||||
}
|
||||
|
||||
static void instruction_set_texel_offset(struct vkd3d_shader_instruction *ins,
|
||||
- const struct sm6_value **operands, struct sm6_parser *sm6)
|
||||
+ const struct sm6_value **operands, unsigned int count, struct sm6_parser *sm6)
|
||||
{
|
||||
ins->texel_offset.u = sm6_value_get_texel_offset(operands[0], sm6);
|
||||
ins->texel_offset.v = sm6_value_get_texel_offset(operands[1], sm6);
|
||||
- ins->texel_offset.w = sm6_value_get_texel_offset(operands[2], sm6);
|
||||
+ if (count == 3)
|
||||
+ ins->texel_offset.w = sm6_value_get_texel_offset(operands[2], sm6);
|
||||
+ else
|
||||
+ ins->texel_offset.w = 0;
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_sample(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
@@ -6228,7 +6231,7 @@ static void sm6_parser_emit_dx_sample(struct sm6_parser *sm6, enum dx_intrinsic_
|
||||
src_param_init_vector_from_reg(&src_params[0], &coord);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[1], &resource->u.handle);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[2], &sampler->u.handle);
|
||||
- instruction_set_texel_offset(ins, &operands[6], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[6], 3, sm6);
|
||||
|
||||
instruction_dst_param_init_ssa_vector(ins, component_count, sm6);
|
||||
}
|
||||
@@ -6402,7 +6405,7 @@ static void sm6_parser_emit_dx_texture_gather(struct sm6_parser *sm6, enum dx_in
|
||||
if (extended_offset)
|
||||
src_param_init_vector_from_reg(&src_params[1], &offset);
|
||||
else
|
||||
- instruction_set_texel_offset(ins, &operands[6], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[6], 2, sm6);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[1 + extended_offset], &resource->u.handle);
|
||||
src_param_init_vector_from_handle(sm6, &src_params[2 + extended_offset], &sampler->u.handle);
|
||||
/* Swizzle stored in the sampler parameter is the scalar component index to be gathered. */
|
||||
@@ -6448,7 +6451,7 @@ static void sm6_parser_emit_dx_texture_load(struct sm6_parser *sm6, enum dx_intr
|
||||
ins = state->ins;
|
||||
instruction_init_with_resource(ins, is_uav ? VSIR_OP_LD_UAV_TYPED
|
||||
: is_multisample ? VSIR_OP_LD2DMS : VSIR_OP_LD, resource, sm6);
|
||||
- instruction_set_texel_offset(ins, &operands[5], sm6);
|
||||
+ instruction_set_texel_offset(ins, &operands[5], 3, sm6);
|
||||
|
||||
for (i = 0; i < VKD3D_VEC4_SIZE; ++i)
|
||||
ins->resource_data_type[i] = resource->u.handle.d->resource_data_type;
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
index 8bb23e0690d..f1368b151aa 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
|
||||
@@ -5490,10 +5490,14 @@ static struct hlsl_ir_node *lower_casts_to_bool(struct hlsl_ctx *ctx,
|
||||
struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_block *instrs,
|
||||
struct hlsl_ir_node *condition, struct hlsl_ir_node *if_true, struct hlsl_ir_node *if_false)
|
||||
{
|
||||
+ struct hlsl_type *false_type = if_false->data_type;
|
||||
struct hlsl_type *cond_type = condition->data_type;
|
||||
struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS];
|
||||
+ struct hlsl_type *true_type = if_true->data_type;
|
||||
|
||||
- VKD3D_ASSERT(hlsl_types_are_equal(if_true->data_type, if_false->data_type));
|
||||
+ VKD3D_ASSERT(hlsl_types_are_equal(true_type, false_type)
|
||||
+ || (hlsl_is_vec1(true_type) && hlsl_is_vec1(false_type)
|
||||
+ && true_type->e.numeric.type == false_type->e.numeric.type));
|
||||
|
||||
if (cond_type->e.numeric.type != HLSL_TYPE_BOOL)
|
||||
{
|
||||
@@ -5505,7 +5509,7 @@ struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct hlsl_bloc
|
||||
operands[0] = condition;
|
||||
operands[1] = if_true;
|
||||
operands[2] = if_false;
|
||||
- return hlsl_block_add_expr(ctx, instrs, HLSL_OP3_TERNARY, operands, if_true->data_type, &condition->loc);
|
||||
+ return hlsl_block_add_expr(ctx, instrs, HLSL_OP3_TERNARY, operands, true_type, &condition->loc);
|
||||
}
|
||||
|
||||
static struct hlsl_ir_node *lower_int_division_sm4(struct hlsl_ctx *ctx,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
index 3950021a2ef..87ec827b420 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
|
||||
@@ -6668,13 +6668,18 @@ static void spirv_compiler_emit_cbv_declaration(struct spirv_compiler *compiler,
|
||||
/* Push constant buffers are handled in
|
||||
* spirv_compiler_emit_push_constant_buffers().
|
||||
*/
|
||||
- push_cb->reg = reg;
|
||||
- push_cb->size = size;
|
||||
if (size_in_bytes > push_cb->pc.size)
|
||||
{
|
||||
- WARN("Constant buffer size %u exceeds push constant size %u.\n",
|
||||
- size_in_bytes, push_cb->pc.size);
|
||||
+ spirv_compiler_warning(compiler, VKD3D_SHADER_WARNING_SPV_INVALID_SIZE,
|
||||
+ "Constant buffer cb%u, space %u, has size %u which exceeds the push constant size %u.",
|
||||
+ push_cb->pc.register_index, push_cb->pc.register_space, size_in_bytes, push_cb->pc.size);
|
||||
+ size_in_bytes = push_cb->pc.size;
|
||||
+ size = align(size_in_bytes, VKD3D_VEC4_SIZE * sizeof(uint32_t));
|
||||
+ size /= VKD3D_VEC4_SIZE * sizeof(uint32_t);
|
||||
}
|
||||
+
|
||||
+ push_cb->reg = reg;
|
||||
+ push_cb->size = size;
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
index c0faa30f14a..ee113f57736 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
|
||||
@@ -23,8 +23,6 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
-/* VKD3D_DEBUG_ENV_NAME("VKD3D_SHADER_DEBUG"); */
|
||||
-
|
||||
static inline int char_to_int(char c)
|
||||
{
|
||||
if ('0' <= c && c <= '9')
|
||||
@@ -268,7 +266,7 @@ void vkd3d_shader_trace_text_(const char *text, size_t size, const char *functio
|
||||
q = end;
|
||||
else
|
||||
++q;
|
||||
- vkd3d_dbg_printf(VKD3D_DBG_LEVEL_TRACE, function, "%.*s", (int)(q - p), p);
|
||||
+ vkd3d_dbg_printf(VKD3D_DEBUG_ENV_NAME, VKD3D_DBG_LEVEL_TRACE, function, "%.*s", (int)(q - p), p);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
index 763a4906919..97fe5238046 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
|
||||
@@ -110,6 +110,7 @@ enum vkd3d_shader_error
|
||||
VKD3D_SHADER_WARNING_SPV_INVALID_SWIZZLE = 2300,
|
||||
VKD3D_SHADER_WARNING_SPV_INVALID_UAV_FLAGS = 2301,
|
||||
VKD3D_SHADER_WARNING_SPV_IGNORING_FLAG = 2302,
|
||||
+ VKD3D_SHADER_WARNING_SPV_INVALID_SIZE = 2303,
|
||||
|
||||
VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY = 3000,
|
||||
VKD3D_SHADER_ERROR_RS_INVALID_VERSION = 3001,
|
||||
diff --git a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
index fea8c2440d1..6e90b48e877 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d-utils/vkd3d_utils_main.c
|
||||
@@ -19,8 +19,6 @@
|
||||
#include "vkd3d_utils_private.h"
|
||||
#undef D3D12CreateDevice
|
||||
|
||||
-/* VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG"); */
|
||||
-
|
||||
static const char *debug_d3d_blob_part(D3D_BLOB_PART part)
|
||||
{
|
||||
switch (part)
|
||||
diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
index 5215cf8ef86..4c58f0a1787 100644
|
||||
--- a/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
+++ b/libs/vkd3d/libs/vkd3d/vkd3d_main.c
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "vkd3d_private.h"
|
||||
|
||||
-VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG");
|
||||
-
|
||||
HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
|
||||
REFIID iid, void **device)
|
||||
{
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 555187b5ebdae9e7aa8a3edf7a74997c86fe0016 Mon Sep 17 00:00:00 2001
|
||||
From 2e3dfb8b8a87cadeb95143b4b67387af283b04e6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 8 Jun 2017 23:50:03 +0200
|
||||
Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr
|
||||
2 files changed, 76 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
|
||||
index 751f2acff96..1af19c6f9ba 100644
|
||||
index f30c340e9bd..3c5b07fd0f7 100644
|
||||
--- a/dlls/ntoskrnl.exe/tests/driver.c
|
||||
+++ b/dlls/ntoskrnl.exe/tests/driver.c
|
||||
@@ -57,6 +57,7 @@ static int kmemcmp( const void *ptr1, const void *ptr2, size_t n )
|
||||
@@ -19,9 +19,9 @@ index 751f2acff96..1af19c6f9ba 100644
|
||||
static DEVICE_OBJECT *lower_device, *upper_device;
|
||||
+static LDR_DATA_TABLE_ENTRY *ldr_module;
|
||||
|
||||
static POBJECT_TYPE *pExEventObjectType, *pIoFileObjectType, *pPsThreadType, *pIoDriverObjectType;
|
||||
static PEPROCESS *pPsInitialSystemProcess;
|
||||
@@ -1716,6 +1717,7 @@ static void test_resource(void)
|
||||
static IRP *queued_async_irps[2];
|
||||
static unsigned int queued_async_count;
|
||||
@@ -1734,6 +1735,7 @@ static void test_resource(void)
|
||||
ok(status == STATUS_SUCCESS, "got status %#lx\n", status);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ index 751f2acff96..1af19c6f9ba 100644
|
||||
static void test_lookup_thread(void)
|
||||
{
|
||||
NTSTATUS status;
|
||||
@@ -2425,6 +2427,52 @@ static void test_default_security(void)
|
||||
@@ -2444,6 +2446,52 @@ static void test_default_security(void)
|
||||
FltFreeSecurityDescriptor(sd);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ index 751f2acff96..1af19c6f9ba 100644
|
||||
static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack)
|
||||
{
|
||||
void *buffer = irp->AssociatedIrp.SystemBuffer;
|
||||
@@ -2457,6 +2505,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
|
||||
@@ -2476,6 +2524,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
|
||||
test_stack_callout();
|
||||
test_lookaside_list();
|
||||
test_ob_reference();
|
||||
@@ -90,7 +90,7 @@ index 751f2acff96..1af19c6f9ba 100644
|
||||
test_resource();
|
||||
test_lookup_thread();
|
||||
test_IoAttachDeviceToDeviceStack();
|
||||
@@ -2938,6 +2987,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry)
|
||||
@@ -2987,6 +3036,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry)
|
||||
DbgPrint("loading driver\n");
|
||||
|
||||
driver_obj = driver;
|
||||
@@ -99,10 +99,10 @@ index 751f2acff96..1af19c6f9ba 100644
|
||||
/* Allow unloading of the driver */
|
||||
driver->DriverUnload = driver_Unload;
|
||||
diff --git a/programs/winedevice/device.c b/programs/winedevice/device.c
|
||||
index bb585087230..9b4395ff098 100644
|
||||
index 8f816c2c0ec..6a7d0972a11 100644
|
||||
--- a/programs/winedevice/device.c
|
||||
+++ b/programs/winedevice/device.c
|
||||
@@ -122,8 +122,16 @@ static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_
|
||||
@@ -121,8 +121,16 @@ static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_
|
||||
|
||||
static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
|
||||
{
|
||||
@@ -119,7 +119,7 @@ index bb585087230..9b4395ff098 100644
|
||||
|
||||
if (!(stop_event = CreateEventW( NULL, TRUE, FALSE, NULL )))
|
||||
return;
|
||||
@@ -136,6 +144,24 @@ static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
|
||||
@@ -135,6 +143,24 @@ static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
|
||||
wcscat( driver_dir, L"\\drivers" );
|
||||
AddDllDirectory( driver_dir );
|
||||
|
||||
@@ -145,5 +145,5 @@ index bb585087230..9b4395ff098 100644
|
||||
set_service_status( service_handle, SERVICE_RUNNING,
|
||||
SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN );
|
||||
--
|
||||
2.43.0
|
||||
2.51.0
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user