mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 15:06:32 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user