gallium: Mute arrays for several meta like callbacks.

Set the _DrawArray pointer to NULL when calling into the Drivers
Bitmap/CopyPixels/DrawAtlasBitmaps/DrawPixels/DrawTex hooks.
This fixes an assert that gets uncovered when the following
patch gets applied.

v2: Mute from within the state tracker instead of generic mesa.
v3: Avoid evaluating _DrawArrays from within st_validate_state.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Mathias Fröhlich
2018-02-05 22:02:51 +01:00
committed by Mathias Fröhlich
parent 2f9eb0aad5
commit 437cae411e
5 changed files with 18 additions and 5 deletions
+10
View File
@@ -203,6 +203,16 @@ void st_validate_state( struct st_context *st, enum st_pipeline pipeline )
pipeline_mask = ST_PIPELINE_CLEAR_STATE_MASK;
break;
case ST_PIPELINE_META:
if (st->gfx_shaders_may_be_dirty) {
check_program_state(st);
st->gfx_shaders_may_be_dirty = false;
}
st_manager_validate_framebuffers(st);
pipeline_mask = ST_PIPELINE_META_STATE_MASK;
break;
case ST_PIPELINE_UPDATE_FRAMEBUFFER:
st_manager_validate_framebuffers(st);
pipeline_mask = ST_PIPELINE_UPDATE_FB_STATE_MASK;
+3
View File
@@ -44,6 +44,7 @@ struct st_context;
enum st_pipeline {
ST_PIPELINE_RENDER,
ST_PIPELINE_CLEAR,
ST_PIPELINE_META,
ST_PIPELINE_UPDATE_FRAMEBUFFER,
ST_PIPELINE_COMPUTE,
};
@@ -149,6 +150,8 @@ enum {
#define ST_PIPELINE_CLEAR_STATE_MASK (ST_NEW_FB_STATE | \
ST_NEW_SCISSOR | \
ST_NEW_WINDOW_RECTANGLES)
#define ST_PIPELINE_META_STATE_MASK (ST_PIPELINE_RENDER_STATE_MASK & \
~ST_NEW_VERTEX_ARRAYS)
/* For ReadPixels, ReadBuffer, GetSamplePosition: */
#define ST_PIPELINE_UPDATE_FB_STATE_MASK (ST_NEW_FB_STATE)
+2 -2
View File
@@ -626,7 +626,7 @@ st_Bitmap(struct gl_context *ctx, GLint x, GLint y,
if ((st->dirty | ctx->NewDriverState) & ~ST_NEW_CONSTANTS &
ST_PIPELINE_RENDER_STATE_MASK ||
st->gfx_shaders_may_be_dirty) {
st_validate_state(st, ST_PIPELINE_RENDER);
st_validate_state(st, ST_PIPELINE_META);
}
if (UseBitmapCache && accum_bitmap(ctx, x, y, width, height, unpack, bitmap))
@@ -681,7 +681,7 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
st_flush_bitmap_cache(st);
st_validate_state(st, ST_PIPELINE_RENDER);
st_validate_state(st, ST_PIPELINE_META);
st_invalidate_readpix_cache(st);
sv = st_create_texture_sampler_view(pipe, stObj->pt);
+2 -2
View File
@@ -1147,7 +1147,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
st_flush_bitmap_cache(st);
st_invalidate_readpix_cache(st);
st_validate_state(st, ST_PIPELINE_RENDER);
st_validate_state(st, ST_PIPELINE_META);
/* Limit the size of the glDrawPixels to the max texture size.
* Strictly speaking, that's not correct but since we don't handle
@@ -1514,7 +1514,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
st_flush_bitmap_cache(st);
st_invalidate_readpix_cache(st);
st_validate_state(st, ST_PIPELINE_RENDER);
st_validate_state(st, ST_PIPELINE_META);
if (type == GL_DEPTH_STENCIL) {
/* XXX make this more efficient */
+1 -1
View File
@@ -120,7 +120,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
st_flush_bitmap_cache(st);
st_invalidate_readpix_cache(st);
st_validate_state(st, ST_PIPELINE_RENDER);
st_validate_state(st, ST_PIPELINE_META);
/* determine if we need vertex color */
if (ctx->FragmentProgram._Current->info.inputs_read & VARYING_BIT_COL0)