1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

wined3d: Introduce a separate fp_disable() method.

Analogous to shader_disable().

We'd like to pass a wined3d_state pointer to fp_enable() to let it handle
actually compiling the fragment pipeline, which doesn't mesh well conceptually
with its use in shader_disable().
This commit is contained in:
Zebediah Figura 2023-11-11 21:32:17 -06:00 committed by Alexandre Julliard
parent 9880e29d69
commit b64cc15d61
8 changed files with 117 additions and 67 deletions

View file

@ -4771,7 +4771,7 @@ static void shader_arb_disable(void *shader_priv, struct wined3d_context *contex
gl_info->gl_ops.gl.p_glDisable(GL_FRAGMENT_PROGRAM_ARB);
checkGLcall("glDisable(GL_FRAGMENT_PROGRAM_ARB)");
}
priv->fragment_pipe->fp_enable(context, FALSE);
priv->fragment_pipe->fp_disable(context);
if (gl_info->supported[ARB_VERTEX_PROGRAM])
{
@ -5756,6 +5756,14 @@ static void arbfp_enable(const struct wined3d_context *context, BOOL enable)
}
}
static void arbfp_disable(const struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
gl_info->gl_ops.gl.p_glDisable(GL_FRAGMENT_PROGRAM_ARB);
checkGLcall("glDisable(GL_FRAGMENT_PROGRAM_ARB)");
}
static void *arbfp_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
{
struct shader_arb_priv *priv;
@ -6894,15 +6902,16 @@ static void arbfp_free_context_data(struct wined3d_context *context)
const struct wined3d_fragment_pipe_ops arbfp_fragment_pipeline =
{
arbfp_enable,
arbfp_get_caps,
arbfp_get_emul_mask,
arbfp_alloc,
arbfp_free,
arbfp_alloc_context_data,
arbfp_free_context_data,
shader_arb_color_fixup_supported,
arbfp_fragmentstate_template,
.fp_enable = arbfp_enable,
.fp_disable = arbfp_disable,
.get_caps = arbfp_get_caps,
.get_emul_mask = arbfp_get_emul_mask,
.alloc_private = arbfp_alloc,
.free_private = arbfp_free,
.allocate_context_data = arbfp_alloc_context_data,
.free_context_data = arbfp_free_context_data,
.color_fixup_supported = shader_arb_color_fixup_supported,
.states = arbfp_fragmentstate_template,
};
struct arbfp_blit_type

View file

@ -1267,6 +1267,14 @@ static void atifs_enable(const struct wined3d_context *context, BOOL enable)
}
}
static void atifs_disable(const struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
gl_info->gl_ops.gl.p_glDisable(GL_FRAGMENT_SHADER_ATI);
checkGLcall("glDisable(GL_FRAGMENT_SHADER_ATI)");
}
static void atifs_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps)
{
memset(caps, 0, sizeof(*caps));
@ -1382,13 +1390,14 @@ static void atifs_free_context_data(struct wined3d_context *context)
const struct wined3d_fragment_pipe_ops atifs_fragment_pipeline =
{
atifs_enable,
atifs_get_caps,
atifs_get_emul_mask,
atifs_alloc,
atifs_free,
atifs_alloc_context_data,
atifs_free_context_data,
atifs_color_fixup_supported,
atifs_fragmentstate_template,
.fp_enable = atifs_enable,
.fp_disable = atifs_disable,
.get_caps = atifs_get_caps,
.get_emul_mask = atifs_get_emul_mask,
.alloc_private = atifs_alloc,
.free_private = atifs_free,
.allocate_context_data = atifs_alloc_context_data,
.free_context_data = atifs_free_context_data,
.color_fixup_supported = atifs_color_fixup_supported,
.states = atifs_fragmentstate_template,
};

View file

@ -4955,15 +4955,16 @@ static void ffp_none_context_free(struct wined3d_context *context)
const struct wined3d_fragment_pipe_ops ffp_fragment_pipeline =
{
ffp_pipe_enable,
ffp_fragment_get_caps,
ffp_fragment_get_emul_mask,
ffp_alloc,
ffp_free,
ffp_none_context_alloc,
ffp_none_context_free,
ffp_color_fixup_supported,
ffp_fragmentstate_template,
.fp_enable = ffp_pipe_enable,
.fp_disable = ffp_pipe_disable,
.get_caps = ffp_fragment_get_caps,
.get_emul_mask = ffp_fragment_get_emul_mask,
.alloc_private = ffp_alloc,
.free_private = ffp_free,
.allocate_context_data = ffp_none_context_alloc,
.free_context_data = ffp_none_context_free,
.color_fixup_supported = ffp_color_fixup_supported,
.states = ffp_fragmentstate_template,
};
static void none_pipe_enable(const struct wined3d_context *context, BOOL enable) {}
@ -5014,15 +5015,15 @@ static BOOL fp_none_color_fixup_supported(struct color_fixup_desc fixup)
const struct wined3d_fragment_pipe_ops none_fragment_pipe =
{
none_pipe_enable,
fp_none_get_caps,
fp_none_get_emul_mask,
none_alloc,
none_free,
ffp_none_context_alloc,
ffp_none_context_free,
fp_none_color_fixup_supported,
NULL,
.fp_enable = none_pipe_enable,
.fp_disable = none_pipe_disable,
.get_caps = fp_none_get_caps,
.get_emul_mask = fp_none_get_emul_mask,
.alloc_private = none_alloc,
.free_private = none_free,
.allocate_context_data = ffp_none_context_alloc,
.free_context_data = ffp_none_context_free,
.color_fixup_supported = fp_none_color_fixup_supported,
};
static unsigned int num_handlers(const APPLYSTATEFUNC *funcs)

View file

@ -10821,7 +10821,7 @@ static void shader_glsl_disable(void *shader_priv, struct wined3d_context *conte
checkGLcall("glUseProgram");
priv->vertex_pipe->vp_disable(context);
priv->fragment_pipe->fp_enable(context, FALSE);
priv->fragment_pipe->fp_disable(context);
if (needs_legacy_glsl_syntax(gl_info) && gl_info->supported[ARB_COLOR_BUFFER_FLOAT])
{
@ -12065,6 +12065,10 @@ static void glsl_fragment_pipe_enable(const struct wined3d_context *context, BOO
/* Nothing to do. */
}
static void glsl_fragment_pipe_disable(const struct wined3d_context *context)
{
}
static void glsl_fragment_pipe_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps)
{
const struct wined3d_gl_info *gl_info = &wined3d_adapter_gl_const(adapter)->gl_info;
@ -12424,15 +12428,16 @@ static void glsl_fragment_pipe_free_context_data(struct wined3d_context *context
const struct wined3d_fragment_pipe_ops glsl_fragment_pipe =
{
glsl_fragment_pipe_enable,
glsl_fragment_pipe_get_caps,
glsl_fragment_pipe_get_emul_mask,
glsl_fragment_pipe_alloc,
glsl_fragment_pipe_free,
glsl_fragment_pipe_alloc_context_data,
glsl_fragment_pipe_free_context_data,
shader_glsl_color_fixup_supported,
glsl_fragment_pipe_state_template,
.fp_enable = glsl_fragment_pipe_enable,
.fp_disable = glsl_fragment_pipe_disable,
.get_caps = glsl_fragment_pipe_get_caps,
.get_emul_mask = glsl_fragment_pipe_get_emul_mask,
.alloc_private = glsl_fragment_pipe_alloc,
.free_private = glsl_fragment_pipe_free,
.allocate_context_data = glsl_fragment_pipe_alloc_context_data,
.free_context_data = glsl_fragment_pipe_free_context_data,
.color_fixup_supported = shader_glsl_color_fixup_supported,
.states = glsl_fragment_pipe_state_template,
};
struct glsl_blitter_args

View file

@ -676,6 +676,14 @@ static void nvrc_enable(const struct wined3d_context *context, BOOL enable)
}
}
static void nvrc_disable(const struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
gl_info->gl_ops.gl.p_glDisable(GL_REGISTER_COMBINERS_NV);
checkGLcall("glDisable(GL_REGISTER_COMBINERS_NV)");
}
/* Context activation is done by the caller. */
static void nvts_enable(const struct wined3d_context *context, BOOL enable)
{
@ -694,6 +702,15 @@ static void nvts_enable(const struct wined3d_context *context, BOOL enable)
}
}
static void nvts_disable(const struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
nvrc_disable(context);
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_SHADER_NV);
checkGLcall("glDisable(GL_TEXTURE_SHADER_NV)");
}
static void nvrc_fragment_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps)
{
const struct wined3d_gl_info *gl_info = &wined3d_adapter_gl_const(adapter)->gl_info;
@ -931,26 +948,28 @@ static void nvrc_context_free(struct wined3d_context *context)
const struct wined3d_fragment_pipe_ops nvts_fragment_pipeline =
{
nvts_enable,
nvrc_fragment_get_caps,
nvrc_fragment_get_emul_mask,
nvrc_fragment_alloc,
nvrc_fragment_free,
nvrc_context_alloc,
nvrc_context_free,
nvts_color_fixup_supported,
nvrc_fragmentstate_template,
.fp_enable = nvts_enable,
.fp_disable = nvts_disable,
.get_caps = nvrc_fragment_get_caps,
.get_emul_mask = nvrc_fragment_get_emul_mask,
.alloc_private = nvrc_fragment_alloc,
.free_private = nvrc_fragment_free,
.allocate_context_data = nvrc_context_alloc,
.free_context_data = nvrc_context_free,
.color_fixup_supported = nvts_color_fixup_supported,
.states = nvrc_fragmentstate_template,
};
const struct wined3d_fragment_pipe_ops nvrc_fragment_pipeline =
{
nvrc_enable,
nvrc_fragment_get_caps,
nvrc_fragment_get_emul_mask,
nvrc_fragment_alloc,
nvrc_fragment_free,
nvrc_context_alloc,
nvrc_context_free,
nvts_color_fixup_supported,
nvrc_fragmentstate_template,
.fp_enable = nvrc_enable,
.fp_disable = nvrc_disable,
.get_caps = nvrc_fragment_get_caps,
.get_emul_mask = nvrc_fragment_get_emul_mask,
.alloc_private = nvrc_fragment_alloc,
.free_private = nvrc_fragment_free,
.allocate_context_data = nvrc_context_alloc,
.free_context_data = nvrc_context_free,
.color_fixup_supported = nvts_color_fixup_supported,
.states = nvrc_fragmentstate_template,
};

View file

@ -1953,7 +1953,7 @@ static void shader_none_disable(void *shader_priv, struct wined3d_context *conte
struct shader_none_priv *priv = shader_priv;
priv->vertex_pipe->vp_disable(context);
priv->fragment_pipe->fp_enable(context, FALSE);
priv->fragment_pipe->fp_disable(context);
context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL)
| (1u << WINED3D_SHADER_TYPE_VERTEX)

View file

@ -905,7 +905,7 @@ static void shader_spirv_disable(void *shader_priv, struct wined3d_context *cont
struct shader_spirv_priv *priv = shader_priv;
priv->vertex_pipe->vp_disable(context);
priv->fragment_pipe->fp_enable(context, false);
priv->fragment_pipe->fp_disable(context);
context_vk->compute.vk_pipeline = VK_NULL_HANDLE;
context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL)
@ -1223,6 +1223,11 @@ static void spirv_fragment_pipe_vk_fp_enable(const struct wined3d_context *conte
/* Nothing to do. */
}
static void spirv_fragment_pipe_vk_fp_disable(const struct wined3d_context *context)
{
/* Nothing to do. */
}
static void spirv_fragment_pipe_vk_fp_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps)
{
memset(caps, 0, sizeof(*caps));
@ -1285,6 +1290,7 @@ static const struct wined3d_state_entry_template spirv_fragment_pipe_vk_fp_state
static const struct wined3d_fragment_pipe_ops spirv_fragment_pipe_vk =
{
.fp_enable = spirv_fragment_pipe_vk_fp_enable,
.fp_disable = spirv_fragment_pipe_vk_fp_disable,
.get_caps = spirv_fragment_pipe_vk_fp_get_caps,
.get_emul_mask = spirv_fragment_pipe_vk_fp_get_emul_mask,
.alloc_private = spirv_fragment_pipe_vk_fp_alloc,

View file

@ -2002,6 +2002,7 @@ struct wined3d_state_entry_template
struct wined3d_fragment_pipe_ops
{
void (*fp_enable)(const struct wined3d_context *context, BOOL enable);
void (*fp_disable)(const struct wined3d_context *context);
void (*get_caps)(const struct wined3d_adapter *adapter, struct fragment_caps *caps);
unsigned int (*get_emul_mask)(const struct wined3d_adapter *adapter);
void *(*alloc_private)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv);