Merge branch 'master' of github.com:highfidelity/hifi into controller-dispatcher-1

This commit is contained in:
druiz17 2017-09-08 17:07:47 -07:00
commit bf1b5bd061
2 changed files with 13 additions and 5 deletions

View file

@ -648,7 +648,9 @@ void Avatar::render(RenderArgs* renderArgs) {
return; return;
} }
fixupModelsInScene(renderArgs->_scene); if (!isMyAvatar()) {
fixupModelsInScene(renderArgs->_scene);
}
if (showCollisionShapes && shouldRenderHead(renderArgs) && _skeletonModel->isRenderable()) { if (showCollisionShapes && shouldRenderHead(renderArgs) && _skeletonModel->isRenderable()) {
PROFILE_RANGE_BATCH(batch, __FUNCTION__":skeletonBoundingCollisionShapes"); PROFILE_RANGE_BATCH(batch, __FUNCTION__":skeletonBoundingCollisionShapes");

View file

@ -9,6 +9,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#include <LogHandler.h>
#include "DrawTask.h" #include "DrawTask.h"
#include "Logging.h" #include "Logging.h"
@ -48,12 +50,14 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons
if (args->_shapePipeline) { if (args->_shapePipeline) {
args->_shapePipeline->prepareShapeItem(args, key, item); args->_shapePipeline->prepareShapeItem(args, key, item);
item.render(args); item.render(args);
} }
args->_shapePipeline = nullptr; args->_shapePipeline = nullptr;
} else if (key.hasOwnPipeline()) { } else if (key.hasOwnPipeline()) {
item.render(args); item.render(args);
} else { } else {
qCDebug(renderlogging) << "Item could not be rendered with invalid key" << key; qCDebug(renderlogging) << "Item could not be rendered with invalid key" << key;
static QString repeatedCouldNotBeRendered = LogHandler::getInstance().addRepeatedMessageRegex(
"Item could not be rendered with invalid key.*");
} }
args->_itemShapeKey = 0; args->_itemShapeKey = 0;
} }
@ -62,7 +66,7 @@ void render::renderShapes(const RenderContextPointer& renderContext,
const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems, const ShapeKey& globalKey) { const ShapePlumberPointer& shapeContext, const ItemBounds& inItems, int maxDrawnItems, const ShapeKey& globalKey) {
auto& scene = renderContext->_scene; auto& scene = renderContext->_scene;
RenderArgs* args = renderContext->args; RenderArgs* args = renderContext->args;
int numItemsToDraw = (int)inItems.size(); int numItemsToDraw = (int)inItems.size();
if (maxDrawnItems != -1) { if (maxDrawnItems != -1) {
numItemsToDraw = glm::min(numItemsToDraw, maxDrawnItems); numItemsToDraw = glm::min(numItemsToDraw, maxDrawnItems);
@ -104,6 +108,8 @@ void render::renderStateSortShapes(const RenderContextPointer& renderContext,
} else if (key.hasOwnPipeline()) { } else if (key.hasOwnPipeline()) {
ownPipelineBucket.push_back( std::make_tuple(item, key) ); ownPipelineBucket.push_back( std::make_tuple(item, key) );
} else { } else {
static QString repeatedCouldNotBeRendered = LogHandler::getInstance().addRepeatedMessageRegex(
"Item could not be rendered with invalid key.*");
qCDebug(renderlogging) << "Item could not be rendered with invalid key" << key; qCDebug(renderlogging) << "Item could not be rendered with invalid key" << key;
} }
} }
@ -113,7 +119,7 @@ void render::renderStateSortShapes(const RenderContextPointer& renderContext,
for (auto& pipelineKey : sortedPipelines) { for (auto& pipelineKey : sortedPipelines) {
auto& bucket = sortedShapes[pipelineKey]; auto& bucket = sortedShapes[pipelineKey];
args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey); args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey);
if (!args->_shapePipeline) { if (!args->_shapePipeline) {
continue; continue;
} }
args->_itemShapeKey = pipelineKey._flags.to_ulong(); args->_itemShapeKey = pipelineKey._flags.to_ulong();
@ -182,7 +188,7 @@ void DrawBounds::run(const RenderContextPointer& renderContext,
if (!_drawBuffer) { if (!_drawBuffer) {
_drawBuffer = std::make_shared<gpu::Buffer>(sizeOfItemBound); _drawBuffer = std::make_shared<gpu::Buffer>(sizeOfItemBound);
} }
_drawBuffer->setData(numItems * sizeOfItemBound, (const gpu::Byte*) items.data()); _drawBuffer->setData(numItems * sizeOfItemBound, (const gpu::Byte*) items.data());
gpu::doInBatch(args->_context, [&](gpu::Batch& batch) { gpu::doInBatch(args->_context, [&](gpu::Batch& batch) {