mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 02:06:30 +02:00
Merge pull request #7781 from zzmp/log/pipeline-flood
Avoid missing pipeline log flood
This commit is contained in:
commit
1e30ba43ea
3 changed files with 15 additions and 5 deletions
|
@ -46,7 +46,7 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons
|
|||
} else if (key.hasOwnPipeline()) {
|
||||
item.render(args);
|
||||
} else {
|
||||
qDebug() << "Item could not be rendered: invalid key ?" << key;
|
||||
qDebug() << "Item could not be rendered with invalid key" << key;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ void render::renderStateSortShapes(const SceneContextPointer& sceneContext, cons
|
|||
} else if (key.hasOwnPipeline()) {
|
||||
ownPipelineBucket.push_back(item);
|
||||
} else {
|
||||
qDebug() << "Item could not be rendered: invalid key ?" << key;
|
||||
qDebug() << "Item could not be rendered with invalid key" << key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,11 @@ const ShapePipelinePointer ShapePlumber::pickPipeline(RenderArgs* args, const Ke
|
|||
|
||||
const auto& pipelineIterator = _pipelineMap.find(key);
|
||||
if (pipelineIterator == _pipelineMap.end()) {
|
||||
qDebug() << "Couldn't find a pipeline from ShapeKey ?" << key;
|
||||
// The first time we can't find a pipeline, we should log it
|
||||
if (_missingKeys.find(key) == _missingKeys.end()) {
|
||||
_missingKeys.insert(key);
|
||||
qDebug() << "Couldn't find a pipeline for" << key;
|
||||
}
|
||||
return PipelinePointer(nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#ifndef hifi_render_ShapePipeline_h
|
||||
#define hifi_render_ShapePipeline_h
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
#include <gpu/Batch.h>
|
||||
#include <RenderArgs.h>
|
||||
|
||||
|
@ -147,7 +149,7 @@ public:
|
|||
bool hasOwnPipeline() const { return _flags[OWN_PIPELINE]; }
|
||||
bool isValid() const { return !_flags[INVALID]; }
|
||||
|
||||
// Hasher for use in unordered_maps
|
||||
// Comparator for use in stl containers
|
||||
class Hash {
|
||||
public:
|
||||
size_t operator() (const ShapeKey& key) const {
|
||||
|
@ -155,7 +157,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
// Comparator for use in unordered_maps
|
||||
// Comparator for use in stl containers
|
||||
class KeyEqual {
|
||||
public:
|
||||
bool operator()(const ShapeKey& lhs, const ShapeKey& rhs) const { return lhs._flags == rhs._flags; }
|
||||
|
@ -271,7 +273,11 @@ public:
|
|||
protected:
|
||||
void addPipelineHelper(const Filter& filter, Key key, int bit, const PipelinePointer& pipeline);
|
||||
PipelineMap _pipelineMap;
|
||||
|
||||
private:
|
||||
mutable std::unordered_set<Key, Key::Hash, Key::KeyEqual> _missingKeys;
|
||||
};
|
||||
|
||||
using ShapePlumberPointer = std::shared_ptr<ShapePlumber>;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue