From: Alexandros Frantzis alexandros.frantzis@collabora.com
--- dlls/winewayland.drv/opengl.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/winewayland.drv/opengl.c b/dlls/winewayland.drv/opengl.c index e714b2cb952..994154968b3 100644 --- a/dlls/winewayland.drv/opengl.c +++ b/dlls/winewayland.drv/opengl.c @@ -49,6 +49,7 @@ static EGLDisplay egl_display; static char wgl_extensions[4096]; static EGLConfig *egl_configs; static int num_egl_configs; +static BOOL has_egl_ext_pixel_format_float;
#define USE_GL_FUNC(name) #name, static const char *opengl_func_names[] = { ALL_WGL_FUNCS }; @@ -765,8 +766,24 @@ static void describe_pixel_format(EGLConfig config, struct wgl_pixel_format *fmt } else fmt->transparent = -1;
- /* TODO: Support floating point pixel components */ - fmt->pixel_type = WGL_TYPE_RGBA_ARB; + if (!has_egl_ext_pixel_format_float) fmt->pixel_type = WGL_TYPE_RGBA_ARB; + else if (p_eglGetConfigAttrib(egl_display, config, EGL_COLOR_COMPONENT_TYPE_EXT, &value)) + { + switch (value) + { + case EGL_COLOR_COMPONENT_TYPE_FIXED_EXT: + fmt->pixel_type = WGL_TYPE_RGBA_ARB; + break; + case EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT: + fmt->pixel_type = WGL_TYPE_RGBA_FLOAT_ARB; + break; + default: + ERR("unexpected color component type 0x%x\n", value); + fmt->pixel_type = -1; + break; + } + } + else fmt->pixel_type = -1;
fmt->draw_to_pbuffer = !!(surface_type & EGL_PBUFFER_BIT); SET_ATTRIB_ARB(max_pbuffer_pixels, EGL_MAX_PBUFFER_PIXELS); @@ -896,6 +913,12 @@ static BOOL init_opengl_funcs(void) opengl_funcs.ext.p_wglGetPixelFormatAttribfvARB = (void *)1; /* never called */ opengl_funcs.ext.p_wglGetPixelFormatAttribivARB = (void *)1; /* never called */
+ if (has_egl_ext_pixel_format_float) + { + register_extension("WGL_ARB_pixel_format_float"); + register_extension("WGL_ATI_pixel_format_float"); + } + return TRUE; }
@@ -1030,6 +1053,8 @@ static void init_opengl(void) REQUIRE_EXT(EGL_KHR_no_config_context); #undef REQUIRE_EXT
+ has_egl_ext_pixel_format_float = has_extension(egl_exts, "EGL_EXT_pixel_format_float"); + if (!init_opengl_funcs()) goto err; if (!init_egl_configs()) goto err;