-
-
Save luluco250/986d6d4b34e5a865819a9c8ef4553dd9 to your computer and use it in GitHub Desktop.
ReShade broken pooled texture behavior on DirectX 9 example shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef BROKEN_POOLED_USE_POOLED | |
#define BROKEN_POOLED_USE_POOLED 1 | |
#endif | |
texture BackBufferTex : COLOR; | |
sampler BackBuffer | |
{ | |
Texture = BackBufferTex; | |
}; | |
texture ATex | |
#if BROKEN_POOLED_USE_POOLED | |
<pooled = true;> | |
#endif | |
{ | |
Width = BUFFER_WIDTH; | |
Height = BUFFER_HEIGHT; | |
}; | |
sampler A | |
{ | |
Texture = ATex; | |
}; | |
texture BTex | |
#if BROKEN_POOLED_USE_POOLED | |
<pooled = true;> | |
#endif | |
{ | |
Width = BUFFER_WIDTH; | |
Height = BUFFER_HEIGHT; | |
}; | |
sampler B | |
{ | |
Texture = BTex; | |
}; | |
void ScreenVS( | |
uint id : SV_VERTEXID, | |
out float4 pos : SV_POSITION, | |
out float2 uv : TEXCOORD) | |
{ | |
uv.x = (id == 2) ? 2.0 : 0.0; | |
uv.y = (id == 1) ? 2.0 : 0.0; | |
pos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); | |
} | |
float4 WriteAPS(float4 p : SV_POSITION, float2 uv : TEXCOORD) : SV_TARGET | |
{ | |
return tex2D(BackBuffer, uv); | |
} | |
float4 WriteBPS(float4 p : SV_POSITION, float2 uv : TEXCOORD) : SV_TARGET | |
{ | |
return tex2D(A, uv); | |
} | |
float4 FinalPS(float4 p : SV_POSITION, float2 uv : TEXCOORD) : SV_TARGET | |
{ | |
return tex2D(B, uv); | |
} | |
technique BrokenPooled | |
{ | |
pass WriteA | |
{ | |
VertexShader = ScreenVS; | |
PixelShader = WriteAPS; | |
RenderTarget = ATex; | |
} | |
pass WriteB | |
{ | |
VertexShader = ScreenVS; | |
PixelShader = WriteBPS; | |
RenderTarget = BTex; | |
} | |
pass Final | |
{ | |
VertexShader = ScreenVS; | |
PixelShader = FinalPS; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment