mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
intel: Skip texture validation logic when nothing has changed.
Improves GLBenchmark 2.1 offscreen performance by 3.2% +/- 1.5% (n=52). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
73c376bbde
commit
2f225f6145
5 changed files with 30 additions and 2 deletions
|
|
@ -771,6 +771,8 @@ intel_miptree_copy_teximage(struct intel_context *intel,
|
|||
struct intel_mipmap_tree *dst_mt)
|
||||
{
|
||||
struct intel_mipmap_tree *src_mt = intelImage->mt;
|
||||
struct intel_texture_object *intel_obj =
|
||||
intel_texture_object(intelImage->base.Base.TexObject);
|
||||
int level = intelImage->base.Base.Level;
|
||||
int face = intelImage->base.Base.Face;
|
||||
GLuint depth = intelImage->base.Base.Depth;
|
||||
|
|
@ -780,6 +782,7 @@ intel_miptree_copy_teximage(struct intel_context *intel,
|
|||
}
|
||||
|
||||
intel_miptree_reference(&intelImage->mt, dst_mt);
|
||||
intel_obj->needs_validate = true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
|
|||
DBG("%s\n", __FUNCTION__);
|
||||
_mesa_initialize_texture_object(&obj->base, name, target);
|
||||
|
||||
obj->needs_validate = true;
|
||||
|
||||
return &obj->base;
|
||||
}
|
||||
|
||||
|
|
@ -107,6 +109,8 @@ intel_alloc_texture_image_buffer(struct gl_context *ctx,
|
|||
image->Width, image->Height, image->Depth, intel_image->mt);
|
||||
}
|
||||
|
||||
intel_texobj->needs_validate = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -274,6 +274,7 @@ intel_set_texture_image_region(struct gl_context *ctx,
|
|||
region);
|
||||
if (intel_image->mt == NULL)
|
||||
return;
|
||||
intel_texobj->needs_validate = true;
|
||||
|
||||
intel_image->mt->offset = offset;
|
||||
intel_image->base.RowStride = region->pitch;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@ struct intel_texture_object
|
|||
* regions will be copied to this region and the old storage freed.
|
||||
*/
|
||||
struct intel_mipmap_tree *mt;
|
||||
|
||||
/**
|
||||
* Set when mipmap trees in the texture images of this texture object
|
||||
* might not all be the mipmap tree above.
|
||||
*/
|
||||
bool needs_validate;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,12 +21,18 @@ intel_update_max_level(struct intel_texture_object *intelObj,
|
|||
struct gl_sampler_object *sampler)
|
||||
{
|
||||
struct gl_texture_object *tObj = &intelObj->base;
|
||||
int maxlevel;
|
||||
|
||||
if (sampler->MinFilter == GL_NEAREST ||
|
||||
sampler->MinFilter == GL_LINEAR) {
|
||||
intelObj->_MaxLevel = tObj->BaseLevel;
|
||||
maxlevel = tObj->BaseLevel;
|
||||
} else {
|
||||
intelObj->_MaxLevel = tObj->_MaxLevel;
|
||||
maxlevel = tObj->_MaxLevel;
|
||||
}
|
||||
|
||||
if (intelObj->_MaxLevel != maxlevel) {
|
||||
intelObj->_MaxLevel = maxlevel;
|
||||
intelObj->needs_validate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -55,6 +61,12 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
|
|||
/* What levels must the tree include at a minimum?
|
||||
*/
|
||||
intel_update_max_level(intelObj, sampler);
|
||||
if (intelObj->mt && intelObj->mt->first_level != tObj->BaseLevel)
|
||||
intelObj->needs_validate = true;
|
||||
|
||||
if (!intelObj->needs_validate)
|
||||
return true;
|
||||
|
||||
firstImage = intel_texture_image(tObj->Image[0][tObj->BaseLevel]);
|
||||
|
||||
/* Check tree can hold all active levels. Check tree matches
|
||||
|
|
@ -122,6 +134,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
|
|||
}
|
||||
}
|
||||
|
||||
intelObj->needs_validate = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue