mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
PixelShaderGen: Sample the correct texture slice.
This commit is contained in:
parent
7c05b9a6d0
commit
b769da23d0
@ -205,7 +205,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
|||||||
|
|
||||||
out.Write("\n");
|
out.Write("\n");
|
||||||
for (int i = 0; i < 8; ++i)
|
for (int i = 0; i < 8; ++i)
|
||||||
out.Write("Texture2D Tex%d : register(t%d);\n", i, i);
|
out.Write("Texture2DArray Tex%d : register(t%d);\n", i, i);
|
||||||
}
|
}
|
||||||
out.Write("\n");
|
out.Write("\n");
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
|||||||
per_pixel_depth ? "\n out float depth : SV_Depth," : "");
|
per_pixel_depth ? "\n out float depth : SV_Depth," : "");
|
||||||
|
|
||||||
out.Write(" in centroid float4 colors_0 : COLOR0,\n");
|
out.Write(" in centroid float4 colors_0 : COLOR0,\n");
|
||||||
out.Write(" in centroid float4 colors_1 : COLOR1");
|
out.Write(" in centroid float4 colors_1 : COLOR1\n");
|
||||||
|
|
||||||
// compute window position if needed because binding semantic WPOS is not widely supported
|
// compute window position if needed because binding semantic WPOS is not widely supported
|
||||||
for (unsigned int i = 0; i < numTexgen; ++i)
|
for (unsigned int i = 0; i < numTexgen; ++i)
|
||||||
@ -380,6 +380,9 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
|||||||
out.Write(",\n in centroid float4 clipPos : TEXCOORD%d", numTexgen);
|
out.Write(",\n in centroid float4 clipPos : TEXCOORD%d", numTexgen);
|
||||||
if (g_ActiveConfig.bEnablePixelLighting)
|
if (g_ActiveConfig.bEnablePixelLighting)
|
||||||
out.Write(",\n in centroid float4 Normal : TEXCOORD%d", numTexgen + 1);
|
out.Write(",\n in centroid float4 Normal : TEXCOORD%d", numTexgen + 1);
|
||||||
|
uid_data->stereo = g_ActiveConfig.iStereoMode > 0;
|
||||||
|
if (g_ActiveConfig.iStereoMode > 0)
|
||||||
|
out.Write(",\n in uint layer : SV_RenderTargetArrayIndex\n");
|
||||||
out.Write(" ) {\n");
|
out.Write(" ) {\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -938,7 +941,7 @@ static inline void SampleTexture(T& out, const char *texcoords, const char *texs
|
|||||||
out.SetConstantsUsed(C_TEXDIMS+texmap,C_TEXDIMS+texmap);
|
out.SetConstantsUsed(C_TEXDIMS+texmap,C_TEXDIMS+texmap);
|
||||||
|
|
||||||
if (ApiType == API_D3D)
|
if (ApiType == API_D3D)
|
||||||
out.Write("iround(255.0 * Tex%d.Sample(samp%d,%s.xy * " I_TEXDIMS"[%d].xy)).%s;\n", texmap,texmap, texcoords, texmap, texswap);
|
out.Write("iround(255.0 * Tex%d.Sample(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texmap, texcoords, texmap, g_ActiveConfig.iStereoMode > 0 ? "layer" : "0", texswap);
|
||||||
else
|
else
|
||||||
out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texcoords, texmap, g_ActiveConfig.iStereoMode > 0 ? "gs.layer" : "0.0", texswap);
|
out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texcoords, texmap, g_ActiveConfig.iStereoMode > 0 ? "gs.layer" : "0.0", texswap);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user