[Mesa-dev] [PATCH 05/13] mesa formats: allow non-integer formats to be used for integer packing
Jordan Justen
jordan.l.justen at intel.com
Mon Jun 25 17:34:36 PDT 2012
For example format=GL_RGBA with type=GL_UNSIGNED_BYTE will be treated
the same as format=GL_RGBA_INTEGER_EXT with type=GL_UNSIGNED_BYTE.
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/mesa/main/pack_tmp.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/mesa/main/pack_tmp.h b/src/mesa/main/pack_tmp.h
index 0d4eb38..178cbbc 100644
--- a/src/mesa/main/pack_tmp.h
+++ b/src/mesa/main/pack_tmp.h
@@ -32,30 +32,35 @@ FN_NAME(struct gl_context *ctx,
switch (dstFormat) {
case GL_RED_INTEGER_EXT:
+ case GL_RED:
for (i=0;i<n;i++) {
dst[i] = SRC_CONVERT(rgba[i][RCOMP]);
}
break;
case GL_GREEN_INTEGER_EXT:
+ case GL_GREEN:
for (i=0;i<n;i++) {
dst[i] = SRC_CONVERT(rgba[i][GCOMP]);
}
break;
case GL_BLUE_INTEGER_EXT:
+ case GL_BLUE:
for (i=0;i<n;i++) {
dst[i] = SRC_CONVERT(rgba[i][BCOMP]);
};
break;
case GL_ALPHA_INTEGER_EXT:
+ case GL_ALPHA:
for (i=0;i<n;i++) {
dst[i] = SRC_CONVERT(rgba[i][ACOMP]);
}
break;
case GL_RG_INTEGER:
+ case GL_RG:
for (i=0;i<n;i++) {
dst[i*2+0] = SRC_CONVERT(rgba[i][RCOMP]);
dst[i*2+1] = SRC_CONVERT(rgba[i][GCOMP]);
@@ -63,6 +68,7 @@ FN_NAME(struct gl_context *ctx,
break;
case GL_RGB_INTEGER_EXT:
+ case GL_RGB:
for (i=0;i<n;i++) {
dst[i*3+0] = SRC_CONVERT(rgba[i][RCOMP]);
dst[i*3+1] = SRC_CONVERT(rgba[i][GCOMP]);
@@ -71,6 +77,7 @@ FN_NAME(struct gl_context *ctx,
break;
case GL_RGBA_INTEGER_EXT:
+ case GL_RGBA:
for (i=0;i<n;i++) {
dst[i*4+0] = SRC_CONVERT(rgba[i][RCOMP]);
dst[i*4+1] = SRC_CONVERT(rgba[i][GCOMP]);
@@ -80,6 +87,7 @@ FN_NAME(struct gl_context *ctx,
break;
case GL_BGR_INTEGER_EXT:
+ case GL_BGR:
for (i=0;i<n;i++) {
dst[i*3+0] = SRC_CONVERT(rgba[i][BCOMP]);
dst[i*3+1] = SRC_CONVERT(rgba[i][GCOMP]);
@@ -88,6 +96,7 @@ FN_NAME(struct gl_context *ctx,
break;
case GL_BGRA_INTEGER_EXT:
+ case GL_BGRA:
for (i=0;i<n;i++) {
dst[i*4+0] = SRC_CONVERT(rgba[i][BCOMP]);
dst[i*4+1] = SRC_CONVERT(rgba[i][GCOMP]);
@@ -97,6 +106,7 @@ FN_NAME(struct gl_context *ctx,
break;
case GL_LUMINANCE_INTEGER_EXT:
+ case GL_LUMINANCE:
for (i=0;i<n;i++) {
dst[i] = SRC_CONVERT(rgba[i][RCOMP] +
rgba[i][GCOMP] +
@@ -105,6 +115,7 @@ FN_NAME(struct gl_context *ctx,
break;
case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ case GL_LUMINANCE_ALPHA:
for (i=0;i<n;i++) {
dst[i*2+0] = SRC_CONVERT(rgba[i][RCOMP] +
rgba[i][GCOMP] +
--
1.7.9.5
More information about the mesa-dev
mailing list