Program Listing for File range-player.h

Return to documentation for file (include\playback\range-player.h)

/******************************************************************************
© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.


 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/

#pragma once

#include "playback/callable-broadcaster.h"
#include "playback/callable-cache.h"
#include "playback/range-repeat-cache.h"

namespace gpa {
namespace playback {

namespace repeat {
class StreamBuilder;
}  // namespace repeat

class Player;
class StreamData;
class PlaybackPreprocessor;

class RangePlayer : public CallableBroadcaster
{
public:
    RangePlayer(Player* player, PlaybackPreprocessor* playbackPreprocessor, bool flattenSecondaryCommandBuffers);
    ~RangePlayer();

    void ConnectExecutionCallbacks(ExecutionCallbacks const& callbacks) override;
    void DisconnectExecutionCallbacks() override;
    void Execute();

    void InitializeRangePlayback();

    bool PlayRange(ExecutionCallbacks const* callbacks);

    void FinalizeRangePlayback();

    CallableCache* GetRangeCache();

private:
    Player* mPlayer = nullptr;
    PlaybackPreprocessor* mPlaybackPreprocessor = nullptr;
    typedef std::vector<gpa::playback::repeat::RangeRepeatCache::Ptr> Snapshot;
    Snapshot mPreSnapshot;
    uint64_t mPassIndex = 0;
    repeat::StreamBuilder* mStreamBuilder = nullptr;

    void SynchronizeQueues(QueuesRequiringGpuSynchronization const& queues = {});
    void PerformSnapshot(CallableCache range, bool flattenSecondaryCommandBuffers);
    void Shutdown();

    ExecutionCallbacks mCallbacks{};

    RangePlayer(RangePlayer const&) = delete;
    RangePlayer& operator=(RangePlayer const&) = delete;
};

}  // namespace playback
}  // namespace gpa