summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2012-07-05 00:07:15 -0400
committerKristian Høgsberg <[email protected]>2012-07-05 14:22:07 -0400
commit454fc07ddefe2b750d78c94e8d52a11a8741c42f (patch)
tree3eb53ea2eec8de3d6c123fa6e38ad800f8294f17
parente408c17767c82c3bbd32d0386d5d9141c1fb20dc (diff)
intel: Just look up image->internal_format using _mesa_get_format_base_format
Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 1cbd249653f..5fc56f7ca20 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -193,29 +193,25 @@ intel_create_image_from_name(__DRIscreen *screen,
switch (format) {
case __DRI_IMAGE_FORMAT_RGB565:
image->format = MESA_FORMAT_RGB565;
- image->internal_format = GL_RGB;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
image->format = MESA_FORMAT_XRGB8888;
- image->internal_format = GL_RGB;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
image->format = MESA_FORMAT_ARGB8888;
- image->internal_format = GL_RGBA;
break;
case __DRI_IMAGE_FORMAT_ABGR8888:
image->format = MESA_FORMAT_RGBA8888_REV;
- image->internal_format = GL_RGBA;
break;
case __DRI_IMAGE_FORMAT_XBGR8888:
image->format = MESA_FORMAT_RGBX8888_REV;
- image->internal_format = GL_RGB;
break;
default:
free(image);
return NULL;
}
+ image->internal_format = _mesa_get_format_base_format(image->format);
image->data = loaderPrivate;
cpp = _mesa_get_format_bytes(image->format);
@@ -314,29 +310,25 @@ intel_create_image(__DRIscreen *screen,
switch (format) {
case __DRI_IMAGE_FORMAT_RGB565:
image->format = MESA_FORMAT_RGB565;
- image->internal_format = GL_RGB;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
image->format = MESA_FORMAT_XRGB8888;
- image->internal_format = GL_RGB;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
image->format = MESA_FORMAT_ARGB8888;
- image->internal_format = GL_RGBA;
break;
case __DRI_IMAGE_FORMAT_ABGR8888:
image->format = MESA_FORMAT_RGBA8888_REV;
- image->internal_format = GL_RGBA;
break;
case __DRI_IMAGE_FORMAT_XBGR8888:
image->format = MESA_FORMAT_RGBX8888_REV;
- image->internal_format = GL_RGB;
break;
default:
free(image);
return NULL;
}
+ image->internal_format = _mesa_get_format_base_format(image->format);
image->data = loaderPrivate;
cpp = _mesa_get_format_bytes(image->format);