TexCache: Fix texture alignment in GLES #11374
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the OpenGL and Direct3D 11 parts of #10629, but not the Vulkan and Direct3D 9 parts.
For textures that were <= 4 pixels wide (not that common), we had a couple invalid assumptions in the GLES path. First, we left row alignment at 4, which would be an issue for 1 pixel wide 16-bit textures (definitely an edge case, though.) More importantly, we unswizzled assuming the pitch was aligned to 16 bytes.
While I was there, I fixed Direct3D 11 using bufw (if larger than w) for pitch. It doesn't need to, but aligning to 16 is ideal (which this was implicitly doing, since bufw is always aligned to 16 bytes.)
I decided to keep it in this same pull, but the color test change is kinda separate. Basically,
x.rgb == y.rgb
was not working, butx.r == y.r && x.g == y.g && x.b == y.b
was. A shame.-[Unknown]