Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Issue 2007973002: Manually generated sRGB mipmaps. (Closed)

Created:
4 years, 7 months ago by Brian Osman
Modified:
4 years, 6 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Manually generated sRGB mipmaps, with successively smaller draws. Dirty GL-generated mipmaps whenever an sRGB texture is used with a new value for TEXTURE_SRGB_DECODE. Add a new test rectangle to the gamma GM that tests that textures are correctly converted to linear before filtering when generating mipmaps. Added a new unit test that alternates how a texture is interpreted (sRGB or not), to verify that we rebuild mipmaps when needed, and that we get the correct results out in both modes. This test originally failed on four of our bots producing incorrect mips in three different ways. I'm not real surprised, but it looks like we can't rely on glGenerateMipmap to do the right thing, in conjunction with TEXTURE_SRGB_DECODE. Instead, actually create mip-chains using a series of draw calls. (My first attempt used glBlitFramebuffer, and that still had bugs on several bots). This approach appears to work correctly on any device that fully supports sRGB. Because the mipmap draws are fairly destructive to state, I had to hoist them out of bindTexture. That means adding a second pass over the texture accesses in the processor, at the very beginning of flush. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1840473002 Committed: https://skia.googlesource.com/skia/+/33f6b3f6ee4de24282f5e7f2dc31a5f538bcf40c

Patch Set 1 #

Patch Set 2 : BlitFramebuffer based mipmap builder, first pass #

Patch Set 3 : Bugfixes #

Patch Set 4 : More fixes #

Patch Set 5 : Hoist mipmap generation earlier in flushGLState #

Patch Set 6 : Build mips with draw calls #

Total comments: 3

Patch Set 7 : Remove leftover changes from earlier version #

Total comments: 2

Patch Set 8 : Cleanup of write-control and bindTexture logic #

Total comments: 11

Patch Set 9 : Review feedback #

Total comments: 5

Patch Set 10 : Switch to triangle filter for odd dimensions #

Patch Set 11 : Rebase #

Patch Set 12 : Break long columns #

Unified diffs Side-by-side diffs Delta from patch set Stats (+686 lines, -35 lines) Patch
M gm/gamma.cpp View 3 chunks +18 lines, -1 line 0 comments Download
M include/gpu/GrTexture.h View 2 chunks +2 lines, -1 line 0 comments Download
M src/gpu/GrTexture.cpp View 3 chunks +5 lines, -1 line 0 comments Download
M src/gpu/GrTexturePriv.h View 2 chunks +7 lines, -1 line 0 comments Download
M src/gpu/gl/GrGLGpu.h View 1 2 3 4 5 6 7 8 9 6 chunks +20 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLGpu.cpp View 1 2 3 4 5 6 7 8 9 10 11 13 chunks +433 lines, -31 lines 0 comments Download
M src/gpu/gl/GrGLProgram.h View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLProgram.cpp View 1 2 3 4 2 chunks +26 lines, -0 lines 0 comments Download
A tests/SRGBMipMapTest.cpp View 1 chunk +166 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (9 generated)
Brian Osman
This isn't ready to go yet - I still have some debugging code in there, ...
4 years, 6 months ago (2016-05-27 20:33:06 UTC) #3
Brian Osman
https://codereview.chromium.org/2007973002/diff/100001/include/gpu/GrTexture.h File include/gpu/GrTexture.h (right): https://codereview.chromium.org/2007973002/diff/100001/include/gpu/GrTexture.h#newcode56 include/gpu/GrTexture.h:56: void dirtyMipMaps(bool mipMapsDirty, bool sRGBCorrect); I think Brian had ...
4 years, 6 months ago (2016-05-27 20:37:12 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2007973002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2007973002/140001
4 years, 6 months ago (2016-05-31 15:38:35 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-05-31 16:01:37 UTC) #8
bsalomon
Wondering whether we can't do the gen and bind in one step. If we gen ...
4 years, 6 months ago (2016-05-31 16:35:03 UTC) #9
bsalomon
https://codereview.chromium.org/2007973002/diff/140001/src/gpu/gl/GrGLGpu.cpp File src/gpu/gl/GrGLGpu.cpp (right): https://codereview.chromium.org/2007973002/diff/140001/src/gpu/gl/GrGLGpu.cpp#newcode4183 src/gpu/gl/GrGLGpu.cpp:4183: // Define the next mip: On 2016/05/31 16:35:03, bsalomon ...
4 years, 6 months ago (2016-05-31 16:38:41 UTC) #10
Brian Osman
New version addresses a bunch of the feedback. Re: Doing mipmap and binding in one ...
4 years, 6 months ago (2016-05-31 17:33:05 UTC) #11
bsalomon
https://codereview.chromium.org/2007973002/diff/140001/src/gpu/gl/GrGLGpu.cpp File src/gpu/gl/GrGLGpu.cpp (right): https://codereview.chromium.org/2007973002/diff/140001/src/gpu/gl/GrGLGpu.cpp#newcode4205 src/gpu/gl/GrGLGpu.cpp:4205: this->setTextureUnit(0); On 2016/05/31 17:33:05, Brian Osman wrote: > On ...
4 years, 6 months ago (2016-05-31 19:45:47 UTC) #12
Brian Osman
I made a couple fixes, and I'm currently working on two larger enhancements: Using different ...
4 years, 6 months ago (2016-06-01 13:24:58 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2007973002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2007973002/220001
4 years, 6 months ago (2016-06-01 15:19:20 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-01 15:36:44 UTC) #18
bsalomon
lgtm https://codereview.chromium.org/2007973002/diff/160001/src/gpu/gl/GrGLGpu.cpp File src/gpu/gl/GrGLGpu.cpp (right): https://codereview.chromium.org/2007973002/diff/160001/src/gpu/gl/GrGLGpu.cpp#newcode3179 src/gpu/gl/GrGLGpu.cpp:3179: // We were supposed to ensure MipMaps were ...
4 years, 6 months ago (2016-06-01 15:41:28 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2007973002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2007973002/220001
4 years, 6 months ago (2016-06-02 12:48:28 UTC) #21
commit-bot: I haz the power
4 years, 6 months ago (2016-06-02 12:49:28 UTC) #23
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://skia.googlesource.com/skia/+/33f6b3f6ee4de24282f5e7f2dc31a5f538bcf40c

Powered by Google App Engine
This is Rietveld 408576698