DBG("%s\n", __func__);
_mesa_initialize_texture_object(ctx, &obj->base, name, target);
+ obj->needs_validation = true;
+
return &obj->base;
}
assert(!stImage->pt); /* xxx this might be wrong */
+ stObj->needs_validation = true;
+
etc_fallback_allocate(st, stImage);
/* Look if the parent texture object has space for this image */
firstImage = st_texture_image_const(stObj->base.Image[cubeMapFace][stObj->base.BaseLevel]);
assert(firstImage);
+ /* Skip the loop over images in the common case of no images having
+ * changed. But if the GL_BASE_LEVEL or GL_MAX_LEVEL change to something we
+ * haven't looked at, then we do need to look at those new images.
+ */
+ if (!stObj->needs_validation &&
+ stObj->base.BaseLevel >= stObj->validated_first_level &&
+ stObj->lastLevel <= stObj->validated_last_level) {
+ return GL_TRUE;
+ }
+
/* If both firstImage and stObj point to a texture which can contain
* all active images, favour firstImage. Note that because of the
* completeness requirement, we know that the image dimensions
}
}
+ stObj->validated_first_level = stObj->base.BaseLevel;
+ stObj->validated_last_level = stObj->lastLevel;
+ stObj->needs_validation = false;
+
return GL_TRUE;
}
}
}
+ /* The texture is in a validated state, so no need to check later. */
+ stObj->needs_validation = false;
+ stObj->validated_first_level = 0;
+ stObj->validated_last_level = levels - 1;
+
return GL_TRUE;
}
*/
st_texture_release_all_sampler_views(st, tex);
+ /* The texture is in a validated state, so no need to check later. */
+ tex->needs_validation = false;
+ tex->validated_first_level = 0;
+ tex->validated_last_level = numLevels - 1;
+
return GL_TRUE;
}
*/
GLuint lastLevel;
+ unsigned int validated_first_level;
+ unsigned int validated_last_level;
+
/* On validation any active images held in main memory or in other
* textures will be copied to this texture and the old storage freed.
*/
unsigned prev_glsl_version;
/** The value of the sampler's sRGBDecode state at the previous validation */
GLenum prev_sRGBDecode;
+
+ /**
+ * Set when the texture images of this texture object might not all be in
+ * the pipe_resource *pt above.
+ */
+ bool needs_validation;
};