Fixes cf312011c0e1f43123682f7f2e783174fea65425.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/state.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 87c734685c..175fd14a0e 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4091,13 +4091,10 @@ static void viewport_miscpart_cc(struct wined3d_context *context,
for (i = 0; i < state->viewport_count; ++i) { - vp[i].x += pixel_center_offset; - vp[i].y += pixel_center_offset; - depth_ranges[i * 2] = vp[i].min_z; depth_ranges[i * 2 + 1] = vp[i].max_z;
- viewports[i * 4 ] = vp[i].x + pixel_center_offset; + viewports[i * 4] = vp[i].x + pixel_center_offset; viewports[i * 4 + 1] = vp[i].y + pixel_center_offset; viewports[i * 4 + 2] = vp[i].width; viewports[i * 4 + 3] = vp[i].height;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- The check really only makes sense on legacy profile.
dlls/wined3d/directx.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 7deefaf82d..89506b1b02 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -854,6 +854,8 @@ static BOOL match_broken_arb_fog(const struct wined3d_gl_info *gl_info, struct w return FALSE; if (!gl_info->supported[ARB_FRAGMENT_PROGRAM]) return FALSE; + if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + return FALSE;
gl_info->gl_ops.gl.p_glGenTextures(1, &tex); gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
glStencilMask() is defined as setting both front and back stencil masks in GL 2.0+ and we don't want to use the EXT_stencil_two_side entry points even if they happen to be available there. D3D doesn't support separate front / back stencil write masks anyway.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/directx.c | 4 ++++ dlls/wined3d/state.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 89506b1b02..164f9c95ba 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -4049,7 +4049,11 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, gl_info->supported[WINED3D_GL_BLEND_EQUATION] = TRUE;
if (gl_version >= MAKEDWORD_VERSION(2, 0)) + { gl_info->supported[WINED3D_GL_VERSION_2_0] = TRUE; + /* We want to use the core APIs for two-sided stencil in GL 2.0. */ + gl_info->supported[EXT_STENCIL_TWO_SIDE] = FALSE; + } if (gl_version >= MAKEDWORD_VERSION(3, 2)) gl_info->supported[WINED3D_GL_VERSION_3_2] = TRUE;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 175fd14a0e..34e08e9ba5 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1003,7 +1003,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ } }
-static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +static void state_stencilwrite2s_ext(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -4603,7 +4603,7 @@ const struct StateEntryTemplate misc_state_template[] = { STATE_RENDER(WINED3D_RS_STENCILFUNC), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_STENCILREF), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_STENCILMASK), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), state_stencilwrite2s}, EXT_STENCIL_TWO_SIDE }, + { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), state_stencilwrite2s_ext}, EXT_STENCIL_TWO_SIDE }, { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), state_stencilwrite }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_BACK_STENCILFAIL), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE },
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/directx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 164f9c95ba..5e10cb1c33 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -674,7 +674,7 @@ static BOOL match_allows_spec_alpha(const struct wined3d_gl_info *gl_info, struc GLenum error; DWORD data[16];
- if (!gl_info->supported[EXT_SECONDARY_COLOR]) + if (!gl_info->supported[EXT_SECONDARY_COLOR] || !gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) return FALSE;
while (gl_info->gl_ops.gl.p_glGetError());
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
It should make it easier for the GL driver to upgrade the context to a GL version higher than strictly requested.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- It might help a bit with users accidentally limiting the GL version to something unnecessarily low, like e.g. in bug 43042. We need a forward-compatible context to be able to use core profile on macOS at all and that should continue to work.
dlls/wined3d/context.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index b96733f79c..300b79b699 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1849,8 +1849,6 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, ctx_attribs[ctx_attrib_idx++] = gl_info->selected_gl_version >> 16; ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_MINOR_VERSION_ARB; ctx_attribs[ctx_attrib_idx++] = gl_info->selected_gl_version & 0xffff; - if (gl_info->selected_gl_version >= MAKEDWORD_VERSION(3, 2)) - ctx_flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; if (ctx_flags) { ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_FLAGS_ARB; @@ -1860,9 +1858,20 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc,
if (!(ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) { - if (ctx_flags & WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB) + if (gl_info->selected_gl_version >= MAKEDWORD_VERSION(3, 2)) { - ctx_attribs[ctx_attrib_idx - 1] &= ~WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + if (ctx_flags) + { + ctx_flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + ctx_attribs[ctx_attrib_idx - 1] = ctx_flags; + } + else + { + ctx_flags = WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_FLAGS_ARB; + ctx_attribs[ctx_attrib_idx++] = ctx_flags; + ctx_attribs[ctx_attrib_idx] = 0; + } if (!(ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) WARN("Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n", GetLastError());
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com