From eabb523aa45f3d8940cadac197ef1225fbfd5c56 Mon Sep 17 00:00:00 2001 From: Daniel Czarnowski Date: Mon, 21 Oct 2013 19:45:35 +0200 Subject: [PATCH] glx: Allow float renderType in glXCreateContextAttribsARB This enables GLX_RGBA_FLOAT_TYPE_ARB and GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT as valid renderType parameters to glXCreateContextAttribsARB. v2 (idr) : Use C-style comments and fix word wrapping. Re-write commit message. Signed-off-by: Daniel Czarnowski Signed-off-by: Ian Romanick Reviewed-by: Ian Romanick --- glx/createcontext.c | 2 ++ glx/glxext.h | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/glx/createcontext.c b/glx/createcontext.c index 13d21ccb9..41ecd118f 100644 --- a/glx/createcontext.c +++ b/glx/createcontext.c @@ -68,6 +68,8 @@ validate_render_type(uint32_t render_type) switch (render_type) { case GLX_RGBA_TYPE: case GLX_COLOR_INDEX_TYPE: + case GLX_RGBA_FLOAT_TYPE_ARB: + case GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT: return True; default: return False; diff --git a/glx/glxext.h b/glx/glxext.h index 9b0978b93..3f2dee696 100644 --- a/glx/glxext.h +++ b/glx/glxext.h @@ -35,6 +35,22 @@ * Silicon Graphics, Inc. */ +/* doing #include & #include could cause problems + * with overlapping definitions, so let's use the easy way + */ +#ifndef GLX_RGBA_FLOAT_BIT_ARB +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#endif +#ifndef GLX_RGBA_FLOAT_TYPE_ARB +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 +#endif +#ifndef GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#endif +#ifndef GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 +#endif + extern GLboolean __glXFreeContext(__GLXcontext * glxc); extern void __glXFlushContextCache(void);