<div dir="ltr">There is something wrong with indentation in that file, but fixing it should be a separate commit.<br><div><br>I will change the patch to keep the original whitespace convention.<br><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/7/15 Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 07/15/2013 07:28 AM, Tomasz Lis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Tomasz Lis <<a href="mailto:tomasz.lis@intel.com" target="_blank">tomasz.lis@intel.com</a>><br>
<br>
The patch marks __DRI_ATTRIB_FLOAT_MODE as deprecated and introduces<br>
nrw flags to __DRI_ATTRIB_RENDER_TYPE which are to define float modes.<br>
Both signed float (fbconfig_float) and unsigned (packed_float) is<br>
introduced as a flag. The old attribute should be set for both float<br>
modes.<br>
<br>
Signed-off-by: Tomasz Lis <<a href="mailto:listom@gmail.com" target="_blank">listom@gmail.com</a>><br>
---<br>
include/GL/internal/dri_<u></u>interface.h | 2 ++<br>
src/egl/drivers/dri2/egl_dri2.<u></u>c | 22 +++++++++++++---------<br>
src/glx/dri_common.c | 16 +++++++++++-----<br>
src/mesa/drivers/dri/common/<u></u>utils.c | 6 ------<br>
4 files changed, 26 insertions(+), 20 deletions(-)<br>
<br>
diff --git a/include/GL/internal/dri_<u></u>interface.h b/include/GL/internal/dri_<u></u>interface.h<br>
index 30ce175..3316fd2 100644<br>
--- a/include/GL/internal/dri_<u></u>interface.h<br>
+++ b/include/GL/internal/dri_<u></u>interface.h<br>
@@ -552,6 +552,8 @@ struct __DRIuseInvalidateExtensionRec {<br>
#define __DRI_ATTRIB_RGBA_BIT 0x01 <br>
#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02<br>
#define __DRI_ATTRIB_LUMINANCE_BIT 0x04<br>
+#define __DRI_ATTRIB_FLOAT_BIT 0x08<br>
+#define __DRI_ATTRIB_UNSIGNED_FLOAT_<u></u>BIT 0x10<br>
<br>
/* __DRI_ATTRIB_CONFIG_CAVEAT */<br>
#define __DRI_ATTRIB_SLOW_BIT 0x01<br>
diff --git a/src/egl/drivers/dri2/egl_<u></u>dri2.c b/src/egl/drivers/dri2/egl_<u></u>dri2.c<br>
index 1bce314..7ec1a5d 100644<br>
--- a/src/egl/drivers/dri2/egl_<u></u>dri2.c<br>
+++ b/src/egl/drivers/dri2/egl_<u></u>dri2.c<br>
@@ -75,7 +75,7 @@ EGLint dri2_to_egl_attribute_map[] = {<br>
0, /* __DRI_ATTRIB_TRANSPARENT_<u></u>GREEN_VALUE */<br>
0, /* __DRI_ATTRIB_TRANSPARENT_BLUE_<u></u>VALUE */<br>
0, /* __DRI_ATTRIB_TRANSPARENT_<u></u>ALPHA_VALUE */<br>
- 0, /* __DRI_ATTRIB_FLOAT_MODE */<br>
+ 0, /* __DRI_ATTRIB_FLOAT_MODE (deprecated) */<br>
0, /* __DRI_ATTRIB_RED_MASK */<br>
0, /* __DRI_ATTRIB_GREEN_MASK */<br>
0, /* __DRI_ATTRIB_BLUE_MASK */<br>
@@ -136,14 +136,18 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,<br>
while (dri2_dpy->core-><u></u>indexConfigAttrib(dri_config, i++, &attrib, &value)) {<br>
switch (attrib) {<br>
case __DRI_ATTRIB_RENDER_TYPE:<br>
- if (value & __DRI_ATTRIB_RGBA_BIT)<br>
- value = EGL_RGB_BUFFER;<br>
- else if (value & __DRI_ATTRIB_LUMINANCE_BIT)<br>
- value = EGL_LUMINANCE_BUFFER;<br>
- else<br>
- /* not valid */;<br>
- _eglSetConfigKey(&base, EGL_COLOR_BUFFER_TYPE, value);<br>
- break; <br>
+ if (value & __DRI_ATTRIB_RGBA_BIT)<br>
+ value = EGL_RGB_BUFFER;<br>
+ else if (value & __DRI_ATTRIB_LUMINANCE_BIT)<br>
+ value = EGL_LUMINANCE_BUFFER;<br>
+ else if (value & __DRI_ATTRIB_FLOAT_BIT)<br>
+ return NULL; // Don't allow float configs for EGL<br>
+ else if (value & __DRI_ATTRIB_UNSIGNED_FLOAT_<u></u>BIT)<br>
+ return NULL; // Don't allow float configs for EGL<br>
+ else<br>
+ /* not valid */;<br>
+ _eglSetConfigKey(&base, EGL_COLOR_BUFFER_TYPE, value);<br>
+ break;<br>
</blockquote>
<br></div></div>
There are some spurious white space changes here.<br>
<br>
Also, I think this code could be simplified by replacing the /* not valid */ comment with 'return NULL;' The existing final else case just looks wrong to me.<br>
<br>
Kristian: Do you remember why that code is like that?<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
case __DRI_ATTRIB_CONFIG_CAVEAT:<br>
if (value & __DRI_ATTRIB_NON_CONFORMANT_<u></u>CONFIG)<br>
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c<br>
index 7ab303e..872f5c3 100644<br>
--- a/src/glx/dri_common.c<br>
+++ b/src/glx/dri_common.c<br>
@@ -281,14 +281,20 @@ driConfigEqual(const __DRIcoreExtension *core,<br>
while (core->indexConfigAttrib(<u></u>driConfig, i++, &attrib, &value)) {<br>
switch (attrib) {<br>
case __DRI_ATTRIB_RENDER_TYPE:<br>
</blockquote>
<br></div>
Lots of spurious white space changes in this hunk too. It looks like there are other spurious changes too... it makes it hard to tell what is actually changed.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- glxValue = 0;<br>
+ glxValue = 0;<br>
if (value & __DRI_ATTRIB_RGBA_BIT) {<br>
- glxValue |= GLX_RGBA_BIT;<br>
+ glxValue |= GLX_RGBA_BIT;<br>
+ }<br>
+ if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) {<br>
+ glxValue |= GLX_COLOR_INDEX_BIT;<br>
+ }<br>
+ if (value & __DRI_ATTRIB_FLOAT_BIT) {<br>
+ glxValue |= GLX_RGBA_FLOAT_BIT_ARB;<br>
}<br>
- else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) {<br>
- glxValue |= GLX_COLOR_INDEX_BIT;<br>
+ if (value & __DRI_ATTRIB_UNSIGNED_FLOAT_<u></u>BIT) {<br>
+ glxValue |= GLX_RGBA_UNSIGNED_FLOAT_BIT_<u></u>EXT;<br>
}<br>
- if (glxValue != config->renderType)<br>
+ if ((glxValue & config->renderType) == 0)<br>
return GL_FALSE;<br>
break;<br>
<br>
diff --git a/src/mesa/drivers/dri/common/<u></u>utils.c b/src/mesa/drivers/dri/common/<u></u>utils.c<br>
index ac0773b..c9fc218 100644<br>
--- a/src/mesa/drivers/dri/common/<u></u>utils.c<br>
+++ b/src/mesa/drivers/dri/common/<u></u>utils.c<br>
@@ -366,7 +366,6 @@ static const struct { unsigned int attrib, offset; } attribMap[] = {<br>
__ATTRIB(__DRI_ATTRIB_<u></u>TRANSPARENT_GREEN_VALUE, transparentGreen),<br>
__ATTRIB(__DRI_ATTRIB_<u></u>TRANSPARENT_BLUE_VALUE, transparentBlue),<br>
__ATTRIB(__DRI_ATTRIB_<u></u>TRANSPARENT_ALPHA_VALUE, transparentAlpha),<br>
- __ATTRIB(__DRI_ATTRIB_FLOAT_<u></u>MODE, floatMode),<br>
__ATTRIB(__DRI_ATTRIB_RED_<u></u>MASK, redMask),<br>
__ATTRIB(__DRI_ATTRIB_GREEN_<u></u>MASK, greenMask),<br>
__ATTRIB(__DRI_ATTRIB_BLUE_<u></u>MASK, blueMask),<br>
@@ -418,11 +417,6 @@ driGetConfigAttribIndex(const __DRIconfig *config,<br>
/* XXX no return value??? */<br>
break;<br>
<br>
- case __DRI_ATTRIB_FLOAT_MODE:<br>
- /* this field is not int-sized */<br>
- *value = config->modes.floatMode;<br>
- break;<br>
-<br>
default:<br>
/* any other int-sized field */<br>
*value = *(unsigned int *)<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>