Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #700 from jimbo1qaz/master
Fix D3D Real XFB texture sampling.
  • Loading branch information
Sonicadvance1 committed Aug 2, 2014
2 parents b8e6471 + fe9b7fa commit 7e83a0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Core/VideoBackends/D3D/XFBEncoder.cpp
Expand Up @@ -97,7 +97,8 @@ static const char XFB_ENCODE_PS[] =

"void main(out float4 ocol0 : SV_Target, in float4 Pos : SV_Position, in float2 Coord : ENCODECOORD)\n"
"{\n"
"float2 baseCoord = Coord * float2(2,1);\n"
// Multiplying X by 2, moves pixel centers from (x+0.5) to (2x+1) instead of (2x+0.5), so subtract 0.5 to compensate
"float2 baseCoord = Coord * float2(2,1) - float2(0.5,0);\n"
// FIXME: Shall we apply gamma here, or apply it below to the Y components?
// Be careful if you apply it to Y! The Y components are in the range (16..235) / 255.
"float3 sampleL = pow(abs(SampleEFB(baseCoord+float2(-1,0))), Params.Gamma);\n" // Left
Expand Down

0 comments on commit 7e83a0e

Please sign in to comment.