aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-06-16 10:28:39 -0700
committerJason Ekstrand <[email protected]>2017-07-12 21:15:46 -0700
commitb3a44ae7a4168677ae855563d80723895e87966b (patch)
tree0c6ff7c3fdaa02cc98f2f1ff184357bd80be9417 /src/mesa
parent90d93755d17397bb2b27fece9aec02914e31e9b7 (diff)
i965: Use create_for_dri_image in intel_update_image_buffer
Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c23
1 files 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 c1a429bfcbe..5c57b864c29 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1581,16 +1581,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;