Commit dc64895d authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Improved timing of processors, TextureManager enabled by default

parent b2472508
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -220,9 +220,13 @@ namespace campvis {
                    }
                    std::chrono::high_resolution_clock::time_point endTime = std::chrono::high_resolution_clock::now();
                    auto dT = std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime);
                    auto timeSinceLastExec = std::chrono::duration_cast<std::chrono::microseconds>(endTime - processor->getLastExecutionTime());
                    double dTms = double(dT.count()) / 1000.;
                    double timeSinceLastExecMs = double(timeSinceLastExec.count()) / 1000.;

                    LINFO("Executed processor " << processor->getName() << " GPU duration: \t" << double(gpuTimeElapsed)/1e6 << ", total: \t" << dTms << " ms");
                    processor->setLastExeuctionTime(endTime);

                    LINFO("Timing " << processor->getName() << ": GPU: \t" << double(gpuTimeElapsed)/1e6 << "ms, total: \t" << dTms << "ms, since Last Exec: \t" << timeSinceLastExecMs << "ms.");
                }
            }
        }
+10 −0
Original line number Diff line number Diff line
@@ -147,6 +147,16 @@ namespace campvis {
        _clockExecutionTime = value;
    }

    std::chrono::high_resolution_clock::time_point AbstractProcessor::getLastExecutionTime()
    {
        return _lastExecutionTime;
    }

    void AbstractProcessor::setLastExeuctionTime(const std::chrono::high_resolution_clock::time_point & executionTime)
    {
        _lastExecutionTime = executionTime;
    }

    void AbstractProcessor::process(DataContainer& data) {
        if (hasInvalidShader()) {
            updateShader();
+12 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include "core/datastructures/datacontainer.h"
#include "core/properties/propertycollection.h"

#include <chrono>
#include <unordered_map>
#include <string>
#include <vector>
@@ -232,6 +233,16 @@ namespace campvis {
         */
        void setClockExecutionTime(bool value);

        /**
         *  Returns the absolute time of the last (timed) execution
         */
        std::chrono::high_resolution_clock::time_point getLastExecutionTime();

        /**
         *  Sets the absolute time of the last execution
         */
        void setLastExeuctionTime(const std::chrono::high_resolution_clock::time_point& executionTime);

        /**
         * Returns the current lockProcessor status of this processor.
         * If a processor is locked, all of its properties are locked and its process method must not be called.
@@ -388,6 +399,7 @@ namespace campvis {

        tbb::atomic<bool> _enabled;                 ///< flag whether this processor is currently enabled
        tbb::atomic<bool> _clockExecutionTime;      ///< flag whether to measure the execution time of this processor
        std::chrono::high_resolution_clock::time_point _lastExecutionTime; ///< time of last execution
        tbb::atomic<int> _ignorePropertyChanges;    ///< flag whether signals from properties shall be ignored

        /// Flag whether this processor is currently locked
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@

#include "opengljobprocessor.h"

//#define ENABLE_TEXTURE_POOL
#define ENABLE_TEXTURE_POOL

namespace {
    /// private class to format iostream to use points as a thousands separator