1Texture2D<float4> TextureF : register(t0); 2Texture2DMS<float4> TextureF_MS: register(t0); 3Texture2D<uint4> TextureUI : register(t0); 4Texture2D<int4> TextureI : register(t0); 5 6SamplerState Sampler : register(s0); 7 8void VS_Passthrough2D( in float2 inPosition : POSITION, in float2 inTexCoord : TEXCOORD0, 9 out float4 outPosition : SV_POSITION, out float2 outTexCoord : TEXCOORD0) 10{ 11 outPosition = float4(inPosition, 0.0f, 1.0f); 12 outTexCoord = inTexCoord; 13} 14 15float PS_PassthroughDepth2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_DEPTH 16{ 17 return TextureF.Sample(Sampler, inTexCoord).r; 18} 19 20float4 PS_PassthroughRGBA2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 21{ 22 return TextureF.Sample(Sampler, inTexCoord).rgba; 23} 24 25float4 PS_PassthroughA2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 26{ 27 return float4(0.0f, 0.0f, 0.0f, TextureF.Sample(Sampler, inTexCoord).a); 28} 29 30float4 PS_PassthroughRGBA2DMS(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCORD0, in uint inSampleIndex : SV_SAMPLEINDEX) : SV_TARGET0 31{ 32 return TextureF_MS.sample[inSampleIndex][inTexCoord].rgba; 33} 34 35uint4 PS_PassthroughRGBA2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 36{ 37 uint2 size; 38 TextureUI.GetDimensions(size.x, size.y); 39 40 return TextureUI.Load(int3(size * inTexCoord, 0)).rgba; 41} 42 43int4 PS_PassthroughRGBA2DI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 44{ 45 uint2 size; 46 TextureI.GetDimensions(size.x, size.y); 47 48 return TextureI.Load(int3(size * inTexCoord, 0)).rgba; 49} 50 51float4 PS_PassthroughRGB2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 52{ 53 return float4(TextureF.Sample(Sampler, inTexCoord).rgb, 1.0f); 54} 55 56uint4 PS_PassthroughRGB2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 57{ 58 uint2 size; 59 TextureUI.GetDimensions(size.x, size.y); 60 61 return uint4(TextureUI.Load(int3(size * inTexCoord, 0)).rgb, 0); 62} 63 64int4 PS_PassthroughRGB2DI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 65{ 66 uint2 size; 67 TextureI.GetDimensions(size.x, size.y); 68 69 return int4(TextureI.Load(int3(size * inTexCoord, 0)).rgb, 0); 70} 71 72float4 PS_PassthroughRG2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 73{ 74 return float4(TextureF.Sample(Sampler, inTexCoord).rg, 0.0f, 1.0f); 75} 76 77uint4 PS_PassthroughRG2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 78{ 79 uint2 size; 80 TextureUI.GetDimensions(size.x, size.y); 81 82 return uint4(TextureUI.Load(int3(size * inTexCoord, 0)).rg, 0, 0); 83} 84 85int4 PS_PassthroughRG2DI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 86{ 87 uint2 size; 88 TextureI.GetDimensions(size.x, size.y); 89 90 return int4(TextureI.Load(int3(size * inTexCoord, 0)).rg, 0, 0); 91} 92 93float4 PS_PassthroughR2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 94{ 95 return float4(TextureF.Sample(Sampler, inTexCoord).r, 0.0f, 0.0f, 1.0f); 96} 97 98uint4 PS_PassthroughR2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 99{ 100 uint2 size; 101 TextureUI.GetDimensions(size.x, size.y); 102 103 return uint4(TextureUI.Load(int3(size * inTexCoord, 0)).r, 0, 0, 0); 104} 105 106int4 PS_PassthroughR2DI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 107{ 108 uint2 size; 109 TextureI.GetDimensions(size.x, size.y); 110 111 return int4(TextureI.Load(int3(size * inTexCoord, 0)).r, 0, 0, 0); 112} 113 114float4 PS_PassthroughLum2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 115{ 116 return float4(TextureF.Sample(Sampler, inTexCoord).rrr, 1.0f); 117} 118 119float4 PS_PassthroughLumAlpha2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 120{ 121 return TextureF.Sample(Sampler, inTexCoord).rrra; 122} 123 124float4 PS_PassthroughRGBA2D_4444(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 125{ 126 return round(TextureF.Sample(Sampler, inTexCoord) * float4(15, 15, 15, 15)) / float4(15, 15, 15, 15); 127} 128 129float4 PS_PassthroughRGB2D_565(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 130{ 131 return float4(round(TextureF.Sample(Sampler, inTexCoord).rgb * float3(31, 63, 31)) / float3(31, 63, 31), 1.0f); 132} 133 134float4 PS_PassthroughRGBA2D_5551(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 135{ 136 return round(TextureF.Sample(Sampler, inTexCoord) * float4(31, 31, 31, 1)) / float4(31, 31, 31, 1); 137} 138