summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-27 20:51:18 -0600
committerBrian Paul <[email protected]>2009-09-27 20:51:18 -0600
commit5cf5d4be21bdac203dc244e9b773a852ddb1baf1 (patch)
tree848a13c4bc1a7c502c12eae5b7e1e139d6c1b377 /src/mesa/main/fbobject.c
parent5978cbdf7728df7952c9c04165ece23394a5fb95 (diff)
mesa: use more format helper functions
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 13f49da5a78..04419da6e59 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -35,6 +35,7 @@
#include "buffers.h"
#include "context.h"
#include "fbobject.h"
+#include "formats.h"
#include "framebuffer.h"
#include "hash.h"
#include "macros.h"
@@ -356,6 +357,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
if (att->Type == GL_TEXTURE) {
const struct gl_texture_object *texObj = att->Texture;
struct gl_texture_image *texImage;
+ GLenum baseFormat;
if (!texObj) {
att_incomplete("no texobj");
@@ -382,26 +384,28 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
return;
}
+ baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat);
+
if (format == GL_COLOR) {
- if (texImage->TexFormat->BaseFormat != GL_RGB &&
- texImage->TexFormat->BaseFormat != GL_RGBA) {
+ if (baseFormat != GL_RGB &&
+ baseFormat != GL_RGBA) {
att_incomplete("bad format");
att->Complete = GL_FALSE;
return;
}
- if (texImage->TexFormat->TexelBytes == 0) {
+ if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) {
att_incomplete("compressed internalformat");
att->Complete = GL_FALSE;
return;
}
}
else if (format == GL_DEPTH) {
- if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT) {
+ if (baseFormat == GL_DEPTH_COMPONENT) {
/* OK */
}
else if (ctx->Extensions.EXT_packed_depth_stencil &&
ctx->Extensions.ARB_depth_texture &&
- texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) {
+ baseFormat == GL_DEPTH_STENCIL_EXT) {
/* OK */
}
else {