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

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Jason Ekstrand 2017-05-31 17:04:13 -07:00 committed by Kenneth Graunke
parent d9ed4f6c32
commit 52f39d6910
1 changed files with 4 additions and 0 deletions

View File

@ -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)