I think I need a different approach for how I've set up rendering. I'm getting serious bottlenecks from having a shit load of GameObjects
About 500-600 simple cubes sharing the same mat/shader/etc will bring the fps down to <30
void Batch::Render(ID3D12GraphicsCommandList2* commandList, D3D12_VIEWPORT viewPort, D3D12_RECT scissorRect, D3D12_CPU_DESCRIPTOR_HANDLE rtv, D3D12_CPU_DESCRIPTOR_HANDLE dsv, XMMATRIX viewProj, Frustum& frustum)
{
for (int i = 0; i < m_gameObjectList.size(); i++)
{
XMFLOAT3 pos;
float radius;
m_gameObjectList[i]->GetBoundingSphere(pos, radius);
if (!FRUSTUM_CULLING_ENABLED || frustum.CheckSphere(pos, radius))
m_gameObjectList[i]->Render(commandList, m_rootSignature.Get(), viewPort, scissorRect, rtv, dsv, viewProj);
}
for (int i = 0; i < m_gameObjectListTransparent.size(); i++)
{
XMFLOAT3 pos;
float radius;
m_gameObjectListTransparent[i]->GetBoundingSphere(pos, radius);
if (!FRUSTUM_CULLING_ENABLED || frustum.CheckSphere(pos, radius))
m_gameObjectListTransparent[i]->Render(commandList, m_rootSignature.Get(), viewPort, scissorRect, rtv, dsv, viewProj);
}
}```