Couple of small optimisation

Add option to build for gprof
Do not build by default with the renderstat (they have a reasonable impact on performances)
Separated created ray and castedray in the stats
Trying to force some simple function to be inlined
This commit is contained in:
Godzil
2020-03-13 18:22:35 +00:00
parent aacd4f6c9e
commit 9849c16f66
8 changed files with 32 additions and 20 deletions

View File

@@ -85,20 +85,32 @@ void RenderStats::addRay()
this->rayCount++;
};
void RenderStats::addCastedRay()
{
#pragma omp atomic
this->rayCasted++;
};
void RenderStats::addLightRay()
{
this->addCastedRay();
#pragma omp atomic
this->lightRayEmitedCount++;
};
void RenderStats::addReflectRay()
{
this->addCastedRay();
#pragma omp atomic
this->reflectionRayCount++;
};
void RenderStats::addRefractRay()
{
this->addCastedRay();
#pragma omp atomic
this->refractedRayCount++;
};
@@ -172,7 +184,8 @@ void RenderStats::printStats()
printf("CSG : %lld\n", this->csgCount);
printf("==================================================\n");
printf("Pixel rendered : %lld\n", this->pixelCount);
printf("Ray casted : %lld\n", this->rayCount);
printf("Ray created : %lld\n", this->rayCount);
printf("Ray casted : %lld\n", this->rayCasted);
printf("Light Ray casted : %lld\n", this->lightRayEmitedCount);
printf("Reflection ray casted : %lld\n", this->reflectionRayCount);
printf("Refraction ray casted : %lld\n", this->refractedRayCount);