winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
865 discussions
Start a n
N
ew thread
Zebediah Figura : quartz/systemclock: Create the advise thread after the events it depends on.
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: 2adc44df2ef9a489c48186f7da5aa6df3c16a36d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2adc44df2ef9a489c48186f7…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Jun 20 20:13:16 2019 -0500 quartz/systemclock: Create the advise thread after the events it depends on. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/systemclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 6bb1f47..2b75c8d 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -103,9 +103,9 @@ static void notify_thread(struct system_clock *clock) { if (!InterlockedCompareExchange(&clock->thread_created, TRUE, FALSE)) { - clock->thread = CreateThread(NULL, 0, SystemClockAdviseThread, clock, 0, NULL); clock->notify_event = CreateEventW(NULL, FALSE, FALSE, NULL); clock->stop_event = CreateEventW(NULL, TRUE, FALSE, NULL); + clock->thread = CreateThread(NULL, 0, SystemClockAdviseThread, clock, 0, NULL); } SetEvent(clock->notify_event); }
1
0
0
0
Henri Verbeet : wined3d: Merge the wined3d_texture_gl texture ops implementations.
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: 3595c42a620ec44364f5d8f56641fe5c77477b94 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3595c42a620ec44364f5d8f5…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Jun 21 03:08:02 2019 +0430 wined3d: Merge the wined3d_texture_gl texture ops implementations. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 97 ++++++-------------------------------------------- 1 file changed, 11 insertions(+), 86 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 4b64785..ae3e179 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2630,9 +2630,9 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g return TRUE; } -/* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ -static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, - struct wined3d_context *context, DWORD location) +/* Context activation is done by the caller. */ +static BOOL wined3d_texture_gl_load_location(struct wined3d_texture *texture, + unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) { struct wined3d_texture_gl *texture_gl = wined3d_texture_gl(texture); struct wined3d_context_gl *context_gl = wined3d_context_gl(context); @@ -2640,6 +2640,9 @@ static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned in TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n", texture, sub_resource_idx, context, wined3d_debug_location(location)); + if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, location)) + return FALSE; + switch (location) { case WINED3D_LOCATION_USER_MEMORY: @@ -2660,7 +2663,8 @@ static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned in context_gl, location == WINED3D_LOCATION_TEXTURE_SRGB); default: - ERR("Don't know how to handle location %#x.\n", location); + FIXME("Unhandled %s load from %s.\n", wined3d_debug_location(location), + wined3d_debug_location(texture->sub_resources[sub_resource_idx].locations)); return FALSE; } } @@ -2757,9 +2761,9 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, wined3d_texture_download_data(src_texture, src_sub_resource_idx, context, dst_bo_addr); } -static const struct wined3d_texture_ops texture2d_ops = +static const struct wined3d_texture_ops texture_gl_ops = { - texture2d_load_location, + wined3d_texture_gl_load_location, wined3d_texture_gl_upload_data, wined3d_texture_gl_download_data, }; @@ -3040,45 +3044,6 @@ static const struct wined3d_resource_ops texture_resource_ops = texture_resource_sub_resource_unmap, }; -/* Context activation is done by the caller. */ -static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, - struct wined3d_context *context, DWORD location) -{ - struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx]; - struct wined3d_texture_gl *texture_gl = wined3d_texture_gl(texture); - struct wined3d_context_gl *context_gl = wined3d_context_gl(context); - - TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n", - texture, sub_resource_idx, context, wined3d_debug_location(location)); - - if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, location)) - return FALSE; - - switch (location) - { - case WINED3D_LOCATION_TEXTURE_RGB: - case WINED3D_LOCATION_TEXTURE_SRGB: - return wined3d_texture_gl_load_texture(texture_gl, sub_resource_idx, - context_gl, location == WINED3D_LOCATION_TEXTURE_SRGB); - - case WINED3D_LOCATION_SYSMEM: - case WINED3D_LOCATION_BUFFER: - return wined3d_texture_gl_load_sysmem(texture_gl, sub_resource_idx, context_gl, location); - - default: - FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), - wined3d_debug_location(sub_resource->locations)); - return FALSE; - } -} - -static const struct wined3d_texture_ops texture1d_ops = -{ - texture1d_load_location, - wined3d_texture_gl_upload_data, - wined3d_texture_gl_download_data, -}; - static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, DWORD flags, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops, void *sub_resources, @@ -3351,42 +3316,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc return WINED3D_OK; } -/* Context activation is done by the caller. */ -static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, - struct wined3d_context *context, DWORD location) -{ - struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx]; - struct wined3d_texture_gl *texture_gl = wined3d_texture_gl(texture); - struct wined3d_context_gl *context_gl = wined3d_context_gl(context); - - if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, location)) - return FALSE; - - switch (location) - { - case WINED3D_LOCATION_TEXTURE_RGB: - case WINED3D_LOCATION_TEXTURE_SRGB: - return wined3d_texture_gl_load_texture(texture_gl, sub_resource_idx, - context_gl, location == WINED3D_LOCATION_TEXTURE_SRGB); - - case WINED3D_LOCATION_SYSMEM: - case WINED3D_LOCATION_BUFFER: - return wined3d_texture_gl_load_sysmem(texture_gl, sub_resource_idx, context_gl, location); - - default: - FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), - wined3d_debug_location(sub_resource->locations)); - return FALSE; - } -} - -static const struct wined3d_texture_ops texture3d_ops = -{ - texture3d_load_location, - wined3d_texture_gl_upload_data, - wined3d_texture_gl_download_data, -}; - HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) @@ -3648,7 +3577,6 @@ static HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, st DWORD flags, void *parent, const struct wined3d_parent_ops *parent_ops, void *sub_resources) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - const struct wined3d_texture_ops *texture_ops; HRESULT hr; TRACE("texture_gl %p, device %p, desc %p, layer_count %u, level_count %u, " @@ -3666,7 +3594,6 @@ static HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, st switch (desc->resource_type) { case WINED3D_RTYPE_TEXTURE_1D: - texture_ops = &texture1d_ops; if (layer_count > 1) texture_gl->target = GL_TEXTURE_1D_ARRAY; else @@ -3674,7 +3601,6 @@ static HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, st break; case WINED3D_RTYPE_TEXTURE_2D: - texture_ops = &texture2d_ops; if (desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP) { texture_gl->target = GL_TEXTURE_CUBE_MAP_ARB; @@ -3701,7 +3627,6 @@ static HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, st WARN("OpenGL implementation does not support 3D textures.\n"); return WINED3DERR_INVALIDCALL; } - texture_ops = &texture3d_ops; texture_gl->target = GL_TEXTURE_3D; break; @@ -3713,7 +3638,7 @@ static HRESULT wined3d_texture_gl_init(struct wined3d_texture_gl *texture_gl, st list_init(&texture_gl->renderbuffers); if (FAILED(hr = wined3d_texture_init(&texture_gl->t, desc, layer_count, level_count, - flags, device, parent, parent_ops, sub_resources, texture_ops))) + flags, device, parent, parent_ops, sub_resources, &texture_gl_ops))) return hr; if (texture_gl->t.resource.gl_type == WINED3D_GL_RES_TYPE_TEX_RECT)
1
0
0
0
Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to find_arb_pshader().
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: 17d159e3ca5be865252d48a9d634c9d03e4d10b4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=17d159e3ca5be865252d48a9…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Jun 21 03:08:01 2019 +0430 wined3d: Pass a wined3d_context_gl structure to find_arb_pshader(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 82ef119..273c4f3 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4227,11 +4227,11 @@ static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader, } /* Context activation is done by the caller. */ -static struct arb_ps_compiled_shader *find_arb_pshader(struct wined3d_context *context, +static struct arb_ps_compiled_shader *find_arb_pshader(struct wined3d_context_gl *context_gl, struct wined3d_shader *shader, const struct arb_ps_compile_args *args) { - const struct wined3d_d3d_info *d3d_info = context->d3d_info; - const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info; + const struct wined3d_gl_info *gl_info = context_gl->c.gl_info; struct wined3d_device *device = shader->device; UINT i; DWORD new_size; @@ -4565,7 +4565,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context TRACE("Using pixel shader %p.\n", ps); find_arb_ps_compile_args(state, context, ps, &compile_args); - compiled = find_arb_pshader(context, ps, &compile_args); + compiled = find_arb_pshader(context_gl, ps, &compile_args); priv->current_fprogram_id = compiled->prgId; priv->compiled_fprog = compiled;
1
0
0
0
Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to shader_arb_load_constants_internal ().
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: 28d61adf5eaccc5e2b3ef56696e46f0036bfb809 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=28d61adf5eaccc5e2b3ef566…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Jun 21 03:08:00 2019 +0430 wined3d: Pass a wined3d_context_gl structure to shader_arb_load_constants_internal(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 50f49fd..82ef119 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -642,13 +642,11 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context * worry about the Integers or Booleans */ /* Context activation is done by the caller (state handler). */ -static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, - struct wined3d_context *context, const struct wined3d_state *state, - BOOL usePixelShader, BOOL useVertexShader, BOOL from_shader_select) +static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, struct wined3d_context_gl *context_gl, + const struct wined3d_state *state, BOOL use_ps, BOOL use_vs, BOOL from_shader_select) { - struct wined3d_context_gl *context_gl = wined3d_context_gl(context); - const struct wined3d_d3d_info *d3d_info = context->d3d_info; - const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info; + const struct wined3d_gl_info *gl_info = context_gl->c.gl_info; if (!from_shader_select) { @@ -661,7 +659,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, && (vshader->reg_maps.integer_constants & ~vshader->reg_maps.local_int_consts)))) { TRACE("bool/integer vertex shader constants potentially modified, forcing shader reselection.\n"); - shader_arb_select(priv, context, state); + shader_arb_select(priv, &context_gl->c, state); } else if (pshader && (pshader->reg_maps.boolean_constants @@ -669,11 +667,11 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, && (pshader->reg_maps.integer_constants & ~pshader->reg_maps.local_int_consts)))) { TRACE("bool/integer pixel shader constants potentially modified, forcing shader reselection.\n"); - shader_arb_select(priv, context, state); + shader_arb_select(priv, &context_gl->c, state); } } - if (context != priv->last_context) + if (&context_gl->c != priv->last_context) { memset(priv->vshader_const_dirty, 1, sizeof(*priv->vshader_const_dirty) * d3d_info->limits.vs_uniform_count); @@ -683,10 +681,10 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, sizeof(*priv->pshader_const_dirty) * d3d_info->limits.ps_uniform_count); priv->highest_dirty_ps_const = d3d_info->limits.ps_uniform_count; - priv->last_context = context; + priv->last_context = &context_gl->c; } - if (useVertexShader) + if (use_vs) { const struct wined3d_shader *vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX]; const struct arb_vs_compiled_shader *gl_shader = priv->compiled_vprog; @@ -697,7 +695,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, shader_arb_vs_local_constants(gl_shader, context_gl, state); } - if (usePixelShader) + if (use_ps) { const struct wined3d_shader *pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; const struct arb_ps_compiled_shader *gl_shader = priv->compiled_fprog; @@ -708,7 +706,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, priv->highest_dirty_ps_const, state->ps_consts_f, priv->pshader_const_dirty); shader_arb_ps_local_constants(gl_shader, context_gl, state, rt_height); - if (context->constant_update_mask & WINED3D_SHADER_CONST_PS_NP2_FIXUP) + if (context_gl->c.constant_update_mask & WINED3D_SHADER_CONST_PS_NP2_FIXUP) shader_arb_load_np2fixup_constants(&gl_shader->np2fixup_info, gl_info, state); } } @@ -716,10 +714,8 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, static void shader_arb_load_constants(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state) { - BOOL vs = use_vs(state); - BOOL ps = use_ps(state); - - shader_arb_load_constants_internal(shader_priv, context, state, ps, vs, FALSE); + shader_arb_load_constants_internal(shader_priv, wined3d_context_gl(context), + state, use_ps(state), use_vs(state), FALSE); } static void shader_arb_update_float_vertex_constants(struct wined3d_device *device, UINT start, UINT count) @@ -4598,7 +4594,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context priv->pshader_const_dirty[i] = 1; } /* Also takes care of loading local constants */ - shader_arb_load_constants_internal(shader_priv, context, state, TRUE, FALSE, TRUE); + shader_arb_load_constants_internal(shader_priv, context_gl, state, TRUE, FALSE, TRUE); } else {
1
0
0
0
Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to shader_arb_vs_local_constants().
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: f1918742cf7b19d3afbf9121ffacf27f1e625436 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1918742cf7b19d3afbf9121…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Jun 21 03:07:59 2019 +0430 wined3d: Pass a wined3d_context_gl structure to shader_arb_vs_local_constants(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 050d12f..50f49fd 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -604,14 +604,14 @@ static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *g /* Context activation is done by the caller. */ static void shader_arb_vs_local_constants(const struct arb_vs_compiled_shader *gl_shader, - const struct wined3d_context *context, const struct wined3d_state *state) + const struct wined3d_context_gl *context_gl, const struct wined3d_state *state) { - const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_gl_info *gl_info = context_gl->c.gl_info; float position_fixup[4]; unsigned char i; /* Upload the position fixup */ - shader_get_position_fixup(context, state, 1, position_fixup); + shader_get_position_fixup(&context_gl->c, state, 1, position_fixup); GL_EXTCALL(glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB, gl_shader->pos_fixup, position_fixup)); if (!gl_shader->num_int_consts) return; @@ -694,7 +694,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, /* Load DirectX 9 float constants for vertex shader */ priv->highest_dirty_vs_const = shader_arb_load_constants_f(vshader, gl_info, GL_VERTEX_PROGRAM_ARB, priv->highest_dirty_vs_const, state->vs_consts_f, priv->vshader_const_dirty); - shader_arb_vs_local_constants(gl_shader, context, state); + shader_arb_vs_local_constants(gl_shader, context_gl, state); } if (usePixelShader) @@ -4661,7 +4661,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context gl_info->gl_ops.gl.p_glEnable(GL_VERTEX_PROGRAM_ARB); checkGLcall("glEnable(GL_VERTEX_PROGRAM_ARB);"); TRACE("Bound vertex program %u and enabled GL_VERTEX_PROGRAM_ARB\n", priv->current_vprogram_id); - shader_arb_vs_local_constants(compiled, context, state); + shader_arb_vs_local_constants(compiled, context_gl, state); if(priv->last_vs_color_unclamp != compiled->need_color_unclamp) { priv->last_vs_color_unclamp = compiled->need_color_unclamp;
1
0
0
0
Henri Verbeet : wined3d: Pass a wined3d_context_gl structure to shader_arb_ps_local_constants().
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: 048f1b16bb052e204da561154671d362b6c998ab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=048f1b16bb052e204da56115…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Jun 21 03:07:58 2019 +0430 wined3d: Pass a wined3d_context_gl structure to shader_arb_ps_local_constants(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 89f9b5a..050d12f 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -540,9 +540,9 @@ static void shader_arb_load_np2fixup_constants(const struct arb_ps_np2fixup_info /* Context activation is done by the caller. */ static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *gl_shader, - const struct wined3d_context *context, const struct wined3d_state *state, UINT rt_height) + const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int rt_height) { - const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_gl_info *gl_info = context_gl->c.gl_info; unsigned char i; for(i = 0; i < gl_shader->numbumpenvmatconsts; i++) @@ -576,8 +576,8 @@ static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *g * ycorrection.w: 0.0 */ float val[4]; - val[0] = context->render_offscreen ? 0.0f : (float) rt_height; - val[1] = context->render_offscreen ? 1.0f : -1.0f; + val[0] = context_gl->c.render_offscreen ? 0.0f : (float)rt_height; + val[1] = context_gl->c.render_offscreen ? 1.0f : -1.0f; val[2] = 1.0f; val[3] = 0.0f; GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, gl_shader->ycorrection, val)); @@ -646,6 +646,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, struct wined3d_context *context, const struct wined3d_state *state, BOOL usePixelShader, BOOL useVertexShader, BOOL from_shader_select) { + struct wined3d_context_gl *context_gl = wined3d_context_gl(context); const struct wined3d_d3d_info *d3d_info = context->d3d_info; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -705,7 +706,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, /* Load DirectX 9 float constants for pixel shader */ priv->highest_dirty_ps_const = shader_arb_load_constants_f(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB, priv->highest_dirty_ps_const, state->ps_consts_f, priv->pshader_const_dirty); - shader_arb_ps_local_constants(gl_shader, context, state, rt_height); + shader_arb_ps_local_constants(gl_shader, context_gl, state, rt_height); if (context->constant_update_mask & WINED3D_SHADER_CONST_PS_NP2_FIXUP) shader_arb_load_np2fixup_constants(&gl_shader->np2fixup_info, gl_info, state); @@ -4554,8 +4555,9 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state, static void shader_arb_select(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state) { - struct shader_arb_priv *priv = shader_priv; + struct wined3d_context_gl *context_gl = wined3d_context_gl(context); const struct wined3d_gl_info *gl_info = context->gl_info; + struct shader_arb_priv *priv = shader_priv; int i; /* Deal with pixel shaders first so the vertex shader arg function has the input signature ready */ @@ -4601,7 +4603,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context else { UINT rt_height = state->fb->render_targets[0]->height; - shader_arb_ps_local_constants(compiled, context, state, rt_height); + shader_arb_ps_local_constants(compiled, context_gl, state, rt_height); } /* Force constant reloading for the NP2 fixup (see comment in shader_glsl_select for more info) */
1
0
0
0
Paul Gofman : ddraw: Do not modify any states for _TEXTUREMAPBLEND if application sets the same value.
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: 6978db2940363c0b6e42206159dca8e520316375 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6978db2940363c0b6e422061…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Tue Jun 18 20:52:26 2019 +0300 ddraw: Do not modify any states for _TEXTUREMAPBLEND if application sets the same value. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/device.c | 8 ++++++++ dlls/ddraw/tests/ddraw4.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index ef940d7..cdf4de8 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -2723,6 +2723,14 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface, case D3DRENDERSTATE_TEXTUREMAPBLEND: { + if (value == device->texture_map_blend) + { + TRACE("Application is setting the same value over, nothing to do.\n"); + + hr = D3D_OK; + break; + } + device->legacyTextureBlending = TRUE; switch (value) diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 3498ddb..6a8ecde 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -9689,13 +9689,13 @@ static void test_texturemapblend(void) ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); color = get_surface_color(rt, 5, 5); - todo_wine ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); color = get_surface_color(rt, 400, 5); ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); color = get_surface_color(rt, 5, 245); ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); color = get_surface_color(rt, 400, 245); - todo_wine ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); /* Turn legacy texture blending on again. */ hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_ADD);
1
0
0
0
Paul Gofman : ddraw: Turn off legacy texture blending in d3d_device3_SetTextureStageState().
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: fb7b878e065da9f279c619ea92a27501131ecd75 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fb7b878e065da9f279c619ea…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Tue Jun 18 20:52:25 2019 +0300 ddraw: Turn off legacy texture blending in d3d_device3_SetTextureStageState(). Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/device.c | 16 +++++++ dlls/ddraw/tests/ddraw4.c | 112 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 116 insertions(+), 12 deletions(-) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index c1815d6..ef940d7 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5166,10 +5166,26 @@ static HRESULT WINAPI d3d_device3_SetTextureStageState(IDirect3DDevice3 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value) { struct d3d_device *device = impl_from_IDirect3DDevice3(iface); + DWORD old_value; + HRESULT hr; TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, stage, state, value); + /* Tests show that legacy texture blending is not reset if the texture stage state + * value is unchanged. */ + if (FAILED(hr = IDirect3DDevice7_GetTextureStageState(&device->IDirect3DDevice7_iface, + stage, state, &old_value))) + return hr; + + if (old_value == value) + { + TRACE("Application is setting the same value over, nothing to do.\n"); + return D3D_OK; + } + + device->legacyTextureBlending = FALSE; + return IDirect3DDevice7_SetTextureStageState(&device->IDirect3DDevice7_iface, stage, state, value); } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index bd6de1e..3498ddb 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -9596,38 +9596,126 @@ static void test_texturemapblend(void) fx.dwSize = sizeof(fx); U5(fx).dwFillColor = 0xff0000ff; hr = IDirectDrawSurface4_Blt(surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); U5(fx).dwFillColor = 0x800000ff; hr = IDirectDrawSurface4_Blt(surface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); - ok(SUCCEEDED(hr), "Failed to clear texture, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); /* Note that the ddraw1 version of this test runs tests 1-3 with * D3DRENDERSTATE_COLORKEYENABLE enabled, whereas this version only runs * test 4 with color keying on. Because no color key is set on the texture * this should not result in different behavior. */ hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Texture stage state does not change so legacy texture blending stays enabled. */ + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_EndScene(device); - ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = get_surface_color(rt, 5, 5); + ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 400, 5); + ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 5, 245); + ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 400, 245); + ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + + /* Turn legacy texture blending off. */ + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = get_surface_color(rt, 5, 5); + ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 400, 5); + ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 5, 245); + ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 400, 245); + ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + + /* This doesn't turn legacy texture blending on again, as setting the same + * _TEXTUREMAPBLEND value. */ + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = get_surface_color(rt, 5, 5); + todo_wine ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 400, 5); + ok(compare_color(color, 0x000000ff, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 5, 245); + ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(rt, 400, 245); + todo_wine ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color); + + /* Turn legacy texture blending on again. */ + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_ADD); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[0], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1, &test1_quads[4], 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); color = get_surface_color(rt, 5, 5); ok(compare_color(color, 0x00000080, 2), "Got unexpected color 0x%08x.\n", color);
1
0
0
0
Paul Gofman : ddraw: Store _TEXTUREMAPBLEND state instead of guessing it from wined3d states.
by Alexandre Julliard
21 Jun '19
21 Jun '19
Module: wine Branch: master Commit: 166a1d462c73462f3856d205739742fc66171e21 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=166a1d462c73462f3856d205…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Tue Jun 18 20:52:24 2019 +0300 ddraw: Store _TEXTUREMAPBLEND state instead of guessing it from wined3d states. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/ddraw_private.h | 1 + dlls/ddraw/device.c | 73 +++++----------------------------------------- dlls/ddraw/tests/ddraw4.c | 5 ++++ 3 files changed, 14 insertions(+), 65 deletions(-) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index adfb029..b228f3e 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -327,6 +327,7 @@ struct d3d_device /* Required to keep track which of two available texture blending modes in d3ddevice3 is used */ BOOL legacyTextureBlending; + D3DTEXTUREBLEND texture_map_blend; D3DMATRIX legacy_projection; D3DMATRIX legacy_clipspace; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index ade56bb..c1815d6 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -2461,62 +2461,7 @@ static HRESULT WINAPI d3d_device3_GetRenderState(IDirect3DDevice3 *iface, case D3DRENDERSTATE_TEXTUREMAPBLEND: { - /* D3DRENDERSTATE_TEXTUREMAPBLEND is mapped to texture state stages in SetRenderState; reverse - the mapping to get the value. */ - DWORD colorop, colorarg1, colorarg2; - DWORD alphaop, alphaarg1, alphaarg2; - - wined3d_mutex_lock(); - - device->legacyTextureBlending = TRUE; - - colorop = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_OP); - colorarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG1); - colorarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG2); - alphaop = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_OP); - alphaarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG1); - alphaarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG2); - - if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE - && alphaop == WINED3D_TOP_SELECT_ARG1 && alphaarg1 == WINED3DTA_TEXTURE) - *value = D3DTBLEND_DECAL; - else if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE - && alphaop == WINED3D_TOP_MODULATE - && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT) - *value = D3DTBLEND_DECALALPHA; - else if (colorop == WINED3D_TOP_MODULATE - && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT - && alphaop == WINED3D_TOP_MODULATE - && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT) - *value = D3DTBLEND_MODULATEALPHA; - else - { - struct wined3d_texture *tex = NULL; - BOOL tex_alpha = FALSE; - DDPIXELFORMAT ddfmt; - - if ((tex = wined3d_device_get_texture(device->wined3d_device, 0))) - { - struct wined3d_resource_desc desc; - - wined3d_resource_get_desc(wined3d_texture_get_resource(tex), &desc); - ddfmt.dwSize = sizeof(ddfmt); - ddrawformat_from_wined3dformat(&ddfmt, desc.format); - if (ddfmt.u5.dwRGBAlphaBitMask) - tex_alpha = TRUE; - } - - if (!(colorop == WINED3D_TOP_MODULATE - && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT - && alphaop == (tex_alpha ? WINED3D_TOP_SELECT_ARG1 : WINED3D_TOP_SELECT_ARG2) - && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)) - ERR("Unexpected texture stage state setup, returning D3DTBLEND_MODULATE - likely erroneous.\n"); - - *value = D3DTBLEND_MODULATE; - } - - wined3d_mutex_unlock(); - + *value = device->texture_map_blend; return D3D_OK; } @@ -2736,8 +2681,7 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface, in device - TRUE if the app is using TEXTUREMAPBLEND. Tests show that setting TEXTUREMAPBLEND on native doesn't seem to change values returned by - GetTextureStageState and vice versa. Not so on Wine, but it is 'undefined' anyway so, probably, ok, - unless some broken game will be found that cares. */ + GetTextureStageState and vice versa. */ struct d3d_device *device = impl_from_IDirect3DDevice3(iface); HRESULT hr; @@ -2875,7 +2819,7 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface, default: FIXME("Unhandled texture environment %#x.\n", value); } - + device->texture_map_blend = value; hr = D3D_OK; break; } @@ -4870,19 +4814,15 @@ static HRESULT WINAPI d3d_device3_SetTexture(IDirect3DDevice3 *iface, { struct d3d_device *device = impl_from_IDirect3DDevice3(iface); struct ddraw_surface *tex = unsafe_impl_from_IDirect3DTexture2(texture); - DWORD texmapblend; HRESULT hr; TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture); wined3d_mutex_lock(); - if (device->legacyTextureBlending) - IDirect3DDevice3_GetRenderState(iface, D3DRENDERSTATE_TEXTUREMAPBLEND, &texmapblend); - hr = IDirect3DDevice7_SetTexture(&device->IDirect3DDevice7_iface, stage, &tex->IDirectDrawSurface7_iface); - if (device->legacyTextureBlending && texmapblend == D3DTBLEND_MODULATE) + if (device->legacyTextureBlending && device->texture_map_blend == D3DTBLEND_MODULATE) { /* This fixup is required by the way D3DTBLEND_MODULATE maps to texture stage states. See d3d_device3_SetRenderState() for details. */ @@ -7053,8 +6993,11 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, else if (version == 2) wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_SPECULARENABLE, TRUE); if (version < 7) + { wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_NORMALIZENORMALS, TRUE); - + IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface, + D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE); + } return D3D_OK; } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 77ae359..bd6de1e 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -9500,6 +9500,7 @@ static void test_texturemapblend(void) DDSURFACEDESC2 surface_desc; IDirect3DTexture2 *texture; IDirect3DDevice3 *device; + DWORD texturemapblend; IDirectDraw4 *ddraw; IDirect3D3 *d3d; DDCOLORKEY ckey; @@ -9557,6 +9558,10 @@ static void test_texturemapblend(void) hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + hr = IDirect3DDevice3_GetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, &texturemapblend); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(texturemapblend == D3DTBLEND_MODULATE, "Got unexpected texture map blend %#x.\n", texturemapblend); + /* Test alpha with DDPF_ALPHAPIXELS texture - should be taken from texture * alpha channel. *
1
0
0
0
Rémi Bernon : hid: Fill the HIDD_ATTRIBUTES Size member, and add a test for expected size.
by Alexandre Julliard
20 Jun '19
20 Jun '19
Module: wine Branch: master Commit: cce8074aa9fb2191faba25ce7fd24e2678d3bd17 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cce8074aa9fb2191faba25ce…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Jun 18 11:34:25 2019 +0200 hid: Fill the HIDD_ATTRIBUTES Size member, and add a test for expected size. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hid/hidd.c | 1 + dlls/hid/tests/device.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dlls/hid/hidd.c b/dlls/hid/hidd.c index 16b3a3f..4bb4deb 100644 --- a/dlls/hid/hidd.c +++ b/dlls/hid/hidd.c @@ -69,6 +69,7 @@ BOOLEAN WINAPI HidD_GetAttributes(HANDLE HidDeviceObject, PHIDD_ATTRIBUTES Attr) if (ret) { + Attr->Size = sizeof(HIDD_ATTRIBUTES); Attr->VendorID = info.VendorID; Attr->ProductID = info.ProductID; Attr->VersionNumber = info.VersionNumber; diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c index 4651ced..bb819cc 100644 --- a/dlls/hid/tests/device.c +++ b/dlls/hid/tests/device.c @@ -34,6 +34,7 @@ static void test_device_info(HANDLE device) { PHIDP_PREPARSED_DATA ppd; HIDP_CAPS Caps; + HIDD_ATTRIBUTES attributes; NTSTATUS status; BOOL rc; WCHAR device_name[128]; @@ -47,6 +48,10 @@ static void test_device_info(HANDLE device) trace("Found device %s (%02x, %02x)\n", wine_dbgstr_w(device_name), Caps.UsagePage, Caps.Usage); rc = HidD_FreePreparsedData(ppd); ok(rc, "Failed to free preparsed data(0x%x)\n", GetLastError()); + rc = HidD_GetAttributes(device, &attributes); + ok(rc, "Failed to get device attributes (0x%x)\n", GetLastError()); + ok(attributes.Size == sizeof(attributes), "Unexpected HIDD_ATTRIBUTES size: %d\n", attributes.Size); + trace("Device attributes: vid:%04x pid:%04x ver:%04x\n", attributes.VendorID, attributes.ProductID, attributes.VersionNumber); } static void run_for_each_device(device_test *test)
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
87
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Results per page:
10
25
50
100
200