cogl: Get the authority for vertex/fragment_snippets_state_equal

They expect the authority of the pipeline, which is not necessarily the
pipeline we're operating on.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3924
Fixes: 5e98ee5dbe ("cogl: Add pipeline hooks to user program pipelines")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4298>
This commit is contained in:
Sebastian Wick 2025-02-22 16:12:21 +01:00 committed by Marge Bot
parent d8512767ea
commit b7e6f6d144

View File

@ -729,6 +729,7 @@ needs_recompile (CoglShader *shader,
* are the pipeline layer-indices, texture-unit-indices and * are the pipeline layer-indices, texture-unit-indices and
* snippets * snippets
*/ */
CoglPipeline *authority, *authority_prev;
if (pipeline == prev) if (pipeline == prev)
return FALSE; return FALSE;
@ -739,11 +740,25 @@ needs_recompile (CoglShader *shader,
switch (shader->type) switch (shader->type)
{ {
case COGL_SHADER_TYPE_VERTEX: case COGL_SHADER_TYPE_VERTEX:
if (!_cogl_pipeline_vertex_snippets_state_equal (prev, pipeline)) authority =
_cogl_pipeline_get_authority (pipeline,
COGL_PIPELINE_STATE_VERTEX_SNIPPETS);
authority_prev =
_cogl_pipeline_get_authority (prev,
COGL_PIPELINE_STATE_VERTEX_SNIPPETS);
if (!_cogl_pipeline_vertex_snippets_state_equal (authority_prev, authority))
return TRUE; return TRUE;
break; break;
case COGL_SHADER_TYPE_FRAGMENT: case COGL_SHADER_TYPE_FRAGMENT:
if (!_cogl_pipeline_fragment_snippets_state_equal (prev, pipeline)) authority =
_cogl_pipeline_get_authority (pipeline,
COGL_PIPELINE_STATE_FRAGMENT_SNIPPETS);
authority_prev =
_cogl_pipeline_get_authority (prev,
COGL_PIPELINE_STATE_FRAGMENT_SNIPPETS);
if (!_cogl_pipeline_fragment_snippets_state_equal (authority_prev, authority))
return TRUE; return TRUE;
break; break;
default: default: