To comply with the requirement from the GL_OES_EGL_image_external
extension that a call to glBindTexture guarantees that all further
sampling will return values that correspond to the values in the
external texture at or after the time that glBindTexture was called,
do not bail out early from mesa_BindTextures if the target is
external.
This will later allow the state tracker to instruct the pipe driver
to invalidate internal resources derived from the external texture.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
assert(targetIndex < NUM_TEXTURE_TARGETS);
/* Check if this texture is only used by this context and is already bound.
- * If so, just return.
+ * If so, just return. For GL_OES_image_external, rebinding the texture
+ * always must invalidate cached resources.
*/
- {
+ if (targetIndex != TEXTURE_EXTERNAL_INDEX) {
bool early_out;
mtx_lock(&ctx->Shared->Mutex);
early_out = ((ctx->Shared->RefCount == 1)