summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-05-31 23:55:21 +0000
committerBrian Paul <[email protected]>2005-05-31 23:55:21 +0000
commit1b93953fbcbeb3c88dc50004a989a3d44d7fd99b (patch)
treeabe8489630f005a4b36d88f2b27b61b9824774f2 /src/mesa
parent5d5100aabcb1e9a740f1e69e8b01743b1c1d3ccd (diff)
add support for GL_RENDERBUFFER_RED/GREEN/BLUE/etc_SIZE_EXT querie
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/fbobject.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index beaf4ed942c..89eb03bab4d 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -339,6 +339,9 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
* Status field with the results.
* Also update the framebuffer's Width and Height fields if the
* framebuffer is complete.
+ *
+ * XXX Need to check for FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT!
+ *
*/
void
_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
@@ -722,6 +725,59 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params)
case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT:
*params = ctx->CurrentRenderbuffer->InternalFormat;
return;
+ case GL_RENDERBUFFER_RED_SIZE_EXT:
+ if (ctx->CurrentRenderbuffer->_BaseFormat == GL_RGB ||
+ ctx->CurrentRenderbuffer->_BaseFormat == GL_RGBA) {
+ *params = ctx->CurrentRenderbuffer->ComponentSizes[0];
+ }
+ else {
+ *params = 0;
+ }
+ break;
+ case GL_RENDERBUFFER_GREEN_SIZE_EXT:
+ if (ctx->CurrentRenderbuffer->_BaseFormat == GL_RGB ||
+ ctx->CurrentRenderbuffer->_BaseFormat == GL_RGBA) {
+ *params = ctx->CurrentRenderbuffer->ComponentSizes[1];
+ }
+ else {
+ *params = 0;
+ }
+ break;
+ case GL_RENDERBUFFER_BLUE_SIZE_EXT:
+ if (ctx->CurrentRenderbuffer->_BaseFormat == GL_RGB ||
+ ctx->CurrentRenderbuffer->_BaseFormat == GL_RGBA) {
+ *params = ctx->CurrentRenderbuffer->ComponentSizes[2];
+ }
+ else {
+ *params = 0;
+ }
+ break;
+ case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
+ if (ctx->CurrentRenderbuffer->_BaseFormat == GL_RGB ||
+ ctx->CurrentRenderbuffer->_BaseFormat == GL_RGBA) {
+ *params = ctx->CurrentRenderbuffer->ComponentSizes[3];
+ }
+ else {
+ *params = 0;
+ }
+ break;
+ case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
+ if (ctx->CurrentRenderbuffer->_BaseFormat == GL_DEPTH_COMPONENT) {
+ *params = ctx->CurrentRenderbuffer->ComponentSizes[0];
+ }
+ else {
+ *params = 0;
+ }
+ break;
+ case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
+ if (ctx->CurrentRenderbuffer->_BaseFormat == GL_STENCIL_INDEX) {
+ *params = ctx->CurrentRenderbuffer->ComponentSizes[0];
+ }
+ else {
+ *params = 0;
+ }
+ break;
+
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetRenderbufferParameterivEXT(target)");
@@ -1234,6 +1290,7 @@ _mesa_GenerateMipmapEXT(GLenum target)
case GL_TEXTURE_2D:
case GL_TEXTURE_3D:
case GL_TEXTURE_CUBE_MAP:
+ /* OK, legal value */
break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)");