summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-08 20:27:27 -0600
committerBrian Paul <[email protected]>2009-10-08 20:27:27 -0600
commit45e76d2665b38ba3787548310efc59e969124c01 (patch)
tree7a1ab9b61bbd0eb03e7154f6f000db58b8eab4f4 /src/mesa/drivers/dri/common
parent74d61d03b54d72217d463c248468cdcd09320efc (diff)
mesa: remove a bunch of gl_renderbuffer fields
_ActualFormat is replaced by Format (MESA_FORMAT_x). ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are all replaced by MESA_FORMAT_x queries.
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c
index 15af99136cd..6fa1c6caa01 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.c
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.c
@@ -1,5 +1,6 @@
#include "main/mtypes.h"
+#include "main/formats.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
#include "main/imports.h"
@@ -83,47 +84,37 @@ driNewRenderbuffer(GLenum format, GLvoid *addr,
if (format == GL_RGBA || format == GL_RGB5 || format == GL_RGBA8) {
/* Color */
- drb->Base._BaseFormat = GL_RGBA;
drb->Base.DataType = GL_UNSIGNED_BYTE;
if (format == GL_RGB5) {
- drb->Base.RedBits = 5;
- drb->Base.GreenBits = 6;
- drb->Base.BlueBits = 5;
+ drb->Base.Format = MESA_FORMAT_RGB565;
}
else {
- drb->Base.RedBits =
- drb->Base.GreenBits =
- drb->Base.BlueBits =
- drb->Base.AlphaBits = 8;
+ drb->Base.Format = MESA_FORMAT_ARGB8888;
}
}
else if (format == GL_DEPTH_COMPONENT16) {
/* Depth */
- drb->Base._BaseFormat = GL_DEPTH_COMPONENT;
/* we always Get/Put 32-bit Z values */
drb->Base.DataType = GL_UNSIGNED_INT;
- drb->Base.DepthBits = 16;
+ drb->Base.Format = MESA_FORMAT_Z16;
}
else if (format == GL_DEPTH_COMPONENT24) {
/* Depth */
- drb->Base._BaseFormat = GL_DEPTH_COMPONENT;
/* we always Get/Put 32-bit Z values */
drb->Base.DataType = GL_UNSIGNED_INT;
- drb->Base.DepthBits = 24;
+ drb->Base.Format = MESA_FORMAT_Z32;
}
else if (format == GL_DEPTH_COMPONENT32) {
/* Depth */
- drb->Base._BaseFormat = GL_DEPTH_COMPONENT;
/* we always Get/Put 32-bit Z values */
drb->Base.DataType = GL_UNSIGNED_INT;
- drb->Base.DepthBits = 32;
+ drb->Base.Format = MESA_FORMAT_Z32;
}
else {
/* Stencil */
ASSERT(format == GL_STENCIL_INDEX8_EXT);
- drb->Base._BaseFormat = GL_STENCIL_INDEX;
drb->Base.DataType = GL_UNSIGNED_BYTE;
- drb->Base.StencilBits = 8;
+ drb->Base.Format = MESA_FORMAT_S8;
}
/* XXX if we were allocating a user-created renderbuffer, we'd have