summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-12-16 09:41:09 -0700
committerBrian Paul <[email protected]>2013-12-18 09:06:52 -0700
commitaa4001b6075a5ca0c695f196e912f09ea12aed44 (patch)
tree39761890ed84b93cd2f80dbe61441849174f766c /src/mesa/main/teximage.c
parenteaaa9695b2c29bcebc670c8af74b54d70bc5cc7d (diff)
mesa: add API/extension checks for 3-component texture buffer formats
The GL_RGB32F, GL_RGB32UI and GL_RGB32I texture buffer formats are only supposed to be allowed if the GL_ARB_texture_buffer_object_rgb32 extension is supported. Note that the texture buffer extensions require a core profile. This patch adds those checks. Fixes the soon-to-be-added arb_clear_buffer_object-negative-bad-internalformat piglit test.
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 6bcabd3275a..211fc798701 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3967,6 +3967,20 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
}
}
+ if (ctx->API == API_OPENGL_CORE &&
+ ctx->Extensions.ARB_texture_buffer_object_rgb32) {
+ switch (internalFormat) {
+ case GL_RGB32F:
+ return MESA_FORMAT_RGB_FLOAT32;
+ case GL_RGB32UI:
+ return MESA_FORMAT_RGB_UINT32;
+ case GL_RGB32I:
+ return MESA_FORMAT_RGB_INT32;
+ default:
+ break;
+ }
+ }
+
switch (internalFormat) {
case GL_RGBA8:
return MESA_FORMAT_RGBA8888_REV;
@@ -4031,13 +4045,6 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
case GL_R32UI:
return MESA_FORMAT_R_UINT32;
- case GL_RGB32F:
- return MESA_FORMAT_RGB_FLOAT32;
- case GL_RGB32UI:
- return MESA_FORMAT_RGB_UINT32;
- case GL_RGB32I:
- return MESA_FORMAT_RGB_INT32;
-
default:
return MESA_FORMAT_NONE;
}