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.
*/
#define ST_CONTEXT_H
#include "main/mtypes.h"
-#include "pipe/p_state.h"
#include "state_tracker/st_api.h"
#include "main/fbobject.h"
#include "state_tracker/st_atom.h"
+#include "util/u_inlines.h"
#ifdef __cplusplus
void st_invalidate_state(struct gl_context * ctx, GLbitfield new_state);
-void st_invalidate_readpix_cache(struct st_context *st);
+/* Invalidate the readpixels cache to ensure we don't read stale data.
+ */
+static inline void
+st_invalidate_readpix_cache(struct st_context *st)
+{
+ if (unlikely(st->readpix_cache.src)) {
+ pipe_resource_reference(&st->readpix_cache.src, NULL);
+ pipe_resource_reference(&st->readpix_cache.cache, NULL);
+ }
+}
#define Y_0_TOP 1