Stub Maxwell3D Alpha Testing

We stub alpha testing as it doesn't exist in Vulkan and few titles use it, it can be emulated in the future using a shader patch with manually discarding fragments failing the alpha test function but this'll be added in later as it isn't high priority at the moment and has associated overhead with it so other options might be explored at the time.
This commit is contained in:
PixelyIon 2021-11-14 19:57:25 +05:30
parent 83ec99fa48
commit ec378814aa
3 changed files with 10 additions and 0 deletions

View File

@ -531,5 +531,10 @@ namespace skyline::gpu::interconnect {
}
}();
}
void SetAlphaTestEnable(bool enable) {
if (enable)
Logger::Warn("Cannot enable alpha testing due to Vulkan constraints");
}
};
}

View File

@ -183,6 +183,10 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
context.UpdateRenderTargetControl(renderTargetControl);
})
MAXWELL3D_CASE(alphaTestEnable, {
context.SetAlphaTestEnable(alphaTestEnable);
})
MAXWELL3D_CASE(lineWidthSmooth, {
if (*registers.lineSmoothEnable)
context.SetLineWidth(lineWidthSmooth);

View File

@ -108,6 +108,7 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
Register<0x3EB, u32> rtSeparateFragData;
Register<0x458, std::array<type::VertexAttribute, 0x20>> vertexAttributeState;
Register<0x487, type::RenderTargetControl> renderTargetControl;
Register<0x4BB, u32> alphaTestEnable;
Register<0x4C3, type::CompareOp> depthTestFunc;
Register<0x4C4, float> alphaTestRef;
Register<0x4C5, type::CompareOp> alphaTestFunc;