summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorJordan Cristiano <jordan.cristi [AT] gmail.com>2013-11-13 04:03:46 -0500
committerJordan Cristiano <jordan.cristi [AT] gmail.com>2013-11-13 04:03:46 -0500
commitf96e9e1ae43a510c83087efcbfb5fd57cdfe0b38 (patch)
tree2ff9ca309347bcaf9de06f590875cd606a9c21ac /Source/Core/VideoCommon
parent038ffea369bbe65a7436c81f6ff7fb12d14ee46d (diff)
warnings and code formatting
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp12
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderManager.cpp8
-rw-r--r--Source/Core/VideoCommon/Src/ShaderGenCommon.h2
-rw-r--r--Source/Core/VideoCommon/Src/VertexShaderGen.cpp6
4 files changed, 19 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index 442cfc1ef4..f107da783e 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -316,8 +316,10 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
// compute window position if needed because binding semantic WPOS is not widely supported
// Let's set up attributes
- for (int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
+ for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
+ {
out.Write("VARYIN float3 uv%d_2;\n", i);
+ }
out.Write("VARYIN float4 clipPos_2;\n");
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
@@ -392,9 +394,13 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
out.Write("float4 colors_1 = colors_12;\n");
// compute window position if needed because binding semantic WPOS is not widely supported
// Let's set up attributes
- if(numTexgen)
- for (int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
+ if (numTexgen)
+ {
+ for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
+ {
out.Write("float3 uv%d = uv%d_2;\n", i, i);
+ }
+ }
out.Write("float4 clipPos = clipPos_2;\n");
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
index b999ada6a3..98722e48ce 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
@@ -84,7 +84,7 @@ void PixelShaderManager::SetConstants(u32 components)
// they are the coefficients from the center to the border of the screen
// so to simplify I use the hi coefficient as K in the shader taking 256 as the scale
constants.fog[2][0] = ScreenSpaceCenter;
- constants.fog[2][1] = Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd));
+ constants.fog[2][1] = (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd));
constants.fog[2][2] = bpmem.fogRange.K[4].HI / 256.0f;
}
else
@@ -263,8 +263,8 @@ void PixelShaderManager::SetZTextureTypeChanged()
void PixelShaderManager::SetTexCoordChanged(u8 texmapid)
{
TCoordInfo& tc = bpmem.texcoords[texmapid];
- constants.texdims[texmapid][2] = tc.s.scale_minus_1 + 1;
- constants.texdims[texmapid][3] = tc.t.scale_minus_1 + 1;
+ constants.texdims[texmapid][2] = (float)(tc.s.scale_minus_1 + 1);
+ constants.texdims[texmapid][3] = (float)(tc.t.scale_minus_1 + 1);
dirty = true;
}
@@ -283,7 +283,7 @@ void PixelShaderManager::SetFogParamChanged()
constants.fog[1][0] = bpmem.fog.a.GetA();
constants.fog[1][1] = (float)bpmem.fog.b_magnitude / 0xFFFFFF;
constants.fog[1][2] = bpmem.fog.c_proj_fsel.GetC();
- constants.fog[1][3] = 1 << bpmem.fog.b_shift;
+ constants.fog[1][3] = (float)(1 << bpmem.fog.b_shift);
}
else
{
diff --git a/Source/Core/VideoCommon/Src/ShaderGenCommon.h b/Source/Core/VideoCommon/Src/ShaderGenCommon.h
index 35ec50407a..b56e9f29ff 100644
--- a/Source/Core/VideoCommon/Src/ShaderGenCommon.h
+++ b/Source/Core/VideoCommon/Src/ShaderGenCommon.h
@@ -236,7 +236,7 @@ public:
u32 value = ((u32*)&new_uid.GetUidData())[i];
if ((i % 4) == 0)
{
- unsigned int last_value = (i+3 < new_uid.GetUidDataSize()-1) ? i+3 : new_uid.GetUidDataSize();
+ auto last_value = (i+3 < new_uid.GetUidDataSize()-1) ? i+3 : new_uid.GetUidDataSize();
file << std::setfill(' ') << std::dec;
file << "Values " << std::setw(2) << i << " - " << last_value << ": ";
}
diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
index f36f857973..78b3c57dda 100644
--- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
@@ -130,9 +130,13 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
}
// Let's set up attributes
- for (int i = 0; i < 8; ++i)
+ for (size_t i = 0; i < 8; ++i)
+ {
if (i < xfregs.numTexGen.numTexGens)
+ {
out.Write("VARYOUT float3 uv%d_2;\n", i);
+ }
+ }
out.Write("VARYOUT float4 clipPos_2;\n");
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
out.Write("VARYOUT float4 Normal_2;\n");