Closed Bug 1073036 Opened 5 years ago Closed 5 years ago

Track program state more carefully to avoid setting unnecessarily

Categories

(Core :: Graphics: Layers, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Details

Attachments

(1 file, 3 obsolete files)

The overall idea is to basically create pipeline objects that we can switch between and only set the different state. The first part of this is to do this with shaders as glUseProgram looks to be the biggest state change area in profiles on OS X.
Activate is going away and we can trigger the workaround more explicitly using raw opengl.
This makes it so that we track the current program in use by compositor and only switch it if it is different.
Attachment #8495355 - Attachment is obsolete: true
Attachment #8495406 - Flags: review?(nical.bugzilla)
Attachment #8495406 - Flags: review?(nical.bugzilla) → review+
This needs to be updated to clear the state when drawing from widget/android
This should fix up the android problem by adding a 'ResetProgram' function that's called when we get the gl context for raw use.
Assignee: nobody → jmuizelaar
Attachment #8495406 - Attachment is obsolete: true
Attachment #8512945 - Flags: review?(nical.bugzilla)
Attachment #8512945 - Flags: review?(nical.bugzilla) → review+
This should be the final version of this.
Attachment #8512945 - Attachment is obsolete: true
Attachment #8524116 - Flags: review?(nical.bugzilla)
Comment on attachment 8524116 [details] [diff] [review]
Also use reset in GLBlitTextureImage

Review of attachment 8524116 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/opengl/OGLShaderProgram.cpp
@@ +549,3 @@
>      }
>    }
> +  MOZ_ASSERT(HasInitialized(), "Attempting to activate a program that's not in use!");

The message for this assertion makes much less sense now.
Attachment #8524116 - Flags: review?(nical.bugzilla) → review+
https://hg.mozilla.org/mozilla-central/rev/5140b218e6cc
https://hg.mozilla.org/mozilla-central/rev/f61b87621f13
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.