mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:47:42 +00:00
GLSL refactors to support Vulkan
This commit is contained in:
@@ -136,6 +136,11 @@ static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f,
|
||||
0.f, 0.f, 1.f, 1.f,
|
||||
0.f, 0.f, 0.f, 1.f);
|
||||
|
||||
static const zeus::CMatrix4f PlusOneZFlip(1.f, 0.f, 0.f, 0.f,
|
||||
0.f, -1.f, 0.f, 0.f,
|
||||
0.f, 0.f, 1.f, 1.f,
|
||||
0.f, 0.f, 0.f, 1.f);
|
||||
|
||||
zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||
float near, float far,
|
||||
bool forRenderer)
|
||||
@@ -184,6 +189,14 @@ zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||
0.f, 0.f, -1.f, 0.f);
|
||||
return PlusOneZ * mat2;
|
||||
}
|
||||
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
||||
{
|
||||
zeus::CMatrix4f mat2(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||
0.f, 2.f * st.x14_near / tmb, tpb / tmb, 0.f,
|
||||
0.f, 0.f, st.x18_far / fmn, st.x14_near * st.x18_far / fmn,
|
||||
0.f, 0.f, -1.f, 0.f);
|
||||
return PlusOneZFlip * mat2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +237,14 @@ zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer)
|
||||
0.f, 0.f, -1.f, 0.f);
|
||||
return PlusOneZ * mat2;
|
||||
}
|
||||
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
||||
{
|
||||
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||
0.f, 0.f, g_Proj.x18_far / fmn, g_Proj.x14_near * g_Proj.x18_far / fmn,
|
||||
0.f, 0.f, -1.f, 0.f);
|
||||
return PlusOneZFlip * mat2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user