mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Move worldpos into it's own varying.
Previously it was packed into spare slots in clippos.xy and normal.w, but it's ugly and more importantly it's causing bugs. This was discovered during the debugging of a zfreeze branch, which expected clippos.xy to be xy position coordinates in clipspace (as the name suggested). Turns out the stereoscopy shader had also run into this trap, modifying clippos.x (introducing errors with per-pixel lighting). This commit has been moved outside of the zfreeze PR for fast merging.
This commit is contained in:
@ -255,7 +255,10 @@ static inline void GenerateVSOutputMembers(T& object, API_TYPE api_type, const c
|
||||
DefineOutputMember(object, api_type, qualifier, "float4", "clipPos", -1, "TEXCOORD", xfmem.numTexGen.numTexGens);
|
||||
|
||||
if (g_ActiveConfig.bEnablePixelLighting)
|
||||
DefineOutputMember(object, api_type, qualifier, "float4", "Normal", -1, "TEXCOORD", xfmem.numTexGen.numTexGens + 1);
|
||||
{
|
||||
DefineOutputMember(object, api_type, qualifier, "float3", "Normal", -1, "TEXCOORD", xfmem.numTexGen.numTexGens + 1);
|
||||
DefineOutputMember(object, api_type, qualifier, "float3", "WorldPos", -1, "TEXCOORD", xfmem.numTexGen.numTexGens + 2);
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@ -271,7 +274,10 @@ static inline void AssignVSOutputMembers(T& object, const char* a, const char* b
|
||||
object.Write("\t%s.clipPos = %s.clipPos;\n", a, b);
|
||||
|
||||
if (g_ActiveConfig.bEnablePixelLighting)
|
||||
{
|
||||
object.Write("\t%s.Normal = %s.Normal;\n", a, b);
|
||||
object.Write("\t%s.WorldPos = %s.WorldPos;\n", a, b);
|
||||
}
|
||||
}
|
||||
|
||||
// Constant variable names
|
||||
|
Reference in New Issue
Block a user