Mesa (master): i965: Allocate texture buffer in intelTexImage

Anuj Phogat aphogat at kemper.freedesktop.org
Wed Feb 25 22:25:44 UTC 2015


Module: Mesa
Branch: master
Commit: 94d88cb46870ad7da8ae9e98ace524319c45bb8b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=94d88cb46870ad7da8ae9e98ace524319c45bb8b

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Thu Feb  5 12:24:57 2015 -0800

i965: Allocate texture buffer in intelTexImage

before calling _mesa_meta_pbo_TexSubImage(). This will be used in
later patches and will be required in Skylake to get the tile
resource mode of miptree before calling _mesa_meta_pbo_TexSubImage().

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Neil Roberts <neil at linux.intel.com>

---

 src/mesa/drivers/dri/i965/intel_tex_image.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 6eebfc4..da42fdd 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -103,11 +103,20 @@ intelTexImage(struct gl_context * ctx,
        _mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type),
        texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
 
+   /* Allocate storage for texture data. */
+   if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage)) {
+      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage%uD", dims);
+      return;
+   }
+
+   assert(intelImage->mt);
+
    ok = _mesa_meta_pbo_TexSubImage(ctx, dims, texImage, 0, 0, 0,
                                    texImage->Width, texImage->Height,
                                    texImage->Depth,
                                    format, type, pixels,
-                                   true, tex_busy, unpack);
+                                   false /*allocate_storage*/,
+                                   tex_busy, unpack);
    if (ok)
       return;
 
@@ -117,7 +126,7 @@ intelTexImage(struct gl_context * ctx,
                                        texImage->Height,
                                        texImage->Depth,
                                        format, type, pixels, unpack,
-                                       true /*for_glTexImage*/);
+                                       false /*allocate_storage*/);
    if (ok)
       return;
 




More information about the mesa-commit mailing list