feat: add microprofiler to the renderer

This commit is contained in:
3UR
2026-03-03 05:58:08 +10:00
parent 5b3d67063f
commit 73fffbbcec
15 changed files with 37749 additions and 2 deletions

View File

@@ -4,11 +4,14 @@
void Renderer::DrawVertexBuffer(C4JRender::ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType,
C4JRender::ePixelShaderType psType)
{
PROFILER_SCOPE("Renderer::DrawVertexBuffer", "DrawVertexBuffer", MP_RED2)
Renderer::Context &c = getContext();
ID3D11DeviceContext *d3d11 = c.m_pDeviceContext;
int drawCount = count;
bool indexed = false;
PROFILER_SCOPE("Renderer::DrawVertexBuffer", "DrawVertexSetup", MP_RED2)
DrawVertexSetup(vType, psType, PrimitiveType, &drawCount, &indexed);
StateUpdate();
@@ -25,6 +28,7 @@ void Renderer::DrawVertexBuffer(C4JRender::ePrimitiveType PrimitiveType, int cou
void Renderer::DrawVertexSetup(C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType, C4JRender::ePrimitiveType PrimitiveType, int *count,
bool *indexed)
{
PROFILER_SCOPE("Renderer::DrawVertexSetup", "DrawVertexSetup", MP_RED2)
Renderer::Context &c = getContext();
ID3D11DeviceContext *d3d11 = c.m_pDeviceContext;
@@ -101,6 +105,7 @@ void Renderer::DrawVertexSetup(C4JRender::eVertexType vType, C4JRender::ePixelSh
void Renderer::DrawVertices(C4JRender::ePrimitiveType PrimitiveType, int count, void *vertices, C4JRender::eVertexType vType,
C4JRender::ePixelShaderType psType)
{
PROFILER_SCOPE("Renderer::DrawVertices", "DrawVertices", MP_RED2)
Renderer::Context &c = getContext();
ID3D11DeviceContext *d3d11 = c.m_pDeviceContext;
Renderer::CommandBuffer *commandBuffer = c.commandBuffer;
@@ -120,6 +125,8 @@ void Renderer::DrawVertices(C4JRender::ePrimitiveType PrimitiveType, int count,
int drawCount = count;
bool indexed = false;
PROFILER_SCOPE("Renderer::DrawVertices", "DrawVertexSetup", MP_RED2)
DrawVertexSetup(vType, psType, PrimitiveType, &drawCount, &indexed);
const UINT stride = vertexStrideTable[vType];