mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-05 00:40:00 +00:00
PSTextureEncoder: Add texture array support.
We only read the first slice, because EFB2RAM doesn't support texture arrays.
This commit is contained in:
parent
ced733ccdf
commit
799697ad80
@ -100,7 +100,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"} Params;\n"
|
||||
"}\n"
|
||||
|
||||
"Texture2D EFBTexture : register(t0);\n"
|
||||
"Texture2DArray EFBTexture : register(t0);\n"
|
||||
"sampler EFBSampler : register(s0);\n"
|
||||
|
||||
// Constants
|
||||
@ -183,7 +183,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"float4 Fetch_0(float2 coord)\n"
|
||||
"{\n"
|
||||
"float2 texCoord = CalcTexCoord(coord);\n"
|
||||
"float4 result = EFBTexture.Sample(EFBSampler, texCoord);\n"
|
||||
"float4 result = EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0));\n"
|
||||
"result.a = 1.0;\n"
|
||||
"return result;\n"
|
||||
"}\n"
|
||||
@ -191,13 +191,13 @@ static const char EFB_ENCODE_PS[] =
|
||||
"float4 Fetch_1(float2 coord)\n"
|
||||
"{\n"
|
||||
"float2 texCoord = CalcTexCoord(coord);\n"
|
||||
"return EFBTexture.Sample(EFBSampler, texCoord);\n"
|
||||
"return EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0));\n"
|
||||
"}\n"
|
||||
|
||||
"float4 Fetch_2(float2 coord)\n"
|
||||
"{\n"
|
||||
"float2 texCoord = CalcTexCoord(coord);\n"
|
||||
"float4 result = EFBTexture.Sample(EFBSampler, texCoord);\n"
|
||||
"float4 result = EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0));\n"
|
||||
"result.a = 1.0;\n"
|
||||
"return result;\n"
|
||||
"}\n"
|
||||
@ -206,7 +206,7 @@ static const char EFB_ENCODE_PS[] =
|
||||
"{\n"
|
||||
"float2 texCoord = CalcTexCoord(coord);\n"
|
||||
|
||||
"uint depth24 = 0xFFFFFF * EFBTexture.Sample(EFBSampler, texCoord).r;\n"
|
||||
"uint depth24 = 0xFFFFFF * EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0)).r;\n"
|
||||
"uint4 bytes = uint4(\n"
|
||||
"(depth24 >> 16) & 0xFF,\n" // r
|
||||
"(depth24 >> 8) & 0xFF,\n" // g
|
||||
|
Loading…
x
Reference in New Issue
Block a user