DescriptionManually 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 #
Messages
Total messages: 23 (9 generated)
|