Simplify D3D texture render shader parameters, fix scaling bug in D3D12

* We previously relied on setting the viewport smaller than the output
  dimensions in D3D11 to scale for lower mips. In D3D12 the viewport is set to
  the output dimensions internally so we can't do that, so instead apply a
  manual scale.
This commit is contained in:
baldurk
2019-11-13 10:05:30 +00:00
parent 0b15b8b5ce
commit c497446524
6 changed files with 43 additions and 49 deletions
+1 -4
View File
@@ -57,10 +57,7 @@ cbuffer FontCBuffer REG(b0)
cbuffer TexDisplayVSCBuffer REG(b0)
{
float2 Position;
float2 TextureResolution;
float2 ScreenAspect;
float Scale;
float2 VertexScale;
};
cbuffer TexDisplayPSCBuffer REG(b0)
+1 -2
View File
@@ -50,8 +50,7 @@ v2f RENDERDOC_TexDisplayVS(uint vertID : SV_VertexID)
float2 pos = positions[vertID];
OUT.pos = float4(Position.xy + pos.xy * TextureResolution.xy * Scale * ScreenAspect.xy, 0, 1) -
float4(1.0, -1.0, 0, 0);
OUT.pos = float4(Position.xy + pos.xy * VertexScale.xy, 0, 1) - float4(1.0, -1.0, 0, 0);
OUT.tex.xy = float2(pos.x, -pos.y);
return OUT;
}