Compare commits

...

4 Commits

Author SHA1 Message Date
Alistair Leslie-Hughes
aa0c8391eb Updated odbc32-fixes patchset
Thanks Steve Fawcett.
2025-04-10 08:25:33 +10:00
Alistair Leslie-Hughes
36020b4a0e Updated vkd3d-latest patchset
Squash and update.
2025-04-10 08:23:17 +10:00
Elizabeth Figura
4fa7fcd631 Rebase against 647004cd5d7ee93ad8b53abb8939da87be3e25a0. 2025-04-09 17:11:35 -05:00
Elizabeth Figura
ebf36e4717 d3dx9_36-DDS: Remove patch.
This was implemented upstream by e12a1d283a0d4a14c2394a05052b06f0de16f1a6.
2025-04-09 16:47:07 -05:00
17 changed files with 7994 additions and 8506 deletions

View File

@@ -1,118 +0,0 @@
From 71d1c176af87bdc48326d5883fbea608314ee0a4 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 11 Jan 2015 16:29:30 +0100
Subject: [PATCH] d3dx9_36: Improve D3DXSaveTextureToFile to save simple
texture to dds file.
---
dlls/d3dx9_36/d3dx9_private.h | 2 ++
dlls/d3dx9_36/surface.c | 63 +++++++++++++++++++++++++++++++++++
dlls/d3dx9_36/texture.c | 5 +--
3 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
index 6a9b3e12b7b..0c6374f35ca 100644
--- a/dlls/d3dx9_36/d3dx9_private.h
+++ b/dlls/d3dx9_36/d3dx9_private.h
@@ -316,6 +316,8 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLO
IDirect3DSurface9 **temp_surface, BOOL write);
HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect,
IDirect3DSurface9 *temp_surface, BOOL update);
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture,
+ const PALETTEENTRY *src_palette);
HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch,
const PALETTEENTRY *palette, enum d3dx_pixel_format_id format, uint32_t left, uint32_t top, uint32_t right,
uint32_t bottom, uint32_t front, uint32_t back, struct d3dx_pixels *pixels);
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 9d2dc96a979..912a3e3c849 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -628,6 +628,69 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
return D3D_OK;
}
+static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex,
+ int face, UINT level, struct IDirect3DSurface9 **surf)
+{
+ switch (type)
+ {
+ case D3DRTYPE_TEXTURE:
+ return IDirect3DTexture9_GetSurfaceLevel((IDirect3DTexture9*) tex, level, surf);
+ case D3DRTYPE_CUBETEXTURE:
+ return IDirect3DCubeTexture9_GetCubeMapSurface((IDirect3DCubeTexture9*) tex, face, level, surf);
+ default:
+ ERR("Unexpected texture type\n");
+ return E_NOTIMPL;
+ }
+}
+
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
+{
+ HRESULT hr;
+ D3DRESOURCETYPE type;
+ UINT mip_levels;
+ IDirect3DSurface9 *surface;
+
+ type = IDirect3DBaseTexture9_GetType(src_texture);
+
+ if ((type != D3DRTYPE_TEXTURE) && (type != D3DRTYPE_CUBETEXTURE) && (type != D3DRTYPE_VOLUMETEXTURE))
+ return D3DERR_INVALIDCALL;
+
+ if (type == D3DRTYPE_CUBETEXTURE)
+ {
+ FIXME("Cube texture not supported yet\n");
+ return E_NOTIMPL;
+ }
+ else if (type == D3DRTYPE_VOLUMETEXTURE)
+ {
+ FIXME("Volume texture not supported yet\n");
+ return E_NOTIMPL;
+ }
+
+ mip_levels = IDirect3DTexture9_GetLevelCount(src_texture);
+
+ if (mip_levels > 1)
+ {
+ FIXME("Mipmap not supported yet\n");
+ return E_NOTIMPL;
+ }
+
+ if (src_palette)
+ {
+ FIXME("Saving surfaces with palettized pixel formats not implemented yet\n");
+ return E_NOTIMPL;
+ }
+
+ hr = get_surface(type, src_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = save_dds_surface_to_memory(dst_buffer, surface, NULL, NULL);
+ IDirect3DSurface9_Release(surface);
+ }
+
+ return hr;
+}
+
static const uint8_t bmp_file_signature[] = { 'B', 'M' };
static const uint8_t jpg_file_signature[] = { 0xff, 0xd8 };
static const uint8_t png_file_signature[] = { 0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a };
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 719a2787445..3f76ec209f9 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -1866,10 +1866,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
if (file_format == D3DXIFF_DDS)
- {
- FIXME("DDS file format isn't supported yet\n");
- return E_NOTIMPL;
- }
+ return save_dds_texture_to_memory(dst_buffer, src_texture, src_palette);
type = IDirect3DBaseTexture9_GetType(src_texture);
switch (type)
--
2.47.2

View File

@@ -1,2 +0,0 @@
Fixes: [26898] Support for DDS file format in D3DXSaveTextureToFileInMemory
Disabled: True

View File

@@ -1,4 +1,4 @@
From 2d897946980e67f742b9f39f5f548cf0e2340510 Mon Sep 17 00:00:00 2001
From f16a96be2b219f8e7733a36dc147f5247b618870 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2024 21:55:20 +1000
Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
@@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
1 file changed, 24 insertions(+)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 3b3b198eaa8..c2748cd33d7 100644
index c16c9a6da69..18d3df1007f 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -2450,11 +2450,35 @@ static SQLRETURN get_data_unix( struct statement *stmt, SQLUSMALLINT column, SQL
@@ -2468,11 +2468,35 @@ static SQLRETURN get_data_unix( struct statement *stmt, SQLUSMALLINT column, SQL
return ret;
}
@@ -31,7 +31,7 @@ index 3b3b198eaa8..c2748cd33d7 100644
if (stmt->hdr.win32_funcs->SQLGetData)
+ {
+ struct environment *env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
+ if (env && env->attr_version == SQL_OV_ODBC2)
+ if (env && env->driver_ver == SQL_OV_ODBC2)
+ {
+ if (type == SQL_C_TYPE_TIME)
+ type = SQL_C_TIME;
@@ -48,5 +48,5 @@ index 3b3b198eaa8..c2748cd33d7 100644
}
--
2.45.2
2.47.2

View File

@@ -1,26 +1,27 @@
From 6b7448e5ebdc0b16f3af606a62e2ca465f3ae026 Mon Sep 17 00:00:00 2001
From 5874cf0a309a0ecfa97206b8b15734485920c325 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2024 22:03:03 +1000
Subject: [PATCH] odbc32: SQLColAttributesW support ODBC v2.0
---
dlls/odbc32/proxyodbc.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
dlls/odbc32/proxyodbc.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 71c853013fd..b5c0edb119e 100644
index 18d3df1007f..8d51ad37176 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -6195,6 +6195,8 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
@@ -6256,6 +6256,9 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen,
SQLLEN *num_attr )
{
+ struct environment *env;
+ SQLRETURN ret = SQL_ERROR;
+
if (stmt->hdr.win32_funcs->SQLColAttributeW)
return stmt->hdr.win32_funcs->SQLColAttributeW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
retlen, num_attr );
@@ -6237,11 +6239,23 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
@@ -6315,11 +6318,23 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
return SQL_ERROR;
}
@@ -28,9 +29,9 @@ index 71c853013fd..b5c0edb119e 100644
+ ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
retlen, num_attr );
+ /* Convert back for ODBC2 drivers */
+ env = (struct environment *)find_object_type(SQL_HANDLE_ENV, stmt->hdr.parent);
+ if (SQL_SUCCEEDED(ret) && num_attr && field_id == SQL_COLUMN_TYPE &&
+ ((struct environment*)(stmt->hdr.parent))->attr_version == SQL_OV_ODBC2 &&
+ ((struct environment*)(stmt->hdr.parent))->driver_ver == SQL_OV_ODBC2)
+ env && env->attr_version == SQL_OV_ODBC3 && env->driver_ver == SQL_OV_ODBC2)
+ {
+ if (*num_attr == SQL_TIME)
+ *num_attr = SQL_TYPE_TIME;
@@ -47,5 +48,5 @@ index 71c853013fd..b5c0edb119e 100644
/*************************************************************************
--
2.43.0
2.47.2

View File

@@ -1,24 +0,0 @@
From 3407a396a86366b81b243fde01e191aa1a2f7f5a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 26 Sep 2014 20:24:50 +0200
Subject: [PATCH] user32: Call UpdateWindow() during DIALOG_CreateIndirect.
---
dlls/user32/dialog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index a226c764c49..91ce53f8297 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -703,6 +703,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE))
{
NtUserShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
+ UpdateWindow( hwnd );
}
return hwnd;
}
--
2.35.1

View File

@@ -1 +0,0 @@
Fixes: [35652] Send WM_PAINT event during dialog creation

View File

@@ -1,4 +1,4 @@
From d5389dd8bb868076b75675719d529d0507a90815 Mon Sep 17 00:00:00 2001
From af732e026343d613cccbab91f7cae3787191ebef Mon Sep 17 00:00:00 2001
From: katahiromz <katayama.hirofumi.mz@gmail.com>
Date: Thu, 11 Oct 2018 13:47:02 +0900
Subject: [PATCH] user32: Implement CascadeWindows.
@@ -11,11 +11,11 @@ Use stanard heap_ functions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45968
Signed-off-by: Hirofumi Katayama <katayama.hirofumi.mz@gmail.com>
---
dlls/user32/mdi.c | 216 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
dlls/user32/mdi.c | 216 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 214 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c
index 10a3882..2e93056 100644
index 05725a29914..e9ec37b0063 100644
--- a/dlls/user32/mdi.c
+++ b/dlls/user32/mdi.c
@@ -2,6 +2,7 @@
@@ -26,7 +26,7 @@ index 10a3882..2e93056 100644
*
* This file contains routines to support MDI (Multiple Document
* Interface) features .
@@ -1846,12 +1847,223 @@ done:
@@ -1795,12 +1796,223 @@ done:
* Success: Number of cascaded windows.
* Failure: 0
*/
@@ -174,7 +174,7 @@ index 10a3882..2e93056 100644
+ work_rect = mi.rcWork;
+ }
+
+ hDWP = BeginDeferWindowPos(info.wnd_count);
+ hDWP = NtUserBeginDeferWindowPos( info.wnd_count );
+ if (hDWP == NULL)
+ goto cleanup;
+
@@ -243,7 +243,7 @@ index 10a3882..2e93056 100644
+ EndDeferWindowPos(hDWP);
+
+ if (prev)
+ SetForegroundWindow(prev);
+ NtUserSetForegroundWindow( prev );
+
+cleanup:
+ heap_free(info.wnd_array);
@@ -253,5 +253,5 @@ index 10a3882..2e93056 100644
--
1.9.1
2.47.2

View File

@@ -1,4 +1,4 @@
From 3f238e248fc4fc4415b3ce5e420c798d516d24ee Mon Sep 17 00:00:00 2001
From 4469bff76a8408ca91dbdd1ebeba5f37f146f854 Mon Sep 17 00:00:00 2001
From: Hirofumi Katayama <katayama.hirofumi.mz@gmail.com>
Date: Mon, 26 Nov 2018 09:09:52 +0900
Subject: [PATCH] user32: Implement TileWindows
@@ -13,10 +13,10 @@ Signed-off-by: Hirofumi Katayama <katayama.hirofumi.mz@gmail.com>
1 file changed, 175 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c
index 9679be895ed..c752f967b4d 100644
index e9ec37b0063..3bf0f28a04f 100644
--- a/dlls/user32/mdi.c
+++ b/dlls/user32/mdi.c
@@ -144,6 +144,10 @@ typedef struct
@@ -132,6 +132,10 @@ typedef struct
static HBITMAP hBmpClose = 0;
@@ -27,7 +27,7 @@ index 9679be895ed..c752f967b4d 100644
/* ----------------- declarations ----------------- */
static void MDI_UpdateFrameText( HWND, HWND, BOOL, LPCWSTR);
static BOOL MDI_AugmentFrameMenu( HWND, HWND );
@@ -1929,8 +1933,6 @@ WORD WINAPI
@@ -1881,8 +1885,6 @@ WORD WINAPI
CascadeWindows (HWND hwndParent, UINT wFlags, const RECT *lpRect,
UINT cKids, const HWND *lpKids)
{
@@ -36,7 +36,7 @@ index 9679be895ed..c752f967b4d 100644
CASCADE_INFO info;
HWND hwnd, top, prev;
HMONITOR monitor;
@@ -2084,8 +2086,177 @@ WORD WINAPI
@@ -2036,8 +2038,177 @@ WORD WINAPI
TileWindows (HWND hwndParent, UINT wFlags, const RECT *lpRect,
UINT cKids, const HWND *lpKids)
{
@@ -135,7 +135,7 @@ index 9679be895ed..c752f967b4d 100644
+ }
+ }
+
+ hDWP = BeginDeferWindowPos(info.wnd_count);
+ hDWP = NtUserBeginDeferWindowPos( info.wnd_count );
+ if (hDWP == NULL)
+ goto cleanup;
+
@@ -206,7 +206,7 @@ index 9679be895ed..c752f967b4d 100644
+ EndDeferWindowPos(hDWP);
+
+ if (hwndPrev)
+ SetForegroundWindow(hwndPrev);
+ NtUserSetForegroundWindow( hwndPrev );
+
+cleanup:
+ if (cKids == 0 || lpKids == NULL)
@@ -217,5 +217,5 @@ index 9679be895ed..c752f967b4d 100644
--
2.24.1
2.47.2

View File

@@ -1,26 +0,0 @@
From ecc14aeb2e510520705e98ebb39e9b2fcb62b453 Mon Sep 17 00:00:00 2001
From: David Torok <dt@zeroitlab.com>
Date: Sun, 17 Nov 2019 19:08:12 +0100
Subject: [PATCH] Send WM_NCPOINTERUP on focus regain
---
dlls/win32u/input.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index a4834b740d8..5d14779538c 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -2045,6 +2045,9 @@ BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus, DWORD new
send_message( hwnd, WM_ACTIVATE,
MAKEWPARAM( mouse ? WA_CLICKACTIVE : WA_ACTIVE, is_iconic(hwnd) ),
(LPARAM)previous );
+
+ send_message( hwnd, WM_NCPOINTERUP, 0, 0);
+
if (NtUserGetAncestor( hwnd, GA_PARENT ) == get_desktop_window())
NtUserPostMessage( get_desktop_window(), WM_PARENTNOTIFY, WM_NCACTIVATE, (LPARAM)hwnd );
}
--
2.47.2

View File

@@ -1,5 +0,0 @@
Fixes: [48121] Improve Alt+tab for unity games.
# The other patches on this bug are other solutions but
# might cause errors if they dont recieve the HTCAPTION
# message.

View File

@@ -0,0 +1,214 @@
From d682beb0dff9eff34d01f2e517145d17d561ef01 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 10 Apr 2025 07:44:42 +1000
Subject: [PATCH 2/2] Updated vkd3d to
cbce3a8631116ec10895e6c9c4a00b89b051f6b0.
---
libs/vkd3d/libs/vkd3d-shader/fx.c | 44 ++++++++++++++++-----
libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c | 10 ++++-
libs/vkd3d/libs/vkd3d-shader/msl.c | 2 +-
libs/vkd3d/libs/vkd3d-shader/tpf.c | 20 +++++++---
4 files changed, 58 insertions(+), 18 deletions(-)
diff --git a/libs/vkd3d/libs/vkd3d-shader/fx.c b/libs/vkd3d/libs/vkd3d-shader/fx.c
index debcb261811..c93f01039ef 100644
--- a/libs/vkd3d/libs/vkd3d-shader/fx.c
+++ b/libs/vkd3d/libs/vkd3d-shader/fx.c
@@ -2420,6 +2420,23 @@ static inline enum hlsl_base_type hlsl_type_from_fx_type(enum state_property_com
}
}
+static inline bool hlsl_type_state_compatible(struct hlsl_type *lhs, enum hlsl_base_type rhs)
+{
+ if (!hlsl_is_numeric_type(lhs))
+ return false;
+ switch (lhs->e.numeric.type)
+ {
+ case HLSL_TYPE_INT:
+ case HLSL_TYPE_UINT:
+ return rhs == HLSL_TYPE_INT || rhs == HLSL_TYPE_UINT;
+
+ default:
+ return lhs->e.numeric.type == rhs;
+ }
+
+ vkd3d_unreachable();
+}
+
static const struct rhs_named_value filter_values[] =
{
{ "MIN_MAG_MIP_POINT", 0x00 },
@@ -2664,9 +2681,9 @@ static void resolve_fx_4_state_block_values(struct hlsl_ir_var *var, struct hlsl
struct replace_state_context replace_context;
const struct fx_4_state *state = NULL;
struct hlsl_type *state_type = NULL;
- struct hlsl_ir_node *node, *cast;
struct hlsl_ctx *ctx = fx->ctx;
enum hlsl_base_type base_type;
+ struct hlsl_ir_node *node;
unsigned int i;
if (type->class == HLSL_CLASS_BLEND_STATE && ctx->profile->major_version == 5)
@@ -2803,9 +2820,15 @@ static void resolve_fx_4_state_block_values(struct hlsl_ir_var *var, struct hlsl
if (state_type)
{
node = entry->args->node;
- if (!(cast = hlsl_new_cast(ctx, node, state_type, &var->loc)))
- return;
- list_add_after(&node->entry, &cast->entry);
+ if (state->type == FX_UINT8 || !hlsl_type_state_compatible(node->data_type, base_type))
+ {
+ struct hlsl_ir_node *cast;
+
+ if (!(cast = hlsl_new_cast(ctx, node, state_type, &var->loc)))
+ return;
+ list_add_after(&node->entry, &cast->entry);
+ node = cast;
+ }
/* FX_UINT8 values are using 32-bits in the binary. Mask higher 24 bits for those. */
if (state->type == FX_UINT8)
@@ -2814,15 +2837,18 @@ static void resolve_fx_4_state_block_values(struct hlsl_ir_var *var, struct hlsl
if (!(mask = hlsl_new_uint_constant(ctx, 0xff, &var->loc)))
return;
- list_add_after(&cast->entry, &mask->entry);
+ list_add_after(&node->entry, &mask->entry);
- if (!(cast = hlsl_new_binary_expr(ctx, HLSL_OP2_BIT_AND, cast, mask)))
+ if (!(node = hlsl_new_binary_expr(ctx, HLSL_OP2_BIT_AND, node, mask)))
return;
- list_add_after(&mask->entry, &cast->entry);
+ list_add_after(&mask->entry, &node->entry);
}
- hlsl_src_remove(entry->args);
- hlsl_src_from_node(entry->args, cast);
+ if (node != entry->args->node)
+ {
+ hlsl_src_remove(entry->args);
+ hlsl_src_from_node(entry->args, node);
+ }
hlsl_run_const_passes(ctx, entry->instrs);
}
diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
index ba56ba90403..dc7607a1393 100644
--- a/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d/libs/vkd3d-shader/hlsl_codegen.c
@@ -6407,7 +6407,9 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var
|| semantic == VKD3D_SHADER_SV_PRIMITIVE_ID)
vip_allocation = true;
- if (semantic == VKD3D_SHADER_SV_IS_FRONT_FACE || semantic == VKD3D_SHADER_SV_SAMPLE_INDEX)
+ if (semantic == VKD3D_SHADER_SV_IS_FRONT_FACE || semantic == VKD3D_SHADER_SV_SAMPLE_INDEX
+ || (version.type == VKD3D_SHADER_TYPE_DOMAIN && !output && !is_primitive)
+ || (ctx->is_patch_constant_func && output))
special_interpolation = true;
}
@@ -6443,6 +6445,8 @@ static void allocate_semantic_registers(struct hlsl_ctx *ctx, struct hlsl_ir_fun
bool is_pixel_shader = ctx->profile->type == VKD3D_SHADER_TYPE_PIXEL;
struct hlsl_ir_var *var;
+ in_prim_allocator.prioritize_smaller_writemasks = true;
+ patch_constant_out_patch_allocator.prioritize_smaller_writemasks = true;
input_allocator.prioritize_smaller_writemasks = true;
output_allocator.prioritize_smaller_writemasks = true;
@@ -6470,6 +6474,8 @@ static void allocate_semantic_registers(struct hlsl_ctx *ctx, struct hlsl_ir_fun
allocate_semantic_register(ctx, var, &output_allocator, true, !is_pixel_shader);
}
+ vkd3d_free(in_prim_allocator.allocations);
+ vkd3d_free(patch_constant_out_patch_allocator.allocations);
vkd3d_free(input_allocator.allocations);
vkd3d_free(output_allocator.allocations);
}
@@ -9770,7 +9776,7 @@ static void sm4_generate_vsir_instr_dcl_semantic(struct hlsl_ctx *ctx, struct vs
else
{
if (semantic == VKD3D_SHADER_SV_NONE || version->type == VKD3D_SHADER_TYPE_PIXEL
- || version->type == VKD3D_SHADER_TYPE_HULL)
+ || (version->type == VKD3D_SHADER_TYPE_HULL && !ctx->is_patch_constant_func))
opcode = VKD3DSIH_DCL_OUTPUT;
else
opcode = VKD3DSIH_DCL_OUTPUT_SIV;
diff --git a/libs/vkd3d/libs/vkd3d-shader/msl.c b/libs/vkd3d/libs/vkd3d-shader/msl.c
index a5d952cd525..d477bfa1c1b 100644
--- a/libs/vkd3d/libs/vkd3d-shader/msl.c
+++ b/libs/vkd3d/libs/vkd3d-shader/msl.c
@@ -1292,7 +1292,7 @@ static int msl_generator_init(struct msl_generator *gen, struct vsir_program *pr
{
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
"Internal compiler error: Unhandled shader type %#x.", type);
- return VKD3D_ERROR_INVALID_SHADER;
+ gen->prefix = "unknown";
}
gen->interface_info = vkd3d_find_struct(compile_info->next, INTERFACE_INFO);
diff --git a/libs/vkd3d/libs/vkd3d-shader/tpf.c b/libs/vkd3d/libs/vkd3d-shader/tpf.c
index 23dab35a288..3be1d743acf 100644
--- a/libs/vkd3d/libs/vkd3d-shader/tpf.c
+++ b/libs/vkd3d/libs/vkd3d-shader/tpf.c
@@ -3116,8 +3116,12 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
{"sv_domainlocation", false, VKD3D_SHADER_TYPE_DOMAIN, ~0u},
{"sv_position", false, VKD3D_SHADER_TYPE_DOMAIN, VKD3D_SHADER_SV_NONE},
{"sv_primitiveid", false, VKD3D_SHADER_TYPE_DOMAIN, ~0u},
+ {"sv_rendertargetarrayindex", false, VKD3D_SHADER_TYPE_DOMAIN, VKD3D_SHADER_SV_NONE},
+ {"sv_viewportarrayindex", false, VKD3D_SHADER_TYPE_DOMAIN, VKD3D_SHADER_SV_NONE},
{"sv_position", true, VKD3D_SHADER_TYPE_DOMAIN, VKD3D_SHADER_SV_POSITION},
+ {"sv_rendertargetarrayindex", true, VKD3D_SHADER_TYPE_DOMAIN, VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX},
+ {"sv_viewportarrayindex", true, VKD3D_SHADER_TYPE_DOMAIN, VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX},
{"sv_primitiveid", false, VKD3D_SHADER_TYPE_GEOMETRY, VKD3D_SHADER_SV_PRIMITIVE_ID},
{"sv_gsinstanceid", false, VKD3D_SHADER_TYPE_GEOMETRY, ~0u},
@@ -3131,6 +3135,8 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
{"sv_primitiveid", false, VKD3D_SHADER_TYPE_HULL, ~0u},
{"sv_position", true, VKD3D_SHADER_TYPE_HULL, VKD3D_SHADER_SV_POSITION},
+ {"sv_rendertargetarrayindex", true, VKD3D_SHADER_TYPE_HULL, VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX},
+ {"sv_viewportarrayindex", true, VKD3D_SHADER_TYPE_HULL, VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX},
{"position", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_POSITION},
{"sv_position", false, VKD3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_SV_POSITION},
@@ -3164,6 +3170,10 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
if (!ascii_strcasecmp(semantic_name, "sv_position")
|| (semantic_compat_mapping && !ascii_strcasecmp(semantic_name, "position")))
*sysval_semantic = VKD3D_SHADER_SV_POSITION;
+ else if (!ascii_strcasecmp(semantic_name, "sv_rendertargetarrayindex"))
+ *sysval_semantic = VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX;
+ else if (!ascii_strcasecmp(semantic_name, "sv_viewportarrayindex"))
+ *sysval_semantic = VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX;
else if (has_sv_prefix)
return false;
else
@@ -3179,11 +3189,6 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
return get_tessfactor_sysval_semantic(sysval_semantic, domain, semantic_idx);
if (!ascii_strcasecmp(semantic_name, "sv_insidetessfactor"))
return get_insidetessfactor_sysval_semantic(sysval_semantic, domain, semantic_idx);
- if (!ascii_strcasecmp(semantic_name, "sv_position"))
- {
- *sysval_semantic = VKD3D_SHADER_SV_NONE;
- return true;
- }
}
else
{
@@ -3214,7 +3219,10 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
&& (semantic_compat_mapping || has_sv_prefix)
&& version->type == semantics[i].shader_type)
{
- *sysval_semantic = semantics[i].semantic;
+ if (is_patch_constant_func && output && semantics[i].semantic != ~0u)
+ *sysval_semantic = VKD3D_SHADER_SV_NONE;
+ else
+ *sysval_semantic = semantics[i].semantic;
return true;
}
}
--
2.47.2

View File

@@ -1 +1 @@
f3843ea16b85012d0d0ca0f4f95a4c87c97d03f9
647004cd5d7ee93ad8b53abb8939da87be3e25a0