binding/unbinding a texture affects the previously specified parameters,
so ensure the driver flag for clamp emulation is also set to perform
updates as needed
Fixes:
e8f71f6ac48 ("mesa/st: add PIPE_CAP_GL_CLAMP")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17459>
*/
FLUSH_VERTICES(ctx, _NEW_TEXTURE_OBJECT, GL_TEXTURE_BIT);
+ /* if the previously bound texture uses GL_CLAMP, flag the driver here
+ * to ensure any emulation is disabled
+ */
+ if (texUnit->CurrentTex[targetIndex] &&
+ texUnit->CurrentTex[targetIndex]->Sampler.glclamp_mask !=
+ texObj->Sampler.glclamp_mask)
+ ctx->NewDriverState |= ctx->DriverFlags.NewSamplersWithClamp;
+
/* If the refcount on the previously bound texture is decremented to
* zero, it'll be deleted here.
*/