mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
mesa/st: Convert st_cb_drawtex to use st_context_invalidate_state
Replace CSO save/restore of atom-backed states with st_context_invalidate_state(). Only stream outputs (no atom) still use CSO save/restore. Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40592>
This commit is contained in:
parent
5d8b900369
commit
4852fa32c1
1 changed files with 15 additions and 11 deletions
|
|
@ -246,14 +246,8 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
|||
#undef SET_ATTRIB
|
||||
}
|
||||
|
||||
cso_save_state(cso, (CSO_BIT_VIEWPORT |
|
||||
CSO_BIT_STREAM_OUTPUTS |
|
||||
CSO_BIT_VERTEX_SHADER |
|
||||
CSO_BIT_TESSCTRL_SHADER |
|
||||
CSO_BIT_TESSEVAL_SHADER |
|
||||
CSO_BIT_GEOMETRY_SHADER |
|
||||
CSO_BIT_MESH_SHADER |
|
||||
CSO_BIT_VERTEX_ELEMENTS));
|
||||
/* Save only states that have no st_atom — they can't be re-derived. */
|
||||
cso_save_state(cso, CSO_BIT_STREAM_OUTPUTS);
|
||||
|
||||
{
|
||||
void *vs = lookup_shader(st, numAttribs, slots);
|
||||
|
|
@ -305,10 +299,20 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
|||
|
||||
pipe_resource_release(pipe, releasebuf);
|
||||
|
||||
/* restore state */
|
||||
/* Restore atomless states via CSO. */
|
||||
cso_restore_state(cso, 0);
|
||||
ctx->Array.NewVertexElements = true;
|
||||
ST_SET_STATE(ctx->NewDriverState, ST_NEW_VERTEX_ARRAYS);
|
||||
|
||||
/* Invalidate all states this meta-op modified. The atoms will
|
||||
* re-derive them from GL state before the next draw.
|
||||
*/
|
||||
st_context_invalidate_state(st,
|
||||
ST_INVALIDATE_VIEWPORT |
|
||||
ST_INVALIDATE_VERTEX_BUFFERS |
|
||||
ST_INVALIDATE_VS_STATE |
|
||||
ST_INVALIDATE_GS_STATE |
|
||||
ST_INVALIDATE_TCS_STATE |
|
||||
ST_INVALIDATE_TES_STATE |
|
||||
ST_INVALIDATE_MESH_STATE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue