summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/osmesa/osmesa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/osmesa/osmesa.c')
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 904659e3450..bac8a9ef142 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -37,6 +37,7 @@
#include "GL/osmesa.h"
#include "main/context.h"
#include "main/extensions.h"
+#include "main/formats.h"
#include "main/framebuffer.h"
#include "main/imports.h"
#include "main/mtypes.h"
@@ -50,6 +51,7 @@
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
#include "vbo/vbo.h"
@@ -839,11 +841,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
else
bpc = 32;
- rb->RedBits =
- rb->GreenBits =
- rb->BlueBits =
- rb->AlphaBits = bpc;
-
/* Note: we can ignoring internalFormat for "window-system" renderbuffers */
(void) internalFormat;
@@ -875,7 +872,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutValues = put_values_RGBA32;
rb->PutMonoValues = put_mono_values_RGBA32;
}
- rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = bpc;
}
else if (osmesa->format == OSMESA_BGRA) {
if (rb->DataType == GL_UNSIGNED_BYTE) {
@@ -905,7 +901,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutValues = put_values_BGRA32;
rb->PutMonoValues = put_mono_values_BGRA32;
}
- rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = bpc;
}
else if (osmesa->format == OSMESA_ARGB) {
if (rb->DataType == GL_UNSIGNED_BYTE) {
@@ -935,7 +930,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutValues = put_values_ARGB32;
rb->PutMonoValues = put_mono_values_ARGB32;
}
- rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = bpc;
}
else if (osmesa->format == OSMESA_RGB) {
if (rb->DataType == GL_UNSIGNED_BYTE) {
@@ -965,7 +959,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutValues = put_values_RGB32;
rb->PutMonoValues = put_mono_values_RGB32;
}
- rb->RedBits = rb->GreenBits = rb->BlueBits = bpc;
}
else if (osmesa->format == OSMESA_BGR) {
if (rb->DataType == GL_UNSIGNED_BYTE) {
@@ -995,7 +988,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutValues = put_values_BGR32;
rb->PutMonoValues = put_mono_values_BGR32;
}
- rb->RedBits = rb->GreenBits = rb->BlueBits = bpc;
}
else if (osmesa->format == OSMESA_RGB_565) {
ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
@@ -1006,9 +998,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_RGB_565;
rb->PutValues = put_values_RGB_565;
rb->PutMonoValues = put_mono_values_RGB_565;
- rb->RedBits = 5;
- rb->GreenBits = 6;
- rb->BlueBits = 5;
}
else if (osmesa->format == OSMESA_COLOR_INDEX) {
rb->GetRow = get_row_CI;
@@ -1017,7 +1006,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_CI;
rb->PutValues = put_values_CI;
rb->PutMonoValues = put_mono_values_CI;
- rb->IndexBits = 8;
}
else {
_mesa_problem(ctx, "bad pixel format in osmesa renderbuffer_storage");
@@ -1047,13 +1035,13 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type)
if (format == OSMESA_COLOR_INDEX) {
rb->InternalFormat = GL_COLOR_INDEX;
- rb->_ActualFormat = GL_COLOR_INDEX8_EXT;
+ rb->Format = MESA_FORMAT_CI8;
rb->_BaseFormat = GL_COLOR_INDEX;
rb->DataType = GL_UNSIGNED_BYTE;
}
else {
rb->InternalFormat = GL_RGBA;
- rb->_ActualFormat = GL_RGBA;
+ rb->Format = MESA_FORMAT_RGBA8888;
rb->_BaseFormat = GL_RGBA;
rb->DataType = type;
}
@@ -1258,6 +1246,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
osmesa->bInd = bind;
osmesa->aInd = aind;
+ _mesa_meta_init(&osmesa->mesa);
+
/* Initialize the software rasterizer and helper modules. */
{
GLcontext *ctx = &osmesa->mesa;
@@ -1304,6 +1294,8 @@ OSMesaDestroyContext( OSMesaContext osmesa )
if (osmesa->rb)
_mesa_reference_renderbuffer(&osmesa->rb, NULL);
+ _mesa_meta_free( &osmesa->mesa );
+
_swsetup_DestroyContext( &osmesa->mesa );
_tnl_DestroyContext( &osmesa->mesa );
_vbo_DestroyContext( &osmesa->mesa );