Added patch to implement dual source blending in wined3d.

This commit is contained in:
Sebastian Lackner
2017-08-22 01:52:47 +02:00
parent 9fbebe7a46
commit bab383452b
8 changed files with 743 additions and 79 deletions

View File

@@ -1,4 +1,4 @@
From 685ac4b76854b8e8960338c81a5f33d7e6d40fb2 Mon Sep 17 00:00:00 2001
From ae25b3f25d761c757cf6170dfd674e9395eafaef 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: wined3d: Wrap GL BOs in a structure
@@ -13,10 +13,10 @@ them for DISCARD maps.
4 files changed, 93 insertions(+), 35 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c05c8c51f2..0c81eeaced 100644
index 0c6160a37e2..cc570c53f48 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5092,3 +5092,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -5274,3 +5274,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@@ -74,10 +74,10 @@ index c05c8c51f2..0c81eeaced 100644
+ wined3d_device_destroy_bo(device, context, bo);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1eea0e8bb0..f1a089e88f 100644
index bf720295adc..3e5a0519da4 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2405,7 +2405,7 @@ static BOOL surface_load_texture(struct wined3d_surface *surface,
@@ -2410,7 +2410,7 @@ static BOOL surface_load_texture(struct wined3d_surface *surface,
/* 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. */
@@ -87,10 +87,10 @@ index 1eea0e8bb0..f1a089e88f 100644
TRACE("Removing the pbo attached to surface %p.\n", surface);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 700e587f8d..0bcf64b87a 100644
index b487f52ee34..f26d502a18e 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -333,7 +333,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
@@ -294,7 +294,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 700e587f8d..0bcf64b87a 100644
return;
}
if (locations & WINED3D_LOCATION_USER_MEMORY)
@@ -434,18 +434,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
@@ -395,18 +395,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 700e587f8d..0bcf64b87a 100644
}
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -465,7 +464,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -426,7 +425,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,7 +134,7 @@ index 700e587f8d..0bcf64b87a 100644
}
if (context)
@@ -622,28 +621,25 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
@@ -583,28 +582,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;
struct wined3d_context *context = NULL;
@@ -168,7 +168,7 @@ index 700e587f8d..0bcf64b87a 100644
}
if (context)
context_release(context);
@@ -1458,22 +1454,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -1411,22 +1407,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 +196,7 @@ index 700e587f8d..0bcf64b87a 100644
}
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
@@ -1599,7 +1592,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -1552,7 +1545,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
return TRUE;
case WINED3D_LOCATION_BUFFER:
@@ -205,7 +205,7 @@ index 700e587f8d..0bcf64b87a 100644
return TRUE;
case WINED3D_LOCATION_TEXTURE_RGB:
@@ -1899,7 +1892,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1853,7 +1846,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
@@ -214,7 +214,7 @@ index 700e587f8d..0bcf64b87a 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);
@@ -1944,7 +1937,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1898,7 +1891,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 +223,7 @@ index 700e587f8d..0bcf64b87a 100644
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -2238,8 +2231,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
@@ -2192,8 +2185,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
}
@@ -234,7 +234,7 @@ index 700e587f8d..0bcf64b87a 100644
if (resource->type == WINED3D_RTYPE_TEXTURE_2D)
{
@@ -3024,7 +3017,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -2969,7 +2962,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
@@ -243,7 +243,7 @@ index 700e587f8d..0bcf64b87a 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);
@@ -3070,7 +3063,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -3015,7 +3008,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,12 +253,12 @@ index 700e587f8d..0bcf64b87a 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 ab73b02b11..11831b3d1f 100644
index 079f18cf5d6..1d31146482b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2624,6 +2624,14 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};
@@ -2846,6 +2846,14 @@ static inline BOOL wined3d_dualblend_enabled(const struct wined3d_state *state,
return FALSE;
}
+struct wined3d_gl_bo
+{
@@ -271,7 +271,7 @@ index ab73b02b11..11831b3d1f 100644
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -2735,6 +2743,10 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2957,6 +2965,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 +282,7 @@ index ab73b02b11..11831b3d1f 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2926,7 +2938,7 @@ struct wined3d_texture
@@ -3144,7 +3156,7 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;
@@ -292,5 +292,5 @@ index ab73b02b11..11831b3d1f 100644
};
--
2.11.0
2.14.1

View File

@@ -619,9 +619,9 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2826,6 +2826,16 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};
@@ -2846,6 +2846,16 @@ static inline BOOL wined3d_dualblend_enabled(const struct wined3d_state *state,
return FALSE;
}
+#if defined(STAGING_CSMT)
+struct wined3d_gl_bo
@@ -636,7 +636,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -2937,6 +2947,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2957,6 +2967,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;
@@ -649,7 +649,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3124,7 +3140,11 @@ struct wined3d_texture
@@ -3144,7 +3160,11 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;
@@ -661,7 +661,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
} sub_resources[1];
};
@@ -3439,6 +3459,9 @@ struct wined3d_cs_queue
@@ -3459,6 +3479,9 @@ struct wined3d_cs_queue
struct wined3d_cs_ops
{