i965: Use create_for_dri_image in intel_update_image_buffer
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chadversary@chromium.org>
This commit is contained in:
@@ -1581,16 +1581,21 @@ intel_update_image_buffer(struct brw_context *intel,
|
|||||||
if (last_mt && last_mt->bo == buffer->bo)
|
if (last_mt && last_mt->bo == buffer->bo)
|
||||||
return;
|
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 =
|
struct intel_mipmap_tree *mt =
|
||||||
intel_miptree_create_for_bo(intel,
|
intel_miptree_create_for_dri_image(intel, buffer, GL_TEXTURE_2D,
|
||||||
buffer->bo,
|
colorspace, true);
|
||||||
intel_rb_format(rb),
|
|
||||||
0,
|
|
||||||
buffer->width,
|
|
||||||
buffer->height,
|
|
||||||
1,
|
|
||||||
buffer->pitch,
|
|
||||||
MIPTREE_LAYOUT_FOR_SCANOUT);
|
|
||||||
if (!mt)
|
if (!mt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user