[Mesa-dev] [PATCH] mesa: add missing RG_INTEGER and some RED_INTEGER_EXT checks.
Dave Airlie
airlied at gmail.com
Sun Dec 4 12:16:46 PST 2011
From: Dave Airlie <airlied at redhat.com>
This just adds the correct checks and asserts in the right places. This doesn't
fix all the tests that I've sent to piglit, need to add int paths to go alongside the uint paths that don't go via float to fix it up properly.
I'm not sure how much of that could be templated/shared will have a look
once I write it the long way.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/mesa/main/framebuffer.c | 1 +
src/mesa/main/image.c | 4 ++++
src/mesa/main/pack.c | 4 ++++
src/mesa/main/texstore.c | 12 ++++++++++++
4 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 8d0763d..e30f31a 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -879,6 +879,7 @@ renderbuffer_exists(struct gl_context *ctx,
case GL_BGRA:
case GL_ABGR_EXT:
case GL_RED_INTEGER_EXT:
+ case GL_RG_INTEGER:
case GL_GREEN_INTEGER_EXT:
case GL_BLUE_INTEGER_EXT:
case GL_ALPHA_INTEGER_EXT:
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index b266e26..ba645fb 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -238,6 +238,7 @@ _mesa_components_in_format( GLenum format )
case GL_DEPTH_STENCIL_EXT:
case GL_DUDV_ATI:
case GL_DU8DV8_ATI:
+ case GL_RG_INTEGER:
return 2;
case GL_RGB:
@@ -527,6 +528,7 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
case GL_GREEN_INTEGER_EXT:
case GL_BLUE_INTEGER_EXT:
case GL_ALPHA_INTEGER_EXT:
+ case GL_RG_INTEGER:
switch (type) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
@@ -751,6 +753,7 @@ _mesa_is_color_format(GLenum format)
case GL_RGBA_INTEGER_EXT:
case GL_BGR_INTEGER_EXT:
case GL_BGRA_INTEGER_EXT:
+ case GL_RG_INTEGER:
case GL_LUMINANCE_INTEGER_EXT:
case GL_LUMINANCE_ALPHA_INTEGER_EXT:
/* sized integer formats */
@@ -954,6 +957,7 @@ _mesa_is_integer_format(GLenum format)
case GL_BGRA_INTEGER_EXT:
case GL_LUMINANCE_INTEGER_EXT:
case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+ case GL_RG_INTEGER:
/* specific integer formats */
case GL_RGBA32UI_EXT:
case GL_RGB32UI_EXT:
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index 0bd4ff1..2933ff6 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -467,6 +467,7 @@ _mesa_pack_rgba_span_int(struct gl_context *ctx, GLuint n, GLuint rgba[][4],
case GL_GREEN_INTEGER_EXT:
case GL_BLUE_INTEGER_EXT:
case GL_ALPHA_INTEGER_EXT:
+ case GL_RG_INTEGER:
case GL_RGB_INTEGER_EXT:
case GL_RGBA_INTEGER_EXT:
case GL_BGR_INTEGER_EXT:
@@ -490,6 +491,7 @@ _mesa_pack_rgba_span_int(struct gl_context *ctx, GLuint n, GLuint rgba[][4],
case GL_GREEN_INTEGER_EXT:
case GL_BLUE_INTEGER_EXT:
case GL_ALPHA_INTEGER_EXT:
+ case GL_RG_INTEGER:
case GL_RGB_INTEGER_EXT:
case GL_RGBA_INTEGER_EXT:
case GL_BGR_INTEGER_EXT:
@@ -3021,6 +3023,7 @@ extract_uint_rgba(GLuint n, GLuint rgba[][4],
srcFormat == GL_DU8DV8_ATI ||
srcFormat == GL_DUDV_ATI ||
srcFormat == GL_RED_INTEGER_EXT ||
+ srcFormat == GL_RG_INTEGER ||
srcFormat == GL_GREEN_INTEGER_EXT ||
srcFormat == GL_BLUE_INTEGER_EXT ||
srcFormat == GL_ALPHA_INTEGER_EXT ||
@@ -3980,6 +3983,7 @@ _mesa_unpack_color_span_uint(struct gl_context *ctx,
srcFormat == GL_GREEN_INTEGER_EXT ||
srcFormat == GL_BLUE_INTEGER_EXT ||
srcFormat == GL_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_RG_INTEGER ||
srcFormat == GL_RGB_INTEGER_EXT ||
srcFormat == GL_RGBA_INTEGER_EXT ||
srcFormat == GL_BGR_INTEGER_EXT ||
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 37fea21..2049e81 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3569,6 +3569,8 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT8);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
+ baseInternalFormat == GL_RG ||
+ baseInternalFormat == GL_RED ||
baseInternalFormat == GL_ALPHA ||
baseInternalFormat == GL_LUMINANCE ||
baseInternalFormat == GL_LUMINANCE_ALPHA ||
@@ -3639,6 +3641,8 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT16);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
+ baseInternalFormat == GL_RG ||
+ baseInternalFormat == GL_RED ||
baseInternalFormat == GL_ALPHA ||
baseInternalFormat == GL_LUMINANCE ||
baseInternalFormat == GL_LUMINANCE_ALPHA ||
@@ -3709,6 +3713,8 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT32);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
+ baseInternalFormat == GL_RG ||
+ baseInternalFormat == GL_RED ||
baseInternalFormat == GL_ALPHA ||
baseInternalFormat == GL_LUMINANCE ||
baseInternalFormat == GL_LUMINANCE_ALPHA ||
@@ -3779,6 +3785,8 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT8);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
+ baseInternalFormat == GL_RG ||
+ baseInternalFormat == GL_RED ||
baseInternalFormat == GL_ALPHA ||
baseInternalFormat == GL_LUMINANCE ||
baseInternalFormat == GL_LUMINANCE_ALPHA ||
@@ -3847,6 +3855,8 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT16);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
+ baseInternalFormat == GL_RG ||
+ baseInternalFormat == GL_RED ||
baseInternalFormat == GL_ALPHA ||
baseInternalFormat == GL_LUMINANCE ||
baseInternalFormat == GL_LUMINANCE_ALPHA ||
@@ -3915,6 +3925,8 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT32);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
+ baseInternalFormat == GL_RG ||
+ baseInternalFormat == GL_RED ||
baseInternalFormat == GL_ALPHA ||
baseInternalFormat == GL_LUMINANCE ||
baseInternalFormat == GL_LUMINANCE_ALPHA ||
--
1.7.7.3
More information about the mesa-dev
mailing list