On 2/13/20 17:30, Henri Verbeet wrote:
On Wed, 12 Feb 2020 at 18:24, Paul Gofman gofmanp@gmail.com wrote:
@@ -616,7 +616,7 @@ static void state_blend_factor(struct wined3d_context *context, const struct win static void state_blend_object(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
- BOOL alpha_to_coverage = FALSE;
BOOL alpha_to_coverage;
if (!gl_info->supported[ARB_MULTISAMPLE]) return;
@@ -626,6 +626,10 @@ static void state_blend_object(struct wined3d_context *context, const struct win struct wined3d_blend_state_desc *desc = &state->blend_state->desc; alpha_to_coverage = desc->alpha_to_coverage; }
else
{
alpha_to_coverage = state->render_states[WINED3D_RS_ADAPTIVETESS_Y] == WINED3DFMT_ATOC;
}
if (alpha_to_coverage) gl_info->gl_ops.gl.p_glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
That works, but it seems tempting to handle the NVIDIA variant in the stateblock as well.
Do you mean bringing in the state trigger behaviour just as for AMD or just move the logic present in this patch to stateblocks somehow? Both variants look less straightforward to me at the moment, as unlike AMD we don't have a pseudo-unique off trigger for Nvidia and it is not immediately clear how to decide when to turn the ATOC state off. For instance, states being set in current stateblock could have never triggered ATOC state but that state can be already set on device previously and the application of stateblock is supposed to turn the state off. I. e., setting the 'changed.blend_state' flag for turning off Nvidia ATOC state becomes cumbersome.