D3D: Define decimals in floating point numbers

This commit is contained in:
Jules Blok 2014-12-05 13:53:30 +01:00
parent a6ac7dd5bd
commit fd6b588627
3 changed files with 6 additions and 6 deletions

View File

@ -183,7 +183,7 @@ static const char EFB_ENCODE_PS[] =
"float4 Fetch_0(float2 coord)\n" "float4 Fetch_0(float2 coord)\n"
"{\n" "{\n"
"float2 texCoord = CalcTexCoord(coord);\n" "float2 texCoord = CalcTexCoord(coord);\n"
"float4 result = EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0));\n" "float4 result = EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0.0));\n"
"result.a = 1.0;\n" "result.a = 1.0;\n"
"return result;\n" "return result;\n"
"}\n" "}\n"
@ -191,13 +191,13 @@ static const char EFB_ENCODE_PS[] =
"float4 Fetch_1(float2 coord)\n" "float4 Fetch_1(float2 coord)\n"
"{\n" "{\n"
"float2 texCoord = CalcTexCoord(coord);\n" "float2 texCoord = CalcTexCoord(coord);\n"
"return EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0));\n" "return EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0.0));\n"
"}\n" "}\n"
"float4 Fetch_2(float2 coord)\n" "float4 Fetch_2(float2 coord)\n"
"{\n" "{\n"
"float2 texCoord = CalcTexCoord(coord);\n" "float2 texCoord = CalcTexCoord(coord);\n"
"float4 result = EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0));\n" "float4 result = EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0.0));\n"
"result.a = 1.0;\n" "result.a = 1.0;\n"
"return result;\n" "return result;\n"
"}\n" "}\n"
@ -206,7 +206,7 @@ static const char EFB_ENCODE_PS[] =
"{\n" "{\n"
"float2 texCoord = CalcTexCoord(coord);\n" "float2 texCoord = CalcTexCoord(coord);\n"
"uint depth24 = 0xFFFFFF * EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0)).r;\n" "uint depth24 = 0xFFFFFF * EFBTexture.Sample(EFBSampler, float3(texCoord.xy, 0.0)).r;\n"
"uint4 bytes = uint4(\n" "uint4 bytes = uint4(\n"
"(depth24 >> 16) & 0xFF,\n" // r "(depth24 >> 16) & 0xFF,\n" // r
"(depth24 >> 8) & 0xFF,\n" // g "(depth24 >> 8) & 0xFF,\n" // g

View File

@ -68,7 +68,7 @@ const char anaglyph_program_code[] = {
"out float4 ocol0 : SV_Target,\n" "out float4 ocol0 : SV_Target,\n"
"in float4 pos : SV_Position,\n" "in float4 pos : SV_Position,\n"
"in float3 uv0 : TEXCOORD0){\n" "in float3 uv0 : TEXCOORD0){\n"
"float4 c0 = Tex0.Sample(samp0, float3(uv0.xy, 0));\n" "float4 c0 = Tex0.Sample(samp0, float3(uv0.xy, 0.0));\n"
"float4 c1 = Tex0.Sample(samp0, float3(uv0.xy, 1));\n" "float4 c1 = Tex0.Sample(samp0, float3(uv0.xy, 1));\n"
"ocol0 = float4(pow(0.7 * c0.g + 0.3 * c0.b, 1.5), c1.gba);" "ocol0 = float4(pow(0.7 * c0.g + 0.3 * c0.b, 1.5), c1.gba);"
"}\n" "}\n"

View File

@ -941,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, float3(%s.xy * " I_TEXDIMS"[%d].xy, %s))).%s;\n", texmap, texmap, texcoords, texmap, g_ActiveConfig.iStereoMode > 0 ? "layer" : "0", 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.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);
} }