Core contexts on Mac OS don't have GL_APPLE_fence or GL_APPLE_ycbcr_422... but they do have GL_APPLE_flush_render and GL_APPLE_rgb_422. So, go back to using APPLE_flush_render in our OS X detection, and accept APPLE_rgb_422 in addition to APPLE_ycbcr_422.
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/wined3d/adapter_gl.c | 5 ++++- dlls/wined3d/wined3d_gl.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 77fe4ca720f..dfe598acf1b 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -54,6 +54,8 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_APPLE_float_pixels", APPLE_FLOAT_PIXELS }, {"GL_APPLE_flush_buffer_range", APPLE_FLUSH_BUFFER_RANGE }, {"GL_APPLE_ycbcr_422", APPLE_YCBCR_422 }, + {"GL_APPLE_flush_render", APPLE_FLUSH_RENDER }, + {"GL_APPLE_rgb_422", APPLE_RGB_422 },
/* ARB */ {"GL_ARB_base_instance", ARB_BASE_INSTANCE }, @@ -1225,7 +1227,8 @@ static enum wined3d_gl_vendor wined3d_guess_gl_vendor(const struct wined3d_gl_in * is specific to the Mac OS X window management, and GL_APPLE_ycbcr_422 is QuickTime specific. So * the chance that other implementations support them is rather small since Win32 QuickTime uses * DirectDraw, not OpenGL. */ - if (gl_info->supported[APPLE_FENCE] && gl_info->supported[APPLE_YCBCR_422]) + if (gl_info->supported[APPLE_FLUSH_RENDER] + && (gl_info->supported[APPLE_YCBCR_422] || gl_info->supported[APPLE_RGB_422])) return GL_VENDOR_APPLE;
if (strstr(gl_vendor_string, "NVIDIA")) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 6b1c99e6da8..2dbc56ab79d 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -37,6 +37,8 @@ enum wined3d_gl_extension APPLE_FENCE, APPLE_FLOAT_PIXELS, APPLE_FLUSH_BUFFER_RANGE, + APPLE_FLUSH_RENDER, + APPLE_RGB_422, APPLE_YCBCR_422, /* ARB */ ARB_BASE_INSTANCE,
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/wined3d/adapter_gl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index dfe598acf1b..a38033fd98c 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -3183,7 +3183,12 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info) gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max); gl_info->limits.glsl_ps_float_constants = gl_max / 4; TRACE("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants); - if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + if (gl_info->supported[ARB_ES2_COMPATIBILITY]) + { + gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VARYING_VECTORS, &gl_max); + gl_info->limits.glsl_varyings = gl_max * 4; + } + else if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max); gl_info->limits.glsl_varyings = gl_max;
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/wined3d/adapter_gl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index a38033fd98c..5f5caa0981a 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -3604,7 +3604,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, * functionality. Prefer the ARB extension */ gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] = FALSE; } - if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) + if (gl_info->supported[ARB_TEXTURE_CUBE_MAP] && gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { TRACE(" IMPLIED: NVIDIA (NV) Texture Gen Reflection support.\n"); gl_info->supported[NV_TEXGEN_REFLECTION] = TRUE;
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/wined3d/context.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 41dbca24dbc..62be2c37291 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1970,7 +1970,7 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, { HGLRC ctx; unsigned int ctx_attrib_idx = 0; - GLint ctx_attribs[7], ctx_flags = 0; + GLint ctx_attribs[9], ctx_flags = 0;
if (context_debug_output_enabled(gl_info)) ctx_flags = WGL_CONTEXT_DEBUG_BIT_ARB; @@ -2001,10 +2001,19 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, 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()); - } + if ((ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) + return ctx; + ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_PROFILE_MASK_ARB; + ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + ctx_attribs[ctx_attrib_idx] = 0; + if ((ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) + return ctx; + ctx_attribs[ctx_attrib_idx - 3] &= ~WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + if ((ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) + return ctx; + } + WARN("Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n", + GetLastError()); } return ctx; }
On Thu, 9 Apr 2020 at 11:08, Chip Davis cdavis@codeweavers.com wrote:
Signed-off-by: Chip Davis cdavis@codeweavers.com
dlls/wined3d/context.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
According to the extension spec, "The default value for WGL_CONTEXT_PROFILE_MASK_ARB is WGL_CONTEXT_CORE_PROFILE_BIT_ARB". I.e., this is not supposed to make a difference.
On Thu, 9 Apr 2020 at 11:08, Chip Davis cdavis@codeweavers.com wrote:
Signed-off-by: Chip Davis cdavis@codeweavers.com
dlls/wined3d/adapter_gl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Like some of the other patches in this series, why does this make a difference? Why would we care? NV_texgen_reflection is used for fixed-function texture coordinate generation, so shouldn't be used on core contexts, regardless of whether it's available or not.
On Thu, 9 Apr 2020 at 11:08, Chip Davis cdavis@codeweavers.com wrote:
Signed-off-by: Chip Davis cdavis@codeweavers.com
dlls/wined3d/adapter_gl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Why?
April 9, 2020 6:07 AM, "Henri Verbeet" hverbeet@gmail.com wrote:
On Thu, 9 Apr 2020 at 11:08, Chip Davis cdavis@codeweavers.com wrote:
Signed-off-by: Chip Davis cdavis@codeweavers.com
dlls/wined3d/adapter_gl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Why?
I had this in my tree before Matteo fixed it to use GL_MAX_FRAGMENT_INPUT_COMPONENTS, but I never bothered to send it. I guess it's obsolete now that he has.
Chip
On Thu, 9 Apr 2020 at 10:52, Chip Davis cdavis@codeweavers.com wrote:
Core contexts on Mac OS don't have GL_APPLE_fence or GL_APPLE_ycbcr_422... but they do have GL_APPLE_flush_render and GL_APPLE_rgb_422. So, go back to using APPLE_flush_render in our OS X detection, and accept APPLE_rgb_422 in addition to APPLE_ycbcr_422.
Signed-off-by: Chip Davis cdavis@codeweavers.com
dlls/wined3d/adapter_gl.c | 5 ++++- dlls/wined3d/wined3d_gl.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-)
As it happens, I had a conversation with Zhiyi the other day about commit messages. Describe what you're changing in the subject line. While there are rare cases where "Fix something." is the best we can do, this isn't one of those.