VertexShaderGen: Correct vertex shader output to consider shifted pixel centers. #306
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.
On the console GPU, pixel centers are located at 0.58333 in screen space, rather than 0.5 as for common GPUs. Hence, primitives get rasterized incorrectly such that they may get offset by one pixel to the bottom-right.
Explanation of the discovery of this issue in bug report 267 - http://code.google.com/p/dolphin-emu/issues/detail?id=267 . This issue caused a clear quad to function improperly there, hence creating artifacts in an EFB copy which showed up as the oddly colored ground texture.
A hwtest was written for this behavior at https://github.com/dolphin-emu/hwtests/blob/872cd517cc3f8edb20161506109344652bbd02b5/gxtest/source/main.cpp#L500 and indeed it shows that indeed the pixel center is (roughly) at 7/12th in screen space. There's no real confirmation, but at least it's very close to that value, and it just makes a lot of sense given that each pixel is divided into a 12x12 grid of subsamples.