You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 813ab925abd45d48c811898028fddc1047b0c250
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 54da86ca6233d826f9566b98fd9d6a6ffd7c5dfd Mon Sep 17 00:00:00 2001
|
||||
From 0dd251b4e4bfc63fab3c22acf894a20e9e6d5914 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Fri, 30 Aug 2013 17:00:35 +0200
|
||||
Subject: [PATCH] wined3d: Wrap GL BOs in a structure
|
||||
@@ -6,17 +6,17 @@ Subject: [PATCH] wined3d: Wrap GL BOs in a structure
|
||||
The idea is to use those structures for mapping through the command stream and caching
|
||||
them for DISCARD maps.
|
||||
---
|
||||
dlls/wined3d/device.c | 53 +++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/device.c | 53 ++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/surface.c | 2 +-
|
||||
dlls/wined3d/texture.c | 59 +++++++++++++++++++-----------------------
|
||||
dlls/wined3d/wined3d_private.h | 14 +++++++++-
|
||||
4 files changed, 93 insertions(+), 35 deletions(-)
|
||||
dlls/wined3d/texture.c | 55 ++++++++++++++++++++----------------------
|
||||
dlls/wined3d/wined3d_private.h | 14 ++++++++++-
|
||||
4 files changed, 93 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index b19f49c..c70be7d 100644
|
||||
index 75494d9..4593b2b 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -5340,3 +5340,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
@@ -5332,3 +5332,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
else
|
||||
return CallWindowProcA(proc, window, message, wparam, lparam);
|
||||
}
|
||||
@@ -74,23 +74,23 @@ index b19f49c..c70be7d 100644
|
||||
+ wined3d_device_destroy_bo(device, context, bo);
|
||||
+}
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 5ce06bb..1765345 100644
|
||||
index 13afdef..8cd5b82 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -2500,7 +2500,7 @@ static BOOL surface_load_texture(struct wined3d_surface *surface,
|
||||
@@ -2408,7 +2408,7 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
|
||||
/* Don't use PBOs for converted surfaces. During PBO conversion we look at
|
||||
* WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is
|
||||
* getting called. */
|
||||
- if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer_object)
|
||||
+ if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer)
|
||||
{
|
||||
TRACE("Removing the pbo attached to surface %p.\n", surface);
|
||||
TRACE("Removing the pbo attached to texture %p, %u.\n", texture, sub_resource_idx);
|
||||
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 257dd01..6f238e9 100644
|
||||
index b79a1ec..d7add3e 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -294,7 +294,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
|
||||
@@ -320,7 +320,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
|
||||
if (locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
data->addr = NULL;
|
||||
@@ -99,7 +99,7 @@ index 257dd01..6f238e9 100644
|
||||
return;
|
||||
}
|
||||
if (locations & WINED3D_LOCATION_USER_MEMORY)
|
||||
@@ -402,18 +402,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
@@ -430,18 +430,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
|
||||
@@ -125,7 +125,7 @@ index 257dd01..6f238e9 100644
|
||||
}
|
||||
|
||||
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
@@ -433,7 +432,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
@@ -461,7 +460,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
&& !wined3d_texture_load_location(texture, i, context, map_binding))
|
||||
ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
|
||||
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
|
||||
@@ -134,11 +134,10 @@ index 257dd01..6f238e9 100644
|
||||
}
|
||||
|
||||
if (context)
|
||||
@@ -634,28 +633,25 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
unsigned int sub_count = texture->level_count * texture->layer_count;
|
||||
struct wined3d_device *device = texture->resource.device;
|
||||
@@ -664,17 +663,17 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
struct wined3d_renderbuffer_entry *entry, *entry2;
|
||||
const struct wined3d_gl_info *gl_info = NULL;
|
||||
struct wined3d_context *context = NULL;
|
||||
- const struct wined3d_gl_info *gl_info;
|
||||
- GLuint buffer_object;
|
||||
+ struct wined3d_gl_bo *buffer;
|
||||
unsigned int i;
|
||||
@@ -156,19 +155,17 @@ index 257dd01..6f238e9 100644
|
||||
|
||||
/* We may not be able to get a context in wined3d_texture_cleanup() in
|
||||
* general, but if a buffer object was previously created we can. */
|
||||
if (!context)
|
||||
- {
|
||||
context = context_acquire(device, NULL, 0);
|
||||
- gl_info = context->gl_info;
|
||||
- }
|
||||
@@ -684,7 +683,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
gl_info = context->gl_info;
|
||||
}
|
||||
|
||||
- GL_EXTCALL(glDeleteBuffers(1, &buffer_object));
|
||||
+ wined3d_device_release_bo(device, buffer, context);
|
||||
+ texture->sub_resources[i].buffer = NULL;
|
||||
}
|
||||
if (context)
|
||||
context_release(context);
|
||||
@@ -1455,22 +1451,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
|
||||
if (!context && !list_empty(&texture->renderbuffers))
|
||||
@@ -1583,22 +1583,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
|
||||
@@ -196,7 +193,7 @@ index 257dd01..6f238e9 100644
|
||||
}
|
||||
|
||||
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
|
||||
@@ -1569,7 +1562,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
@@ -1697,7 +1694,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
@@ -205,7 +202,7 @@ index 257dd01..6f238e9 100644
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
@@ -1868,7 +1861,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1996,7 +1993,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
@@ -214,7 +211,7 @@ index 257dd01..6f238e9 100644
|
||||
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
|
||||
@@ -1913,7 +1906,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -2041,7 +2038,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@@ -223,7 +220,7 @@ index 257dd01..6f238e9 100644
|
||||
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
@@ -2201,8 +2194,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
@@ -2339,8 +2336,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
@@ -231,10 +228,10 @@ index 257dd01..6f238e9 100644
|
||||
- wined3d_texture_remove_buffer_object(texture, i, context->gl_info);
|
||||
+ if (sub_resource->buffer)
|
||||
+ wined3d_texture_remove_buffer_object(texture, i, context);
|
||||
}
|
||||
|
||||
if (resource->type == WINED3D_RTYPE_TEXTURE_2D)
|
||||
{
|
||||
@@ -2965,7 +2958,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
||||
@@ -3095,7 +3092,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
@@ -243,7 +240,7 @@ index 257dd01..6f238e9 100644
|
||||
wined3d_texture_bind_and_dirtify(texture, context,
|
||||
location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
@@ -3011,7 +3004,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -3141,7 +3138,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@@ -253,10 +250,10 @@ index 257dd01..6f238e9 100644
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index ea01e15..cbad162 100644
|
||||
index 3137e7a..f47fd09 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2895,6 +2895,14 @@ struct wined3d_dummy_textures
|
||||
@@ -2894,6 +2894,14 @@ struct wined3d_dummy_textures
|
||||
GLuint tex_2d_ms_array;
|
||||
};
|
||||
|
||||
@@ -271,7 +268,7 @@ index ea01e15..cbad162 100644
|
||||
#define WINED3D_UNMAPPED_STAGE ~0u
|
||||
|
||||
/* Multithreaded flag. Removed from the public header to signal that
|
||||
@@ -2995,6 +3003,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
@@ -2994,6 +3002,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
|
||||
@@ -282,7 +279,7 @@ index ea01e15..cbad162 100644
|
||||
|
||||
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
|
||||
{
|
||||
@@ -3194,7 +3206,7 @@ struct wined3d_texture
|
||||
@@ -3196,7 +3208,7 @@ struct wined3d_texture
|
||||
|
||||
unsigned int map_count;
|
||||
DWORD locations;
|
||||
|
@@ -5,18 +5,8 @@ Based on patches by:
|
||||
Michael Müller <michael@fds-team.de>
|
||||
Sebastian Lackner <sebastian@fds-team.de>
|
||||
Stefan Dösinger <stefan@codeweavers.com>
|
||||
---
|
||||
dlls/wined3d/cs.c | 90 +++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/device.c | 74 +++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/surface.c | 4 ++
|
||||
dlls/wined3d/swapchain.c | 4 ++
|
||||
dlls/wined3d/texture.c | 92 +++++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/wined3d/view.c | 14 +++++++
|
||||
dlls/wined3d/wined3d_private.h | 23 +++++++++++
|
||||
7 files changed, 300 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 003cda3..3a7c95d 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -406,6 +406,9 @@ struct wined3d_cs_update_sub_resource
|
||||
@@ -29,7 +19,7 @@ index 003cda3..3a7c95d 100644
|
||||
};
|
||||
|
||||
struct wined3d_cs_add_dirty_texture_region
|
||||
@@ -2259,6 +2262,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2256,6 +2259,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
unsigned int slice_pitch)
|
||||
{
|
||||
struct wined3d_cs_update_sub_resource *op;
|
||||
@@ -83,7 +73,7 @@ index 003cda3..3a7c95d 100644
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
|
||||
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
|
||||
@@ -2272,8 +2322,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2269,8 +2319,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
wined3d_resource_acquire(resource);
|
||||
|
||||
cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP);
|
||||
@@ -94,7 +84,7 @@ index 003cda3..3a7c95d 100644
|
||||
cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
|
||||
}
|
||||
|
||||
@@ -2456,6 +2508,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2453,6 +2505,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_GENERATE_MIPMAPS */ wined3d_cs_exec_generate_mipmaps,
|
||||
};
|
||||
|
||||
@@ -108,7 +98,7 @@ index 003cda3..3a7c95d 100644
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (size > (cs->data_size - cs->end))
|
||||
@@ -2509,6 +2568,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2506,6 +2565,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_st_ops =
|
||||
{
|
||||
@@ -118,7 +108,7 @@ index 003cda3..3a7c95d 100644
|
||||
wined3d_cs_st_require_space,
|
||||
wined3d_cs_st_submit,
|
||||
wined3d_cs_st_finish,
|
||||
@@ -2542,6 +2604,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2539,6 +2601,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
wined3d_cs_queue_submit(&cs->queue[queue_id], cs);
|
||||
}
|
||||
|
||||
@@ -140,7 +130,7 @@ index 003cda3..3a7c95d 100644
|
||||
static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size_t size, struct wined3d_cs *cs)
|
||||
{
|
||||
size_t queue_size = ARRAY_SIZE(queue->data);
|
||||
@@ -2603,6 +2680,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
@@ -2600,6 +2677,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
return packet->data;
|
||||
}
|
||||
|
||||
@@ -157,7 +147,7 @@ index 003cda3..3a7c95d 100644
|
||||
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (cs->thread_id == GetCurrentThreadId())
|
||||
@@ -2622,6 +2709,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2619,6 +2706,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_mt_ops =
|
||||
{
|
||||
@@ -168,7 +158,6 @@ index 003cda3..3a7c95d 100644
|
||||
wined3d_cs_mt_submit,
|
||||
wined3d_cs_mt_finish,
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 3f7d8f7..e2b27e0 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -1212,6 +1212,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
|
||||
@@ -280,10 +269,9 @@ index 3f7d8f7..e2b27e0 100644
|
||||
+}
|
||||
+#endif /* STAGING_CSMT */
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index b2c98c5..a2f4135 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -2409,7 +2409,11 @@ BOOL surface_load_texture(struct wined3d_surface *surface,
|
||||
@@ -2407,7 +2407,11 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
|
||||
/* Don't use PBOs for converted surfaces. During PBO conversion we look at
|
||||
* WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is
|
||||
* getting called. */
|
||||
@@ -293,10 +281,9 @@ index b2c98c5..a2f4135 100644
|
||||
+ if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer)
|
||||
+#endif /* STAGING_CSMT */
|
||||
{
|
||||
TRACE("Removing the pbo attached to surface %p.\n", surface);
|
||||
TRACE("Removing the pbo attached to texture %p, %u.\n", texture, sub_resource_idx);
|
||||
|
||||
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
|
||||
index 9b3962f..3721db6 100644
|
||||
--- a/dlls/wined3d/swapchain.c
|
||||
+++ b/dlls/wined3d/swapchain.c
|
||||
@@ -476,7 +476,11 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
|
||||
@@ -312,7 +299,6 @@ index 9b3962f..3721db6 100644
|
||||
|
||||
/* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 78e43db..5abb82b 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -320,7 +320,11 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
|
||||
@@ -367,7 +353,7 @@ index 78e43db..5abb82b 100644
|
||||
}
|
||||
|
||||
if (context)
|
||||
@@ -664,27 +686,45 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
@@ -664,17 +686,28 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
struct wined3d_renderbuffer_entry *entry, *entry2;
|
||||
const struct wined3d_gl_info *gl_info = NULL;
|
||||
struct wined3d_context *context = NULL;
|
||||
@@ -396,24 +382,20 @@ index 78e43db..5abb82b 100644
|
||||
|
||||
/* We may not be able to get a context in wined3d_texture_cleanup() in
|
||||
* general, but if a buffer object was previously created we can. */
|
||||
if (!context)
|
||||
+#if !defined(STAGING_CSMT)
|
||||
{
|
||||
context = context_acquire(device, NULL, 0);
|
||||
@@ -684,7 +717,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
gl_info = context->gl_info;
|
||||
}
|
||||
|
||||
+#if !defined(STAGING_CSMT)
|
||||
GL_EXTCALL(glDeleteBuffers(1, &buffer_object));
|
||||
+#else /* STAGING_CSMT */
|
||||
+ context = context_acquire(device, NULL, 0);
|
||||
+
|
||||
+ wined3d_device_release_bo(device, buffer, context);
|
||||
+ texture->sub_resources[i].buffer = NULL;
|
||||
+#endif /* STAGING_CSMT */
|
||||
}
|
||||
|
||||
if (!context && !list_empty(&texture->renderbuffers))
|
||||
@@ -1583,11 +1623,16 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1583,11 +1621,16 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
|
||||
@@ -430,7 +412,7 @@ index 78e43db..5abb82b 100644
|
||||
if (sub_resource->buffer_object)
|
||||
return;
|
||||
|
||||
@@ -1599,6 +1644,16 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
|
||||
@@ -1599,6 +1642,16 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
|
||||
|
||||
TRACE("Created buffer object %u for texture %p, sub-resource %u.\n",
|
||||
sub_resource->buffer_object, texture, sub_resource_idx);
|
||||
@@ -447,7 +429,7 @@ index 78e43db..5abb82b 100644
|
||||
}
|
||||
|
||||
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
|
||||
@@ -1697,7 +1752,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
@@ -1697,7 +1750,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
@@ -459,7 +441,7 @@ index 78e43db..5abb82b 100644
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
@@ -1996,7 +2055,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -1996,7 +2053,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
@@ -471,7 +453,7 @@ index 78e43db..5abb82b 100644
|
||||
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
|
||||
@@ -2041,7 +2104,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -2041,7 +2102,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@@ -483,7 +465,7 @@ index 78e43db..5abb82b 100644
|
||||
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
@@ -2342,8 +2409,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
@@ -2339,8 +2404,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
@@ -497,15 +479,7 @@ index 78e43db..5abb82b 100644
|
||||
}
|
||||
|
||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
||||
@@ -2677,7 +2749,6 @@ static HRESULT texture1d_init(struct wined3d_texture *texture, const struct wine
|
||||
surface->container = texture;
|
||||
surface->texture_level = i;
|
||||
surface->texture_layer = j;
|
||||
- list_init(&surface->renderbuffers);
|
||||
|
||||
sub_resource = &texture->sub_resources[idx];
|
||||
sub_resource->locations = WINED3D_LOCATION_DISCARDED;
|
||||
@@ -3099,7 +3170,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -3095,7 +3165,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
@@ -517,7 +491,7 @@ index 78e43db..5abb82b 100644
|
||||
wined3d_texture_bind_and_dirtify(texture, context,
|
||||
location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
@@ -3145,7 +3220,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -3141,7 +3215,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
|
||||
{
|
||||
@@ -529,7 +503,7 @@ index 78e43db..5abb82b 100644
|
||||
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
@@ -3348,8 +3427,19 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned
|
||||
@@ -3344,8 +3422,19 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned
|
||||
if (dst_texture->sub_resources[dst_sub_resource_idx].map_count
|
||||
|| src_texture->sub_resources[src_sub_resource_idx].map_count)
|
||||
{
|
||||
@@ -550,7 +524,6 @@ index 78e43db..5abb82b 100644
|
||||
|
||||
if ((src_format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
|
||||
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
|
||||
index 1eebce6..bed39db 100644
|
||||
--- a/dlls/wined3d/view.c
|
||||
+++ b/dlls/wined3d/view.c
|
||||
@@ -750,6 +750,10 @@ static void wined3d_shader_resource_view_cs_init(void *object)
|
||||
@@ -596,7 +569,6 @@ index 1eebce6..bed39db 100644
|
||||
|
||||
return WINED3D_OK;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 5ac535b..b4b9055 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2898,6 +2898,16 @@ struct wined3d_dummy_textures
|
||||
@@ -651,6 +623,3 @@ index 5ac535b..b4b9055 100644
|
||||
void *(*require_space)(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id);
|
||||
void (*submit)(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id);
|
||||
void (*finish)(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id);
|
||||
--
|
||||
1.9.1
|
||||
|
||||
|
Reference in New Issue
Block a user