mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
VideoBackends: Reimplement SSAA, now for D3D + OGL
This commit is contained in:
@ -279,6 +279,29 @@ static inline void AssignVSOutputMembers(T& object, const char* a, const char* b
|
||||
}
|
||||
}
|
||||
|
||||
// We use the flag "centroid" to fix some MSAA rendering bugs. With MSAA, the
|
||||
// pixel shader will be executed for each pixel which has at least one passed sample.
|
||||
// So there may be rendered pixels where the center of the pixel isn't in the primitive.
|
||||
// As the pixel shader usually renders at the center of the pixel, this position may be
|
||||
// outside the primitive. This will lead to sampling outside the texture, sign changes, ...
|
||||
// As a workaround, we interpolate at the centroid of the coveraged pixel, which
|
||||
// is always inside the primitive.
|
||||
// Without MSAA, this flag is defined to have no effect.
|
||||
static inline const char* GetInterpolationQualifier(API_TYPE api_type, bool in = true, bool in_out = false)
|
||||
{
|
||||
if (!g_ActiveConfig.iMultisampleMode)
|
||||
return "";
|
||||
|
||||
if (!g_ActiveConfig.bSSAA)
|
||||
{
|
||||
if (in_out && api_type == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsBindingLayout)
|
||||
return in ? "centroid in" : "centroid out";
|
||||
return "centroid";
|
||||
}
|
||||
|
||||
return "sample";
|
||||
}
|
||||
|
||||
// Constant variable names
|
||||
#define I_COLORS "color"
|
||||
#define I_KCOLORS "k"
|
||||
|
Reference in New Issue
Block a user