Rebase against d575e0afe304d0096f8014f7f411bf28c126cc0b.

[kernel32-Codepage_Conversion]
Removed patch to make sure codepage conversion fails when destination length
is < 0 (accepted upstream).

[server-Coverity]
Removed patches to fix multiple possible invalid memory accesses detected by
Coverity (accepted upstream).

[user32-SetCaretPos]
Removed patch to avoid corruption of caret when SetCaretPos() is called
(accepted upstream).
This commit is contained in:
Sebastian Lackner 2016-01-25 19:23:47 +01:00
parent f2d347b897
commit 124b8035a4
8 changed files with 90 additions and 417 deletions

View File

@ -1,124 +0,0 @@
From 351e216da1c1325ec354183ebf027b09b3d008c7 Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Sat, 19 Sep 2015 12:58:37 +0200
Subject: kernel32: Set error if dstlen < 0 in codepage conversion functions
---
dlls/kernel32/locale.c | 4 ++--
dlls/kernel32/tests/codepage.c | 48 +++++++++++++++++++++++++-----------------
2 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index c0a66ef..6ede521 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -2125,7 +2125,7 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
const union cptable *table;
int ret;
- if (!src || !srclen || (!dst && dstlen))
+ if (!src || !srclen || (!dst && dstlen) || dstlen < 0)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
@@ -2341,7 +2341,7 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
const union cptable *table;
int ret, used_tmp;
- if (!src || !srclen || (!dst && dstlen))
+ if (!src || !srclen || (!dst && dstlen) || dstlen < 0)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
diff --git a/dlls/kernel32/tests/codepage.c b/dlls/kernel32/tests/codepage.c
index 54f62ae..6718a3b 100644
--- a/dlls/kernel32/tests/codepage.c
+++ b/dlls/kernel32/tests/codepage.c
@@ -28,6 +28,7 @@
#include "winbase.h"
#include "winnls.h"
+static const char foobarA[] = "foobar";
static const WCHAR foobarW[] = {'f','o','o','b','a','r',0};
static void test_destination_buffer(void)
@@ -144,48 +145,57 @@ static void test_negative_source_length(void)
static void test_negative_dest_length(void)
{
int len, i;
- static char buf[LONGBUFLEN];
+ static WCHAR bufW[LONGBUFLEN];
+ static char bufA[LONGBUFLEN];
static WCHAR originalW[LONGBUFLEN];
static char originalA[LONGBUFLEN];
DWORD theError;
/* Test return on -1 dest length */
SetLastError( 0xdeadbeef );
- memset(buf,'x',sizeof(buf));
- len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, -1, NULL, NULL);
- todo_wine {
- ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
- "WideCharToMultiByte(destlen -1): len=%d error=%x\n", len, GetLastError());
- }
+ memset(bufA,'x',sizeof(bufA));
+ len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1, NULL, NULL);
+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
+ "WideCharToMultiByte(destlen -1): len=%d error=%x\n", len, GetLastError());
+
+ SetLastError( 0xdeadbeef );
+ memset(bufW,'x',sizeof(bufW));
+ len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1, bufW, -1);
+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
+ "MultiByteToWideChar(destlen -1): len=%d error=%x\n", len, GetLastError());
/* Test return on -1000 dest length */
SetLastError( 0xdeadbeef );
- memset(buf,'x',sizeof(buf));
- len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, -1000, NULL, NULL);
- todo_wine {
- ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
- "WideCharToMultiByte(destlen -1000): len=%d error=%x\n", len, GetLastError());
- }
+ memset(bufA,'x',sizeof(bufA));
+ len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, -1000, NULL, NULL);
+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
+ "WideCharToMultiByte(destlen -1000): len=%d error=%x\n", len, GetLastError());
+
+ SetLastError( 0xdeadbeef );
+ memset(bufW,'x',sizeof(bufW));
+ len = MultiByteToWideChar(CP_ACP, 0, foobarA, -1000, bufW, -1);
+ ok(len == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
+ "MultiByteToWideChar(destlen -1000): len=%d error=%x\n", len, GetLastError());
/* Test return on INT_MAX dest length */
SetLastError( 0xdeadbeef );
- memset(buf,'x',sizeof(buf));
- len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buf, INT_MAX, NULL, NULL);
- ok(len == 7 && !lstrcmpA(buf, "foobar") && GetLastError() == 0xdeadbeef,
+ memset(bufA,'x',sizeof(bufA));
+ len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, bufA, INT_MAX, NULL, NULL);
+ ok(len == 7 && !lstrcmpA(bufA, "foobar") && GetLastError() == 0xdeadbeef,
"WideCharToMultiByte(destlen INT_MAX): len=%d error=%x\n", len, GetLastError());
/* Test return on INT_MAX dest length and very long input */
SetLastError( 0xdeadbeef );
- memset(buf,'x',sizeof(buf));
+ memset(bufA,'x',sizeof(bufA));
for (i=0; i < LONGBUFLEN - 1; i++) {
originalW[i] = 'Q';
originalA[i] = 'Q';
}
originalW[LONGBUFLEN-1] = 0;
originalA[LONGBUFLEN-1] = 0;
- len = WideCharToMultiByte(CP_ACP, 0, originalW, -1, buf, INT_MAX, NULL, NULL);
+ len = WideCharToMultiByte(CP_ACP, 0, originalW, -1, bufA, INT_MAX, NULL, NULL);
theError = GetLastError();
- ok(len == LONGBUFLEN && !lstrcmpA(buf, originalA) && theError == 0xdeadbeef,
+ ok(len == LONGBUFLEN && !lstrcmpA(bufA, originalA) && theError == 0xdeadbeef,
"WideCharToMultiByte(srclen %d, destlen INT_MAX): len %d error=%x\n", LONGBUFLEN, len, theError);
}
--
2.5.1

View File

@ -1 +0,0 @@
Fixes: Codepage conversion should fail when destination length is < 0

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "e5132e5a91208253e67c0eff709ab5c96d79b790"
echo "d575e0afe304d0096f8014f7f411bf28c126cc0b"
}
# Show version information
@ -154,7 +154,6 @@ patch_enable_all ()
enable_iphlpapi_System_Ping="$1"
enable_iphlpapi_TCP_Table="$1"
enable_kernel32_COMSPEC="$1"
enable_kernel32_Codepage_Conversion="$1"
enable_kernel32_CompareString_Length="$1"
enable_kernel32_CopyFileEx="$1"
enable_kernel32_Cwd_Startup_Info="$1"
@ -252,7 +251,6 @@ patch_enable_all ()
enable_rpcrt4_RpcBindingServerFromClient="$1"
enable_secur32_ANSI_NTLM_Credentials="$1"
enable_server_ClipCursor="$1"
enable_server_Coverity="$1"
enable_server_CreateProcess_ACLs="$1"
enable_server_Desktop_Refcount="$1"
enable_server_FileEndOfFileInformation="$1"
@ -308,7 +306,6 @@ patch_enable_all ()
enable_user32_Mouse_Message_Hwnd="$1"
enable_user32_Refresh_MDI_Menus="$1"
enable_user32_ScrollWindowEx="$1"
enable_user32_SetCaretPos="$1"
enable_user32_SetCoalescableTimer="$1"
enable_user32_WM_CAPTURECHANGE="$1"
enable_user32_WM_MDICALCCHILDSCROLL="$1"
@ -603,9 +600,6 @@ patch_enable ()
kernel32-COMSPEC)
enable_kernel32_COMSPEC="$2"
;;
kernel32-Codepage_Conversion)
enable_kernel32_Codepage_Conversion="$2"
;;
kernel32-CompareString_Length)
enable_kernel32_CompareString_Length="$2"
;;
@ -897,9 +891,6 @@ patch_enable ()
server-ClipCursor)
enable_server_ClipCursor="$2"
;;
server-Coverity)
enable_server_Coverity="$2"
;;
server-CreateProcess_ACLs)
enable_server_CreateProcess_ACLs="$2"
;;
@ -1065,9 +1056,6 @@ patch_enable ()
user32-ScrollWindowEx)
enable_user32_ScrollWindowEx="$2"
;;
user32-SetCaretPos)
enable_user32_SetCaretPos="$2"
;;
user32-SetCoalescableTimer)
enable_user32_SetCoalescableTimer="$2"
;;
@ -3749,18 +3737,6 @@ if test "$enable_kernel32_COMSPEC" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-Codepage_Conversion
# |
# | Modified files:
# | * dlls/kernel32/locale.c, dlls/kernel32/tests/codepage.c
# |
if test "$enable_kernel32_Codepage_Conversion" -eq 1; then
patch_apply kernel32-Codepage_Conversion/0001-kernel32-Set-error-if-dstlen-0-in-codepage-conversio.patch
(
echo '+ { "Alex Henrie", "kernel32: Set error if dstlen < 0 in codepage conversion functions.", 1 },';
) >> "$patchlist"
fi
# Patchset kernel32-CompareString_Length
# |
# | This patchset fixes the following Wine bugs:
@ -5393,20 +5369,6 @@ if test "$enable_server_ClipCursor" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-Coverity
# |
# | Modified files:
# | * server/directory.c, server/registry.c
# |
if test "$enable_server_Coverity" -eq 1; then
patch_apply server-Coverity/0001-server-Add-missing-check-for-objattr-variable-in-loa.patch
patch_apply server-Coverity/0002-server-Avoid-invalid-memory-access-if-creation-of-na.patch
(
echo '+ { "Sebastian Lackner", "server: Add missing check for objattr variable in load_registry wineserver call (Coverity).", 1 },';
echo '+ { "Sebastian Lackner", "server: Avoid invalid memory access if creation of namespace fails in create_directory (Coverity).", 1 },';
) >> "$patchlist"
fi
# Patchset server-FileEndOfFileInformation
# |
# | Modified files:
@ -6189,18 +6151,6 @@ if test "$enable_user32_ScrollWindowEx" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-SetCaretPos
# |
# | Modified files:
# | * dlls/user32/caret.c, server/protocol.def, server/queue.c
# |
if test "$enable_user32_SetCaretPos" -eq 1; then
patch_apply user32-SetCaretPos/0001-user32-Set-correct-caret-state-in-the-server-in-SetC.patch
(
echo '+ { "Anton Baskanov", "user32: Set correct caret state in the server in SetCaretPos.", 5 },';
) >> "$patchlist"
fi
# Patchset user32-SetCoalescableTimer
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,26 +0,0 @@
From b2fec3a86116deb45df5c8f3f6ac07434d3d34a7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 23 Jan 2016 20:23:04 +0100
Subject: server: Add missing check for objattr variable in load_registry
wineserver call (Coverity).
---
server/registry.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/server/registry.c b/server/registry.c
index 5723824..a35765c 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -2187,6 +2187,8 @@ DECL_HANDLER(load_registry)
const struct security_descriptor *sd;
const struct object_attributes *objattr = get_req_object_attributes( &sd, &name );
+ if (!objattr) return;
+
if (!thread_single_check_privilege( current, &SeRestorePrivilege ))
{
set_error( STATUS_PRIVILEGE_NOT_HELD );
--
2.6.4

View File

@ -1,26 +0,0 @@
From 4e690407c338be1553e6c2c18977364152477339 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 23 Jan 2016 20:23:48 +0100
Subject: server: Avoid invalid memory access if creation of namespace fails in
create_directory (Coverity).
---
server/directory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/directory.c b/server/directory.c
index de049ef..937ab89 100644
--- a/server/directory.c
+++ b/server/directory.c
@@ -192,7 +192,7 @@ static struct directory *create_directory( struct directory *root, const struct
if (!(dir->entries = create_namespace( hash_size )))
{
release_object( dir );
- dir = NULL;
+ return NULL;
}
if (sd) default_set_sd( &dir->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION );
--
2.6.4

View File

@ -1,99 +0,0 @@
From 64b178a05599e08ff0ceb28e6455bedd58487ff1 Mon Sep 17 00:00:00 2001
From: Anton Baskanov <baskanov@gmail.com>
Date: Thu, 31 Dec 2015 17:39:02 +0100
Subject: user32: Set correct caret state in the server in SetCaretPos. (try 5)
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
---
dlls/user32/caret.c | 8 ++++----
server/protocol.def | 6 +++++-
server/queue.c | 8 ++++++--
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/caret.c b/dlls/user32/caret.c
index 53bb5b4..734377a 100644
--- a/dlls/user32/caret.c
+++ b/dlls/user32/caret.c
@@ -86,7 +86,7 @@ static void CALLBACK CARET_Callback( HWND hwnd, UINT msg, UINT_PTR id, DWORD cti
req->x = 0;
req->y = 0;
req->hide = 0;
- req->state = -1; /* toggle current state */
+ req->state = CARET_STATE_TOGGLE;
if ((ret = !wine_server_call( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
@@ -256,7 +256,7 @@ BOOL WINAPI SetCaretPos( INT x, INT y )
req->x = x;
req->y = y;
req->hide = 0;
- req->state = 1;
+ req->state = CARET_STATE_ON_IF_POS_CHANGED;
if ((ret = !wine_server_call_err( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
@@ -300,7 +300,7 @@ BOOL WINAPI HideCaret( HWND hwnd )
req->x = 0;
req->y = 0;
req->hide = 1;
- req->state = 0;
+ req->state = CARET_STATE_OFF;
if ((ret = !wine_server_call_err( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
@@ -339,7 +339,7 @@ BOOL WINAPI ShowCaret( HWND hwnd )
req->x = 0;
req->y = 0;
req->hide = -1;
- req->state = 1;
+ req->state = CARET_STATE_ON;
if ((ret = !wine_server_call_err( req )))
{
hwnd = wine_server_ptr_handle( reply->full_handle );
diff --git a/server/protocol.def b/server/protocol.def
index ea5bd61..ad702fe 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -2978,7 +2978,7 @@ enum coords_relative
int x; /* caret x position */
int y; /* caret y position */
int hide; /* increment for hide count (can be negative to show it) */
- int state; /* caret state (1=on, 0=off, -1=toggle current state) */
+ int state; /* caret state (see below) */
@REPLY
user_handle_t full_handle; /* handle to the current caret window */
rectangle_t old_rect; /* previous caret rectangle */
@@ -2988,6 +2988,10 @@ enum coords_relative
#define SET_CARET_POS 0x01 /* set the caret position from x,y */
#define SET_CARET_HIDE 0x02 /* increment the caret hide count */
#define SET_CARET_STATE 0x04 /* set the caret on/off state */
+#define CARET_STATE_OFF 0 /* off */
+#define CARET_STATE_ON 1 /* on */
+#define CARET_STATE_TOGGLE -1 /* toggle current state */
+#define CARET_STATE_ON_IF_POS_CHANGED -2 /* on if the position differs, unchanged otherwise */
/* Set a window hook */
diff --git a/server/queue.c b/server/queue.c
index 3099e12..25260e4 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -3039,8 +3039,12 @@ DECL_HANDLER(set_caret_info)
}
if (req->flags & SET_CARET_STATE)
{
- if (req->state == -1) input->caret_state = !input->caret_state;
- else input->caret_state = !!req->state;
+ if (req->state == CARET_STATE_TOGGLE)
+ input->caret_state = !input->caret_state;
+ else if (req->state != CARET_STATE_ON_IF_POS_CHANGED)
+ input->caret_state = (req->state != CARET_STATE_OFF);
+ else if (req->x != reply->old_rect.left || req->y != reply->old_rect.top)
+ input->caret_state = 1;
}
}
--
2.6.4

View File

@ -1 +0,0 @@
Fixes: Avoid corruption of caret when SetCaretPos() is called

View File

@ -2341,7 +2341,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -921,7 +969,11 @@
@@ -923,7 +971,11 @@
BOOL ds_enable = !!swapchain->desc.enable_auto_depth_stencil;
unsigned int i;
@ -2353,7 +2353,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -939,7 +991,13 @@
@@ -941,7 +993,13 @@
struct wined3d_swapchain_desc *swapchain_desc)
{
static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
@ -2367,7 +2367,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
DWORD clear_flags = 0;
HRESULT hr;
@@ -950,6 +1008,11 @@
@@ -952,6 +1010,11 @@
if (device->wined3d->flags & WINED3D_NO3D)
return WINED3DERR_INVALIDCALL;
@ -2379,7 +2379,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
device->adapter->vertex_pipe, device->adapter->fragment_pipe)))
{
@@ -990,8 +1053,16 @@
@@ -992,8 +1055,16 @@
device->swapchains[0] = swapchain;
device_init_swapchain_state(device, swapchain);
@ -2396,7 +2396,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->contexts[0]->last_was_rhw = 0;
@@ -1003,7 +1074,11 @@
@@ -1005,7 +1076,11 @@
case ORM_BACKBUFFER:
{
@ -2408,7 +2408,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
TRACE("Using auxiliary buffer for offscreen rendering\n");
device->offscreenBuffer = GL_AUX0;
@@ -1015,9 +1090,16 @@
@@ -1017,9 +1092,16 @@
}
}
}
@ -2425,7 +2425,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Clear the screen */
if (swapchain->back_buffers && swapchain->back_buffers[0])
@@ -1034,6 +1116,9 @@
@@ -1036,6 +1118,9 @@
return WINED3D_OK;
err_out:
@ -2435,7 +2435,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
HeapFree(GetProcessHeap(), 0, device->swapchains);
device->swapchain_count = 0;
if (device->back_buffer_view)
@@ -1091,6 +1176,10 @@
@@ -1093,6 +1178,10 @@
HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
{
struct wined3d_resource *resource, *cursor;
@ -2446,7 +2446,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_surface *surface;
UINT i;
@@ -1099,6 +1188,7 @@
@@ -1101,6 +1190,7 @@
if (!device->d3d_initialized)
return WINED3DERR_INVALIDCALL;
@ -2454,7 +2454,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (wined3d_settings.cs_multithreaded)
device->cs->ops->finish(device->cs);
@@ -1137,6 +1227,83 @@
@@ -1139,6 +1229,83 @@
/* FIXME: Is this in the right place??? */
wined3d_cs_emit_delete_opengl_contexts(device->cs, device->swapchains[0]);
@ -2538,7 +2538,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (device->back_buffer_view)
{
wined3d_rendertarget_view_decref(device->back_buffer_view);
@@ -1154,6 +1321,11 @@
@@ -1156,6 +1323,11 @@
device->swapchains = NULL;
device->swapchain_count = 0;
@ -2550,7 +2550,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->d3d_initialized = FALSE;
return WINED3D_OK;
@@ -1540,6 +1712,16 @@
@@ -1542,6 +1714,16 @@
TRACE("... Range(%f), Falloff(%f), Theta(%f), Phi(%f)\n",
light->range, light->falloff, light->theta, light->phi);
@ -2567,7 +2567,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Save away the information. */
object->OriginalParms = *light;
@@ -1619,9 +1801,11 @@
@@ -1621,9 +1803,11 @@
FIXME("Unrecognized light type %#x.\n", light->type);
}
@ -2579,7 +2579,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -1694,6 +1878,14 @@
@@ -1696,6 +1880,14 @@
{
if (light_info->glIndex != -1)
{
@ -2594,7 +2594,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->update_state->lights[light_info->glIndex] = NULL;
light_info->glIndex = -1;
}
@@ -1735,11 +1927,23 @@
@@ -1737,11 +1929,23 @@
WARN("Too many concurrently active lights\n");
return WINED3D_OK;
}
@ -2618,7 +2618,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -1914,9 +2118,11 @@
@@ -1916,9 +2120,11 @@
TRACE("device %p, base_index %d.\n", device, base_index);
device->update_state->base_vertex_index = base_index;
@ -2630,7 +2630,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device)
@@ -1961,7 +2167,11 @@
@@ -1963,7 +2169,11 @@
|| !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH))
return;
surface = surface_from_resource(texture->sub_resources[0]);
@ -2642,7 +2642,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return;
wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT);
@@ -2288,7 +2498,11 @@
@@ -2290,7 +2500,11 @@
return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx];
}
@ -2654,7 +2654,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
UINT i;
@@ -2321,8 +2535,12 @@
@@ -2323,8 +2537,12 @@
}
else
{
@ -2667,7 +2667,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2369,8 +2587,12 @@
@@ -2371,8 +2589,12 @@
}
else
{
@ -2680,7 +2680,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2421,8 +2643,13 @@
@@ -2423,8 +2645,13 @@
memset(device->recording->changed.vertexShaderConstantsF + start_register, 1,
sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count);
else
@ -2694,7 +2694,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -2557,8 +2784,12 @@
@@ -2559,8 +2786,12 @@
}
else
{
@ -2707,7 +2707,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2605,8 +2836,12 @@
@@ -2607,8 +2838,12 @@
}
else
{
@ -2720,7 +2720,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
return WINED3D_OK;
@@ -2658,8 +2893,12 @@
@@ -2660,8 +2895,12 @@
memset(device->recording->changed.pixelShaderConstantsF + start_register, 1,
sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count);
else
@ -2733,7 +2733,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -2819,6 +3058,7 @@
@@ -2821,6 +3060,7 @@
return hr;
}
@ -2741,7 +2741,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (wined3d_settings.cs_multithreaded)
{
FIXME("Waiting for cs.\n");
@@ -2826,6 +3066,7 @@
@@ -2828,6 +3068,7 @@
device->cs->ops->finish(device->cs);
}
@ -2749,7 +2749,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat);
wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat);
wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat);
@@ -3311,6 +3552,10 @@
@@ -3313,6 +3554,10 @@
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
{
@ -2760,7 +2760,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p.\n", device);
if (!device->inScene)
@@ -3319,6 +3564,15 @@
@@ -3321,6 +3566,15 @@
return WINED3DERR_INVALIDCALL;
}
@ -2776,7 +2776,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device->inScene = FALSE;
return WINED3D_OK;
}
@@ -3326,8 +3580,10 @@
@@ -3328,8 +3582,10 @@
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count,
const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
{
@ -2787,7 +2787,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n",
device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil);
@@ -3336,12 +3592,19 @@
@@ -3338,12 +3594,19 @@
WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects);
return WINED3D_OK;
}
@ -2807,7 +2807,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!ds)
{
WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n");
@@ -3350,8 +3613,13 @@
@@ -3352,8 +3615,13 @@
}
else if (flags & WINED3DCLEAR_TARGET)
{
@ -2821,7 +2821,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
WARN("Silently ignoring depth and target clear with mismatching sizes\n");
return WINED3D_OK;
@@ -3397,6 +3665,9 @@
@@ -3399,6 +3667,9 @@
enum wined3d_primitive_type primitive_type)
{
GLenum gl_primitive_type, prev;
@ -2831,7 +2831,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type));
gl_primitive_type = gl_primitive_type_from_d3d(primitive_type);
@@ -3404,8 +3675,13 @@
@@ -3406,8 +3677,13 @@
device->update_state->gl_primitive_type = gl_primitive_type;
if (device->recording)
device->recording->changed.primitive_type = TRUE;
@ -2845,7 +2845,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device,
@@ -3428,6 +3704,14 @@
@@ -3430,6 +3706,14 @@
return WINED3DERR_INVALIDCALL;
}
@ -2860,7 +2860,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE);
return WINED3D_OK;
@@ -3444,6 +3728,10 @@
@@ -3446,6 +3730,10 @@
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
{
@ -2871,7 +2871,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
if (!device->state.index_buffer)
@@ -3462,6 +3750,15 @@
@@ -3464,6 +3752,15 @@
return WINED3DERR_INVALIDCALL;
}
@ -2887,7 +2887,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE);
return WINED3D_OK;
@@ -3477,6 +3774,7 @@
@@ -3479,6 +3776,7 @@
}
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
@ -2895,7 +2895,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
static void device_update_volume(struct wined3d_context *context,
struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume)
{
@@ -3513,6 +3811,88 @@
@@ -3515,6 +3813,88 @@
{
enum wined3d_resource_type type = src_texture->resource.type;
unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0;
@ -2984,7 +2984,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
level_count = min(wined3d_texture_get_level_count(src_texture),
wined3d_texture_get_level_count(dst_texture));
@@ -3531,7 +3911,13 @@
@@ -3533,7 +3913,13 @@
}
/* Make sure that the destination texture is loaded. */
@ -2998,7 +2998,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Update every surface level of the texture. */
switch (type)
@@ -3546,7 +3932,16 @@
@@ -3548,7 +3934,16 @@
src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture,
i + src_skip_levels));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
@ -3015,7 +3015,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
break;
}
@@ -3566,7 +3961,16 @@
@@ -3568,7 +3963,16 @@
i * src_levels + j + src_skip_levels));
dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture,
i * dst_levels + j));
@ -3032,7 +3032,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
}
break;
@@ -3576,6 +3980,7 @@
@@ -3578,6 +3982,7 @@
{
for (i = 0; i < level_count; ++i)
{
@ -3040,7 +3040,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
device_update_volume(context,
volume_from_resource(wined3d_texture_get_sub_resource(src_texture,
i + src_skip_levels)),
@@ -3629,6 +4034,25 @@
@@ -3631,6 +4036,25 @@
}
wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture);
@ -3066,7 +3066,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -3678,8 +4102,13 @@
@@ -3680,8 +4104,13 @@
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
@ -3080,7 +3080,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (ds && rt && (ds->width < rt->width || ds->height < rt->height))
{
@@ -3778,6 +4207,7 @@
@@ -3780,6 +4209,7 @@
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const POINT *dst_point)
{
@ -3088,7 +3088,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
const struct wined3d_format *src_format = src_surface->resource.format;
const struct wined3d_format *dst_format = dst_surface->resource.format;
UINT update_w, update_h;
@@ -3785,6 +4215,7 @@
@@ -3787,6 +4217,7 @@
RECT r, dst_rect;
POINT p;
@ -3096,7 +3096,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n",
device, src_surface, wine_dbgstr_rect(src_rect),
dst_surface, wine_dbgstr_point(dst_point));
@@ -3796,6 +4227,7 @@
@@ -3798,6 +4229,7 @@
return WINED3DERR_INVALIDCALL;
}
@ -3104,7 +3104,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (src_format->id != dst_format->id)
{
WARN("Source and destination surfaces should have the same format.\n");
@@ -3860,6 +4292,9 @@
@@ -3862,6 +4294,9 @@
wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point);
return WINED3D_OK;
@ -3114,7 +3114,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
void CDECL wined3d_device_copy_resource(struct wined3d_device *device,
@@ -4032,7 +4467,17 @@
@@ -4034,7 +4469,17 @@
unsigned int depth_pitch)
{
struct wined3d_resource *sub_resource;
@ -3132,7 +3132,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, resource %p, sub_resource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n",
device, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
@@ -4066,7 +4511,14 @@
@@ -4068,7 +4513,14 @@
WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx);
return;
}
@ -3147,7 +3147,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (box)
{
if (box->left >= box->right || box->right > sub_resource->width
@@ -4077,9 +4529,47 @@
@@ -4079,9 +4531,47 @@
box->left, box->top, box->front, box->right, box->bottom, box->back);
return;
}
@ -3195,7 +3195,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device,
@@ -4110,8 +4600,14 @@
@@ -4112,8 +4602,14 @@
rect = &r;
}
@ -3210,7 +3210,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
@@ -4125,6 +4621,7 @@
@@ -4127,6 +4623,7 @@
return NULL;
}
@ -3218,7 +3218,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return device->state.fb.render_targets[view_idx];
}
@@ -4140,6 +4637,22 @@
@@ -4142,6 +4639,22 @@
{
struct wined3d_rendertarget_view *prev;
struct wined3d_fb_state *fb = &device->state.fb;
@ -3241,7 +3241,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n",
device, view_idx, view, set_viewport);
@@ -4179,6 +4692,7 @@
@@ -4181,6 +4694,7 @@
}
@ -3249,7 +3249,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
prev = fb->render_targets[view_idx];
if (view == prev)
return WINED3D_OK;
@@ -4186,6 +4700,15 @@
@@ -4188,6 +4702,15 @@
if (view)
wined3d_rendertarget_view_incref(view);
fb->render_targets[view_idx] = view;
@ -3265,7 +3265,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view);
/* Release after the assignment, to prevent device_resource_released()
* from seeing the surface as still in use. */
@@ -4197,6 +4720,7 @@
@@ -4199,6 +4722,7 @@
void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view)
{
@ -3273,7 +3273,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_fb_state *fb = &device->state.fb;
struct wined3d_rendertarget_view *prev;
@@ -4214,6 +4738,66 @@
@@ -4216,6 +4740,66 @@
wined3d_cs_emit_set_depth_stencil_view(device->cs, view);
if (prev)
wined3d_rendertarget_view_decref(prev);
@ -3340,7 +3340,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device,
@@ -4234,6 +4818,14 @@
@@ -4236,6 +4820,14 @@
cursor_image = surface_from_resource(sub_resource);
@ -3355,7 +3355,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM)
{
WARN("Surface %p has an invalid format %s.\n",
@@ -4261,6 +4853,13 @@
@@ -4263,6 +4855,13 @@
* release it after setting the cursor image. Windows doesn't
* addref the set surface, so we can't do this either without
* creating circular refcount dependencies. */
@ -3369,7 +3369,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32)
{
@@ -4365,6 +4964,12 @@
@@ -4367,6 +4966,12 @@
else
SetCursor(NULL);
}
@ -3382,7 +3382,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return oldVisible;
}
@@ -4375,8 +4980,10 @@
@@ -4377,8 +4982,10 @@
TRACE("device %p.\n", device);
@ -3393,7 +3393,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
TRACE("Checking resource %p for eviction.\n", resource);
@@ -4384,6 +4991,7 @@
@@ -4386,6 +4993,7 @@
if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count)
{
TRACE("Evicting %p.\n", resource);
@ -3401,7 +3401,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_evict_resource(device->cs, resource);
}
}
@@ -4402,6 +5010,37 @@
@@ -4404,6 +5012,37 @@
context = context_acquire(device, NULL);
gl_info = context->gl_info;
@ -3439,7 +3439,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (device->depth_blt_texture)
{
@@ -4423,6 +5062,7 @@
@@ -4425,6 +5064,7 @@
HeapFree(GetProcessHeap(), 0, swapchain->context);
swapchain->context = NULL;
@ -3447,7 +3447,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
swapchain->num_contexts = 0;
}
@@ -4442,6 +5082,14 @@
@@ -4444,6 +5084,14 @@
static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
{
@ -3462,7 +3462,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
HRESULT hr;
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
@@ -4458,6 +5106,7 @@
@@ -4460,6 +5108,7 @@
return hr;
}
@ -3470,7 +3470,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
if (FAILED(hr))
{
@@ -4468,6 +5117,35 @@
@@ -4470,6 +5119,35 @@
}
wined3d_cs_emit_create_dummy_textures(device->cs);
@ -3506,7 +3506,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
return WINED3D_OK;
}
@@ -4486,9 +5164,11 @@
@@ -4488,9 +5166,11 @@
TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n",
device, swapchain_desc, mode, callback, reset_state);
@ -3518,7 +3518,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (!(swapchain = wined3d_device_get_swapchain(device, 0)))
{
ERR("Failed to get the first implicit swapchain.\n");
@@ -4503,9 +5183,21 @@
@@ -4505,9 +5185,21 @@
wined3d_texture_decref(device->logo_texture);
device->logo_texture = NULL;
}
@ -3540,7 +3540,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
{
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@@ -4514,6 +5206,7 @@
@@ -4516,6 +5208,7 @@
}
wined3d_device_set_depth_stencil_view(device, NULL);
@ -3548,7 +3548,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (reset_state)
{
state_unbind_resources(&device->state);
@@ -4523,6 +5216,12 @@
@@ -4525,6 +5218,12 @@
{
wined3d_texture_decref(device->cs->onscreen_depth_stencil->container);
device->cs->onscreen_depth_stencil = NULL;
@ -3561,7 +3561,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
if (reset_state)
@@ -4535,6 +5234,7 @@
@@ -4537,6 +5236,7 @@
}
}
@ -3569,7 +3569,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Free implicit resources and wait for the command stream before modifying
* swapchain parameters. After modifying the swapchain parameters a new GL
* context may be acquired by the worker thread. This causes problems in the
@@ -4556,6 +5256,7 @@
@@ -4558,6 +5258,7 @@
}
device->cs->ops->finish(device->cs);
@ -3577,7 +3577,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
TRACE("New params:\n");
TRACE("backbuffer_width %u\n", swapchain_desc->backbuffer_width);
TRACE("backbuffer_height %u\n", swapchain_desc->backbuffer_height);
@@ -4682,6 +5383,13 @@
@@ -4684,6 +5385,13 @@
swapchain_desc->multisample_type, swapchain_desc->multisample_quality)))
return hr;
@ -3591,7 +3591,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.enable_auto_depth_stencil)
{
struct wined3d_resource_desc texture_desc;
@@ -4724,6 +5432,13 @@
@@ -4726,6 +5434,13 @@
wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view);
}
@ -3605,7 +3605,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface(
surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)),
NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
@@ -4744,12 +5459,20 @@
@@ -4746,12 +5461,20 @@
}
wined3d_cs_emit_reset_state(device->cs);
state_cleanup(&device->state);
@ -3626,7 +3626,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize device state, hr %#x.\n", hr);
device->update_state = &device->state;
@@ -4758,6 +5481,7 @@
@@ -4760,6 +5483,7 @@
}
else if (device->back_buffer_view)
{
@ -3634,7 +3634,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
struct wined3d_state *state = &device->state;
wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE);
@@ -4773,6 +5497,24 @@
@@ -4775,6 +5499,24 @@
state->scissor_rect.left = 0;
state->scissor_rect.right = swapchain->desc.backbuffer_width;
state->scissor_rect.bottom = swapchain->desc.backbuffer_height;
@ -3659,7 +3659,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect);
}
@@ -4848,6 +5590,10 @@
@@ -4850,6 +5592,10 @@
TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
@ -3670,7 +3670,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
switch (type)
{
case WINED3D_RTYPE_SURFACE:
@@ -4858,6 +5604,7 @@
@@ -4860,6 +5606,7 @@
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{
@ -3678,7 +3678,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface)
{
ERR("Surface %p is still in use as render target %u.\n", surface, i);
@@ -4869,6 +5616,19 @@
@@ -4871,6 +5618,19 @@
{
ERR("Surface %p is still in use as depth/stencil buffer.\n", surface);
device->state.fb.depth_stencil = NULL;
@ -3698,7 +3698,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
}
break;
@@ -5031,7 +5791,11 @@
@@ -5033,7 +5793,11 @@
device->blitter = adapter->blitter;
@ -3710,7 +3710,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
&adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT)))
{
ERR("Failed to initialize device state, hr %#x.\n", hr);
@@ -5130,6 +5894,7 @@
@@ -5132,6 +5896,7 @@
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@ -3718,7 +3718,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
/* Context activation is done by the caller */
struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage,
@@ -5183,3 +5948,4 @@
@@ -5185,3 +5950,4 @@
wined3d_device_destroy_bo(device, context, bo);
}
@ -3726,7 +3726,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5555,9 +5555,15 @@
@@ -5557,9 +5557,15 @@
DebugBreak();
}
@ -3980,7 +3980,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
unsigned int i, extra_constants_needed = 0;
const struct wined3d_shader_lconst *lconst;
const char *prefix;
@@ -1905,7 +1913,11 @@
@@ -1928,7 +1936,11 @@
{
UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input);
@ -3992,7 +3992,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
declare_in_varying(gl_info, buffer, FALSE, "vec4 %s_link[%u];\n", prefix, in_count);
shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count);
}
@@ -1946,6 +1958,7 @@
@@ -1969,6 +1981,7 @@
}
else
{
@ -4000,7 +4000,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
/* This happens because we do not have proper tracking of the
* constant registers that are actually used, only the max
* limit of the shader version.
@@ -1954,6 +1967,23 @@
@@ -1977,6 +1990,23 @@
* it and just create the uniform.
*/
FIXME("Cannot find a free uniform for vpos correction params\n");