summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-16 12:03:09 -0700
committerBrian Paul <[email protected]>2012-01-24 14:12:24 -0700
commitf9874feef4d8952df5054bd8e8f4e0deda4ef44f (patch)
treed3ac6f1405c4557b599332a0e4b99ab77884f349 /src/mesa/drivers/dri
parent1e1b5cb01a10e39d01923e3c7e989c44210950cd (diff)
mesa: remove gl_renderbuffer::DataType
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_hiz.c1
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fbo.c5
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_fbo.c80
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c2
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c4
7 files changed, 2 insertions, 96 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_hiz.c b/src/mesa/drivers/dri/i965/gen6_hiz.c
index 4d36729e7c5..d7698ed2aa2 100644
--- a/src/mesa/drivers/dri/i965/gen6_hiz.c
+++ b/src/mesa/drivers/dri/i965/gen6_hiz.c
@@ -230,7 +230,6 @@ gen6_hiz_setup_depth_buffer(struct brw_context *brw,
rb->Format = mt->format;
rb->_BaseFormat = _mesa_get_format_base_format(rb->Format);
- rb->DataType = intel_mesa_format_to_rb_datatype(rb->Format);
rb->InternalFormat = rb->_BaseFormat;
rb->Width = mt->level[level].width;
rb->Height = mt->level[level].height;
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index bd4fc7f589d..e13d62cc914 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -237,7 +237,6 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
rb->Width = width;
rb->Height = height;
rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
- rb->DataType = intel_mesa_format_to_rb_datatype(rb->Format);
intel_miptree_release(&irb->mt);
@@ -303,7 +302,6 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
rb->Width = image->region->width;
rb->Height = image->region->height;
rb->Format = image->format;
- rb->DataType = image->data_type;
rb->_BaseFormat = _mesa_base_fbo_format(&intel->ctx,
image->internal_format);
}
@@ -385,7 +383,6 @@ intel_create_renderbuffer(gl_format format)
irb->Base._BaseFormat = _mesa_get_format_base_format(format);
irb->Base.Format = format;
irb->Base.InternalFormat = irb->Base._BaseFormat;
- irb->Base.DataType = intel_mesa_format_to_rb_datatype(format);
/* intel-specific methods */
irb->Base.Delete = intel_delete_renderbuffer;
@@ -486,7 +483,6 @@ intel_renderbuffer_update_wrapper(struct intel_context *intel,
rb->Format = format;
rb->InternalFormat = internal_format;
- rb->DataType = intel_mesa_format_to_rb_datatype(rb->Format);
rb->_BaseFormat = _mesa_get_format_base_format(rb->Format);
rb->Width = mt->level[level].width;
rb->Height = mt->level[level].height;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 094ff568c44..3d5689ab79e 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -208,7 +208,7 @@ intel_create_image_from_renderbuffer(__DRIcontext *context,
image->internal_format = rb->InternalFormat;
image->format = rb->Format;
- image->data_type = rb->DataType;
+ image->data_type = GL_UNSIGNED_BYTE;
image->data = loaderPrivate;
intel_region_reference(&image->region, irb->mt->region);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
index d56e954e45a..6f4956efe8c 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
@@ -46,26 +46,22 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat)
case GL_RGB8:
rb->_BaseFormat = GL_RGB;
rb->Format = MESA_FORMAT_XRGB8888;
- rb->DataType = GL_UNSIGNED_BYTE;
s->cpp = 4;
break;
case GL_RGBA:
case GL_RGBA8:
rb->_BaseFormat = GL_RGBA;
rb->Format = MESA_FORMAT_ARGB8888;
- rb->DataType = GL_UNSIGNED_BYTE;
s->cpp = 4;
break;
case GL_RGB5:
rb->_BaseFormat = GL_RGB;
rb->Format = MESA_FORMAT_RGB565;
- rb->DataType = GL_UNSIGNED_BYTE;
s->cpp = 2;
break;
case GL_DEPTH_COMPONENT16:
rb->_BaseFormat = GL_DEPTH_COMPONENT;
rb->Format = MESA_FORMAT_Z16;
- rb->DataType = GL_UNSIGNED_SHORT;
s->cpp = 2;
break;
case GL_DEPTH_COMPONENT:
@@ -74,7 +70,6 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat)
case GL_DEPTH24_STENCIL8_EXT:
rb->_BaseFormat = GL_DEPTH_STENCIL;
rb->Format = MESA_FORMAT_Z24_S8;
- rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
s->cpp = 4;
break;
default:
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index a0d79560818..026587c1bab 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -481,7 +481,6 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe
case GL_RGB4:
case GL_RGB5:
rb->Format = _radeon_texformat_rgb565;
- rb->DataType = GL_UNSIGNED_BYTE;
cpp = 2;
break;
case GL_RGB:
@@ -490,7 +489,6 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe
case GL_RGB12:
case GL_RGB16:
rb->Format = _radeon_texformat_argb8888;
- rb->DataType = GL_UNSIGNED_BYTE;
cpp = 4;
break;
case GL_RGBA:
@@ -502,7 +500,6 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe
case GL_RGBA12:
case GL_RGBA16:
rb->Format = _radeon_texformat_argb8888;
- rb->DataType = GL_UNSIGNED_BYTE;
cpp = 4;
break;
case GL_STENCIL_INDEX:
@@ -512,25 +509,21 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe
case GL_STENCIL_INDEX16_EXT:
/* alloc a depth+stencil buffer */
rb->Format = MESA_FORMAT_S8_Z24;
- rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
cpp = 4;
break;
case GL_DEPTH_COMPONENT16:
rb->Format = MESA_FORMAT_Z16;
- rb->DataType = GL_UNSIGNED_SHORT;
cpp = 2;
break;
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
rb->Format = MESA_FORMAT_X8_Z24;
- rb->DataType = GL_UNSIGNED_INT;
cpp = 4;
break;
case GL_DEPTH_STENCIL_EXT:
case GL_DEPTH24_STENCIL8_EXT:
rb->Format = MESA_FORMAT_S8_Z24;
- rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
cpp = 4;
break;
default:
@@ -604,7 +597,6 @@ radeon_image_target_renderbuffer_storage(struct gl_context *ctx,
rb->Width = image->width;
rb->Height = image->height;
rb->Format = image->format;
- rb->DataType = image->data_type;
rb->_BaseFormat = _mesa_base_fbo_format(radeon->glCtx,
image->internal_format);
}
@@ -696,49 +688,6 @@ radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv)
rrb->base.Format = format;
- switch (format) {
- case MESA_FORMAT_RGB565:
- assert(_mesa_little_endian());
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_RGB565_REV:
- assert(!_mesa_little_endian());
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_XRGB8888:
- assert(_mesa_little_endian());
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_XRGB8888_REV:
- assert(!_mesa_little_endian());
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_ARGB8888:
- assert(_mesa_little_endian());
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_ARGB8888_REV:
- assert(!_mesa_little_endian());
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_S8:
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_Z16:
- rrb->base.DataType = GL_UNSIGNED_SHORT;
- break;
- case MESA_FORMAT_X8_Z24:
- rrb->base.DataType = GL_UNSIGNED_INT;
- break;
- case MESA_FORMAT_S8_Z24:
- rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT;
- break;
- default:
- fprintf(stderr, "%s: Unknown format %s\n",
- __FUNCTION__, _mesa_get_format_name(format));
- _mesa_delete_renderbuffer(&rrb->base);
- return NULL;
- }
rrb->base._BaseFormat = _mesa_get_format_base_format(format);
rrb->dPriv = driDrawPriv;
@@ -816,35 +765,6 @@ radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb,
"%s(%p, rrb %p, texImage %p, texFormat %s) \n",
__func__, ctx, rrb, texImage, _mesa_get_format_name(texImage->TexFormat));
- switch (texImage->TexFormat) {
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_XRGB8888_REV:
- case MESA_FORMAT_RGB565:
- case MESA_FORMAT_RGB565_REV:
- case MESA_FORMAT_RGBA5551:
- case MESA_FORMAT_ARGB1555:
- case MESA_FORMAT_ARGB1555_REV:
- case MESA_FORMAT_ARGB4444:
- case MESA_FORMAT_ARGB4444_REV:
- rrb->base.DataType = GL_UNSIGNED_BYTE;
- break;
- case MESA_FORMAT_Z16:
- rrb->base.DataType = GL_UNSIGNED_SHORT;
- break;
- case MESA_FORMAT_X8_Z24:
- rrb->base.DataType = GL_UNSIGNED_INT;
- break;
- case MESA_FORMAT_S8_Z24:
- rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT;
- break;
- default:
- _mesa_problem(ctx, "Unexpected texture format in radeon_update_wrapper()");
- }
-
rrb->cpp = _mesa_get_format_bytes(texImage->TexFormat);
rrb->pitch = texImage->Width * rrb->cpp;
rrb->base.Format = texImage->TexFormat;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index a5dff983aa9..06eadd2262e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -282,7 +282,7 @@ radeon_create_image_from_renderbuffer(__DRIcontext *context,
image->internal_format = rb->InternalFormat;
image->format = rb->Format;
image->cpp = rrb->cpp;
- image->data_type = rb->DataType;
+ image->data_type = GL_UNSIGNED_BYTE;
image->data = loaderPrivate;
radeon_bo_ref(rrb->bo);
image->bo = rrb->bo;
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index efc55272508..19da7028e8a 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -344,28 +344,24 @@ swrast_new_renderbuffer(const struct gl_config *visual, __DRIdrawable *dPriv,
xrb->Base.Format = MESA_FORMAT_ARGB8888;
xrb->Base.InternalFormat = GL_RGBA;
xrb->Base._BaseFormat = GL_RGBA;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
xrb->bpp = 32;
break;
case PF_X8R8G8B8:
xrb->Base.Format = MESA_FORMAT_ARGB8888; /* XXX */
xrb->Base.InternalFormat = GL_RGB;
xrb->Base._BaseFormat = GL_RGB;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
xrb->bpp = 32;
break;
case PF_R5G6B5:
xrb->Base.Format = MESA_FORMAT_RGB565;
xrb->Base.InternalFormat = GL_RGB;
xrb->Base._BaseFormat = GL_RGB;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
xrb->bpp = 16;
break;
case PF_R3G3B2:
xrb->Base.Format = MESA_FORMAT_RGB332;
xrb->Base.InternalFormat = GL_RGB;
xrb->Base._BaseFormat = GL_RGB;
- xrb->Base.DataType = GL_UNSIGNED_BYTE;
xrb->bpp = 8;
break;
default: