[Mesa-dev] [PATCH v2 12/27] i965: Use create_for_dri_image in intel_update_image_buffer
Jason Ekstrand
jason at jlekstrand.net
Fri Jun 30 03:13:21 UTC 2017
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Chad Versace <chadversary at chromium.org>
---
src/mesa/drivers/dri/i965/brw_context.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 53e1a85..1c7cf90 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1702,16 +1702,21 @@ intel_update_image_buffer(struct brw_context *intel,
if (last_mt && last_mt->bo == buffer->bo)
return;
+ enum isl_colorspace colorspace;
+ switch (_mesa_get_format_color_encoding(intel_rb_format(rb))) {
+ case GL_SRGB:
+ colorspace = ISL_COLORSPACE_SRGB;
+ break;
+ case GL_LINEAR:
+ colorspace = ISL_COLORSPACE_LINEAR;
+ break;
+ default:
+ unreachable("Invalid color encoding");
+ }
+
struct intel_mipmap_tree *mt =
- intel_miptree_create_for_bo(intel,
- buffer->bo,
- intel_rb_format(rb),
- 0,
- buffer->width,
- buffer->height,
- 1,
- buffer->pitch,
- MIPTREE_LAYOUT_FOR_SCANOUT);
+ intel_miptree_create_for_dri_image(intel, buffer, GL_TEXTURE_2D,
+ colorspace, true);
if (!mt)
return;
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list