diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2018-06-05 11:42:37 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-06-11 10:08:30 -0700 |
commit | 5fb59f46863c9a7381c89038cfb78375a159c1b7 (patch) | |
tree | 780949af2fab3e7d607cea28b6de4ea542f7b134 | |
parent | 47e22895ebb3e04fe58ffea69e200429d9ece4c1 (diff) |
i965/screen: Use RGBA non-sRGB formats for images
Not all of the MESA_FORMAT and ISL_FORMAT helpers we use can properly
handle RGBX formats. Also, we don't want to make decisions based on
those in the first place because we can't render to RGBA and we use the
non-sRGB version to determine whether or not to allow CCS_E.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 7ed8c125ad3df29ce1ae9fcb82762a589cd8817c)
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index a4b2c0b698..61e01c8c55 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -335,6 +335,10 @@ modifier_is_supported(const struct gen_device_info *devinfo, } mesa_format format = driImageFormatToGLFormat(dri_format); + /* Whether or not we support compression is based on the RGBA non-sRGB + * version of the format. + */ + format = _mesa_format_fallback_rgbx_to_rgba(format); format = _mesa_get_srgb_format_linear(format); if (!isl_format_supports_ccs_e(devinfo, brw_isl_format_for_mesa_format(format))) @@ -1088,6 +1092,11 @@ intel_create_image_from_fds_common(__DRIscreen *dri_screen, image->strides[index] = strides[index]; mesa_format format = driImageFormatToGLFormat(f->planes[i].dri_format); + /* The images we will create are actually based on the RGBA non-sRGB + * version of the format. + */ + format = _mesa_format_fallback_rgbx_to_rgba(format); + format = _mesa_get_srgb_format_linear(format); ok = isl_surf_init(&screen->isl_dev, &surf, .dim = ISL_SURF_DIM_2D, |