Module: wine
Branch: master
Commit: de5a07b20bd00c66528570400416e9eadac0cf9c
URL: https://gitlab.winehq.org/wine/wine/-/commit/de5a07b20bd00c66528570400416e9…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Thu Jan 5 11:20:25 2023 -0600
wined3d/arb: Compare the fragment pipe ops in shader_arb_select() instead of using an extra field.
Matches what's done in the GLSL shader backend.
---
dlls/wined3d/arb_program_shader.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index c89c2e848a6..eecbe1c22b1 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -271,7 +271,6 @@ struct shader_arb_priv
{
const struct arb_ps_compiled_shader *compiled_fprog;
const struct arb_vs_compiled_shader *compiled_vprog;
- BOOL use_arbfp_fixed_func;
struct wine_rb_tree fragment_shaders;
BOOL last_ps_const_clamped;
BOOL last_vs_color_unclamp;
@@ -4677,7 +4676,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
}
else
{
- if (gl_info->supported[ARB_FRAGMENT_PROGRAM] && !priv->use_arbfp_fixed_func)
+ if (gl_info->supported[ARB_FRAGMENT_PROGRAM] && context->device->adapter->fragment_pipe != &arbfp_fragment_pipeline)
{
/* Disable only if we're not using arbfp fixed function fragment
* processing. If this is used, keep GL_FRAGMENT_PROGRAM_ARB
@@ -5759,15 +5758,13 @@ static void *arbfp_alloc(const struct wined3d_shader_backend_ops *shader_backend
/* Share private data between the shader backend and the pipeline
* replacement, if both are the arb implementation. This is needed to
- * figure out whether ARBfp should be disabled if no pixel shader is bound
- * or not. */
+ * invalidate some data when switching between FFP and fragment shaders. */
if (shader_backend == &arb_program_shader_backend)
priv = shader_priv;
else if (!(priv = heap_alloc_zero(sizeof(*priv))))
return NULL;
wine_rb_init(&priv->fragment_shaders, wined3d_ffp_frag_program_key_compare);
- priv->use_arbfp_fixed_func = TRUE;
return priv;
}
@@ -5792,7 +5789,6 @@ static void arbfp_free(struct wined3d_device *device, struct wined3d_context *co
struct shader_arb_priv *priv = device->fragment_priv;
wine_rb_destroy(&priv->fragment_shaders, arbfp_free_ffpshader, context_gl);
- priv->use_arbfp_fixed_func = FALSE;
if (device->shader_backend != &arb_program_shader_backend)
heap_free(device->fragment_priv);
Module: wine
Branch: master
Commit: 37d909e0076fef93dec10ea7b7c3e06a4cef7c97
URL: https://gitlab.winehq.org/wine/wine/-/commit/37d909e0076fef93dec10ea7b7c3e0…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Thu Jan 5 11:16:14 2023 -0600
wined3d/arb: Always disable the fragment pipeline in shader_arb_select().
The original intent here seems to have been to avoid disabling
GL_FRAGMENT_PROGRAM_ARB only to reënable it again. There is not actually any
harm in this, however.
---
dlls/wined3d/arb_program_shader.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index ee693924a24..c89c2e848a6 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -4639,10 +4639,10 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, compiled->prgId));
checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, compiled->prgId);");
- if (!priv->use_arbfp_fixed_func)
- priv->fragment_pipe->fp_enable(context, FALSE);
+ priv->fragment_pipe->fp_enable(context, FALSE);
- /* Enable OpenGL fragment programs. */
+ /* Enable OpenGL fragment programs. Note that we may have already
+ * disabled them when disabling the fragment pipeline. */
gl_info->gl_ops.gl.p_glEnable(GL_FRAGMENT_PROGRAM_ARB);
checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB);");