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
July 2024
----- 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
2 participants
519 discussions
Start a n
N
ew thread
Elizabeth Figura : wined3d: Feed WINED3D_RS_AMBIENT through a push constant buffer.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: 76c6e36b90a5415df75d50a2579e55652dfce57f URL:
https://gitlab.winehq.org/wine/wine/-/commit/76c6e36b90a5415df75d50a2579e55…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Sun Jun 9 12:50:25 2024 -0500 wined3d: Feed WINED3D_RS_AMBIENT through a push constant buffer. --- dlls/wined3d/cs.c | 1 + dlls/wined3d/ffp_gl.c | 2 +- dlls/wined3d/glsl_shader.c | 19 ++++++------------- dlls/wined3d/shader_spirv.c | 1 - dlls/wined3d/stateblock.c | 12 +++++++++++- dlls/wined3d/wined3d_private.h | 9 +++++++++ 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index cc6153ce257..275941dd183 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2148,6 +2148,7 @@ wined3d_cs_push_constant_info[] = [WINED3D_PUSH_CONSTANTS_PS_I] = {sizeof(struct wined3d_ivec4), WINED3D_MAX_CONSTS_I, WINED3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_D3DBC_INT_CONSTANT_REGISTER}, [WINED3D_PUSH_CONSTANTS_VS_B] = {sizeof(BOOL), WINED3D_MAX_CONSTS_B, WINED3D_SHADER_TYPE_VERTEX, VKD3D_SHADER_D3DBC_BOOL_CONSTANT_REGISTER}, [WINED3D_PUSH_CONSTANTS_PS_B] = {sizeof(BOOL), WINED3D_MAX_CONSTS_B, WINED3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_D3DBC_BOOL_CONSTANT_REGISTER}, + [WINED3D_PUSH_CONSTANTS_VS_FFP] = {1, sizeof(struct wined3d_ffp_vs_constants), WINED3D_SHADER_TYPE_VERTEX, VKD3D_SHADER_D3DBC_FLOAT_CONSTANT_REGISTER}, [WINED3D_PUSH_CONSTANTS_PS_FFP] = {1, sizeof(struct wined3d_ffp_ps_constants), WINED3D_SHADER_TYPE_PIXEL, VKD3D_SHADER_D3DBC_FLOAT_CONSTANT_REGISTER}, }; diff --git a/dlls/wined3d/ffp_gl.c b/dlls/wined3d/ffp_gl.c index ddb461bb56f..d0d82181c1e 100644 --- a/dlls/wined3d/ffp_gl.c +++ b/dlls/wined3d/ffp_gl.c @@ -1679,7 +1679,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table) { 39, 40}, { 42, 47}, { 49, 135}, - {138, 138}, + {138, 139}, {144, 144}, {149, 150}, {153, 153}, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 118ea7c926d..c0d75897857 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1535,17 +1535,6 @@ static void shader_glsl_ffp_vertex_material_uniform(const struct wined3d_context checkGLcall("setting FFP material uniforms"); } -static void shader_glsl_ffp_vertex_lightambient_uniform(const struct wined3d_context_gl *context_gl, - const struct wined3d_state *state, struct glsl_shader_prog_link *prog) -{ - const struct wined3d_gl_info *gl_info = context_gl->gl_info; - struct wined3d_color color; - - wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_AMBIENT]); - GL_EXTCALL(glUniform3fv(prog->vs.light_ambient_location, 1, &color.r)); - checkGLcall("glUniform3fv"); -} - static void shader_glsl_ffp_vertex_light_uniform(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int light, const struct wined3d_light_info *light_info, struct glsl_shader_prog_link *prog) @@ -1780,10 +1769,13 @@ static void shader_glsl_load_constants(struct shader_glsl_priv *priv, if (update_mask & WINED3D_SHADER_CONST_FFP_LIGHTS) { unsigned int point_idx, spot_idx, directional_idx, parallel_point_idx; + const struct wined3d_ffp_vs_constants *constants; DWORD point_count = 0; DWORD spot_count = 0; DWORD directional_count = 0; + constants = wined3d_buffer_load_sysmem(context->device->push_constants[WINED3D_PUSH_CONSTANTS_VS_FFP], context); + for (i = 0; i < WINED3D_MAX_ACTIVE_LIGHTS; ++i) { if (!state->light_state.lights[i]) @@ -1812,7 +1804,9 @@ static void shader_glsl_load_constants(struct shader_glsl_priv *priv, directional_idx = spot_idx + spot_count; parallel_point_idx = directional_idx + directional_count; - shader_glsl_ffp_vertex_lightambient_uniform(context_gl, state, prog); + GL_EXTCALL(glUniform3fv(prog->vs.light_ambient_location, 1, &constants->light.ambient.r)); + checkGLcall("glUniform3fv"); + for (i = 0; i < WINED3D_MAX_ACTIVE_LIGHTS; ++i) { const struct wined3d_light_info *light_info = state->light_state.lights[i]; @@ -12066,7 +12060,6 @@ static const struct wined3d_state_entry_template glsl_vertex_pipe_vp_states[] = {STATE_RENDER(WINED3D_RS_CLIPPING), {STATE_RENDER(WINED3D_RS_CLIPPING), state_clipping }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_CLIPPLANEENABLE), {STATE_RENDER(WINED3D_RS_CLIPPING), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_LIGHTING), {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), NULL }, WINED3D_GL_EXT_NONE }, - {STATE_RENDER(WINED3D_RS_AMBIENT), {STATE_RENDER(WINED3D_RS_AMBIENT), glsl_vertex_pipe_light }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_COLORVERTEX), {STATE_RENDER(WINED3D_RS_COLORVERTEX), glsl_vertex_pipe_shader}, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_LOCALVIEWER), {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_NORMALIZENORMALS), {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), NULL }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index dc1c3a13131..a4b311ae8d2 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -1160,7 +1160,6 @@ static const struct wined3d_state_entry_template spirv_vertex_pipe_vk_vp_states[ {STATE_RENDER(WINED3D_RS_RANGEFOGENABLE), {STATE_RENDER(WINED3D_RS_RANGEFOGENABLE), state_nop}}, {STATE_RENDER(WINED3D_RS_CLIPPING), {STATE_RENDER(WINED3D_RS_CLIPPING), state_nop}}, {STATE_RENDER(WINED3D_RS_LIGHTING), {STATE_RENDER(WINED3D_RS_LIGHTING), state_nop}}, - {STATE_RENDER(WINED3D_RS_AMBIENT), {STATE_RENDER(WINED3D_RS_AMBIENT), state_nop}}, {STATE_RENDER(WINED3D_RS_COLORVERTEX), {STATE_RENDER(WINED3D_RS_COLORVERTEX), state_nop}}, {STATE_RENDER(WINED3D_RS_LOCALVIEWER), {STATE_RENDER(WINED3D_RS_LOCALVIEWER), state_nop}}, {STATE_RENDER(WINED3D_RS_NORMALIZENORMALS), {STATE_RENDER(WINED3D_RS_NORMALIZENORMALS), state_nop}}, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 11276ffd419..548bf9aa477 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2200,6 +2200,7 @@ static void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state static void wined3d_stateblock_invalidate_push_constants(struct wined3d_stateblock *stateblock) { stateblock->changed.ffp_ps_constants = 1; + stateblock->changed.lights = 1; } static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const struct wined3d_stateblock *device_state, @@ -2682,8 +2683,8 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, bool set_blend_state = false, set_depth_stencil_state = false, set_rasterizer_state = false; const struct wined3d_stateblock_state *state = &stateblock->stateblock_state; - const struct wined3d_saved_states *changed = &stateblock->changed; const unsigned int word_bit_count = sizeof(DWORD) * CHAR_BIT; + struct wined3d_saved_states *changed = &stateblock->changed; struct wined3d_device_context *context = &device->cs->c; unsigned int i, j, start, idx; bool set_depth_bounds = false; @@ -2810,6 +2811,10 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, set_depth_bounds = true; break; + case WINED3D_RS_AMBIENT: + changed->lights = 1; + break; + case WINED3D_RS_ADAPTIVETESS_Y: case WINED3D_RS_TEXTUREFACTOR: break; @@ -3326,6 +3331,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, if (changed->lights) { + struct wined3d_ffp_light_constants constants; struct wined3d_light_info *light, *cursor; LIST_FOR_EACH_ENTRY_SAFE(light, cursor, &changed->changed_lights, struct wined3d_light_info, changed_entry) @@ -3335,6 +3341,10 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, list_remove(&light->changed_entry); light->changed = false; } + + wined3d_color_from_d3dcolor(&constants.ambient, state->rs[WINED3D_RS_AMBIENT]); + wined3d_device_context_push_constants(context, WINED3D_PUSH_CONSTANTS_VS_FFP, WINED3D_SHADER_CONST_FFP_LIGHTS, + offsetof(struct wined3d_ffp_vs_constants, light), sizeof(constants), &constants); } if (changed->ffp_ps_constants) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f6adc96887d..9ad1d0f8ba5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2764,6 +2764,14 @@ BOOL wined3d_get_app_name(char *app_name, unsigned int app_name_size); * i.e. only used when shaders are disabled. */ +struct wined3d_ffp_vs_constants +{ + struct wined3d_ffp_light_constants + { + struct wined3d_color ambient; + } light; +}; + struct wined3d_ffp_ps_constants { struct wined3d_color texture_constants[WINED3D_MAX_FFP_TEXTURES]; @@ -2782,6 +2790,7 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_I, WINED3D_PUSH_CONSTANTS_VS_B, WINED3D_PUSH_CONSTANTS_PS_B, + WINED3D_PUSH_CONSTANTS_VS_FFP, WINED3D_PUSH_CONSTANTS_PS_FFP, WINED3D_PUSH_CONSTANTS_COUNT, };
1
0
0
0
Elizabeth Figura : wined3d: Reorder light application in wined3d_device_apply_stateblock().
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: 8e403b721a35eec587a3527b0362f0f4add638eb URL:
https://gitlab.winehq.org/wine/wine/-/commit/8e403b721a35eec587a3527b0362f0…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Sun Jun 9 12:50:25 2024 -0500 wined3d: Reorder light application in wined3d_device_apply_stateblock(). --- dlls/wined3d/stateblock.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 7b09b874137..11276ffd419 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2749,19 +2749,6 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, wined3d_device_set_ps_consts_b(device, range.offset, range.size, &state->ps_consts_b[range.offset]); } - if (changed->lights) - { - struct wined3d_light_info *light, *cursor; - - LIST_FOR_EACH_ENTRY_SAFE(light, cursor, &changed->changed_lights, struct wined3d_light_info, changed_entry) - { - wined3d_device_context_set_light(context, light->OriginalIndex, &light->OriginalParms); - wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1); - list_remove(&light->changed_entry); - light->changed = false; - } - } - for (i = 0; i < ARRAY_SIZE(changed->renderState); ++i) { map = changed->renderState[i]; @@ -3337,6 +3324,19 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, wined3d_device_set_clip_plane(device, i, &state->clip_planes[i]); } + if (changed->lights) + { + struct wined3d_light_info *light, *cursor; + + LIST_FOR_EACH_ENTRY_SAFE(light, cursor, &changed->changed_lights, struct wined3d_light_info, changed_entry) + { + wined3d_device_context_set_light(context, light->OriginalIndex, &light->OriginalParms); + wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1); + list_remove(&light->changed_entry); + light->changed = false; + } + } + if (changed->ffp_ps_constants) { static const struct wined3d_color specular_enabled = {1.0f, 1.0f, 1.0f, 0.0f};
1
0
0
0
Elizabeth Figura : wined3d: Feed the FFP color key through a push constant buffer.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: 65165cf8520f85ac327115536749cda1aabef77b URL:
https://gitlab.winehq.org/wine/wine/-/commit/65165cf8520f85ac327115536749cd…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Sun Jun 9 12:50:26 2024 -0500 wined3d: Feed the FFP color key through a push constant buffer. --- dlls/wined3d/cs.c | 4 ---- dlls/wined3d/ffp_gl.c | 1 - dlls/wined3d/glsl_shader.c | 25 ++++++------------------- dlls/wined3d/shader_spirv.c | 1 - dlls/wined3d/stateblock.c | 16 ++++++++++++++-- dlls/wined3d/texture.c | 3 +++ dlls/wined3d/utils.c | 2 -- dlls/wined3d/wined3d_private.h | 9 +++++---- 8 files changed, 28 insertions(+), 33 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 81a66ab3cf7..cc6153ce257 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1580,9 +1580,6 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (new_use_color_key != old_use_color_key) device_invalidate_state(cs->c.device, STATE_RENDER(WINED3D_RS_COLORKEYENABLE)); - - if (new_use_color_key) - device_invalidate_state(cs->c.device, STATE_COLOR_KEY); } void wined3d_device_context_emit_set_texture(struct wined3d_device_context *context, @@ -1957,7 +1954,6 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat case WINED3D_CKEY_SRC_BLT: if (texture == wined3d_state_get_ffp_texture(&cs->state, 0)) { - device_invalidate_state(cs->c.device, STATE_COLOR_KEY); if (!(texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT)) device_invalidate_state(cs->c.device, STATE_RENDER(WINED3D_RS_COLORKEYENABLE)); } diff --git a/dlls/wined3d/ffp_gl.c b/dlls/wined3d/ffp_gl.c index bab0f752df8..ddb461bb56f 100644 --- a/dlls/wined3d/ffp_gl.c +++ b/dlls/wined3d/ffp_gl.c @@ -1717,7 +1717,6 @@ static void validate_state_table(struct wined3d_state_entry *state_table) STATE_BASEVERTEXINDEX, STATE_FRAMEBUFFER, STATE_POINT_ENABLE, - STATE_COLOR_KEY, STATE_BLEND, STATE_BLEND_FACTOR, STATE_DEPTH_STENCIL, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 4f7929923b8..118ea7c926d 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1670,17 +1670,6 @@ static void shader_glsl_clip_plane_uniform(const struct wined3d_context_gl *cont GL_EXTCALL(glUniform4fv(prog->vs.clip_planes_location + index, 1, &plane.x)); } -/* Context activation is done by the caller (state handler). */ -static void shader_glsl_load_color_key_constant(const struct glsl_ps_program *ps, - const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) -{ - struct wined3d_color float_key[2]; - const struct wined3d_texture *texture = wined3d_state_get_ffp_texture(state, 0); - - wined3d_format_get_float_color_key(texture->resource.format, &texture->async.src_blt_color_key, float_key); - GL_EXTCALL(glUniform4fv(ps->color_key_location, 2, &float_key[0].r)); -} - static void shader_glsl_load_constants(struct shader_glsl_priv *priv, struct wined3d_context *context, const struct wined3d_state *state) { @@ -1889,7 +1878,12 @@ static void shader_glsl_load_constants(struct shader_glsl_priv *priv, } if (update_mask & WINED3D_SHADER_CONST_FFP_COLOR_KEY) - shader_glsl_load_color_key_constant(&prog->ps, gl_info, state); + { + const struct wined3d_ffp_ps_constants *constants = wined3d_buffer_load_sysmem( + context_gl->c.device->push_constants[WINED3D_PUSH_CONSTANTS_PS_FFP], &context_gl->c); + + GL_EXTCALL(glUniform4fv(prog->ps.color_key_location, 2, &constants->color_key[0].r)); + } if (update_mask & WINED3D_SHADER_CONST_FFP_PS) { @@ -12326,12 +12320,6 @@ static void glsl_fragment_pipe_core_alpha_test_ref(struct wined3d_context *conte context->constant_update_mask |= WINED3D_SHADER_CONST_PS_ALPHA_TEST; } -static void glsl_fragment_pipe_color_key(struct wined3d_context *context, - const struct wined3d_state *state, DWORD state_id) -{ - context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_COLOR_KEY; -} - static void glsl_fragment_pipe_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -12422,7 +12410,6 @@ static const struct wined3d_state_entry_template glsl_fragment_pipe_state_templa {STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), {STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), glsl_fragment_pipe_alpha_test }, WINED3D_GL_LEGACY_CONTEXT}, {STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), {STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), glsl_fragment_pipe_core_alpha_test }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_COLORKEYENABLE), {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, - {STATE_COLOR_KEY, { STATE_COLOR_KEY, glsl_fragment_pipe_color_key }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_FOGENABLE), {STATE_RENDER(WINED3D_RS_FOGENABLE), glsl_fragment_pipe_fog }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_FOGTABLEMODE), {STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_FOGVERTEXMODE), {STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index 61a64f07a6f..dc1c3a13131 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -1263,7 +1263,6 @@ static const struct wined3d_state_entry_template spirv_fragment_pipe_vk_fp_state {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_nop}}, {STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), {STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), state_nop}}, {STATE_POINT_ENABLE, {STATE_POINT_ENABLE, state_nop}}, - {STATE_COLOR_KEY, {STATE_COLOR_KEY, state_nop}}, {0}, /* Terminate */ }; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index f97b03e508e..7b09b874137 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -3314,8 +3314,20 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, map = changed->textures; while (map) { + struct wined3d_color float_key[2]; + struct wined3d_texture *texture; + i = wined3d_bit_scan(&map); - wined3d_device_set_texture(device, i, state->textures[i]); + texture = state->textures[i]; + wined3d_device_set_texture(device, i, texture); + + if (!i && texture) + { + wined3d_format_get_float_color_key(texture->resource.format, &texture->src_blt_color_key, float_key); + wined3d_device_context_push_constants(context, + WINED3D_PUSH_CONSTANTS_PS_FFP, WINED3D_SHADER_CONST_FFP_COLOR_KEY, + offsetof(struct wined3d_ffp_ps_constants, color_key), sizeof(float_key), float_key); + } } map = changed->clipplane; @@ -3339,7 +3351,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, constants.specular_enable = state->rs[WINED3D_RS_SPECULARENABLE] ? specular_enabled : specular_disabled; wined3d_device_context_push_constants(context, WINED3D_PUSH_CONSTANTS_PS_FFP, - WINED3D_SHADER_CONST_FFP_PS, 0, sizeof(constants), &constants); + WINED3D_SHADER_CONST_FFP_PS, 0, offsetof(struct wined3d_ffp_ps_constants, color_key), &constants); } assert(list_empty(&stateblock->changed.changed_lights)); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index eeb2ea3a7cc..99c6a89764d 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1770,6 +1770,9 @@ 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; + wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key); return WINED3D_OK; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 779af782b6c..c43995b06ea 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -5383,8 +5383,6 @@ const char *debug_d3dstate(uint32_t state) return "STATE_FRAMEBUFFER"; if (STATE_IS_POINT_ENABLE(state)) return "STATE_POINT_ENABLE"; - if (STATE_IS_COLOR_KEY(state)) - return "STATE_COLOR_KEY"; if (STATE_IS_STREAM_OUTPUT(state)) return "STATE_STREAM_OUTPUT"; if (STATE_IS_BLEND(state)) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 5bfc13f3b88..f6adc96887d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1777,10 +1777,7 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state #define STATE_POINT_ENABLE (STATE_FRAMEBUFFER + 1) #define STATE_IS_POINT_ENABLE(a) ((a) == STATE_POINT_ENABLE) -#define STATE_COLOR_KEY (STATE_POINT_ENABLE + 1) -#define STATE_IS_COLOR_KEY(a) ((a) == STATE_COLOR_KEY) - -#define STATE_STREAM_OUTPUT (STATE_COLOR_KEY + 1) +#define STATE_STREAM_OUTPUT (STATE_POINT_ENABLE + 1) #define STATE_IS_STREAM_OUTPUT(a) ((a) == STATE_STREAM_OUTPUT) #define STATE_BLEND (STATE_STREAM_OUTPUT + 1) @@ -2774,6 +2771,7 @@ struct wined3d_ffp_ps_constants /* (1, 1, 1, 0) or (0, 0, 0, 0), which shaders will multiply with the * specular color. */ struct wined3d_color specular_enable; + struct wined3d_color color_key[2]; }; enum wined3d_push_constants @@ -3333,6 +3331,9 @@ struct wined3d_texture DWORD color_key_flags; } async; + /* Color key field accessed from the client side. */ + struct wined3d_color_key src_blt_color_key; + struct wined3d_dirty_regions { struct wined3d_box *boxes;
1
0
0
0
Elizabeth Figura : wined3d: Feed the fragment part of WINED3D_RS_SPECULARENABLE through a push constant buffer.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: f1e52bf16218ffeacf91438b7928d1d678099b0c URL:
https://gitlab.winehq.org/wine/wine/-/commit/f1e52bf16218ffeacf91438b7928d1…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Sun Jun 9 12:50:25 2024 -0500 wined3d: Feed the fragment part of WINED3D_RS_SPECULARENABLE through a push constant buffer. --- dlls/wined3d/glsl_shader.c | 12 +----------- dlls/wined3d/shader_spirv.c | 1 - dlls/wined3d/stateblock.c | 5 +++++ dlls/wined3d/wined3d_private.h | 3 +++ 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 3c97eebe124..4f7929923b8 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1901,10 +1901,7 @@ static void shader_glsl_load_constants(struct shader_glsl_priv *priv, if (prog->ps.tex_factor_location != -1) GL_EXTCALL(glUniform4fv(prog->ps.tex_factor_location, 1, &constants->texture_factor.r)); - if (state->render_states[WINED3D_RS_SPECULARENABLE]) - GL_EXTCALL(glUniform4f(prog->ps.specular_enable_location, 1.0f, 1.0f, 1.0f, 0.0f)); - else - GL_EXTCALL(glUniform4f(prog->ps.specular_enable_location, 0.0f, 0.0f, 0.0f, 0.0f)); + GL_EXTCALL(glUniform4fv(prog->ps.specular_enable_location, 1, &constants->specular_enable.r)); for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i) { @@ -12286,12 +12283,6 @@ static void glsl_fragment_pipe_tex_transform(struct wined3d_context *context, context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } -static void glsl_fragment_pipe_invalidate_constants(struct wined3d_context *context, - const struct wined3d_state *state, DWORD state_id) -{ - context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_PS; -} - static void glsl_fragment_pipe_alpha_test_func(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -12451,7 +12442,6 @@ static const struct wined3d_state_entry_template glsl_fragment_pipe_state_templa {STATE_TEXTURESTAGE(5,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(5, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(6,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(6, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(7,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(7, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, - {STATE_RENDER(WINED3D_RS_SPECULARENABLE), {STATE_RENDER(WINED3D_RS_SPECULARENABLE), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, {STATE_POINT_ENABLE, {STATE_POINT_ENABLE, glsl_fragment_pipe_shader }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), glsl_fragment_pipe_shademode }, WINED3D_GLSL_130 }, {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index b4ef9f61f43..61a64f07a6f 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -1253,7 +1253,6 @@ static const struct wined3d_state_entry_template spirv_fragment_pipe_vk_fp_state {STATE_RENDER(WINED3D_RS_ALPHAREF), {STATE_RENDER(WINED3D_RS_ALPHAREF), state_nop}}, {STATE_RENDER(WINED3D_RS_ALPHAFUNC), {STATE_RENDER(WINED3D_RS_ALPHAFUNC), state_nop}}, {STATE_RENDER(WINED3D_RS_FOGENABLE), {STATE_RENDER(WINED3D_RS_FOGENABLE), state_nop}}, - {STATE_RENDER(WINED3D_RS_SPECULARENABLE), {STATE_RENDER(WINED3D_RS_SPECULARENABLE), state_nop}}, {STATE_RENDER(WINED3D_RS_FOGCOLOR), {STATE_RENDER(WINED3D_RS_FOGCOLOR), state_nop}}, {STATE_RENDER(WINED3D_RS_FOGTABLEMODE), {STATE_RENDER(WINED3D_RS_FOGTABLEMODE), state_nop}}, {STATE_RENDER(WINED3D_RS_FOGSTART), {STATE_RENDER(WINED3D_RS_FOGSTART), state_nop}}, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 104affe6e56..f97b03e508e 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1542,6 +1542,7 @@ void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateb } break; + case WINED3D_RS_SPECULARENABLE: case WINED3D_RS_TEXTUREFACTOR: stateblock->changed.ffp_ps_constants = 1; break; @@ -3326,6 +3327,8 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, if (changed->ffp_ps_constants) { + static const struct wined3d_color specular_enabled = {1.0f, 1.0f, 1.0f, 0.0f}; + static const struct wined3d_color specular_disabled; struct wined3d_ffp_ps_constants constants; for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i) @@ -3333,6 +3336,8 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, wined3d_color_from_d3dcolor(&constants.texture_factor, state->rs[WINED3D_RS_TEXTUREFACTOR]); + constants.specular_enable = state->rs[WINED3D_RS_SPECULARENABLE] ? specular_enabled : specular_disabled; + wined3d_device_context_push_constants(context, WINED3D_PUSH_CONSTANTS_PS_FFP, WINED3D_SHADER_CONST_FFP_PS, 0, sizeof(constants), &constants); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 46cc0ec30ce..5bfc13f3b88 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2771,6 +2771,9 @@ struct wined3d_ffp_ps_constants { struct wined3d_color texture_constants[WINED3D_MAX_FFP_TEXTURES]; struct wined3d_color texture_factor; + /* (1, 1, 1, 0) or (0, 0, 0, 0), which shaders will multiply with the + * specular color. */ + struct wined3d_color specular_enable; }; enum wined3d_push_constants
1
0
0
0
Elizabeth Figura : wined3d: Destroy the push constant buffers on device reset.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: a5535aea042674417935a2239f1242a9a3306cdd URL:
https://gitlab.winehq.org/wine/wine/-/commit/a5535aea042674417935a2239f1242…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Sun Jun 9 12:50:30 2024 -0500 wined3d: Destroy the push constant buffers on device reset. --- dlls/wined3d/device.c | 6 ++++++ dlls/wined3d/stateblock.c | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index acc70256462..e445679ec2f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5020,6 +5020,12 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } + for (unsigned int i = 0; i < ARRAY_SIZE(device->push_constants); ++i) + { + if (device->push_constants[i]) + wined3d_buffer_decref(device->push_constants[i]); + device->push_constants[i] = NULL; + } state_unbind_resources(state); } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 28aa2a46f08..104affe6e56 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2193,6 +2193,14 @@ static void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state } +/* FFP push constant buffers do not have a "default" state on the CS side. + * We need to explicitly invalidate them when initializing the context or + * resetting. */ +static void wined3d_stateblock_invalidate_push_constants(struct wined3d_stateblock *stateblock) +{ + stateblock->changed.ffp_ps_constants = 1; +} + static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const struct wined3d_stateblock *device_state, struct wined3d_device *device, enum wined3d_stateblock_type type) { @@ -2207,9 +2215,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const stru stateblock->changed.store_stream_offset = 1; list_init(&stateblock->changed.changed_lights); - /* FFP push constant buffers need to be set if used; the backend does not - * have a default state for them. */ - stateblock->changed.ffp_ps_constants = 1; + wined3d_stateblock_invalidate_push_constants(stateblock); if (type == WINED3D_SBT_RECORDED || type == WINED3D_SBT_PRIMARY) return WINED3D_OK; @@ -2286,6 +2292,7 @@ void CDECL wined3d_stateblock_reset(struct wined3d_stateblock *stateblock) memset(&stateblock->stateblock_state, 0, sizeof(stateblock->stateblock_state)); stateblock->stateblock_state.light_state = &stateblock->light_state; wined3d_stateblock_state_init(&stateblock->stateblock_state, stateblock->device, WINED3D_STATE_INIT_DEFAULT); + wined3d_stateblock_invalidate_push_constants(stateblock); } static void wined3d_device_set_base_vertex_index(struct wined3d_device *device, int base_index)
1
0
0
0
Hans Leidekker : odbc32: Use SQLSetConnectAttrW() instead of SQLSetConnectAttr() if possible.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: 551a3e6887c4f79daa823ddc366996243a977fa9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/551a3e6887c4f79daa823ddc366996…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jul 12 08:24:58 2024 +0200 odbc32: Use SQLSetConnectAttrW() instead of SQLSetConnectAttr() if possible. --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 033d009be50..957584af008 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -854,7 +854,20 @@ static SQLRETURN set_con_attr( struct handle *handle, SQLINTEGER attr, SQLPOINTE } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, attr, value, len ); + switch (attr) + { + case SQL_ATTR_CURRENT_CATALOG: + case SQL_ATTR_TRACEFILE: + case SQL_ATTR_TRANSLATE_LIB: + ERR( "string attribute %u not handled\n", attr ); + return SQL_ERROR; + default: + break; + } + if (handle->win32_funcs->SQLSetConnectAttrW) + ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, attr, value, len ); + else if (handle->win32_funcs->SQLSetConnectAttr) + ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, attr, value, len ); } return ret; }
1
0
0
0
Hans Leidekker : odbc32: Use SQLFreeHandle() instead of SQLFreeEnv/Connect().
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: dbe651d330f260183c6d3e59e06b82910ba34c9f URL:
https://gitlab.winehq.org/wine/wine/-/commit/dbe651d330f260183c6d3e59e06b82…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jul 12 08:20:11 2024 +0200 odbc32: Use SQLFreeHandle() instead of SQLFreeEnv/Connect(). The latter are not exported by some drivers. --- dlls/odbc32/proxyodbc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 54b680feb71..033d009be50 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -1359,12 +1359,12 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) if (handle->unix_handle) { - struct SQLFreeConnect_params params = { handle->unix_handle }; - ret = ODBC_CALL( SQLFreeConnect, ¶ms ); + struct SQLFreeHandle_params params = { SQL_HANDLE_DBC, handle->unix_handle }; + ret = ODBC_CALL( SQLFreeHandle, ¶ms ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLFreeConnect( handle->win32_handle ); + ret = handle->win32_funcs->SQLFreeHandle( SQL_HANDLE_DBC, handle->win32_handle ); } free( handle ); @@ -1386,12 +1386,12 @@ SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) if (handle->unix_handle) { - struct SQLFreeEnv_params params = { handle->unix_handle }; - ret = ODBC_CALL( SQLFreeEnv, ¶ms ); + struct SQLFreeHandle_params params = { SQL_HANDLE_ENV, handle->unix_handle }; + ret = ODBC_CALL( SQLFreeHandle, ¶ms ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLFreeEnv( handle->win32_handle ); + ret = handle->win32_funcs->SQLFreeHandle( SQL_HANDLE_ENV, handle->win32_handle ); } RegCloseKey( handle->drivers_key );
1
0
0
0
Hans Leidekker : odbc32: Set parent functions before creating the environment handle.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: 8c7e82d01f0003e84a86d21e4ac12c960a4dfb09 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8c7e82d01f0003e84a86d21e4ac12c…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jul 11 22:00:35 2024 +0200 odbc32: Set parent functions before creating the environment handle. --- dlls/odbc32/proxyodbc.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index d1e1beef723..54b680feb71 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -914,7 +914,7 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM if (has_suffix( filename, L".dll" )) { - if (!(handle->win32_funcs = load_driver( filename ))) + if (!(handle->win32_funcs = handle->parent->win32_funcs = load_driver( filename ))) { WARN( "failed to load driver %s\n", debugstr_w(filename) ); goto done; @@ -922,7 +922,6 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM TRACE( "using Windows driver %s\n", debugstr_w(filename) ); if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; - handle->parent->win32_funcs = handle->win32_funcs; if (!SUCCESS((ret = create_con( handle )))) goto done; ret = handle->win32_funcs->SQLConnect( handle->win32_handle, ServerName, NameLength1, UserName, NameLength2, @@ -2647,7 +2646,7 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio if (has_suffix( filename, L".dll" )) { - if (!(handle->win32_funcs = load_driver( filename ))) + if (!(handle->win32_funcs = handle->parent->win32_funcs = load_driver( filename ))) { WARN( "failed to load driver %s\n", debugstr_w(filename) ); goto done; @@ -2655,7 +2654,6 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio TRACE( "using Windows driver %s\n", debugstr_w(filename) ); if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; - handle->parent->win32_funcs = handle->win32_funcs; if (!SUCCESS((ret = create_con( handle )))) goto done; ret = handle->win32_funcs->SQLBrowseConnect( handle->win32_handle, InConnectionString, StringLength1, @@ -3309,7 +3307,7 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle if (has_suffix( filename, L".dll" )) { - if (!(handle->win32_funcs = load_driver( filename ))) + if (!(handle->win32_funcs = handle->parent->win32_funcs = load_driver( filename ))) { WARN( "failed to load driver %s\n", debugstr_w(filename) ); goto done; @@ -3317,7 +3315,6 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle TRACE( "using Windows driver %s\n", debugstr_w(filename) ); if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; - handle->parent->win32_funcs = handle->win32_funcs; if (!SUCCESS((ret = create_con( handle )))) goto done; ret = handle->win32_funcs->SQLDriverConnect( handle->win32_handle, WindowHandle, InConnectionString, Length, @@ -3467,7 +3464,7 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA if (has_suffix( filename, L".dll" )) { - if (!(handle->win32_funcs = load_driver( filename ))) + if (!(handle->win32_funcs = handle->parent->win32_funcs = load_driver( filename ))) { WARN( "failed to load driver %s\n", debugstr_w(filename) ); goto done; @@ -3475,7 +3472,6 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA TRACE( "using Windows driver %s\n", debugstr_w(filename) ); if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; - handle->parent->win32_funcs = handle->win32_funcs; if (!SUCCESS((ret = create_con( handle )))) goto done; ret = handle->win32_funcs->SQLConnectW( handle->win32_handle, ServerName, NameLength1, UserName, NameLength2, @@ -4048,7 +4044,7 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl if (has_suffix( filename, L".dll" )) { - if (!(handle->win32_funcs = load_driver( filename ))) + if (!(handle->win32_funcs = handle->parent->win32_funcs = load_driver( filename ))) { WARN( "failed to load driver %s\n", debugstr_w(filename) ); goto done; @@ -4056,7 +4052,6 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl TRACE( "using Windows driver %s\n", debugstr_w(filename) ); if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; - handle->parent->win32_funcs = handle->win32_funcs; if (!SUCCESS((ret = create_con( handle )))) goto done; ret = handle->win32_funcs->SQLDriverConnectW( handle->win32_handle, WindowHandle, InConnectionString, Length, @@ -4338,7 +4333,7 @@ SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnect if (has_suffix( filename, L".dll" )) { - if (!(handle->win32_funcs = load_driver( filename ))) + if (!(handle->win32_funcs = handle->parent->win32_funcs = load_driver( filename ))) { WARN( "failed to load driver %s\n", debugstr_w(filename) ); goto done; @@ -4346,7 +4341,6 @@ SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnect TRACE( "using Windows driver %s\n", debugstr_w(filename) ); if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; - handle->parent->win32_funcs = handle->win32_funcs; if (!SUCCESS((ret = create_con( handle )))) goto done; ret = handle->win32_funcs->SQLBrowseConnectW( handle->win32_handle, InConnectionString, StringLength1,
1
0
0
0
Hans Leidekker : odbc32: Accept SQL_FETCH_NEXT in SQLDataSources/Drivers() if the key has not been opened.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: 2bd4c765eab7d9840815642d63ae94380b1d9dfb URL:
https://gitlab.winehq.org/wine/wine/-/commit/2bd4c765eab7d9840815642d63ae94…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jul 11 15:57:17 2024 +0200 odbc32: Accept SQL_FETCH_NEXT in SQLDataSources/Drivers() if the key has not been opened. --- dlls/odbc32/proxyodbc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 094d690c714..d1e1beef723 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -1000,7 +1000,7 @@ SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Directio if (!handle) return SQL_INVALID_HANDLE; - if (Direction == SQL_FETCH_FIRST) + if (Direction == SQL_FETCH_FIRST || (Direction == SQL_FETCH_NEXT && !handle->sources_key)) { handle->sources_idx = 0; handle->sources_system = FALSE; @@ -3185,7 +3185,7 @@ SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, S if (!handle) return SQL_INVALID_HANDLE; - if (Direction == SQL_FETCH_FIRST) + if (Direction == SQL_FETCH_FIRST || (Direction == SQL_FETCH_NEXT && !handle->drivers_key)) { handle->drivers_idx = 0; RegCloseKey( handle->drivers_key ); @@ -4425,7 +4425,7 @@ SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi if (!handle) return SQL_INVALID_HANDLE; - if (Direction == SQL_FETCH_FIRST) + if (Direction == SQL_FETCH_FIRST || (Direction == SQL_FETCH_NEXT && !handle->sources_key)) { handle->sources_idx = 0; handle->sources_system = FALSE; @@ -4699,7 +4699,7 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, if (!handle) return SQL_INVALID_HANDLE; - if (Direction == SQL_FETCH_FIRST) + if (Direction == SQL_FETCH_FIRST || (Direction == SQL_FETCH_NEXT && !handle->drivers_key)) { handle->drivers_idx = 0; RegCloseKey( handle->drivers_key );
1
0
0
0
Hans Leidekker : odbc32: Factor out helpers to create driver environment and connection handles.
by Alexandre Julliard
12 Jul '24
12 Jul '24
Module: wine Branch: master Commit: caa124252f23022b9273e7a0b30f342a513bb1f5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/caa124252f23022b9273e7a0b30f34…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jul 11 08:22:43 2024 +0200 odbc32: Factor out helpers to create driver environment and connection handles. --- dlls/odbc32/proxyodbc.c | 166 ++++++++++++++++++++---------------------------- 1 file changed, 68 insertions(+), 98 deletions(-)
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
52
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
Results per page:
10
25
50
100
200