New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 906264 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Audit command buffer's context state reset code

Project Member Reported by zmo@chromium.org, Nov 16

Issue description

Now we have skia calling GL directly, so some previously valid assumptions are no longer valid.

For example, looking at ContextState::PushTextureUnpackState(), we assumed UNPACK_SKIP_* params are always zero on the service side because we unwind them from the client side. However, now skia can just set them to none zero directly to GL, and since we don't reset them at context switch, tex upload will be wrong.

I think today we are probably lucky that skia doesn't set these params.

Regardless, we could either let skia have its own real context, or we need to reset all states at context switching, getting rid of whatever optimizations we may have today.
 
Cc: backer@chromium.org penghuang@chromium.org khushals...@chromium.org
Cc: bsalomon@chromium.org
Note that these optimizations can stay when we're switching from a non-null "prev_state" ContextState to another one, but we would need to reset all the state when the "prev_state" ContextState is null (when we switch away from Skia).
Cc: ericrk@chromium.org
FYI, note that there are additional flags:
GL_UNPACK_SWAP_BYTES and GL_UNPACK_LSB_FIRST which are part of desktop GL, but not GLES. Skia doesn't currently use them (but could), worth adding these in if we try to harden context state reset code.
Since command buffer is GLES, so if we want to add something only available on desktop, we will need to define and expose an extension for that.
It's not so much to expose it to the client, but to make sure the state is reset when switching from a null ContextState (full reset).
In this case, then this audit needs to cover various desktop GL versions, various ES versions, and their exposed GL states?
Yes, or at the very least the states touched by Skia (modulo extensions that we blacklist and GL versions that we limit to).
See https://cs.chromium.org/chromium/src/ui/gl/init/create_gr_gl_interface.cc?type=cs&q=ui/gl/init&sq=package:chromium&g=0&l=94

Sign in to add a comment