diff --git a/Source/Core/VideoCommon/ConstantManager.h b/Source/Core/VideoCommon/ConstantManager.h index 85630966c5..b03d2ced6d 100644 --- a/Source/Core/VideoCommon/ConstantManager.h +++ b/Source/Core/VideoCommon/ConstantManager.h @@ -19,7 +19,7 @@ struct PixelShaderConstants int4 indtexscale[2]; int4 indtexmtx[6]; int4 fogcolor; - int4 fogi[1]; + int4 fogi; float4 fogf[2]; // For pixel lighting diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 8d22bd5ef4..fe9eecfdea 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -253,7 +253,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T DeclareUniform(out, ApiType, C_INDTEXSCALE, "int4", I_INDTEXSCALE"[2]"); DeclareUniform(out, ApiType, C_INDTEXMTX, "int4", I_INDTEXMTX"[6]"); DeclareUniform(out, ApiType, C_FOGCOLOR, "int4", I_FOGCOLOR); - DeclareUniform(out, ApiType, C_FOGI, "int4", I_FOGI"[1]"); + DeclareUniform(out, ApiType, C_FOGI, "int4", I_FOGI); DeclareUniform(out, ApiType, C_FOGF, "float4", I_FOGF"[2]"); // For pixel lighting - TODO: Should only be defined when per pixel lighting is enabled! @@ -989,7 +989,7 @@ static inline void WriteFog(T& out, pixel_shader_uid_data& uid_data) // TODO: Verify that we want to drop lower bits here! (currently taken over from software renderer) // Maybe we want to use "ze = (A << B_SHF)/((B << B_SHF) - Zs)" instead? // That's equivalent, but keeps the lower bits of Zs. - out.Write("\tfloat ze = (" I_FOGF"[1].x * 16777215.0) / float(" I_FOGI"[0].y - (zCoord >> " I_FOGI"[0].w));\n"); + out.Write("\tfloat ze = (" I_FOGF"[1].x * 16777215.0) / float(" I_FOGI".y - (zCoord >> " I_FOGI".w));\n"); } else { diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index 86111334ce..7cbb155be2 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -283,16 +283,16 @@ void PixelShaderManager::SetFogParamChanged() if (!g_ActiveConfig.bDisableFog) { constants.fogf[1][0] = bpmem.fog.a.GetA(); - constants.fogi[0][1] = bpmem.fog.b_magnitude; + constants.fogi[1] = bpmem.fog.b_magnitude; constants.fogf[1][2] = bpmem.fog.c_proj_fsel.GetC(); - constants.fogi[0][3] = bpmem.fog.b_shift; + constants.fogi[3] = bpmem.fog.b_shift; } else { constants.fogf[1][0] = 0.f; - constants.fogi[0][1] = 1; + constants.fogi[1] = 1; constants.fogf[1][2] = 0.f; - constants.fogi[0][3] = 1; + constants.fogi[3] = 1; } dirty = true; }