Reviewed-by: Marek Olšák <marek.olsak@amd.com>
return success;
}
+/* Invalidate the readpixels cache to ensure we don't read stale data.
+ */
+void st_invalidate_readpix_cache(struct st_context *st)
+{
+ pipe_resource_reference(&st->readpix_cache.src, NULL);
+ pipe_resource_reference(&st->readpix_cache.cache, NULL);
+}
+
/**
* Create a staging texture and blit the requested region to it.
*/
free(st->drawpix_cache.image);
pipe_resource_reference(&st->drawpix_cache.texture, NULL);
+ /* free glReadPixels cache data */
+ st_invalidate_readpix_cache(st);
+
cso_destroy_context(st->cso_context);
free( st );
}
struct pipe_resource *texture;
} drawpix_cache;
+ /** for glReadPixels */
+ struct {
+ struct pipe_resource *src;
+ struct pipe_resource *cache;
+ enum pipe_format dst_format;
+ unsigned level;
+ unsigned layer;
+ unsigned hits;
+ } readpix_cache;
+
/** for glClear */
struct {
struct pipe_rasterizer_state raster;
void st_invalidate_state(struct gl_context * ctx, GLbitfield new_state);
+void st_invalidate_readpix_cache(struct st_context *st);
#define Y_0_TOP 1