i965: Finalize miptrees before prepare_texture
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 May 2017 17:57:33 +0000 (10:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 5 Jun 2017 16:26:22 +0000 (09:26 -0700)
In order to do resolves for texture views with different formats, we
need intel_texture_object::_Format to be valid.  Calling
intel_finalize_mipmap_tree can safely be done multiple times in a row
and should be a fairly cheap operation.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_context.c

index 9878cae..0a5120d 100644 (file)
@@ -253,6 +253,10 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
       tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current);
       if (!tex_obj || !tex_obj->mt)
         continue;
+
+      /* We need inte_texture_object::_Format to be valid */
+      intel_finalize_mipmap_tree(brw, i);
+
       if (intel_miptree_sample_with_hiz(brw, tex_obj->mt))
          intel_miptree_all_slices_resolve_hiz(brw, tex_obj->mt);
       else