Compare commits

..

12 Commits
v9.18 ... v9.20

Author SHA1 Message Date
Alistair Leslie-Hughes
5a1b9d5093 Release v9.20 2024-10-19 08:10:39 +11:00
Alistair Leslie-Hughes
c1f62cba4d Rebase against 3a6e9365336304b4d7eb4d66aef959f67361cc1f. 2024-10-19 08:03:42 +11:00
Alistair Leslie-Hughes
02792d0328 Added win32u-NtGdiExtTextOutW-rotation patchset 2024-10-18 07:34:05 +11:00
Alistair Leslie-Hughes
44f9ec9761 Updated vkd3d-latest patchset 2024-10-18 07:32:33 +11:00
Alistair Leslie-Hughes
81492f7156 Updated vkd3d-latest patchset 2024-10-15 09:23:52 +11:00
Alistair Leslie-Hughes
683813d151 Drop gdi32-rotation patchset
This was "fixed" upstream. Though the current implementation is causing
multiple regressions with Rounded Rects.
2024-10-15 09:22:31 +11:00
Alistair Leslie-Hughes
858bf979a1 Release v9.19 2024-10-06 08:54:49 +11:00
Alistair Leslie-Hughes
c2319432af Updated vkd3d-latest patchset 2024-10-05 11:28:16 +10:00
Alistair Leslie-Hughes
ff1bc55757 Rebase against 7ee99608f469723bafadb28ef0ebd20631f86e9d. 2024-10-05 11:27:49 +10:00
Alistair Leslie-Hughes
3695e09653 updated vkd3d-latest patchset 2024-10-03 12:54:36 +10:00
Alistair Leslie-Hughes
ef36ee4399 Rebase against 7c1fbc40b7ed0b9b1f2c96b99a592530eadae14f. 2024-10-03 12:53:12 +10:00
Elizabeth Figura
3dfacea342 Rebase against b6196159becb194a56434061fe3bba239863b783. 2024-09-24 11:33:47 -05:00
33 changed files with 24379 additions and 13461 deletions

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
From e222dd363cf419eecb0d5c97390b60de15f37951 Mon Sep 17 00:00:00 2001
From 0c97689e30108869e0ffc5fb7a13edcb42de7450 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Fri, 8 Jun 2018 18:51:40 -0500
Subject: [PATCH] server: Add an object operation to grab the esync file
@@ -25,6 +25,7 @@ Split off to decrease patch size.
server/mapping.c | 3 +++
server/mutex.c | 1 +
server/named_pipe.c | 5 +++++
server/object.c | 2 ++
server/object.h | 2 ++
server/process.c | 3 +++
server/queue.c | 2 ++
@@ -40,13 +41,13 @@ Split off to decrease patch size.
server/token.c | 1 +
server/window.c | 1 +
server/winstation.c | 2 ++
34 files changed, 68 insertions(+)
35 files changed, 70 insertions(+)
diff --git a/server/async.c b/server/async.c
index 9cb251df5ce..337bba8631b 100644
index 749c547af4f..2377c737e98 100644
--- a/server/async.c
+++ b/server/async.c
@@ -77,6 +77,7 @@ static const struct object_ops async_ops =
@@ -78,6 +78,7 @@ static const struct object_ops async_ops =
add_queue, /* add_queue */
remove_queue, /* remove_queue */
async_signaled, /* signaled */
@@ -54,7 +55,7 @@ index 9cb251df5ce..337bba8631b 100644
async_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -676,6 +677,7 @@ static const struct object_ops iosb_ops =
@@ -698,6 +699,7 @@ static const struct object_ops iosb_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -75,7 +76,7 @@ index ff0799f5880..d9824de8eac 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/change.c b/server/change.c
index 7a806abc017..e080511bb23 100644
index f42ce066340..d0a90a99261 100644
--- a/server/change.c
+++ b/server/change.c
@@ -112,6 +112,7 @@ static const struct object_ops dir_ops =
@@ -87,7 +88,7 @@ index 7a806abc017..e080511bb23 100644
no_signal, /* signal */
dir_get_fd, /* get_fd */
diff --git a/server/clipboard.c b/server/clipboard.c
index 8118a467dd8..8b265f2dcea 100644
index 91f159bc7c9..0df7fd2f18e 100644
--- a/server/clipboard.c
+++ b/server/clipboard.c
@@ -76,6 +76,7 @@ static const struct object_ops clipboard_ops =
@@ -171,7 +172,7 @@ index b64283baf4a..1cc9eea6a50 100644
no_signal, /* signal */
console_connection_get_fd, /* get_fd */
diff --git a/server/debugger.c b/server/debugger.c
index 48adb244b09..d85a2000684 100644
index c59a0abea77..ca04d4c71ce 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -86,6 +86,7 @@ static const struct object_ops debug_event_ops =
@@ -227,7 +228,7 @@ index 436dac6bfe9..f730fa81afa 100644
no_signal, /* signal */
device_file_get_fd, /* get_fd */
diff --git a/server/directory.c b/server/directory.c
index 23d7eb0a2b7..bc161b9ab7e 100644
index b37ec969a9e..a6c0e292071 100644
--- a/server/directory.c
+++ b/server/directory.c
@@ -69,6 +69,7 @@ static const struct object_ops object_type_ops =
@@ -279,7 +280,7 @@ index f1b79b1b35e..c727bfdd1ba 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/fd.c b/server/fd.c
index 74ad95fd4d1..4ce498ec0ef 100644
index 16328063df6..4ce78db5b33 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -172,6 +172,7 @@ static const struct object_ops fd_ops =
@@ -315,7 +316,7 @@ index 74ad95fd4d1..4ce498ec0ef 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/file.c b/server/file.c
index b4f99ddc93b..1b4efb04bc5 100644
index 2a839968c25..cbef0c63383 100644
--- a/server/file.c
+++ b/server/file.c
@@ -94,6 +94,7 @@ static const struct object_ops file_ops =
@@ -327,7 +328,7 @@ index b4f99ddc93b..1b4efb04bc5 100644
no_signal, /* signal */
file_get_fd, /* get_fd */
diff --git a/server/handle.c b/server/handle.c
index 0595fdb403b..d41c7e86454 100644
index e65831b3b22..e6c5707556f 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -126,6 +126,7 @@ static const struct object_ops handle_table_ops =
@@ -339,10 +340,10 @@ index 0595fdb403b..d41c7e86454 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/hook.c b/server/hook.c
index 5abdf39ad37..da351d6791f 100644
index c2d2823cd61..ab4d0e9dd31 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -80,6 +80,7 @@ static const struct object_ops hook_table_ops =
@@ -81,6 +81,7 @@ static const struct object_ops hook_table_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -351,10 +352,10 @@ index 5abdf39ad37..da351d6791f 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/mailslot.c b/server/mailslot.c
index 2d8697ec9bd..4cf9b73f784 100644
index 61eceec94e2..92fe938d3b9 100644
--- a/server/mailslot.c
+++ b/server/mailslot.c
@@ -74,6 +74,7 @@ static const struct object_ops mailslot_ops =
@@ -81,6 +81,7 @@ static const struct object_ops mailslot_ops =
add_queue, /* add_queue */
remove_queue, /* remove_queue */
default_fd_signaled, /* signaled */
@@ -362,7 +363,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
mailslot_get_fd, /* get_fd */
@@ -133,6 +134,7 @@ static const struct object_ops mail_writer_ops =
@@ -142,6 +143,7 @@ static const struct object_ops mail_writer_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -370,7 +371,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
NULL, /* satisfied */
no_signal, /* signal */
mail_writer_get_fd, /* get_fd */
@@ -196,6 +198,7 @@ static const struct object_ops mailslot_device_ops =
@@ -207,6 +209,7 @@ static const struct object_ops mailslot_device_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -378,7 +379,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -226,6 +229,7 @@ static const struct object_ops mailslot_device_file_ops =
@@ -237,6 +240,7 @@ static const struct object_ops mailslot_device_file_ops =
add_queue, /* add_queue */
remove_queue, /* remove_queue */
default_fd_signaled, /* signaled */
@@ -387,7 +388,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
no_signal, /* signal */
mailslot_device_file_get_fd, /* get_fd */
diff --git a/server/mapping.c b/server/mapping.c
index 2d0a0b783e2..1acfb032bfd 100644
index 2bf45780375..b84bb08a77b 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -67,6 +67,7 @@ static const struct object_ops ranges_ops =
@@ -427,7 +428,7 @@ index af0efe72132..4785a830e92 100644
mutex_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/named_pipe.c b/server/named_pipe.c
index f3404a33c3b..f28cb14cb45 100644
index dd8c14b30a9..5880b601d3a 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -119,6 +119,7 @@ static const struct object_ops named_pipe_ops =
@@ -470,8 +471,28 @@ index f3404a33c3b..f28cb14cb45 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
named_pipe_device_file_get_fd, /* get_fd */
diff --git a/server/object.c b/server/object.c
index b1665fb5372..0a4d1bede06 100644
--- a/server/object.c
+++ b/server/object.c
@@ -108,6 +108,7 @@ static const struct object_ops apc_reserve_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
+ NULL, /* get_esync_fd */
no_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -132,6 +133,7 @@ static const struct object_ops completion_reserve_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
+ NULL, /* get_esync_fd */
no_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/object.h b/server/object.h
index dfdd691601f..711af54b579 100644
index 6222e3352ed..0a65d0e3892 100644
--- a/server/object.h
+++ b/server/object.h
@@ -78,6 +78,8 @@ struct object_ops
@@ -484,7 +505,7 @@ index dfdd691601f..711af54b579 100644
void (*satisfied)(struct object *,struct wait_queue_entry *);
/* signal an object */
diff --git a/server/process.c b/server/process.c
index a0d5ea64d97..777bf7c2fe2 100644
index 49f5c75005f..dc83a089655 100644
--- a/server/process.c
+++ b/server/process.c
@@ -105,6 +105,7 @@ static const struct object_ops process_ops =
@@ -512,10 +533,10 @@ index a0d5ea64d97..777bf7c2fe2 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/queue.c b/server/queue.c
index 348fdac3214..2cd8949a252 100644
index 984d466b66e..8a95055db40 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -174,6 +174,7 @@ static const struct object_ops msg_queue_ops =
@@ -165,6 +165,7 @@ static const struct object_ops msg_queue_ops =
msg_queue_add_queue, /* add_queue */
msg_queue_remove_queue, /* remove_queue */
msg_queue_signaled, /* signaled */
@@ -523,7 +544,7 @@ index 348fdac3214..2cd8949a252 100644
msg_queue_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -211,6 +212,7 @@ static const struct object_ops thread_input_ops =
@@ -202,6 +203,7 @@ static const struct object_ops thread_input_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -532,7 +553,7 @@ index 348fdac3214..2cd8949a252 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/registry.c b/server/registry.c
index 629d67c832f..d6b39b99b22 100644
index cc9a33fff1d..c19e92c9750 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -180,6 +180,7 @@ static const struct object_ops key_ops =
@@ -544,7 +565,7 @@ index 629d67c832f..d6b39b99b22 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/request.c b/server/request.c
index 7021741c765..ca83fdbd2af 100644
index dabcea68309..832a33917b4 100644
--- a/server/request.c
+++ b/server/request.c
@@ -90,6 +90,7 @@ static const struct object_ops master_socket_ops =
@@ -568,10 +589,10 @@ index 53b42a886df..e3889f24601 100644
semaphore_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/serial.c b/server/serial.c
index d665eb7fa35..11e204e4419 100644
index 209f2e9174e..0d49a996c2a 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -85,6 +85,7 @@ static const struct object_ops serial_ops =
@@ -91,6 +91,7 @@ static const struct object_ops serial_ops =
add_queue, /* add_queue */
remove_queue, /* remove_queue */
default_fd_signaled, /* signaled */
@@ -592,10 +613,10 @@ index 19b76d44c16..55cd6aa037e 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/sock.c b/server/sock.c
index 52175b08987..77b41716cd1 100644
index d2ec882554f..44a4e3b7b15 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -451,6 +451,7 @@ static const struct object_ops sock_ops =
@@ -471,6 +471,7 @@ static const struct object_ops sock_ops =
add_queue, /* add_queue */
remove_queue, /* remove_queue */
default_fd_signaled, /* signaled */
@@ -603,7 +624,7 @@ index 52175b08987..77b41716cd1 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
sock_get_fd, /* get_fd */
@@ -3481,6 +3482,7 @@ static const struct object_ops ifchange_ops =
@@ -3599,6 +3600,7 @@ static const struct object_ops ifchange_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -611,7 +632,7 @@ index 52175b08987..77b41716cd1 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
ifchange_get_fd, /* get_fd */
@@ -3702,6 +3704,7 @@ static const struct object_ops socket_device_ops =
@@ -3820,6 +3822,7 @@ static const struct object_ops socket_device_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -620,7 +641,7 @@ index 52175b08987..77b41716cd1 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/symlink.c b/server/symlink.c
index 27d48e2f994..8cb24b4ff6e 100644
index dd28efd3a75..c7f34412317 100644
--- a/server/symlink.c
+++ b/server/symlink.c
@@ -71,6 +71,7 @@ static const struct object_ops symlink_ops =
@@ -632,7 +653,7 @@ index 27d48e2f994..8cb24b4ff6e 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/thread.c b/server/thread.c
index 0d5bdcf21d9..9dc38d4cce9 100644
index cf69b3b53c3..4b537586e31 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -96,6 +96,7 @@ static const struct object_ops thread_apc_ops =
@@ -672,10 +693,10 @@ index 96dc9d00ca1..f59902d5607 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/token.c b/server/token.c
index 4df8d2e0c6e..8b4d2f0c1b1 100644
index 48ee1eca8fe..479596bdbfa 100644
--- a/server/token.c
+++ b/server/token.c
@@ -143,6 +143,7 @@ static const struct object_ops token_ops =
@@ -145,6 +145,7 @@ static const struct object_ops token_ops =
no_add_queue, /* add_queue */
NULL, /* remove_queue */
NULL, /* signaled */
@@ -684,7 +705,7 @@ index 4df8d2e0c6e..8b4d2f0c1b1 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/window.c b/server/window.c
index 242e93f303a..3aa7ad4ad79 100644
index 412592fbc71..94a70ce890f 100644
--- a/server/window.c
+++ b/server/window.c
@@ -107,6 +107,7 @@ static const struct object_ops window_ops =
@@ -696,7 +717,7 @@ index 242e93f303a..3aa7ad4ad79 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/winstation.c b/server/winstation.c
index 5903497d61e..7692fbe3ed2 100644
index e5f4bfec357..50fe34aa9ce 100644
--- a/server/winstation.c
+++ b/server/winstation.c
@@ -76,6 +76,7 @@ static const struct object_ops winstation_ops =
@@ -716,5 +737,5 @@ index 5903497d61e..7692fbe3ed2 100644
no_signal, /* signal */
no_get_fd, /* get_fd */
--
2.42.0
2.45.2

View File

@@ -1,119 +0,0 @@
From dc2aaa6a25ebccc30c7903fa68235d5971f8d6b8 Mon Sep 17 00:00:00 2001
From: Daniel Wendt <daniel.wendt@linux.com>
Date: Fri, 15 Nov 2013 12:52:37 +0100
Subject: [PATCH] gdi32: fix for rotated Arc, ArcTo, Chord and Pie drawing
problem
Wine-Bug: http://bugs.winehq.org/show_bug.cgi?id=34579
---
dlls/win32u/dibdrv/graphics.c | 80 +++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c
index 410f29e8f19..3a6f8184009 100644
--- a/dlls/win32u/dibdrv/graphics.c
+++ b/dlls/win32u/dibdrv/graphics.c
@@ -310,6 +310,60 @@ static int get_arc_points( int arc_dir, const RECT *rect, POINT start, POINT end
return pos - count;
}
+/*
+ Check if matrix has uniform scale and shear and contains a rotation.
+*/
+static BOOL xform_has_rotate_and_uniform_scale_and_shear( const XFORM *xform )
+{
+ return xform->eM21 != 0 && xform->eM11 == xform->eM22 && -xform->eM21 == xform->eM12;
+}
+
+/*
+ Decompose rotation and translation from matrix xform.
+
+ If parameter rotation_and_translation is != NULL, save rotation and translation into it.
+
+ Note: The current implementation only works on matrixes with uniform scale and shear,
+ which has to be checked by a call to xform_has_rotate_and_uniform_scale_and_shear().
+ Hints how to get unique values for non-uniform matrixes are welcome.
+*/
+static BOOL xform_decompose_rotation_and_translation( XFORM *xform, XFORM *rotation_and_translation )
+{
+ XFORM inverse_matrix_scale;
+ XFORM origin_matrix = *xform;
+ double determinant = 0;
+
+ /* xform = xfrom-transposed * xform */
+ xform->eM11 = sqrt( xform->eM11 * xform->eM11 + xform->eM21 * xform->eM21 );
+ xform->eM22 = sqrt( xform->eM12 * xform->eM12 + xform->eM22 * xform->eM22 );
+ xform->eM12 = 0;
+ xform->eM21 = 0;
+ xform->eDx = 0;
+ xform->eDy = 0;
+
+ if ( rotation_and_translation == NULL )
+ return TRUE;
+
+ if ( xform->eM11 == 0 || xform->eM22 == 0 )
+ return FALSE;
+
+ determinant = xform->eM11 * xform->eM22;
+
+ inverse_matrix_scale.eM11 = xform->eM22 / determinant;
+ inverse_matrix_scale.eM12 = 0;
+ inverse_matrix_scale.eM21 = 0;
+ inverse_matrix_scale.eM22 = xform->eM11 / determinant;
+
+ /* calculate the rotation matrix */
+ rotation_and_translation->eM11 = inverse_matrix_scale.eM11 * origin_matrix.eM11;
+ rotation_and_translation->eM12 = inverse_matrix_scale.eM11 * origin_matrix.eM12;
+ rotation_and_translation->eM21 = inverse_matrix_scale.eM22 * origin_matrix.eM12 * -1;
+ rotation_and_translation->eM22 = inverse_matrix_scale.eM22 * origin_matrix.eM22;
+ rotation_and_translation->eDx = origin_matrix.eDx;
+ rotation_and_translation->eDy = origin_matrix.eDy;
+ return TRUE;
+}
+
/* backend for arc functions; extra_lines is -1 for ArcTo, 0 for Arc, 1 for Chord, 2 for Pie */
static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT start_x, INT start_y, INT end_x, INT end_y, INT extra_lines )
@@ -322,6 +376,22 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
BOOL ret = TRUE;
HRGN outline = 0, interior = 0;
+ BOOL exclude_rotation = FALSE;
+ XFORM old;
+ XFORM rotation_and_translation;
+ if (dc->attr->graphics_mode == GM_ADVANCED)
+ {
+ XFORM xf;
+ NtGdiGetTransform( pdev->dev.hdc, 0x203, &old );
+ xf = old;
+ if (xform_has_rotate_and_uniform_scale_and_shear( &xf ) &&
+ xform_decompose_rotation_and_translation( &xf, &rotation_and_translation ))
+ {
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &xf, MWT_SET );
+ exclude_rotation = TRUE;
+ }
+ }
+
if (!get_pen_device_rect( dc, pdev, &rect, left, top, right, bottom )) return TRUE;
width = rect.right - rect.left;
@@ -355,6 +425,16 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
points[count].y = rect.top + height / 2;
count++;
}
+
+ if (exclude_rotation == TRUE)
+ {
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &rotation_and_translation, MWT_SET );
+ /* apply rotation and translation to calculated points */
+ NtGdiTransformPoints( dev->hdc, points, points, count, NtGdiLPtoDP );
+ /* restore origin matrix */
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &old, MWT_SET );
+ }
+
if (count < 2)
{
free( points );
--
2.33.0

View File

@@ -1,110 +0,0 @@
From fdc9d34400af31765d20ca7b070e53d7eec710e4 Mon Sep 17 00:00:00 2001
From: Daniel Wendt <daniel.wendt@linux.com>
Date: Tue, 10 Dec 2013 14:55:32 +0100
Subject: [PATCH] gdi32: fix for rotated ellipse
Bug: http://bugs.winehq.org/show_bug.cgi?id=35331
---
dlls/win32u/dibdrv/graphics.c | 63 ++++++++++++++++++++++++-----------
1 file changed, 44 insertions(+), 19 deletions(-)
diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c
index 21d2eabbc9e..1eeea1d68ea 100644
--- a/dlls/win32u/dibdrv/graphics.c
+++ b/dlls/win32u/dibdrv/graphics.c
@@ -1531,10 +1531,28 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
DC *dc = get_physdev_dc( dev );
RECT rect;
POINT pt[2], *points;
- int i, end, count;
+ int i, end;
+ ULONG count;
BOOL ret = TRUE;
HRGN outline = 0, interior = 0;
+ BOOL exclude_rotation_translation = FALSE;
+ XFORM old;
+ XFORM rotation_and_translation;
+
+ if (dc->attr->graphics_mode == GM_ADVANCED)
+ {
+ XFORM xf;
+ NtGdiGetTransform( pdev->dev.hdc, 0x203, &old );
+ xf = old;
+ if (xform_has_rotate_and_uniform_scale_and_shear( &xf ) &&
+ xform_decompose_rotation_and_translation( &xf, &rotation_and_translation ))
+ {
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &xf, MWT_SET );
+ exclude_rotation_translation = TRUE;
+ }
+ }
+
if (!get_pen_device_rect( dc, pdev, &rect, left, top, right, bottom )) return TRUE;
pt[0].x = pt[0].y = 0;
@@ -1555,23 +1573,6 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
return FALSE;
}
- if (pdev->brush.style != BS_NULL &&
- !(interior = NtGdiCreateRoundRectRgn( rect.left, rect.top, rect.right + 1, rect.bottom + 1,
- ellipse_width, ellipse_height )))
- {
- free( points );
- if (outline) NtGdiDeleteObjectApp( outline );
- return FALSE;
- }
-
- /* if not using a region, paint the interior first so the outline can overlap it */
- if (interior && !outline)
- {
- ret = brush_region( pdev, interior );
- NtGdiDeleteObjectApp( interior );
- interior = 0;
- }
-
count = ellipse_first_quadrant( ellipse_width, ellipse_height, points );
if (dc->attr->arc_direction == AD_CLOCKWISE)
@@ -1615,13 +1616,37 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
}
count = end + 1;
+ if (exclude_rotation_translation == TRUE)
+ {
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &rotation_and_translation, MWT_SET );
+ /* apply rotation and translation to calculated points */
+ NtGdiTransformPoints( dev->hdc, points, points, count, NtGdiLPtoDP );
+ /* restore origin matrix */
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &old, MWT_SET );
+ }
+
+ if (pdev->brush.style != BS_NULL &&
+ !(interior = ULongToHandle(NtGdiPolyPolyDraw( ULongToHandle(ALTERNATE), points, &count, 1, NtGdiPolyPolygonRgn ))))
+ {
+ free( points );
+ if (outline) NtGdiDeleteObjectApp( outline );
+ return FALSE;
+ }
+
+ /* if not using a region, paint the interior first so the outline can overlap it */
+ if (interior && !outline)
+ {
+ ret = brush_region( pdev, interior );
+ NtGdiDeleteObjectApp( interior );
+ interior = 0;
+ }
+
reset_dash_origin( pdev );
pdev->pen_lines( pdev, count, points, TRUE, outline );
add_pen_lines_bounds( pdev, count, points, outline );
if (interior)
{
- NtGdiCombineRgn( interior, interior, outline, RGN_DIFF );
ret = brush_region( pdev, interior );
NtGdiDeleteObjectApp( interior );
}
--
2.43.0

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,386 @@
From 4b1bc5d293eca9de7f1f00f3afac32e329364515 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 10 Oct 2024 07:16:15 +1100
Subject: [PATCH] Updated vkd3d to 9cb4207c92ec3ee05fce15580c89f2e5146354db.
---
libs/vkd3d/libs/vkd3d-shader/dxil.c | 15 +++
libs/vkd3d/libs/vkd3d-shader/glsl.c | 101 ++++++++++++++++--
libs/vkd3d/libs/vkd3d-shader/ir.c | 40 +++++++
libs/vkd3d/libs/vkd3d-shader/spirv.c | 24 ++---
libs/vkd3d/libs/vkd3d-shader/tpf.c | 15 +++
.../libs/vkd3d-shader/vkd3d_shader_main.c | 2 +
.../libs/vkd3d-shader/vkd3d_shader_private.h | 1 +
7 files changed, 173 insertions(+), 25 deletions(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/dxil.c b/libs/vkd3d/libs/vkd3d-shader/dxil.c
index c66b059325a..5db9d6da063 100644
--- a/libs/vkd3d/libs/vkd3d-shader/dxil.c
+++ b/libs/vkd3d/libs/vkd3d-shader/dxil.c
@@ -10315,6 +10315,21 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, struct vsir_pro
sm6->ptr = &sm6->start[1];
sm6->bitpos = 2;
+ switch (program->shader_version.type)
+ {
+ case VKD3D_SHADER_TYPE_HULL:
+ case VKD3D_SHADER_TYPE_DOMAIN:
+ break;
+
+ default:
+ if (program->patch_constant_signature.element_count != 0)
+ {
+ WARN("The patch constant signature only makes sense for Hull and Domain Shaders, ignoring it.\n");
+ shader_signature_cleanup(&program->patch_constant_signature);
+ }
+ break;
+ }
+
input_signature = &program->input_signature;
output_signature = &program->output_signature;
patch_constant_signature = &program->patch_constant_signature;
diff --git a/libs/vkd3d/libs/vkd3d-shader/glsl.c b/libs/vkd3d/libs/vkd3d-shader/glsl.c
index 4dc95899a11..91ee355ed39 100644
--- a/libs/vkd3d/libs/vkd3d-shader/glsl.c
+++ b/libs/vkd3d/libs/vkd3d-shader/glsl.c
@@ -651,6 +651,20 @@ static void shader_glsl_cast(struct vkd3d_glsl_generator *gen, const struct vkd3
glsl_dst_cleanup(&dst, &gen->string_buffers);
}
+static void shader_glsl_end_block(struct vkd3d_glsl_generator *gen)
+{
+ --gen->indent;
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "}\n");
+}
+
+static void shader_glsl_begin_block(struct vkd3d_glsl_generator *gen)
+{
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "{\n");
+ ++gen->indent;
+}
+
static void shader_glsl_if(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
{
const char *condition;
@@ -664,23 +678,65 @@ static void shader_glsl_if(struct vkd3d_glsl_generator *gen, const struct vkd3d_
glsl_src_cleanup(&src, &gen->string_buffers);
- shader_glsl_print_indent(gen->buffer, gen->indent);
- vkd3d_string_buffer_printf(gen->buffer, "{\n");
- ++gen->indent;
+ shader_glsl_begin_block(gen);
}
static void shader_glsl_else(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
{
- unsigned int i = 4 * (gen->indent - 1);
+ shader_glsl_end_block(gen);
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "else\n");
+ shader_glsl_begin_block(gen);
+}
- vkd3d_string_buffer_printf(gen->buffer, "%*s}\n%*selse\n%*s{\n", i, "", i, "", i, "");
+static void shader_glsl_loop(struct vkd3d_glsl_generator *gen)
+{
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "for (;;)\n");
+ shader_glsl_begin_block(gen);
}
-static void shader_glsl_endif(struct vkd3d_glsl_generator *gen)
+static void shader_glsl_break(struct vkd3d_glsl_generator *gen)
{
- --gen->indent;
shader_glsl_print_indent(gen->buffer, gen->indent);
- vkd3d_string_buffer_printf(gen->buffer, "}\n");
+ vkd3d_string_buffer_printf(gen->buffer, "break;\n");
+}
+
+static void shader_glsl_continue(struct vkd3d_glsl_generator *gen)
+{
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "continue;\n");
+}
+
+static void shader_glsl_switch(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
+{
+ struct glsl_src src;
+
+ glsl_src_init(&src, gen, &ins->src[0], VKD3DSP_WRITEMASK_0);
+
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "switch (%s)\n", src.str->buffer);
+ shader_glsl_begin_block(gen);
+
+ glsl_src_cleanup(&src, &gen->string_buffers);
+}
+
+static void shader_glsl_case(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
+{
+ struct glsl_src src;
+
+ glsl_src_init(&src, gen, &ins->src[0], VKD3DSP_WRITEMASK_0);
+
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "case %s:\n", src.str->buffer);
+
+ glsl_src_cleanup(&src, &gen->string_buffers);
+}
+
+static void shader_glsl_default(struct vkd3d_glsl_generator *gen)
+{
+ shader_glsl_print_indent(gen->buffer, gen->indent);
+ vkd3d_string_buffer_printf(gen->buffer, "default:\n");
}
static void shader_glsl_ld(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
@@ -1013,6 +1069,9 @@ static void shader_glsl_shader_prologue(struct vkd3d_glsl_generator *gen)
case VKD3D_SHADER_COMPONENT_UINT:
vkd3d_string_buffer_printf(buffer, " = uintBitsToFloat(shader_in_%u)", i);
break;
+ case VKD3D_SHADER_COMPONENT_INT:
+ vkd3d_string_buffer_printf(buffer, " = intBitsToFloat(shader_in_%u)", i);
+ break;
default:
vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL,
"Internal compiler error: Unhandled input component type %#x.", e->component_type);
@@ -1127,6 +1186,15 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_AND:
shader_glsl_binop(gen, ins, "&");
break;
+ case VKD3DSIH_BREAK:
+ shader_glsl_break(gen);
+ break;
+ case VKD3DSIH_CASE:
+ shader_glsl_case(gen, ins);
+ break;
+ case VKD3DSIH_CONTINUE:
+ shader_glsl_continue(gen);
+ break;
case VKD3DSIH_DCL_INDEXABLE_TEMP:
shader_glsl_dcl_indexable_temp(gen, ins);
break;
@@ -1138,6 +1206,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_DCL_OUTPUT_SIV:
case VKD3DSIH_NOP:
break;
+ case VKD3DSIH_DEFAULT:
+ shader_glsl_default(gen);
+ break;
case VKD3DSIH_DIV:
shader_glsl_binop(gen, ins, "/");
break;
@@ -1154,7 +1225,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
shader_glsl_else(gen, ins);
break;
case VKD3DSIH_ENDIF:
- shader_glsl_endif(gen);
+ case VKD3DSIH_ENDLOOP:
+ case VKD3DSIH_ENDSWITCH:
+ shader_glsl_end_block(gen);
break;
case VKD3DSIH_EQO:
case VKD3DSIH_IEQ:
@@ -1184,6 +1257,7 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
break;
case VKD3DSIH_ILT:
case VKD3DSIH_LTO:
+ case VKD3DSIH_ULT:
shader_glsl_relop(gen, ins, "<", "lessThan");
break;
case VKD3DSIH_IMAX:
@@ -1220,6 +1294,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_LOG:
shader_glsl_intrinsic(gen, ins, "log2");
break;
+ case VKD3DSIH_LOOP:
+ shader_glsl_loop(gen);
+ break;
case VKD3DSIH_MOV:
shader_glsl_mov(gen, ins);
break;
@@ -1259,6 +1336,9 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen,
case VKD3DSIH_SQRT:
shader_glsl_intrinsic(gen, ins, "sqrt");
break;
+ case VKD3DSIH_SWITCH:
+ shader_glsl_switch(gen, ins);
+ break;
default:
shader_glsl_unhandled(gen, ins);
break;
@@ -1663,6 +1743,9 @@ static void shader_glsl_generate_input_declarations(struct vkd3d_glsl_generator
case VKD3D_SHADER_COMPONENT_UINT:
vkd3d_string_buffer_printf(buffer, "uvec4");
break;
+ case VKD3D_SHADER_COMPONENT_INT:
+ vkd3d_string_buffer_printf(buffer, "ivec4");
+ break;
case VKD3D_SHADER_COMPONENT_FLOAT:
vkd3d_string_buffer_printf(buffer, "vec4");
break;
diff --git a/libs/vkd3d/libs/vkd3d-shader/ir.c b/libs/vkd3d/libs/vkd3d-shader/ir.c
index 14cf23e8d1a..affbae3ea4e 100644
--- a/libs/vkd3d/libs/vkd3d-shader/ir.c
+++ b/libs/vkd3d/libs/vkd3d-shader/ir.c
@@ -6505,6 +6505,30 @@ static bool vsir_validate_src_max_count(struct validation_context *ctx,
return true;
}
+static void vsir_validate_signature_element(struct validation_context *ctx,
+ const struct shader_signature *signature, const char *signature_type,
+ unsigned int idx)
+{
+ const struct signature_element *element = &signature->elements[idx];
+
+ if (element->register_count == 0)
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
+ "element %u of %s signature: Invalid zero register count.", idx, signature_type);
+
+ if (element->mask == 0 || (element->mask & ~0xf))
+ validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
+ "element %u of %s signature: Invalid mask %#x.", idx, signature_type, element->mask);
+}
+
+static void vsir_validate_signature(struct validation_context *ctx,
+ const struct shader_signature *signature, const char *signature_type)
+{
+ unsigned int i;
+
+ for (i = 0; i < signature->element_count; ++i)
+ vsir_validate_signature_element(ctx, signature, signature_type, i);
+}
+
static const char *name_from_cf_type(enum vsir_control_flow_type type)
{
switch (type)
@@ -7042,6 +7066,22 @@ enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t c
if (!(config_flags & VKD3D_SHADER_CONFIG_FLAG_FORCE_VALIDATION))
return VKD3D_OK;
+ switch (program->shader_version.type)
+ {
+ case VKD3D_SHADER_TYPE_HULL:
+ case VKD3D_SHADER_TYPE_DOMAIN:
+ break;
+
+ default:
+ if (program->patch_constant_signature.element_count != 0)
+ validator_error(&ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE,
+ "Patch constant signature is only valid for hull and domain shaders.");
+ }
+
+ vsir_validate_signature(&ctx, &program->input_signature, "input");
+ vsir_validate_signature(&ctx, &program->output_signature, "output");
+ vsir_validate_signature(&ctx, &program->patch_constant_signature, "patch constant");
+
if (!(ctx.temps = vkd3d_calloc(ctx.program->temp_count, sizeof(*ctx.temps))))
goto fail;
diff --git a/libs/vkd3d/libs/vkd3d-shader/spirv.c b/libs/vkd3d/libs/vkd3d-shader/spirv.c
index cb610c929b6..692432d5513 100644
--- a/libs/vkd3d/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d/libs/vkd3d-shader/spirv.c
@@ -3267,18 +3267,6 @@ static void spirv_compiler_emit_register_debug_name(struct vkd3d_spirv_builder *
vkd3d_spirv_build_op_name(builder, id, "%s", debug_name);
}
-static uint32_t spirv_compiler_emit_variable(struct spirv_compiler *compiler,
- struct vkd3d_spirv_stream *stream, SpvStorageClass storage_class,
- enum vkd3d_shader_component_type component_type, unsigned int component_count)
-{
- struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
- uint32_t type_id, ptr_type_id;
-
- type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count);
- ptr_type_id = vkd3d_spirv_get_op_type_pointer(builder, storage_class, type_id);
- return vkd3d_spirv_build_op_variable(builder, stream, ptr_type_id, storage_class, 0);
-}
-
static uint32_t spirv_compiler_emit_array_variable(struct spirv_compiler *compiler,
struct vkd3d_spirv_stream *stream, SpvStorageClass storage_class,
enum vkd3d_shader_component_type component_type, unsigned int component_count,
@@ -3288,10 +3276,6 @@ static uint32_t spirv_compiler_emit_array_variable(struct spirv_compiler *compil
uint32_t type_id, length_id, ptr_type_id;
unsigned int i;
- if (!length_count)
- return spirv_compiler_emit_variable(compiler,
- stream, storage_class, component_type, component_count);
-
type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count);
for (i = 0; i < length_count; ++i)
{
@@ -3305,6 +3289,14 @@ static uint32_t spirv_compiler_emit_array_variable(struct spirv_compiler *compil
return vkd3d_spirv_build_op_variable(builder, stream, ptr_type_id, storage_class, 0);
}
+static uint32_t spirv_compiler_emit_variable(struct spirv_compiler *compiler,
+ struct vkd3d_spirv_stream *stream, SpvStorageClass storage_class,
+ enum vkd3d_shader_component_type component_type, unsigned int component_count)
+{
+ return spirv_compiler_emit_array_variable(compiler, stream, storage_class,
+ component_type, component_count, NULL, 0);
+}
+
static const struct vkd3d_spec_constant_info
{
enum vkd3d_shader_parameter_name name;
diff --git a/libs/vkd3d/libs/vkd3d-shader/tpf.c b/libs/vkd3d/libs/vkd3d-shader/tpf.c
index 75bdb06fe0e..f79e97e92d4 100644
--- a/libs/vkd3d/libs/vkd3d-shader/tpf.c
+++ b/libs/vkd3d/libs/vkd3d-shader/tpf.c
@@ -2914,6 +2914,21 @@ int tpf_parse(const struct vkd3d_shader_compile_info *compile_info, uint64_t con
if (program->shader_version.type == VKD3D_SHADER_TYPE_HULL)
uninvert_used_masks(&program->patch_constant_signature);
+ switch (program->shader_version.type)
+ {
+ case VKD3D_SHADER_TYPE_HULL:
+ case VKD3D_SHADER_TYPE_DOMAIN:
+ break;
+
+ default:
+ if (program->patch_constant_signature.element_count != 0)
+ {
+ WARN("The patch constant signature only makes sense for Hull and Domain Shaders, ignoring it.\n");
+ shader_signature_cleanup(&program->patch_constant_signature);
+ }
+ break;
+ }
+
if (!shader_sm4_parser_validate_signature(&sm4, &program->input_signature,
sm4.input_register_masks, "Input")
|| !shader_sm4_parser_validate_signature(&sm4, &program->output_signature,
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
index 9b320106340..f84ac551272 100644
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_main.c
@@ -1846,6 +1846,8 @@ void shader_signature_cleanup(struct shader_signature *signature)
}
vkd3d_free(signature->elements);
signature->elements = NULL;
+ signature->elements_capacity = 0;
+ signature->element_count = 0;
}
int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc,
diff --git a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
index 1a42f385fc0..41b879af4b4 100644
--- a/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -245,6 +245,7 @@ enum vkd3d_shader_error
VKD3D_SHADER_ERROR_VSIR_INVALID_GS = 9019,
VKD3D_SHADER_ERROR_VSIR_INVALID_PARAMETER = 9020,
VKD3D_SHADER_ERROR_VSIR_MISSING_SEMANTIC = 9021,
+ VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE = 9022,
VKD3D_SHADER_WARNING_VSIR_DYNAMIC_DESCRIPTOR_ARRAY = 9300,
--
2.45.2

View File

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

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