st/mesa: invalidate readpixels cache
Whenever a draw happens or some other function call might change the result of future glReadPixels calls, we must invalidate the cache. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -113,6 +113,7 @@ update_framebuffer_state( struct st_context *st )
|
||||
GLuint i;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
st->state.fb_orientation = st_fb_orientation(fb);
|
||||
|
||||
|
@@ -636,6 +636,8 @@ st_Bitmap(struct gl_context *ctx, GLint x, GLint y,
|
||||
assert(width > 0);
|
||||
assert(height > 0);
|
||||
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
if (!st->bitmap.cache) {
|
||||
init_bitmap_state(st);
|
||||
}
|
||||
@@ -702,6 +704,7 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
|
||||
st_flush_bitmap_cache(st);
|
||||
|
||||
st_validate_state(st, ST_PIPELINE_RENDER);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
sv = st_create_texture_sampler_view(pipe, stObj->pt);
|
||||
if (!sv) {
|
||||
|
@@ -97,6 +97,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
|
||||
|
||||
/* Make sure bitmap rendering has landed in the framebuffers */
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
clip.srcX0 = srcX0;
|
||||
clip.srcY0 = srcY0;
|
||||
|
@@ -401,6 +401,7 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
|
||||
GLuint i;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
/* This makes sure the pipe has the latest scissor, etc values */
|
||||
st_validate_state( st, ST_PIPELINE_RENDER );
|
||||
|
@@ -46,6 +46,7 @@ static void st_dispatch_compute_common(struct gl_context *ctx,
|
||||
struct pipe_grid_info info = { 0 };
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
if (ctx->NewState)
|
||||
_mesa_update_state(ctx);
|
||||
|
@@ -549,6 +549,7 @@ st_CopyImageSubData(struct gl_context *ctx,
|
||||
int src_level, dst_level;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
if (src_image) {
|
||||
struct st_texture_image *src = st_texture_image(src_image);
|
||||
|
@@ -1072,6 +1072,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
|
||||
assert(ctx->NewState == 0x0);
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
st_validate_state(st, ST_PIPELINE_RENDER);
|
||||
|
||||
@@ -1437,6 +1438,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
|
||||
struct gl_pixelstore_attrib pack = ctx->DefaultPacking;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
st_validate_state(st, ST_PIPELINE_RENDER);
|
||||
|
||||
|
@@ -118,6 +118,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
||||
unsigned offset;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
st_validate_state(st, ST_PIPELINE_RENDER);
|
||||
|
||||
|
@@ -1325,6 +1325,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
unsigned dst_level = 0;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
if (stObj->pt == stImage->pt)
|
||||
dst_level = texImage->TexObject->MinLevel + texImage->Level;
|
||||
@@ -2260,6 +2261,7 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
|
||||
GLint srcY0, srcY1;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
assert(!_mesa_is_format_etc2(texImage->TexFormat) &&
|
||||
texImage->TexFormat != MESA_FORMAT_ETC1_RGB8);
|
||||
@@ -2784,6 +2786,7 @@ st_ClearTexSubImage(struct gl_context *ctx,
|
||||
return;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
u_box_3d(xoffset, yoffset, zoffset + texImage->Face,
|
||||
width, height, depth, &box);
|
||||
|
@@ -170,6 +170,7 @@ st_draw_vbo(struct gl_context *ctx,
|
||||
assert(ctx->NewState == 0x0);
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
/* Validate state. */
|
||||
if (st->dirty.st || st->dirty.mesa || ctx->NewDriverState) {
|
||||
|
@@ -139,6 +139,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
|
||||
assert(draw);
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
st_validate_state(st, ST_PIPELINE_RENDER);
|
||||
|
||||
|
@@ -98,6 +98,7 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
|
||||
return;
|
||||
|
||||
st_flush_bitmap_cache(st);
|
||||
st_invalidate_readpix_cache(st);
|
||||
|
||||
/* The texture isn't in a "complete" state yet so set the expected
|
||||
* lastLevel here, since it won't get done in st_finalize_texture().
|
||||
|
Reference in New Issue
Block a user