mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 38f3d59ed694afba7913b4992d13cb044a09126c.
[user32-CharToOem] Removed patch to properly handle invalid parameters in CharToOem* and OemToChar* APIs (accepted upstream).
This commit is contained in:
parent
867c8334a1
commit
970dc74e89
@ -51,7 +51,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "94b6a885a880728f5e0a865fc17a82532723e756"
|
||||
echo "38f3d59ed694afba7913b4992d13cb044a09126c"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -322,7 +322,6 @@ patch_enable_all ()
|
||||
enable_taskmgr_Memory_Usage="$1"
|
||||
enable_user_exe16_CONTAINING_RECORD="$1"
|
||||
enable_user_exe16_DlgDirList="$1"
|
||||
enable_user32_CharToOem="$1"
|
||||
enable_user32_DM_SETDEFID="$1"
|
||||
enable_user32_DeferWindowPos="$1"
|
||||
enable_user32_DialogBoxParam="$1"
|
||||
@ -1143,9 +1142,6 @@ patch_enable ()
|
||||
user.exe16-DlgDirList)
|
||||
enable_user_exe16_DlgDirList="$2"
|
||||
;;
|
||||
user32-CharToOem)
|
||||
enable_user32_CharToOem="$2"
|
||||
;;
|
||||
user32-DM_SETDEFID)
|
||||
enable_user32_DM_SETDEFID="$2"
|
||||
;;
|
||||
@ -6639,21 +6635,6 @@ if test "$enable_user_exe16_DlgDirList" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset user32-CharToOem
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#21891] Properly handle invalid parameters in CharToOem* and OemToChar* APIs
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/user32/lstr.c, dlls/user32/tests/text.c
|
||||
# |
|
||||
if test "$enable_user32_CharToOem" -eq 1; then
|
||||
patch_apply user32-CharToOem/0001-user32-Properly-handle-invalid-parameters-in-CharToO.patch
|
||||
(
|
||||
echo '+ { "Dmitry Timoshkov", "user32: Properly handle invalid parameters in CharToOem* and OemToChar* APIs.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset user32-DM_SETDEFID
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -1,145 +0,0 @@
|
||||
From 34d57635381ada21fdf49cde329a12dab02fa537 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 17 May 2016 14:47:24 +0800
|
||||
Subject: user32: Properly handle invalid parameters in CharToOem* and
|
||||
OemToChar* APIs.
|
||||
|
||||
Fixes #21891.
|
||||
---
|
||||
dlls/user32/lstr.c | 12 ++++++++++--
|
||||
dlls/user32/tests/text.c | 37 ++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 46 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/lstr.c b/dlls/user32/lstr.c
|
||||
index a56e21c..b73f40b 100644
|
||||
--- a/dlls/user32/lstr.c
|
||||
+++ b/dlls/user32/lstr.c
|
||||
@@ -136,7 +136,7 @@ LPWSTR WINAPI CharPrevW(LPCWSTR start,LPCWSTR x)
|
||||
*/
|
||||
BOOL WINAPI CharToOemA( LPCSTR s, LPSTR d )
|
||||
{
|
||||
- if ( !s || !d ) return TRUE;
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
return CharToOemBuffA( s, d, strlen( s ) + 1 );
|
||||
}
|
||||
|
||||
@@ -148,6 +148,8 @@ BOOL WINAPI CharToOemBuffA( LPCSTR s, LPSTR d, DWORD len )
|
||||
{
|
||||
WCHAR *bufW;
|
||||
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
+
|
||||
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
|
||||
if( bufW )
|
||||
{
|
||||
@@ -164,7 +166,7 @@ BOOL WINAPI CharToOemBuffA( LPCSTR s, LPSTR d, DWORD len )
|
||||
*/
|
||||
BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len )
|
||||
{
|
||||
- if ( !s || !d ) return TRUE;
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
WideCharToMultiByte( CP_OEMCP, 0, s, len, d, len, NULL, NULL );
|
||||
return TRUE;
|
||||
}
|
||||
@@ -175,6 +177,7 @@ BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len )
|
||||
*/
|
||||
BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
|
||||
{
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
return CharToOemBuffW( s, d, lstrlenW( s ) + 1 );
|
||||
}
|
||||
|
||||
@@ -184,6 +187,7 @@ BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
|
||||
*/
|
||||
BOOL WINAPI OemToCharA( LPCSTR s, LPSTR d )
|
||||
{
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
return OemToCharBuffA( s, d, strlen( s ) + 1 );
|
||||
}
|
||||
|
||||
@@ -195,6 +199,8 @@ BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len )
|
||||
{
|
||||
WCHAR *bufW;
|
||||
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
+
|
||||
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
|
||||
if( bufW )
|
||||
{
|
||||
@@ -211,6 +217,7 @@ BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len )
|
||||
*/
|
||||
BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len )
|
||||
{
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len );
|
||||
return TRUE;
|
||||
}
|
||||
@@ -221,6 +228,7 @@ BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len )
|
||||
*/
|
||||
BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d )
|
||||
{
|
||||
+ if ( !s || !d ) return FALSE;
|
||||
return OemToCharBuffW( s, d, strlen( s ) + 1 );
|
||||
}
|
||||
|
||||
diff --git a/dlls/user32/tests/text.c b/dlls/user32/tests/text.c
|
||||
index eccf972..6bc1017 100644
|
||||
--- a/dlls/user32/tests/text.c
|
||||
+++ b/dlls/user32/tests/text.c
|
||||
@@ -2,7 +2,7 @@
|
||||
* DrawText tests
|
||||
*
|
||||
* Copyright (c) 2004 Zach Gorman
|
||||
- * Copyright 2007 Dmitry Timoshkov
|
||||
+ * Copyright 2007,2016 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -759,9 +759,44 @@ static void test_DrawState(void)
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
+static void test_string_conversions(void)
|
||||
+{
|
||||
+ char buf[64] = "string";
|
||||
+ int i;
|
||||
+ BOOL ret;
|
||||
+ struct
|
||||
+ {
|
||||
+ char *src, *dst;
|
||||
+ unsigned len;
|
||||
+ BOOL ret;
|
||||
+ } test[] =
|
||||
+ {
|
||||
+ { NULL, NULL, 1, FALSE },
|
||||
+ { buf, NULL, 1, FALSE },
|
||||
+ { NULL, buf, 1, FALSE },
|
||||
+ { buf, buf, 1, TRUE }
|
||||
+ };
|
||||
+
|
||||
+ for (i = 0; i < sizeof(test)/sizeof(test[0]); i++)
|
||||
+ {
|
||||
+ ret = CharToOemA(test[i].src, test[i].dst);
|
||||
+ ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret);
|
||||
+
|
||||
+ ret = CharToOemBuffA(test[i].src, test[i].dst, test[i].len);
|
||||
+ ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret);
|
||||
+
|
||||
+ ret = OemToCharA(test[i].src, test[i].dst);
|
||||
+ ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret);
|
||||
+
|
||||
+ ret = OemToCharBuffA(test[i].src, test[i].dst, test[i].len);
|
||||
+ ok(ret == test[i].ret, "%d: expected %d, got %d\n", i, test[i].ret, ret);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
START_TEST(text)
|
||||
{
|
||||
test_TabbedText();
|
||||
test_DrawTextCalcRect();
|
||||
test_DrawState();
|
||||
+ test_string_conversions();
|
||||
}
|
||||
--
|
||||
2.8.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [21891] Properly handle invalid parameters in CharToOem* and OemToChar* APIs
|
@ -1,4 +1,4 @@
|
||||
From 06122f35e04bf34a47f07afdeaebd72caf572579 Mon Sep 17 00:00:00 2001
|
||||
From 10d588d723446311832d7b4a6ccf37ba85003a18 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 27 Sep 2013 19:24:21 +0200
|
||||
Subject: wined3d: Implement DISCARD resource maps with heap memory.
|
||||
@ -12,10 +12,10 @@ Subject: wined3d: Implement DISCARD resource maps with heap memory.
|
||||
5 files changed, 51 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 2c66a4b..f887ee6 100644
|
||||
index 92a0cab..bd1a2c2 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -503,6 +503,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *c
|
||||
@@ -496,6 +496,7 @@ BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *c
|
||||
|
||||
if (!wined3d_resource_allocate_sysmem(&buffer->resource))
|
||||
ERR("Failed to allocate system memory.\n");
|
||||
@ -24,10 +24,10 @@ index 2c66a4b..f887ee6 100644
|
||||
buffer_bind(buffer, context);
|
||||
GL_EXTCALL(glGetBufferSubData(buffer->buffer_type_hint, 0, buffer->resource.size, buffer->resource.heap_memory));
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 94298af..3a6299a 100644
|
||||
index 595520a..640a5f8 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -382,6 +382,7 @@ struct wined3d_cs_texture_changed
|
||||
@@ -394,6 +394,7 @@ struct wined3d_cs_texture_changed
|
||||
struct wined3d_texture *texture;
|
||||
unsigned int sub_resource_idx;
|
||||
struct wined3d_gl_bo *swap_buffer;
|
||||
@ -35,7 +35,7 @@ index 94298af..3a6299a 100644
|
||||
};
|
||||
|
||||
struct wined3d_cs_skip
|
||||
@@ -1920,13 +1921,13 @@ static UINT wined3d_cs_exec_texture_changed(struct wined3d_cs *cs, const void *d
|
||||
@@ -1952,13 +1953,13 @@ static UINT wined3d_cs_exec_texture_changed(struct wined3d_cs *cs, const void *d
|
||||
{
|
||||
const struct wined3d_cs_texture_changed *op = data;
|
||||
|
||||
@ -51,7 +51,7 @@ index 94298af..3a6299a 100644
|
||||
{
|
||||
struct wined3d_cs_texture_changed *op;
|
||||
|
||||
@@ -1935,6 +1936,7 @@ void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_textu
|
||||
@@ -1967,6 +1968,7 @@ void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_textu
|
||||
op->texture = texture;
|
||||
op->sub_resource_idx = sub_resource_idx;
|
||||
op->swap_buffer = swap_buffer;
|
||||
@ -60,10 +60,10 @@ index 94298af..3a6299a 100644
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index be7dfb4..acbf7a6 100644
|
||||
index e10921a..75a3dd5 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -210,6 +210,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
@@ -213,6 +213,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
ERR("Failed to allocate system memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
@ -71,15 +71,15 @@ index be7dfb4..acbf7a6 100644
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -246,6 +247,7 @@ void resource_cleanup(struct wined3d_resource *resource)
|
||||
}
|
||||
@@ -241,6 +242,7 @@ static void wined3d_resource_destroy_object(void *object)
|
||||
struct wined3d_resource *resource = object;
|
||||
|
||||
wined3d_resource_free_sysmem(resource);
|
||||
+ resource->map_heap_memory = NULL;
|
||||
|
||||
device_resource_released(resource->device, resource);
|
||||
context_resource_released(resource->device, resource, resource->type);
|
||||
}
|
||||
@@ -330,7 +332,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
|
||||
|
||||
@@ -340,7 +342,7 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
|
||||
p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1;
|
||||
*p = mem;
|
||||
|
||||
@ -89,10 +89,10 @@ index be7dfb4..acbf7a6 100644
|
||||
return TRUE;
|
||||
}
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 2cc4014..bc1bb27 100644
|
||||
index de2d135..d810267 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -95,6 +95,7 @@ static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
|
||||
@@ -104,6 +104,7 @@ static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
|
||||
sub_resource->locations &= ~WINED3D_LOCATION_SYSMEM;
|
||||
}
|
||||
wined3d_resource_free_sysmem(&texture->resource);
|
||||
@ -100,7 +100,7 @@ index 2cc4014..bc1bb27 100644
|
||||
}
|
||||
|
||||
void wined3d_texture_validate_location(struct wined3d_texture *texture,
|
||||
@@ -206,7 +207,10 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
|
||||
@@ -220,7 +221,10 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
|
||||
}
|
||||
if (locations & WINED3D_LOCATION_SYSMEM)
|
||||
{
|
||||
@ -112,7 +112,7 @@ index 2cc4014..bc1bb27 100644
|
||||
data->addr += sub_resource->offset;
|
||||
data->buffer_object = 0;
|
||||
return;
|
||||
@@ -1030,6 +1034,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1105,6 +1109,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
}
|
||||
|
||||
wined3d_resource_free_sysmem(&texture->resource);
|
||||
@ -120,7 +120,7 @@ index 2cc4014..bc1bb27 100644
|
||||
|
||||
if ((texture->row_pitch = pitch))
|
||||
texture->slice_pitch = height * pitch;
|
||||
@@ -1224,6 +1229,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
@@ -1299,6 +1304,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
ERR("Failed to allocate system memory.\n");
|
||||
return FALSE;
|
||||
}
|
||||
@ -128,7 +128,7 @@ index 2cc4014..bc1bb27 100644
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_USER_MEMORY:
|
||||
@@ -1612,6 +1618,12 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
@@ -1656,6 +1662,12 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
ret = !!sub_resource->map_buffer;
|
||||
break;
|
||||
|
||||
@ -141,7 +141,7 @@ index 2cc4014..bc1bb27 100644
|
||||
default:
|
||||
ret = wined3d_texture_prepare_location(texture, sub_resource_idx,
|
||||
context, texture->resource.map_binding);
|
||||
@@ -1717,7 +1729,21 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
@@ -1761,7 +1773,21 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
|
||||
if (flags & WINED3D_MAP_NOOVERWRITE)
|
||||
FIXME("WINED3D_MAP_NOOVERWRITE is not implemented yet.\n");
|
||||
|
||||
@ -164,7 +164,7 @@ index 2cc4014..bc1bb27 100644
|
||||
wined3d_resource_wait_fence(&texture->resource);
|
||||
|
||||
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
|
||||
@@ -1793,7 +1819,7 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1837,7 +1863,7 @@ void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
|
||||
void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
@ -173,7 +173,7 @@ index 2cc4014..bc1bb27 100644
|
||||
{
|
||||
struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
|
||||
|
||||
@@ -1806,6 +1832,12 @@ void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_r
|
||||
@@ -1850,6 +1876,12 @@ void wined3d_texture_changed(struct wined3d_texture *texture, unsigned int sub_r
|
||||
sub_resource->buffer = swap_buffer;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ index 2cc4014..bc1bb27 100644
|
||||
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
|
||||
}
|
||||
|
||||
@@ -1833,7 +1865,8 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
|
||||
@@ -1877,7 +1909,8 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso
|
||||
|
||||
if (sub_resource->unmap_dirtify)
|
||||
{
|
||||
@ -196,7 +196,7 @@ index 2cc4014..bc1bb27 100644
|
||||
sub_resource->unmap_dirtify = FALSE;
|
||||
}
|
||||
|
||||
@@ -2276,6 +2309,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
@@ -2332,6 +2365,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
|
||||
if (wined3d_texture_use_pbo(texture, gl_info))
|
||||
{
|
||||
wined3d_resource_free_sysmem(&texture->resource);
|
||||
@ -205,10 +205,10 @@ index 2cc4014..bc1bb27 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 4d6721d..5feee06 100644
|
||||
index 1b125d5..50c0854 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2429,7 +2429,7 @@ struct wined3d_resource
|
||||
@@ -2536,7 +2536,7 @@ struct wined3d_resource
|
||||
UINT depth;
|
||||
UINT size;
|
||||
DWORD priority;
|
||||
@ -217,7 +217,7 @@ index 4d6721d..5feee06 100644
|
||||
struct list resource_list_entry;
|
||||
LONG access_fence;
|
||||
|
||||
@@ -2626,7 +2626,8 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
|
||||
@@ -2733,7 +2733,8 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
|
||||
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
|
||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_changed(struct wined3d_texture *texture,
|
||||
@ -227,7 +227,7 @@ index 4d6721d..5feee06 100644
|
||||
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
|
||||
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
|
||||
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
@@ -3014,7 +3015,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
|
||||
@@ -3118,7 +3119,8 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
|
||||
const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
|
||||
const struct blit_shader *blitter) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_texture_changed(struct wined3d_cs *cs, struct wined3d_texture *texture,
|
||||
|
@ -1,22 +1,18 @@
|
||||
From c2e47132931b0ace4129f74f3905732be5575277 Mon Sep 17 00:00:00 2001
|
||||
From f63385f0d8260f11819bad1b075af20c98bb3bd4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 2 Oct 2013 22:38:51 +0200
|
||||
Subject: wined3d: Clean up resource data through the CS.
|
||||
|
||||
---
|
||||
dlls/wined3d/buffer.c | 7 +++++++
|
||||
dlls/wined3d/cs.c | 28 ++++++++++++++++++++++++++++
|
||||
dlls/wined3d/device.c | 2 --
|
||||
dlls/wined3d/resource.c | 11 ++++++++---
|
||||
dlls/wined3d/texture.c | 2 ++
|
||||
dlls/wined3d/wined3d_private.h | 3 +++
|
||||
6 files changed, 48 insertions(+), 5 deletions(-)
|
||||
dlls/wined3d/buffer.c | 7 +++++++
|
||||
dlls/wined3d/texture.c | 2 ++
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index b611daf..e1ce265 100644
|
||||
index 86395c4..90a707c 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -570,6 +570,9 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
|
||||
@@ -586,6 +586,9 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
|
||||
}
|
||||
|
||||
resource_cleanup(&buffer->resource);
|
||||
@ -26,7 +22,7 @@ index b611daf..e1ce265 100644
|
||||
buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, buffer->maps);
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
@@ -1354,6 +1357,8 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
|
||||
@@ -1355,6 +1358,8 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
|
||||
ERR("Out of memory.\n");
|
||||
buffer_unload(&buffer->resource);
|
||||
resource_cleanup(&buffer->resource);
|
||||
@ -35,7 +31,7 @@ index b611daf..e1ce265 100644
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
buffer->maps_size = 1;
|
||||
@@ -1364,6 +1369,8 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
|
||||
@@ -1365,6 +1370,8 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
|
||||
buffer_unload(&buffer->resource);
|
||||
resource_cleanup(&buffer->resource);
|
||||
HeapFree(GetProcessHeap(), 0, buffer->maps);
|
||||
@ -44,109 +40,6 @@ index b611daf..e1ce265 100644
|
||||
return hr;
|
||||
}
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index f501fa4..fec2ac3 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -80,6 +80,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_EVICT_RESOURCE,
|
||||
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
|
||||
WINED3D_CS_OP_CREATE_VBO,
|
||||
+ WINED3D_CS_OP_RESOURCE_CLEANUP,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -474,6 +475,12 @@ struct wined3d_cs_create_vbo
|
||||
struct wined3d_buffer *buffer;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_resource_cleanup
|
||||
+{
|
||||
+ enum wined3d_cs_op opcode;
|
||||
+ struct wined3d_resource *resource;
|
||||
+};
|
||||
+
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -2401,6 +2408,26 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu
|
||||
cs->ops->finish_prio(cs);
|
||||
}
|
||||
|
||||
+static UINT wined3d_cs_exec_resource_cleanup(struct wined3d_cs *cs, const void *data)
|
||||
+{
|
||||
+ const struct wined3d_cs_resource_cleanup *op = data;
|
||||
+
|
||||
+ wined3d_resource_cleanup_cs(op->resource);
|
||||
+
|
||||
+ return sizeof(*op);
|
||||
+}
|
||||
+
|
||||
+void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_resource *resource)
|
||||
+{
|
||||
+ struct wined3d_cs_resource_cleanup *op;
|
||||
+
|
||||
+ op = cs->ops->require_space(cs, sizeof(*op));
|
||||
+ op->opcode = WINED3D_CS_OP_RESOURCE_CLEANUP;
|
||||
+ op->resource = resource;
|
||||
+
|
||||
+ cs->ops->submit(cs, sizeof(*op));
|
||||
+}
|
||||
+
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -2459,6 +2486,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource,
|
||||
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
|
||||
/* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo,
|
||||
+ /* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup,
|
||||
};
|
||||
|
||||
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index f1c8eae..5bf3dfb 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -5000,8 +5000,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
|
||||
|
||||
TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
|
||||
|
||||
- context_resource_released(device, resource, type);
|
||||
-
|
||||
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
|
||||
{
|
||||
if ((rtv = device->state.fb.render_targets[i]) && rtv->resource == resource)
|
||||
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
|
||||
index 9acc7be..3af6851 100644
|
||||
--- a/dlls/wined3d/resource.c
|
||||
+++ b/dlls/wined3d/resource.c
|
||||
@@ -237,6 +237,13 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+void wined3d_resource_cleanup_cs(struct wined3d_resource *resource)
|
||||
+{
|
||||
+ wined3d_resource_free_sysmem(resource);
|
||||
+ resource->map_heap_memory = NULL;
|
||||
+ context_resource_released(resource->device, resource, resource->type);
|
||||
+}
|
||||
+
|
||||
void resource_cleanup(struct wined3d_resource *resource)
|
||||
{
|
||||
const struct wined3d *d3d = resource->device->wined3d;
|
||||
@@ -249,10 +256,8 @@ void resource_cleanup(struct wined3d_resource *resource)
|
||||
adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size);
|
||||
}
|
||||
|
||||
- wined3d_resource_free_sysmem(resource);
|
||||
- resource->map_heap_memory = NULL;
|
||||
-
|
||||
device_resource_released(resource->device, resource);
|
||||
+ wined3d_cs_emit_resource_cleanup(resource->device->cs, resource);
|
||||
}
|
||||
|
||||
void resource_unload(struct wined3d_resource *resource)
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index d810267..53dfea6 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
@ -160,27 +53,6 @@ index d810267..53dfea6 100644
|
||||
}
|
||||
|
||||
void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 012494d..0477ef9 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2507,6 +2507,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
||||
const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN;
|
||||
void resource_unload(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
+void wined3d_resource_cleanup_cs(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
|
||||
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
|
||||
@@ -3086,6 +3087,8 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
|
||||
struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs,
|
||||
+ struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Direct3D terminology with little modifications. We do not have an issued state
|
||||
* because only the driver knows about it, but we have a created state because d3d
|
||||
--
|
||||
2.8.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 3bf5e65dbf7f9c4afd8b48c277c354222a9761c3 Mon Sep 17 00:00:00 2001
|
||||
From 10e80fbfff5af4dd169e9d6f6292787639602ece Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 16 Mar 2014 14:13:42 +0100
|
||||
Subject: wined3d: Send getdc and releasedc through the command stream.
|
||||
@ -11,20 +11,20 @@ Another hacky patch to avoid using GL outside the worker thread.
|
||||
3 files changed, 113 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 64585f6..959ce85 100644
|
||||
index 7344c4b..c48f5e3 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -81,6 +81,8 @@ enum wined3d_cs_op
|
||||
@@ -79,6 +79,8 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_EVICT_RESOURCE,
|
||||
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
|
||||
WINED3D_CS_OP_CREATE_VBO,
|
||||
WINED3D_CS_OP_RESOURCE_CLEANUP,
|
||||
+ WINED3D_CS_OP_GET_DC,
|
||||
+ WINED3D_CS_OP_RELEASE_DC,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -481,6 +483,13 @@ struct wined3d_cs_resource_cleanup
|
||||
struct wined3d_resource *resource;
|
||||
@@ -467,6 +469,13 @@ struct wined3d_cs_create_vbo
|
||||
struct wined3d_buffer *buffer;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_get_release_dc
|
||||
@ -37,8 +37,8 @@ index 64585f6..959ce85 100644
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -2450,6 +2459,52 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
@@ -2396,6 +2405,52 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu
|
||||
cs->ops->finish_prio(cs);
|
||||
}
|
||||
|
||||
+static UINT wined3d_cs_exec_get_dc(struct wined3d_cs *cs, const void *data)
|
||||
@ -90,10 +90,10 @@ index 64585f6..959ce85 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -2509,6 +2564,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2453,6 +2508,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource,
|
||||
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
|
||||
/* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo,
|
||||
/* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup,
|
||||
+ /* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
|
||||
+ /* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
|
||||
};
|
||||
@ -217,10 +217,10 @@ index 2f57373..f36ae61 100644
|
||||
return WINED3D_OK;
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 6753579..7141256 100644
|
||||
index 6261b30..a8c92f8 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2587,6 +2587,7 @@ struct wined3d_texture
|
||||
@@ -2643,6 +2643,7 @@ struct wined3d_texture
|
||||
DWORD flags;
|
||||
GLenum target;
|
||||
DWORD update_map_binding;
|
||||
@ -228,7 +228,7 @@ index 6753579..7141256 100644
|
||||
|
||||
GLuint rb_multisample;
|
||||
GLuint rb_resolved;
|
||||
@@ -2681,6 +2682,7 @@ void wined3d_texture_changed(struct wined3d_texture *texture,
|
||||
@@ -2737,6 +2738,7 @@ void wined3d_texture_changed(struct wined3d_texture *texture,
|
||||
void *swap_heap_memory) DECLSPEC_HIDDEN;
|
||||
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
|
||||
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
|
||||
@ -236,7 +236,7 @@ index 6753579..7141256 100644
|
||||
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx,
|
||||
struct wined3d_bo_address *data, DWORD locations, BOOL map) DECLSPEC_HIDDEN;
|
||||
@@ -2700,6 +2702,8 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
@@ -2756,6 +2758,8 @@ void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int
|
||||
DWORD flags) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
|
||||
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
|
||||
@ -245,10 +245,10 @@ index 6753579..7141256 100644
|
||||
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
|
||||
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
|
||||
@@ -3094,6 +3098,10 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer
|
||||
@@ -3147,6 +3151,10 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
|
||||
struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs,
|
||||
struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
|
||||
+ unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 287c22bdc1ce3cc81fcd80ea9b2e555acb07895b Mon Sep 17 00:00:00 2001
|
||||
From 2db17c7ebe378168da7a1f05fef44dff4465c478 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 10 Oct 2013 16:29:42 +0200
|
||||
Subject: wined3d: Create dummy textures through the CS.
|
||||
@ -12,18 +12,18 @@ crash.
|
||||
3 files changed, 35 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 959ce85..e50d2fa 100644
|
||||
index c48f5e3..3044e26 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -83,6 +83,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_RESOURCE_CLEANUP,
|
||||
@@ -81,6 +81,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_CREATE_VBO,
|
||||
WINED3D_CS_OP_GET_DC,
|
||||
WINED3D_CS_OP_RELEASE_DC,
|
||||
+ WINED3D_CS_OP_CREATE_DUMMY_TEXTURES,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -490,6 +491,11 @@ struct wined3d_cs_get_release_dc
|
||||
@@ -476,6 +477,11 @@ struct wined3d_cs_get_release_dc
|
||||
unsigned int sub_resource_idx;
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ index 959ce85..e50d2fa 100644
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -2505,6 +2511,28 @@ void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *t
|
||||
@@ -2451,6 +2457,28 @@ void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *t
|
||||
cs->ops->finish(cs);
|
||||
}
|
||||
|
||||
@ -64,8 +64,8 @@ index 959ce85..e50d2fa 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -2566,6 +2594,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup,
|
||||
@@ -2510,6 +2538,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo,
|
||||
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
|
||||
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
|
||||
+ /* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures,
|
||||
@ -115,10 +115,10 @@ index 5c47a70..bca71ad 100644
|
||||
context_release(context);
|
||||
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 7141256..bd4abc9 100644
|
||||
index a8c92f8..30529d3 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2435,7 +2435,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT
|
||||
@@ -2492,7 +2492,7 @@ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT
|
||||
GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||
void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo,
|
||||
const struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||
@ -127,7 +127,7 @@ index 7141256..bd4abc9 100644
|
||||
|
||||
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
|
||||
{
|
||||
@@ -3102,6 +3102,7 @@ void wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *textu
|
||||
@@ -3155,6 +3155,7 @@ void wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *textu
|
||||
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
|
||||
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 3672080dca25e19d625417d907ec26ac1f8d4b5c Mon Sep 17 00:00:00 2001
|
||||
From 3bc2195fcff838f6875a50a6b07332a232e7f546 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
|
||||
Date: Sat, 7 May 2016 22:07:22 +0100
|
||||
Subject: wined3d: Do the sampler GL init through the CS.
|
||||
@ -12,19 +12,19 @@ This extra parameter is barf-inducing.
|
||||
4 files changed, 63 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 70d3e1f..028003f 100644
|
||||
index 0e976b0..acf2ae0 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -81,6 +81,7 @@ enum wined3d_cs_op
|
||||
@@ -79,6 +79,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_EVICT_RESOURCE,
|
||||
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
|
||||
WINED3D_CS_OP_CREATE_VBO,
|
||||
WINED3D_CS_OP_RESOURCE_CLEANUP,
|
||||
+ WINED3D_CS_OP_SAMPLER_INIT,
|
||||
WINED3D_CS_OP_GET_DC,
|
||||
WINED3D_CS_OP_RELEASE_DC,
|
||||
WINED3D_CS_OP_CREATE_DUMMY_TEXTURES,
|
||||
@@ -487,6 +488,12 @@ struct wined3d_cs_resource_cleanup
|
||||
struct wined3d_resource *resource;
|
||||
@@ -473,6 +474,12 @@ struct wined3d_cs_create_vbo
|
||||
struct wined3d_buffer *buffer;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_sampler_init
|
||||
@ -36,8 +36,8 @@ index 70d3e1f..028003f 100644
|
||||
struct wined3d_cs_get_release_dc
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
@@ -2487,6 +2494,26 @@ void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs, struct wined3d_reso
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
@@ -2433,6 +2440,26 @@ void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *bu
|
||||
cs->ops->finish_prio(cs);
|
||||
}
|
||||
|
||||
+static UINT wined3d_cs_exec_sampler_init(struct wined3d_cs *cs, const void *data)
|
||||
@ -63,19 +63,19 @@ index 70d3e1f..028003f 100644
|
||||
static UINT wined3d_cs_exec_get_dc(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_get_release_dc *op = data;
|
||||
@@ -2681,6 +2708,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2625,6 +2652,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource,
|
||||
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
|
||||
/* WINED3D_CS_OP_CREATE_VBO */ wined3d_cs_exec_create_vbo,
|
||||
/* WINED3D_CS_OP_RESOURCE_CLEANUP */ wined3d_cs_exec_resource_cleanup,
|
||||
+ /* WINED3D_CS_OP_SAMPLER_INIT */ wined3d_cs_exec_sampler_init,
|
||||
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
|
||||
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
|
||||
/* WINED3D_CS_OP_CREATE_DUMMY_TEXTURES */ wined3d_cs_exec_create_dummy_textures,
|
||||
diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c
|
||||
index 8c73466..bc165a8 100644
|
||||
index 1a2e2a1..2bf881f 100644
|
||||
--- a/dlls/wined3d/sampler.c
|
||||
+++ b/dlls/wined3d/sampler.c
|
||||
@@ -67,43 +67,37 @@ void * CDECL wined3d_sampler_get_parent(const struct wined3d_sampler *sampler)
|
||||
@@ -66,43 +66,37 @@ void * CDECL wined3d_sampler_get_parent(const struct wined3d_sampler *sampler)
|
||||
return sampler->parent;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ index 8c73466..bc165a8 100644
|
||||
GL_EXTCALL(glSamplerParameteri(sampler->name, GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT));
|
||||
checkGLcall("sampler creation");
|
||||
|
||||
@@ -115,6 +109,12 @@ static void wined3d_sampler_init(struct wined3d_sampler *sampler, struct wined3d
|
||||
@@ -114,6 +108,12 @@ static void wined3d_sampler_init(struct wined3d_sampler *sampler, struct wined3d
|
||||
HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct wined3d_sampler_desc *desc,
|
||||
void *parent, struct wined3d_sampler **sampler)
|
||||
{
|
||||
@ -147,7 +147,7 @@ index 8c73466..bc165a8 100644
|
||||
struct wined3d_sampler *object;
|
||||
|
||||
TRACE("device %p, desc %p, parent %p, sampler %p.\n", device, desc, parent, sampler);
|
||||
@@ -135,7 +135,14 @@ HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct
|
||||
@@ -134,7 +134,14 @@ HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct
|
||||
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
@ -164,7 +164,7 @@ index 8c73466..bc165a8 100644
|
||||
TRACE("Created sampler %p.\n", object);
|
||||
*sampler = object;
|
||||
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
|
||||
index ed578b8..a513298 100644
|
||||
index 50cf6cd..64afaac 100644
|
||||
--- a/dlls/wined3d/state.c
|
||||
+++ b/dlls/wined3d/state.c
|
||||
@@ -3604,7 +3604,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
|
||||
@ -177,10 +177,10 @@ index ed578b8..a513298 100644
|
||||
ERR("Failed to create sampler.\n");
|
||||
sampler = NULL;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 629ac6d..8b48d64 100644
|
||||
index 9a43938..fd4ba77 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2858,6 +2858,10 @@ struct wined3d_sampler
|
||||
@@ -2914,6 +2914,10 @@ struct wined3d_sampler
|
||||
GLuint name;
|
||||
};
|
||||
|
||||
@ -191,10 +191,10 @@ index 629ac6d..8b48d64 100644
|
||||
struct wined3d_vertex_declaration_element
|
||||
{
|
||||
const struct wined3d_format *format;
|
||||
@@ -3100,6 +3104,7 @@ void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer
|
||||
@@ -3153,6 +3157,7 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
|
||||
struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_buffer_preload(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_create_vbo(struct wined3d_cs *cs, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_resource_cleanup(struct wined3d_cs *cs,
|
||||
struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_sampler_init(struct wined3d_cs *cs, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
|
||||
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user