Rebase against d7430abd406d1f298acb9b2e5a397e11e448f304.

This commit is contained in:
Zebediah Figura
2018-03-27 18:31:13 -05:00
parent f7ba182039
commit b7119079a3
17 changed files with 2250 additions and 347 deletions

View File

@@ -1,4 +1,4 @@
From 0dd251b4e4bfc63fab3c22acf894a20e9e6d5914 Mon Sep 17 00:00:00 2001
From fda0041ebe98a2da3a43dad2443812406f2eafd4 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
@@ -13,10 +13,10 @@ them for DISCARD maps.
4 files changed, 93 insertions(+), 31 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 75494d9..4593b2b 100644
index 9472ffa..656febf 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5332,3 +5332,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -5307,3 +5307,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 75494d9..4593b2b 100644
+ wined3d_device_destroy_bo(device, context, bo);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 13afdef..8cd5b82 100644
index 30f4936..a27b623 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2408,7 +2408,7 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
@@ -2232,7 +2232,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)
- if (conversion && sub_resource->buffer_object)
+ if (conversion && sub_resource->buffer)
{
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 b79a1ec..d7add3e 100644
index 526bfb1..89313ca 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -320,7 +320,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
@@ -321,7 +321,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 b79a1ec..d7add3e 100644
return;
}
if (locations & WINED3D_LOCATION_USER_MEMORY)
@@ -430,18 +430,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
@@ -345,18 +345,17 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
/* Context activation is done by the caller. */
static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
@@ -125,7 +125,7 @@ index b79a1ec..d7add3e 100644
}
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)
@@ -376,7 +375,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,10 +134,10 @@ index b79a1ec..d7add3e 100644
}
if (context)
@@ -664,17 +663,17 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
struct wined3d_renderbuffer_entry *entry, *entry2;
@@ -719,17 +718,17 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
const struct wined3d_gl_info *gl_info = NULL;
struct wined3d_context *context = NULL;
struct wined3d_dc_info *dc_info;
- GLuint buffer_object;
+ struct wined3d_gl_bo *buffer;
unsigned int i;
@@ -155,7 +155,7 @@ index b79a1ec..d7add3e 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. */
@@ -684,7 +683,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
@@ -739,7 +738,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
gl_info = context->gl_info;
}
@@ -165,7 +165,7 @@ index b79a1ec..d7add3e 100644
}
if (!context && !list_empty(&texture->renderbuffers))
@@ -1583,22 +1583,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -1545,22 +1545,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,
@@ -193,7 +193,7 @@ index b79a1ec..d7add3e 100644
}
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
@@ -1697,7 +1694,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -1695,7 +1692,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
return TRUE;
case WINED3D_LOCATION_BUFFER:
@@ -202,25 +202,7 @@ index b79a1ec..d7add3e 100644
return TRUE;
case WINED3D_LOCATION_TEXTURE_RGB:
@@ -1996,7 +1993,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
- struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL};
+ struct wined3d_const_bo_address data = {sub_resource->buffer->name, NULL};
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 +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))
{
- struct wined3d_bo_address data = {sub_resource->buffer_object, NULL};
+ struct wined3d_bo_address data = {sub_resource->buffer->name, NULL};
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -2339,8 +2336,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
@@ -2073,8 +2070,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
}
@@ -231,16 +213,34 @@ index b79a1ec..d7add3e 100644
}
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
@@ -2372,7 +2369,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
- struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL};
+ struct wined3d_const_bo_address data = {sub_resource->buffer->name, NULL};
struct wined3d_box src_box;
wined3d_texture_bind_and_dirtify(texture, context,
location == WINED3D_LOCATION_TEXTURE_SRGB);
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
@@ -3141,7 +3138,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -2414,7 +2411,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))
{
- struct wined3d_bo_address data = {sub_resource->buffer_object, NULL};
+ struct wined3d_bo_address data = {sub_resource->buffer->name, NULL};
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -2871,7 +2868,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
- struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL};
+ struct wined3d_const_bo_address data = {sub_resource->buffer->name, NULL};
struct wined3d_box src_box;
wined3d_texture_bind_and_dirtify(texture, context,
@@ -2921,7 +2918,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))
{
@@ -250,10 +250,10 @@ index b79a1ec..d7add3e 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 3137e7a..f47fd09 100644
index e98a100..af58836 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2894,6 +2894,14 @@ struct wined3d_dummy_textures
@@ -2896,6 +2896,14 @@ struct wined3d_dummy_textures
GLuint tex_2d_ms_array;
};
@@ -268,7 +268,7 @@ index 3137e7a..f47fd09 100644
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -2994,6 +3002,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2995,6 +3003,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;
@@ -279,7 +279,7 @@ index 3137e7a..f47fd09 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3196,7 +3208,7 @@ struct wined3d_texture
@@ -3194,7 +3206,7 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;

View File

@@ -1,27 +1,12 @@
From 68a40c7553254a71925933c26d63147ec5b2b490 Mon Sep 17 00:00:00 2001
From: Wine Staging Team <webmaster@fds-team.de>
Date: Fri, 16 Mar 2018 14:10:37 +1100
Subject: [PATCH] Autogenerated #ifdef patch for wined3d-CSMT_Main.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Subject: Autogenerated #ifdef patch for wined3d-CSMT_Main.
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 | 85 +++++++++++++++++++++++++++++++++++++++
dlls/wined3d/view.c | 14 +++++++
dlls/wined3d/wined3d_private.h | 23 +++++++++++
7 files changed, 294 insertions(+)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index c194832..0493bb8 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -406,6 +406,9 @@ struct wined3d_cs_update_sub_resource
@@ -34,7 +19,7 @@ index c194832..0493bb8 100644
};
struct wined3d_cs_add_dirty_texture_region
@@ -2243,6 +2246,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2238,6 +2241,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;
@@ -88,7 +73,7 @@ index c194832..0493bb8 100644
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
@@ -2256,8 +2306,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2251,8 +2301,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);
@@ -99,7 +84,7 @@ index c194832..0493bb8 100644
cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
}
@@ -2440,6 +2492,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2435,6 +2487,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GENERATE_MIPMAPS */ wined3d_cs_exec_generate_mipmaps,
};
@@ -113,7 +98,7 @@ index c194832..0493bb8 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))
@@ -2493,6 +2552,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
@@ -2488,6 +2547,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 =
{
@@ -123,7 +108,7 @@ index c194832..0493bb8 100644
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
wined3d_cs_st_finish,
@@ -2526,6 +2588,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
@@ -2521,6 +2583,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);
}
@@ -145,7 +130,7 @@ index c194832..0493bb8 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);
@@ -2587,6 +2664,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
@@ -2582,6 +2659,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
return packet->data;
}
@@ -162,7 +147,7 @@ index c194832..0493bb8 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())
@@ -2606,6 +2693,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
@@ -2601,6 +2688,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 =
{
@@ -173,10 +158,9 @@ index c194832..0493bb8 100644
wined3d_cs_mt_submit,
wined3d_cs_mt_finish,
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 583e85f..d0eb846 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1221,6 +1221,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -1219,6 +1219,9 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
wine_rb_clear(&device->samplers, device_free_sampler, NULL);
@@ -186,7 +170,7 @@ index 583e85f..d0eb846 100644
wined3d_device_delete_opengl_contexts(device);
if (device->fb.depth_stencil)
@@ -4217,6 +4220,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4212,6 +4215,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
return WINED3DERR_INVALIDCALL;
}
@@ -194,7 +178,7 @@ index 583e85f..d0eb846 100644
if (dst_texture->sub_resources[dst_sub_resource_idx].map_count)
{
WARN("Destination sub-resource %u is mapped.\n", dst_sub_resource_idx);
@@ -4227,6 +4231,19 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4222,6 +4226,19 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
{
WARN("Source sub-resource %u is mapped.\n", src_sub_resource_idx);
return WINED3DERR_INVALIDCALL;
@@ -214,7 +198,7 @@ index 583e85f..d0eb846 100644
}
if (!src_box)
@@ -4328,8 +4345,10 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
@@ -4314,8 +4331,10 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
return;
}
@@ -225,7 +209,7 @@ index 583e85f..d0eb846 100644
wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
}
@@ -5329,3 +5348,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -5306,3 +5325,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@@ -285,10 +269,9 @@ index 583e85f..d0eb846 100644
+}
+#endif /* STAGING_CSMT */
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 217d1d8..bed9e86 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2239,7 +2239,11 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
@@ -2232,7 +2232,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. */
@@ -301,10 +284,9 @@ index 217d1d8..bed9e86 100644
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 09e26af..26ebba9 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -476,7 +476,11 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
@@ -472,7 +472,11 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
if (swapchain->render_to_fbo)
swapchain_blit(swapchain, context, src_rect, dst_rect);
@@ -317,10 +299,9 @@ index 09e26af..26ebba9 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 4fcec89..6d12d60 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -326,7 +326,11 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
@@ -321,7 +321,11 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
if (locations & WINED3D_LOCATION_BUFFER)
{
data->addr = NULL;
@@ -332,7 +313,7 @@ index 4fcec89..6d12d60 100644
return;
}
if (locations & WINED3D_LOCATION_USER_MEMORY)
@@ -350,6 +354,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
@@ -345,6 +349,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
/* Context activation is done by the caller. */
static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
@@ -340,7 +321,7 @@ index 4fcec89..6d12d60 100644
unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info)
{
GLuint *buffer_object = &texture->sub_resources[sub_resource_idx].buffer_object;
@@ -362,6 +367,19 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture
@@ -357,6 +362,19 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture
wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_BUFFER);
*buffer_object = 0;
@@ -360,7 +341,7 @@ index 4fcec89..6d12d60 100644
}
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -381,7 +399,11 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -376,7 +394,11 @@ 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)
@@ -372,7 +353,7 @@ index 4fcec89..6d12d60 100644
}
if (context)
@@ -726,17 +748,28 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
@@ -719,17 +741,28 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
const struct wined3d_gl_info *gl_info = NULL;
struct wined3d_context *context = NULL;
struct wined3d_dc_info *dc_info;
@@ -401,7 +382,7 @@ index 4fcec89..6d12d60 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. */
@@ -746,7 +779,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
@@ -739,7 +772,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
gl_info = context->gl_info;
}
@@ -414,7 +395,7 @@ index 4fcec89..6d12d60 100644
}
if (!context && !list_empty(&texture->renderbuffers))
@@ -1558,11 +1596,16 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -1545,11 +1583,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,
@@ -431,7 +412,7 @@ index 4fcec89..6d12d60 100644
if (sub_resource->buffer_object)
return;
@@ -1574,6 +1617,16 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
@@ -1561,6 +1604,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);
@@ -448,7 +429,7 @@ index 4fcec89..6d12d60 100644
}
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
@@ -1708,7 +1761,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -1695,7 +1748,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
return TRUE;
case WINED3D_LOCATION_BUFFER:
@@ -460,19 +441,7 @@ index 4fcec89..6d12d60 100644
return TRUE;
case WINED3D_LOCATION_TEXTURE_RGB:
@@ -1957,7 +2014,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))
{
+#if !defined(STAGING_CSMT)
struct wined3d_bo_address data = {sub_resource->buffer_object, NULL};
+#else /* STAGING_CSMT */
+ struct wined3d_bo_address data = {sub_resource->buffer->name, NULL};
+#endif /* STAGING_CSMT */
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -2304,8 +2365,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
@@ -2073,8 +2130,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
}
@@ -486,7 +455,7 @@ index 4fcec89..6d12d60 100644
}
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture->renderbuffers, struct wined3d_renderbuffer_entry, entry)
@@ -3080,7 +3146,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -2372,7 +2434,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
@@ -498,7 +467,7 @@ index 4fcec89..6d12d60 100644
struct wined3d_box src_box;
wined3d_texture_bind_and_dirtify(texture, context,
@@ -3130,7 +3200,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -2414,7 +2480,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))
{
@@ -510,7 +479,31 @@ index 4fcec89..6d12d60 100644
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -3196,8 +3270,19 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned
@@ -2871,7 +2941,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
+#if !defined(STAGING_CSMT)
struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL};
+#else /* STAGING_CSMT */
+ struct wined3d_const_bo_address data = {sub_resource->buffer->name, NULL};
+#endif /* STAGING_CSMT */
struct wined3d_box src_box;
wined3d_texture_bind_and_dirtify(texture, context,
@@ -2921,7 +2995,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))
{
+#if !defined(STAGING_CSMT)
struct wined3d_bo_address data = {sub_resource->buffer_object, NULL};
+#else /* STAGING_CSMT */
+ struct wined3d_bo_address data = {sub_resource->buffer->name, NULL};
+#endif /* STAGING_CSMT */
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -2987,8 +3065,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)
{
@@ -531,7 +524,6 @@ index 4fcec89..6d12d60 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)
@@ -577,10 +569,9 @@ index 1eebce6..bed39db 100644
return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b240503..996da72 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2904,6 +2904,16 @@ struct wined3d_dummy_textures
@@ -2896,6 +2896,16 @@ struct wined3d_dummy_textures
GLuint tex_2d_ms_array;
};
@@ -597,7 +588,7 @@ index b240503..996da72 100644
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -3004,6 +3014,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2995,6 +3005,12 @@ 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;
@@ -610,7 +601,7 @@ index b240503..996da72 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3203,7 +3219,11 @@ struct wined3d_texture
@@ -3194,7 +3210,11 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;
@@ -622,7 +613,7 @@ index b240503..996da72 100644
} sub_resources[1];
};
@@ -3518,6 +3538,9 @@ struct wined3d_cs_queue
@@ -3509,6 +3529,9 @@ struct wined3d_cs_queue
struct wined3d_cs_ops
{
@@ -632,6 +623,3 @@ index b240503..996da72 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