Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37073 Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/wined3d/state.c | 10 ++++++++-- dlls/wined3d/utils.c | 10 ++++++++++ dlls/wined3d/wined3d_private.h | 3 ++- include/wine/wined3d.h | 1 + 4 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 97fab9cd40..f87421ebf9 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1514,15 +1514,20 @@ void state_alpha_to_coverage(struct wined3d_context *context, const struct wined if (!gl_info->supported[ARB_MULTISAMPLE]) return;
- if (state->render_states[WINED3D_RS_POINTSIZE] == WINED3D_ALPHA_TO_COVERAGE_ENABLE) + if (state->render_states[WINED3D_RS_POINTSIZE] == WINED3D_ALPHA_TO_COVERAGE_ENABLE + || state->render_states[WINED3D_RS_ADAPTIVETESS_Y] == WINED3DFMT_ATOC) { gl_info->gl_ops.gl.p_glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); checkGLcall("glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE)"); + if (state->render_states[WINED3D_RS_ADAPTIVETESS_Y] == WINED3DFMT_ATOC) + context->nv_atoc_enabled = 1; } - else if (state->render_states[WINED3D_RS_POINTSIZE] == WINED3D_ALPHA_TO_COVERAGE_DISABLE) + else if (state->render_states[WINED3D_RS_POINTSIZE] == WINED3D_ALPHA_TO_COVERAGE_DISABLE + || (context->nv_atoc_enabled && state->render_states[WINED3D_RS_ADAPTIVETESS_Y] == WINED3DFMT_UNKNOWN)) { gl_info->gl_ops.gl.p_glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); checkGLcall("glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE)"); + context->nv_atoc_enabled = 0; } }
@@ -1947,6 +1952,7 @@ static void state_nvdb(struct wined3d_context *context, const struct wined3d_sta checkGLcall("glDisable(GL_DEPTH_BOUNDS_TEST_EXT)"); }
+ state_alpha_to_coverage(context, state, state_id); state_tessellation(context, state, STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION)); }
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index a968aa4eea..a476c977c8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -65,6 +65,7 @@ format_index_remap[] = {WINED3DFMT_R16, WINED3D_FORMAT_FOURCC_BASE + 20}, {WINED3DFMT_AL16, WINED3D_FORMAT_FOURCC_BASE + 21}, {WINED3DFMT_NV12, WINED3D_FORMAT_FOURCC_BASE + 22}, + {WINED3DFMT_ATOC, WINED3D_FORMAT_FOURCC_BASE + 23}, };
#define WINED3D_FORMAT_COUNT (WINED3D_FORMAT_FOURCC_BASE + ARRAY_SIZE(format_index_remap)) @@ -135,6 +136,7 @@ static const struct wined3d_format_channels formats[] = {WINED3DFMT_ATI1N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_ATI2N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_NVDB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {WINED3DFMT_ATOC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {WINED3DFMT_INST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {WINED3DFMT_INTZ, 0, 0, 0, 0, 0, 0, 0, 0, 4, 24, 8}, {WINED3DFMT_RESZ, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, @@ -339,6 +341,7 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_INST, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_NULL, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_NVDB, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_ATOC, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_RESZ, WINED3DFMT_FLAG_EXTENSION}, };
@@ -3709,6 +3712,12 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); }
+ if (gl_info->supported[ARB_MULTISAMPLE]) + { + format = get_format_gl_internal(adapter, WINED3DFMT_ATOC); + format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + } + /* RESZ aka AMD DX9-level hack for multisampled depth buffer resolve. You query for RESZ * support by checking for availability of MAKEFOURCC('R','E','S','Z') surfaces with * RENDERTARGET usage. */ @@ -4627,6 +4636,7 @@ const char *debug_d3dformat(enum wined3d_format_id format_id) FMT_TO_STR(WINED3DFMT_R16); FMT_TO_STR(WINED3DFMT_AL16); FMT_TO_STR(WINED3DFMT_NV12); + FMT_TO_STR(WINED3DFMT_ATOC); #undef FMT_TO_STR default: { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8e595db65d..e3f3fc6f2a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1977,7 +1977,8 @@ struct wined3d_context DWORD destroyed : 1; DWORD destroy_delayed : 1; DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */ - DWORD padding : 14; + DWORD nv_atoc_enabled : 1; + DWORD padding : 13;
DWORD constant_update_mask; DWORD numbered_array_mask; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 2b08e7f37a..bbb038d0d3 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -269,6 +269,7 @@ enum wined3d_format_id WINED3DFMT_NV12 = WINEMAKEFOURCC('N','V','1','2'), WINED3DFMT_DF16 = WINEMAKEFOURCC('D','F','1','6'), WINED3DFMT_DF24 = WINEMAKEFOURCC('D','F','2','4'), + WINED3DFMT_ATOC = WINEMAKEFOURCC('A','T','O','C'),
WINED3DFMT_FORCE_DWORD = 0xffffffff };