mesh profiling

This commit is contained in:
austin 2025-05-24 22:56:21 -04:00
parent 272a1268a0
commit 3625123363
2 changed files with 9 additions and 0 deletions

View File

@ -1973,6 +1973,7 @@ Performance improvements
- Nearby entity lookup caching per frame
- Far-away entities do not spawn physics by default
Lod emitter service checker function
Mesh profiling

View File

@ -445,6 +445,7 @@ public class Mesh {
}
if(renderPipelineState.getUseLight()){
Globals.profiler.beginAggregateCpuSample("Light");
//Until we switch to uniform buffer objects we will have to buffer lighting data here manually each time we draw
//side note: :(
if(Globals.renderingEngine.getLightManager() == null){
@ -463,6 +464,7 @@ public class Mesh {
}
Globals.renderingEngine.checkError();
Globals.profiler.endCpuSample();
}
if(renderPipelineState.getUseMaterial() && textureMask == null){
@ -483,6 +485,7 @@ public class Mesh {
//
//The texture masking logic
if(textureMask != null){
Globals.profiler.beginAggregateCpuSample("Texture mask");
//
//path that uses already-defined texture objects
if(textureMask.getTextures() != null){
@ -507,6 +510,7 @@ public class Mesh {
}
}
Globals.renderingEngine.checkError();
Globals.profiler.endCpuSample();
}
if(renderPipelineState.getUseShadowMap()){
@ -574,15 +578,19 @@ public class Mesh {
}
if(renderPipelineState.getBufferNonStandardUniforms()){
Globals.profiler.beginAggregateCpuSample("Nonstandard uniforms");
this.bufferAllUniforms(openGLState);
Globals.renderingEngine.checkError();
Globals.profiler.endCpuSample();
}
if(renderPipelineState.getInstanced()){
Globals.profiler.beginAggregateCpuSample("Instance logic");
if(renderPipelineState.getInstanceData()!=null){
InstanceData instanceData = renderPipelineState.getInstanceData();
instanceData.upload(openGLState, renderPipelineState);
}
Globals.profiler.endCpuSample();
}