After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662542 - The ARBfp and GLSL pipeline backends sometimes don't flush uniforms
The ARBfp and GLSL pipeline backends sometimes don't flush uniforms
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: CoglPipeline
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-10-23 19:24 UTC by Neil Roberts
Modified: 2011-10-24 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pipeline: Reset last_used_for_pipeline when the pipeline is destroyed (4.30 KB, patch)
2011-10-23 19:26 UTC, Neil Roberts
none Details | Review

Description Neil Roberts 2011-10-23 19:24:36 UTC
See the patch
Comment 1 Neil Roberts 2011-10-23 19:26:39 UTC
Created attachment 199770 [details] [review]
pipeline: Reset last_used_for_pipeline when the pipeline is destroyed

Both the GLSL and the ARBfp pipeline backends were using a variable
called last_used_for_pipeline to keep track of the last pipeline that
the shader or program state was used for. If this address is the same
as last time when the pipeline state is flushed then Cogl will only
flush the uniforms that have been modified, otherwise it will flush
all of them. The problem with this is that there was nothing to keep
that address alive so it could be destroyed and reused for a different
pipeline by the time the shader state is reused. This is quite likely
to happen in an application using legacy state because in that case
the shader state will always be used with a one-shot pipeline that
will likely be recycled in the next frame.

There is already a destroy callback to unref the shader state when the
pipeline is destroyed so this patch just makes that callback also
clear the last_used_for_pipeline pointer if it matches the pipeline
being destroyed.
Comment 2 Neil Roberts 2011-10-24 13:42:03 UTC
Pushed as 49e733fcd to master and 6ce87a0877726 on the cogl-1.8 branch.