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

Issue 615517 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 540761



Sign in to add a comment

Gpu generated mipmaps are all black on ChromeOS

Project Member Reported by junov@chromium.org, May 27 2016

Issue description

Skia's implementation of kMedium_SkFilterQuality and kHigh_SkFilterQuality do not work on ChromeOS when rendering to a GPU-accelerated surface.  Probably a bug in Mesa or in the Intel DRI driver.

This is preventing us from shipping the canvas.imageSmoothingQuality feature.

We need to either fix the driver bug, or implement a workaround in skia. A possible workaround might be to generate the mipmaps ourselves instead of relying on the driver.


 

Comment 1 by bsalo...@google.com, May 27 2016

Cc: brianosman@chromium.org
Brian Osman has been working on adding MIP map generation code to Skia's GL backend to work around sRGB-related driver bugs.

Comment 2 by junov@chromium.org, May 27 2016

Repro:
1. Navigate to chrome://flags
2. Enable experimental canvas features
3. Restart Chrome (big blue button)
4. navigate to: http://jsfiddle.net/zbs9cpm2/

Observed Result: 
In the top left corner, there are two thumbnails, the bottom one is black

Expected result:
The two thumbnails should look the same (% filtering quality)

Only Repros on ChromeOS.
Works fine when accelerated-2d-canvas is disabled

Comment 3 by junov@chromium.org, May 27 2016

Blocking: 540761

Comment 4 by junov@chromium.org, Jun 6 2016

Owner: brianosman@chromium.org
brianosman@: please update this issue once your mip map generation code is ready. 

If skia will be switching between driver/skia implementations of mipmap generation, then there should probably be a bit in glCaps that we can flip to tell Ganesh to never use the driver's implementation.

You can assign this issue back to me if anything needs be done on the blink/chromium side.
The code for the manual mip-map generation landed, and several more fixes went in, the most recent being: https://skia.googlesource.com/skia/+/21c5ec62aab4be1fa1bfa06167ce8fd4c9decb35

There is a caps bit (GrGLCaps::fDoManualMipmapping) that determines whether we use the driver (glGenerateMipmap) or the draw-call based code. Right now, we choose to use the new code path unless GPU or driver bugs prevent us from doing so. At the moment, the main classes of devices that still use the driver are:

- Adreno3xx : Inability to render to very small FBs prevent us from generating the full mip-chain.
- Adreno4xx : A driver bug with FB sRGB write-control causes us to (conservatively) opt-out for sRGB textures, but not others.
- Anything that's only running ES2, because we need the ability to set GL_TEXTURE_BASE_LEVEL during the downsample chain.

I'm also looking at performance results, to see if we should opt-out on GPUs (especially tilers) where the repeated render-to-texture/resolve cycle may be less efficient than whatever the driver was previously doing.

It sounds like the ChromeOS devices are using Intel chipsets? In that case, it's likely that they will pick up the new code-path be default, and should "just work". Fingers crossed.

Comment 6 by junov@chromium.org, Jun 6 2016

Excellent! I'll check it out and let you know if there are any issues.
As a follow-up to this: Due to performance regression, we made this opt-in, rather than opt-out. That caps bit is now enabled when:

- Vendor == "Intel" or "ATI"
- Driver == "NVIDIA" && MacOS

That covers the machines in our testing that were failing to produce correct sRGB mip-maps with the driver. bsalomon@ informs me that ChromeOS doesn't report the actual GL vendor, so this may go back to not working for you, but we could add a flag to GrContextOptions that lets you override the behavior, if you'd like?
Cc: vmi...@chromium.org
+Victor as this came up in the gpu raster meeting the other day. For context GrContextOptions is a means by which we can add client overrides for caps that we would otherwise infer from GL strings (among other uses). It is passed to the factory function that create GrContext.

Comment 9 by junov@chromium.org, Jul 13 2016

@brianosman So I tried flipping the fDoManualMipmapping on my local chromeOS build and I get transparent black mipmaps (before I had opaque black). So it does something, but it still does not work.  Any ideas?

Comment 10 by junov@chromium.org, Jul 27 2016

Status: WontFix (was: Assigned)
This issue is obsolete A workaround was implemented in the chromium gpu stack.

Sign in to add a comment