Optimize hot matrix maths in renderer draw call submission (#2135)

This commit is contained in:
juj 2020-05-06 17:38:54 +03:00 committed by GitHub
parent 196dc67d64
commit 486f8bde71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,7 +232,7 @@ namespace bgfx
{
Matrix4 modelView;
const Matrix4& model = frameCache.m_matrixCache.m_cache[_draw.m_startMatrix];
bx::float4x4_mul(&modelView.un.f4x4
bx::model4x4_mul(&modelView.un.f4x4
, &model.un.f4x4
, &m_view[_view].un.f4x4
);
@ -248,7 +248,7 @@ namespace bgfx
{
Matrix4 modelViewProj;
const Matrix4& model = frameCache.m_matrixCache.m_cache[_draw.m_startMatrix];
bx::float4x4_mul(&modelViewProj.un.f4x4
bx::model4x4_mul_viewproj4x4(&modelViewProj.un.f4x4
, &model.un.f4x4
, &m_viewProj[_view].un.f4x4
);