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 f2cb86decb334fc72ff5422122ba190bc9b6046e
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From c653adacc254629d34c5a7c27b820f229698d661 Mon Sep 17 00:00:00 2001
|
||||
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.
|
||||
@@ -15,13 +15,13 @@ Based on patches by:
|
||||
dlls/wined3d/device.c | 74 ++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/surface.c | 4 ++
|
||||
dlls/wined3d/swapchain.c | 4 ++
|
||||
dlls/wined3d/texture.c | 89 +++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/texture.c | 85 +++++++++++++++++++++++++++++++++++++++
|
||||
dlls/wined3d/view.c | 14 +++++++
|
||||
dlls/wined3d/wined3d_private.h | 23 +++++++++++
|
||||
7 files changed, 298 insertions(+)
|
||||
7 files changed, 294 insertions(+)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 0d7e10f..f342819 100644
|
||||
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 +34,7 @@ index 0d7e10f..f342819 100644
|
||||
};
|
||||
|
||||
struct wined3d_cs_add_dirty_texture_region
|
||||
@@ -2247,6 +2250,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2243,6 +2246,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 +88,7 @@ index 0d7e10f..f342819 100644
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
|
||||
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
|
||||
@@ -2260,8 +2310,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2256,8 +2306,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 +99,7 @@ index 0d7e10f..f342819 100644
|
||||
cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
|
||||
}
|
||||
|
||||
@@ -2444,6 +2496,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2440,6 +2492,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 +113,7 @@ index 0d7e10f..f342819 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))
|
||||
@@ -2497,6 +2556,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2493,6 +2552,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 +123,7 @@ index 0d7e10f..f342819 100644
|
||||
wined3d_cs_st_require_space,
|
||||
wined3d_cs_st_submit,
|
||||
wined3d_cs_st_finish,
|
||||
@@ -2530,6 +2592,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2526,6 +2588,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 +145,7 @@ index 0d7e10f..f342819 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);
|
||||
@@ -2591,6 +2668,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
@@ -2587,6 +2664,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
return packet->data;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ index 0d7e10f..f342819 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())
|
||||
@@ -2610,6 +2697,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2606,6 +2693,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 =
|
||||
{
|
||||
@@ -285,17 +285,17 @@ index 583e85f..d0eb846 100644
|
||||
+}
|
||||
+#endif /* STAGING_CSMT */
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 913f217..088391e 100644
|
||||
index 217d1d8..bed9e86 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -2392,7 +2392,11 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
|
||||
@@ -2239,7 +2239,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. */
|
||||
+#if !defined(STAGING_CSMT)
|
||||
if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer_object)
|
||||
if (conversion && sub_resource->buffer_object)
|
||||
+#else /* STAGING_CSMT */
|
||||
+ if ((format.conv_byte_count || conversion) && texture->sub_resources[sub_resource_idx].buffer)
|
||||
+ if (conversion && sub_resource->buffer)
|
||||
+#endif /* STAGING_CSMT */
|
||||
{
|
||||
TRACE("Removing the pbo attached to texture %p, %u.\n", texture, sub_resource_idx);
|
||||
@@ -317,7 +317,7 @@ 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 c3f98ba..33165fb 100644
|
||||
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
|
||||
@@ -332,7 +332,7 @@ index c3f98ba..33165fb 100644
|
||||
return;
|
||||
}
|
||||
if (locations & WINED3D_LOCATION_USER_MEMORY)
|
||||
@@ -436,6 +440,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
|
||||
@@ -350,6 +354,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 +340,7 @@ index c3f98ba..33165fb 100644
|
||||
unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info)
|
||||
{
|
||||
GLuint *buffer_object = &texture->sub_resources[sub_resource_idx].buffer_object;
|
||||
@@ -448,6 +453,19 @@ static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture
|
||||
@@ -362,6 +367,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 +360,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||
@@ -467,7 +485,11 @@ 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)
|
||||
&& !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 +372,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
if (context)
|
||||
@@ -788,17 +810,28 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
@@ -726,17 +748,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 +401,7 @@ index c3f98ba..33165fb 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. */
|
||||
@@ -808,7 +841,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
@@ -746,7 +779,12 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
gl_info = context->gl_info;
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
if (!context && !list_empty(&texture->renderbuffers))
|
||||
@@ -1620,11 +1658,16 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
|
||||
@@ -1558,11 +1596,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 +431,7 @@ index c3f98ba..33165fb 100644
|
||||
if (sub_resource->buffer_object)
|
||||
return;
|
||||
|
||||
@@ -1636,6 +1679,16 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur
|
||||
@@ -1574,6 +1617,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 +448,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
|
||||
@@ -1734,7 +1787,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
@@ -1708,7 +1761,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_BUFFER:
|
||||
@@ -460,19 +460,7 @@ index c3f98ba..33165fb 100644
|
||||
return TRUE;
|
||||
|
||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||
@@ -2033,7 +2090,11 @@ static BOOL texture1d_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 */
|
||||
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, NULL, &data, row_pitch, slice_pitch, 0, 0, 0, FALSE);
|
||||
@@ -2078,7 +2139,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -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))
|
||||
{
|
||||
@@ -484,7 +472,7 @@ index c3f98ba..33165fb 100644
|
||||
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
@@ -2347,8 +2412,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
@@ -2304,8 +2365,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
|
||||
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
|
||||
}
|
||||
|
||||
@@ -498,7 +486,7 @@ index c3f98ba..33165fb 100644
|
||||
}
|
||||
|
||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
||||
@@ -3105,7 +3175,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -3080,7 +3146,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
}
|
||||
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
|
||||
{
|
||||
@@ -507,10 +495,10 @@ index c3f98ba..33165fb 100644
|
||||
+#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,
|
||||
location == WINED3D_LOCATION_TEXTURE_SRGB);
|
||||
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
|
||||
@@ -3151,7 +3225,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
|
||||
@@ -3130,7 +3200,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))
|
||||
{
|
||||
@@ -522,7 +510,7 @@ index c3f98ba..33165fb 100644
|
||||
|
||||
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
|
||||
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
|
||||
@@ -3349,8 +3427,19 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned
|
||||
@@ -3196,8 +3270,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)
|
||||
{
|
||||
@@ -589,7 +577,7 @@ index 1eebce6..bed39db 100644
|
||||
|
||||
return WINED3D_OK;
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index c1bcfde..33ca431 100644
|
||||
index b240503..996da72 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2904,6 +2904,16 @@ struct wined3d_dummy_textures
|
||||
@@ -622,7 +610,7 @@ index c1bcfde..33ca431 100644
|
||||
|
||||
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
|
||||
{
|
||||
@@ -3208,7 +3224,11 @@ struct wined3d_texture
|
||||
@@ -3203,7 +3219,11 @@ struct wined3d_texture
|
||||
|
||||
unsigned int map_count;
|
||||
DWORD locations;
|
||||
|
Reference in New Issue
Block a user