Mesa (master): i965/tex: Check if there is data to upload up-front

Kenneth Graunke kwg at kemper.freedesktop.org
Fri Oct 13 04:44:56 UTC 2017


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed May 31 17:04:13 2017 -0700

i965/tex: Check if there is data to upload up-front

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/intel_tex_image.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 7396597d9f..69860e28e3 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -296,6 +296,10 @@ intel_upload_tex(struct gl_context * ctx,
    struct intel_mipmap_tree *mt = intel_texture_image(texImage)->mt;
    bool ok;
 
+   /* Check that there is actually data to store. */
+   if (pixels == NULL && !_mesa_is_bufferobj(packing->BufferObj))
+      return;
+
    bool tex_busy = mt && brw_bo_busy(mt->bo);
 
    if (mt && mt->format == MESA_FORMAT_S_UINT8)




More information about the mesa-commit mailing list