summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/osmesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-03-30 16:33:35 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-03-30 16:33:35 +0000
commit9e81d6ae3a6db9831d6aea0fe4d92722176e9f74 (patch)
treefa81a73c9356c0add97e8339960258b8a2653076 /src/mesa/drivers/osmesa
parent94d6bf883b3c2bfa52e178aa8abf5929ff524949 (diff)
When creating front/back renderbuffers, init the Red/Green/Blue/AlphaBits fields
Diffstat (limited to 'src/mesa/drivers/osmesa')
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 8afd0a7176..2ba3b81706 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -601,6 +601,7 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
{
const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
+ /* Note: we can ignoring internalFormat for "window-system" renderbuffers */
if (osmesa->format == OSMESA_RGBA) {
rb->GetRow = get_row_RGBA;
rb->GetValues = get_values_RGBA;
@@ -609,6 +610,10 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_RGBA;
rb->PutValues = put_values_RGBA;
rb->PutMonoValues = put_mono_values_RGBA;
+ rb->RedBits =
+ rb->GreenBits =
+ rb->BlueBits =
+ rb->AlphaBits = 8 * sizeof(GLchan);
}
else if (osmesa->format == OSMESA_BGRA) {
rb->GetRow = get_row_BGRA;
@@ -618,6 +623,10 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_BGRA;
rb->PutValues = put_values_BGRA;
rb->PutMonoValues = put_mono_values_BGRA;
+ rb->RedBits =
+ rb->GreenBits =
+ rb->BlueBits =
+ rb->AlphaBits = 8 * sizeof(GLchan);
}
else if (osmesa->format == OSMESA_ARGB) {
rb->GetRow = get_row_ARGB;
@@ -627,6 +636,10 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_ARGB;
rb->PutValues = put_values_ARGB;
rb->PutMonoValues = put_mono_values_ARGB;
+ rb->RedBits =
+ rb->GreenBits =
+ rb->BlueBits =
+ rb->AlphaBits = 8 * sizeof(GLchan);
}
else if (osmesa->format == OSMESA_RGB) {
rb->GetRow = get_row_RGB;
@@ -636,6 +649,9 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_RGB;
rb->PutValues = put_values_RGB;
rb->PutMonoValues = put_mono_values_RGB;
+ rb->RedBits =
+ rb->GreenBits =
+ rb->BlueBits = 8 * sizeof(GLchan);
}
else if (osmesa->format == OSMESA_BGR) {
rb->GetRow = get_row_BGR;
@@ -645,6 +661,9 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_BGR;
rb->PutValues = put_values_BGR;
rb->PutMonoValues = put_mono_values_BGR;
+ rb->RedBits =
+ rb->GreenBits =
+ rb->BlueBits = 8 * sizeof(GLchan);
}
#if CHAN_TYPE == GL_UNSIGNED_BYTE
else if (osmesa->format == OSMESA_RGB_565) {
@@ -655,6 +674,9 @@ 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;
}
#endif
else if (osmesa->format == OSMESA_COLOR_INDEX) {
@@ -664,6 +686,7 @@ 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");