add an option to preserve position invariance

This commit is contained in:
Samuliak 2024-12-18 16:38:55 +01:00
parent 4281f6e0c8
commit fa004a33c6
No known key found for this signature in database
7 changed files with 21 additions and 2 deletions

View file

@ -178,6 +178,8 @@ void RendererShaderMtl::CompileInternal()
// TODO: always disable fast math for problematic shaders
if (g_current_game_profile->GetFastMath())
options->setFastMathEnabled(true);
if (g_current_game_profile->GetPositionInvariance())
options->setPreserveInvariance(true);
NS::Error* error = nullptr;
MTL::Library* library = m_mtlr->GetDevice()->newLibrary(ToNSString(m_mslCode), options, &error);