From: Elizabeth Figura zfigura@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56969 --- dlls/wined3d/utils.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 71b629da50e..27abbeb574e 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -6111,7 +6111,7 @@ static float color_to_float(DWORD color, DWORD size, DWORD offset) void wined3d_format_get_float_color_key(const struct wined3d_format *format, const struct wined3d_color_key *key, struct wined3d_color *float_colors) { - struct wined3d_color slop; + struct wined3d_color slop = {INFINITY, INFINITY, INFINITY, INFINITY};
switch (format->id) { @@ -6133,10 +6133,14 @@ void wined3d_format_get_float_color_key(const struct wined3d_format *format, case WINED3DFMT_R8G8B8X8_UNORM: case WINED3DFMT_R16G16_UNORM: case WINED3DFMT_B10G10R10A2_UNORM: - slop.r = 0.5f / wined3d_mask_from_size(format->red_size); - slop.g = 0.5f / wined3d_mask_from_size(format->green_size); - slop.b = 0.5f / wined3d_mask_from_size(format->blue_size); - slop.a = 0.5f / wined3d_mask_from_size(format->alpha_size); + if (format->red_size) + slop.r = 0.5f / wined3d_mask_from_size(format->red_size); + if (format->green_size) + slop.g = 0.5f / wined3d_mask_from_size(format->green_size); + if (format->blue_size) + slop.b = 0.5f / wined3d_mask_from_size(format->blue_size); + if (format->alpha_size) + slop.a = 0.5f / wined3d_mask_from_size(format->alpha_size);
float_colors[0].r = color_to_float(key->color_space_low_value, format->red_size, format->red_offset) - slop.r;
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/stateblock.c | 2 +- dlls/wined3d/texture.c | 12 ++++++++++-- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 5d275be1ae1..2cd88497750 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -3332,7 +3332,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, texture = state->textures[i]; wined3d_device_set_texture(device, i, texture);
- if (!i && texture) + if (!i && texture && (texture->color_key_flags & WINED3D_CKEY_SRC_BLT)) { wined3d_format_get_float_color_key(texture->resource.format, &texture->src_blt_color_key, float_key); wined3d_device_context_push_constants(context, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 99c6a89764d..2efdaf91438 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1770,8 +1770,16 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture, return WINED3DERR_INVALIDCALL; }
- if ((flags & WINED3D_CKEY_SRC_BLT) && color_key) - texture->src_blt_color_key = *color_key; + if (color_key) + { + if (flags & WINED3D_CKEY_SRC_BLT) + texture->src_blt_color_key = *color_key; + texture->color_key_flags |= flags; + } + else + { + texture->color_key_flags &= ~flags; + }
wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c8b437aa524..96bfee21d1b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3348,6 +3348,7 @@ struct wined3d_texture
/* Color key field accessed from the client side. */ struct wined3d_color_key src_blt_color_key; + uint32_t color_key_flags;
struct wined3d_dirty_regions {
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147203
Your paranoid android.
=== debian11b (64 bit WoW report) ===
ddraw: ddraw7.c:3741: Test failed: Expected message 0x5, but didn't receive it. ddraw7.c:3743: Test failed: Expected screen size 1024x768, got 0x0.
This merge request was approved by Jan Sikorski.