VertexShaderGen: Clip z using user-defined clipping planes.

This commit is contained in:
Jules Blok
2016-08-04 14:09:35 +02:00
parent 159247f4ad
commit b1ed7e80fb
3 changed files with 10 additions and 0 deletions

View File

@ -196,6 +196,8 @@ inline void GenerateVSOutputMembers(T& object, APIType api_type, u32 texgens,
DefineOutputMember(object, api_type, qualifier, "float3", "WorldPos", -1, "TEXCOORD",
texgens + 2);
}
DefineOutputMember(object, api_type, qualifier, "float", "clipDist", -1, "SV_ClipDistance");
}
template <class T>
@ -216,6 +218,8 @@ inline void AssignVSOutputMembers(T& object, const char* a, const char* b, u32 t
object.Write("\t%s.Normal = %s.Normal;\n", a, b);
object.Write("\t%s.WorldPos = %s.WorldPos;\n", a, b);
}
object.Write("\t%s.clipDist = %s.clipDist;\n", a, b);
}
// We use the flag "centroid" to fix some MSAA rendering bugs. With MSAA, the