mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:41:10 +02:00
Add name of the batch during tracing and introduce detailed tracing if needed and one error message in the case the materialMap is detected in an fst file but not understood
This commit is contained in:
parent
86972cf4fb
commit
986dece4ec
3 changed files with 101 additions and 1 deletions
|
@ -128,7 +128,11 @@ void FBXReader::consolidateFBXMaterials(const QVariantHash& mapping) {
|
||||||
QString materialMapString = mapping.value("materialMap").toString();
|
QString materialMapString = mapping.value("materialMap").toString();
|
||||||
QJsonDocument materialMapDocument = QJsonDocument::fromJson(materialMapString.toUtf8());
|
QJsonDocument materialMapDocument = QJsonDocument::fromJson(materialMapString.toUtf8());
|
||||||
QJsonObject materialMap = materialMapDocument.object();
|
QJsonObject materialMap = materialMapDocument.object();
|
||||||
|
if (!materialMapString.isEmpty()) {
|
||||||
|
if (materialMapDocument.isEmpty() || materialMap.isEmpty()) {
|
||||||
|
qCDebug(modelformat) << "fbx Material Map found but did not produce valid JSON:" << materialMapString;
|
||||||
|
}
|
||||||
|
}
|
||||||
for (QHash<QString, FBXMaterial>::iterator it = _fbxMaterials.begin(); it != _fbxMaterials.end(); it++) {
|
for (QHash<QString, FBXMaterial>::iterator it = _fbxMaterials.begin(); it != _fbxMaterials.end(); it++) {
|
||||||
FBXMaterial& material = (*it);
|
FBXMaterial& material = (*it);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
#include "nvToolsExt.h"
|
#include "nvToolsExt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Define the GPU_BATCH_DETAILED_TRACING to get detailed tracing of the commands during the batch executions
|
||||||
|
// #define GPU_BATCH_DETAILED_TRACING
|
||||||
|
|
||||||
#include <GPUIdent.h>
|
#include <GPUIdent.h>
|
||||||
|
|
||||||
#include "GLTexture.h"
|
#include "GLTexture.h"
|
||||||
|
@ -271,6 +274,8 @@ void GLBackend::renderPassDraw(const Batch& batch) {
|
||||||
case Batch::COMMAND_drawIndexedInstanced:
|
case Batch::COMMAND_drawIndexedInstanced:
|
||||||
case Batch::COMMAND_multiDrawIndirect:
|
case Batch::COMMAND_multiDrawIndirect:
|
||||||
case Batch::COMMAND_multiDrawIndexedIndirect: {
|
case Batch::COMMAND_multiDrawIndexedIndirect: {
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "drawcall");
|
||||||
|
|
||||||
// updates for draw calls
|
// updates for draw calls
|
||||||
++_currentDraw;
|
++_currentDraw;
|
||||||
updateInput();
|
updateInput();
|
||||||
|
@ -281,6 +286,94 @@ void GLBackend::renderPassDraw(const Batch& batch) {
|
||||||
(this->*(call))(batch, *offset);
|
(this->*(call))(batch, *offset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef GPU_BATCH_DETAILED_TRACING
|
||||||
|
//case Batch::COMMAND_setModelTransform:
|
||||||
|
//case Batch::COMMAND_setViewTransform:
|
||||||
|
//case Batch::COMMAND_setProjectionTransform:
|
||||||
|
case Batch::COMMAND_setProjectionJitter:
|
||||||
|
case Batch::COMMAND_setViewportTransform:
|
||||||
|
case Batch::COMMAND_setDepthRangeTransform:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "transform");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_clearFramebuffer:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "clear");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_blit:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "blit");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_setInputFormat:
|
||||||
|
case Batch::COMMAND_setInputBuffer:
|
||||||
|
case Batch::COMMAND_setIndexBuffer:
|
||||||
|
case Batch::COMMAND_setIndirectBuffer: {
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "input");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_setStateBlendFactor:
|
||||||
|
case Batch::COMMAND_setStateScissorRect:
|
||||||
|
case Batch::COMMAND_setPipeline: {
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "pipeline");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_setUniformBuffer:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "ubo");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_setResourceBuffer:
|
||||||
|
case Batch::COMMAND_setResourceTexture:
|
||||||
|
case Batch::COMMAND_setResourceTextureTable:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "resource");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Batch::COMMAND_setResourceFramebufferSwapChainTexture:
|
||||||
|
case Batch::COMMAND_setFramebuffer:
|
||||||
|
case Batch::COMMAND_setFramebufferSwapChain:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "framebuffer");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_generateTextureMips:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "genMipMaps");
|
||||||
|
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Batch::COMMAND_beginQuery:
|
||||||
|
case Batch::COMMAND_endQuery:
|
||||||
|
case Batch::COMMAND_getQuery:
|
||||||
|
{
|
||||||
|
PROFILE_RANGE(render_gpu_gl_detail, "query");
|
||||||
|
CommandCall call = _commandCalls[(*command)];
|
||||||
|
(this->*(call))(batch, *offset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
default: {
|
default: {
|
||||||
CommandCall call = _commandCalls[(*command)];
|
CommandCall call = _commandCalls[(*command)];
|
||||||
(this->*(call))(batch, *offset);
|
(this->*(call))(batch, *offset);
|
||||||
|
@ -294,6 +387,8 @@ void GLBackend::renderPassDraw(const Batch& batch) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLBackend::render(const Batch& batch) {
|
void GLBackend::render(const Batch& batch) {
|
||||||
|
PROFILE_RANGE(render_gpu_gl, batch.getName());
|
||||||
|
|
||||||
_transform._skybox = _stereo._skybox = batch.isSkyboxEnabled();
|
_transform._skybox = _stereo._skybox = batch.isSkyboxEnabled();
|
||||||
// Allow the batch to override the rendering stereo settings
|
// Allow the batch to override the rendering stereo settings
|
||||||
// for things like full framebuffer copy operations (deferred lighting passes)
|
// for things like full framebuffer copy operations (deferred lighting passes)
|
||||||
|
|
|
@ -95,6 +95,7 @@ public:
|
||||||
~Batch();
|
~Batch();
|
||||||
|
|
||||||
void setName(const char* name);
|
void setName(const char* name);
|
||||||
|
const char* getName() const { return _name; }
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
// Batches may need to override the context level stereo settings
|
// Batches may need to override the context level stereo settings
|
||||||
|
|
Loading…
Reference in a new issue