diff options
author | Kristian Høgsberg <[email protected]> | 2012-07-16 10:54:30 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2012-07-16 11:00:16 -0400 |
commit | 636646a481ef6ce29e74e4604125a42def3ed1e5 (patch) | |
tree | 87232e77e17dea6b1a2fb373db4d4285e5a06705 /src | |
parent | 81de0431d6f52084e01874163657e141e6beffdf (diff) |
intel: Don't call _mesa_get_format_bytes for MESA_FORMAT_NONE
When we don't intend to texture from or render to a __DRIimage we
use __DRI_IMAGE_FORMAT_NONE. In that case, we just create the __DRIimage
to reference the underlying buffer, and will create usable __DRIimages
from it using createSubImage later.
If we try to use _mesa_get_format_bytes() on MESA_FORMAT_NONE in
a debug build, we hit an assertion, so let's not do that.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 3638d0d13cb..bcd85e93dc4 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -233,7 +233,10 @@ intel_create_image_from_name(__DRIscreen *screen, int cpp; image = intel_allocate_image(format, loaderPrivate); - cpp = _mesa_get_format_bytes(image->format); + if (image->format == MESA_FORMAT_NONE) + cpp = 0; + else + cpp = _mesa_get_format_bytes(image->format); image->region = intel_region_alloc_for_handle(intelScreen, cpp, width, height, pitch, name, "image"); |