From 5394ac86726111ea5d6790def85a5529ac79055d Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Wed, 12 Jul 2017 17:33:05 +0200 Subject: [PATCH] Cleaning up changes, removing comments and dead code etc... --- interface/src/Application.cpp | 2 +- .../src/RenderablePolyVoxEntityItem.cpp | 40 +------------------ libraries/render/src/render/DrawTask.cpp | 19 --------- 3 files changed, 2 insertions(+), 59 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1ab8dca762..ddd1870723 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -343,7 +343,7 @@ public: // Don't actually crash in debug builds, in case this apparent deadlock is simply from // the developer actively debugging code #ifdef NDEBUG - // deadlockDetectionCrash(); + deadlockDetectionCrash(); #endif } } diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp index 364195ae0b..1d309a8e14 100644 --- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp @@ -59,12 +59,8 @@ #include "EntityEditPacketSender.h" #include "PhysicalEntitySimulation.h" -//gpu::PipelinePointer RenderablePolyVoxEntityItem::_pipeline = nullptr; -//gpu::PipelinePointer RenderablePolyVoxEntityItem::_wireframePipeline = nullptr; - const float MARCHING_CUBE_COLLISION_HULL_OFFSET = 0.5; - /* A PolyVoxEntity has several interdependent parts: @@ -736,35 +732,6 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) { !mesh->getIndexBuffer()._buffer) { return; } - - /* if (!_pipeline) { - gpu::ShaderPointer vertexShader = gpu::Shader::createVertex(std::string(polyvox_vert)); - gpu::ShaderPointer pixelShader = gpu::Shader::createPixel(std::string(polyvox_frag)); - - gpu::Shader::BindingSet slotBindings; - slotBindings.insert(gpu::Shader::Binding(std::string("materialBuffer"), MATERIAL_GPU_SLOT)); - slotBindings.insert(gpu::Shader::Binding(std::string("xMap"), 0)); - slotBindings.insert(gpu::Shader::Binding(std::string("yMap"), 1)); - slotBindings.insert(gpu::Shader::Binding(std::string("zMap"), 2)); - - gpu::ShaderPointer program = gpu::Shader::createProgram(vertexShader, pixelShader); - gpu::Shader::makeProgram(*program, slotBindings); - - auto state = std::make_shared(); - state->setCullMode(gpu::State::CULL_BACK); - state->setDepthTest(true, true, gpu::LESS_EQUAL); - PrepareStencil::testMaskDrawShape(*state); - - _pipeline = gpu::Pipeline::create(program, state); - - auto wireframeState = std::make_shared(); - wireframeState->setCullMode(gpu::State::CULL_BACK); - wireframeState->setDepthTest(true, true, gpu::LESS_EQUAL); - wireframeState->setFillMode(gpu::State::FILL_LINE); - PrepareStencil::testMaskDrawShape(*wireframeState); - - _wireframePipeline = gpu::Pipeline::create(program, wireframeState); - }*/ if (!_vertexFormat) { auto vf = std::make_shared(); @@ -775,11 +742,6 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) { gpu::Batch& batch = *args->_batch; - // Pick correct Pipeline - // bool wireframe = (render::ShapeKey(args->_globalShapeKey).isWireframe()); - // auto pipeline = (wireframe ? _wireframePipeline : _pipeline); - // batch.setPipeline(pipeline); - Transform transform(voxelToWorldMatrix()); batch.setModelTransform(transform); batch.setInputFormat(_vertexFormat); @@ -1669,7 +1631,7 @@ void RenderablePolyVoxEntityItem::bonkNeighbors() { void RenderablePolyVoxEntityItem::locationChanged(bool tellPhysics) { EntityItem::locationChanged(tellPhysics); - if (/*!_pipeline || */!render::Item::isValidID(_myItem)) { + if (!render::Item::isValidID(_myItem)) { return; } render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene(); diff --git a/libraries/render/src/render/DrawTask.cpp b/libraries/render/src/render/DrawTask.cpp index f7712f59e7..a3175ffdec 100755 --- a/libraries/render/src/render/DrawTask.cpp +++ b/libraries/render/src/render/DrawTask.cpp @@ -44,13 +44,6 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons auto key = item.getShapeKey() | globalKey; if (key.isValid() && !key.hasOwnPipeline()) { args->_shapePipeline = shapeContext->pickPipeline(args, key); - /* if (!args->_shapePipeline) { - if (key.isCustom()) { - if (item.defineCustomShapePipeline(*shapeContext, key)) { - args->_shapePipeline = shapeContext->pickPipeline(args, key); - } - } - }*/ if (args->_shapePipeline) { args->_shapePipeline->prepareShapeItem(args, key, item); item.render(args); @@ -119,18 +112,6 @@ void render::renderStateSortShapes(const RenderContextPointer& renderContext, auto& bucket = sortedShapes[pipelineKey]; args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey); if (!args->_shapePipeline) { - /* if (pipelineKey.isCustom()) { - if (bucket.front().defineCustomShapePipeline(*shapeContext, pipelineKey)) { - args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey); - if (!args->_shapePipeline) { - - } else { - continue; - } - } else { - continue; - } - }*/ continue; } for (auto& item : bucket) {