X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi965%2Fintel_tex_validate.c;h=08cf3bf7dc16d589791fa963bc2898de5006be2e;hb=8ce2afe776eee8444d7dd00b3e93ab2ed399903d;hp=3a811e10359ecd87cc17536321721a7dabd30442;hpb=320ccf710e337ae443128ae37c3dfa2f74efb2d0;p=mesa.git diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c index 3a811e10359..08cf3bf7dc1 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c @@ -64,7 +64,7 @@ intel_update_max_level(struct intel_texture_object *intelObj, * BaseLevel/MaxLevel/filtering, and copy in any texture images that are * stored in other miptrees. */ -GLuint +void intel_finalize_mipmap_tree(struct brw_context *brw, GLuint unit) { struct gl_context *ctx = &brw->ctx; @@ -78,7 +78,7 @@ intel_finalize_mipmap_tree(struct brw_context *brw, GLuint unit) /* TBOs require no validation -- they always just point to their BO. */ if (tObj->Target == GL_TEXTURE_BUFFER) - return true; + return; /* We know that this is true by now, and if it wasn't, we might have * mismatched level sizes and the copies would fail. @@ -98,7 +98,7 @@ intel_finalize_mipmap_tree(struct brw_context *brw, GLuint unit) if (!intelObj->needs_validate && validate_first_level >= intelObj->validated_first_level && validate_last_level <= intelObj->validated_last_level) { - return true; + return; } /* On recent generations, immutable textures should not get this far @@ -149,7 +149,7 @@ intel_finalize_mipmap_tree(struct brw_context *brw, GLuint unit) 0 /* num_samples */, layout_flags); if (!intelObj->mt) - return false; + return; } /* Pull in any images not in the object's tree: @@ -180,6 +180,23 @@ intel_finalize_mipmap_tree(struct brw_context *brw, GLuint unit) intelObj->validated_last_level = validate_last_level; intelObj->_Format = intelObj->mt->format; intelObj->needs_validate = false; +} - return true; +/** + * Finalizes all textures, completing any rendering that needs to be done + * to prepare them. + */ +void +brw_validate_textures(struct brw_context *brw) +{ + struct gl_context *ctx = &brw->ctx; + const int max_enabled_unit = ctx->Texture._MaxEnabledTexImageUnit; + + for (int unit = 0; unit <= max_enabled_unit; unit++) { + struct gl_texture_unit *tex_unit = &ctx->Texture.Unit[unit]; + + if (tex_unit->_Current) { + intel_finalize_mipmap_tree(brw, unit); + } + } }