Program Listing for File vulkan-range-repeat-cache-cmdbuffer.h
↰ Return to documentation for file (include\playback\vulkan-range-repeat-cache-cmdbuffer.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/range-repeat-cache.h"
#include "playback/vulkan-range-repeat-cache.h"
#define VK_NO_PROTOTYPES
#include <vulkan/vulkan.h>
#undef VK_NO_PROTOTYPES
#include <vector>
#include <list>
#include <atomic>
#include <map>
#include <set>
namespace gpa {
namespace playback {
class Callable;
namespace repeat {
namespace vulkan {
struct MemoryBarrierChange
{
VkAccessFlags dstAccessMask;
};
struct MemoryBarrierUpdates
{
std::map<VkDeviceMemory, MemoryBarrierChange> memoryBarrierChanges;
std::map<VkBuffer, MemoryBarrierChange> bufferBarrierChanges;
std::map<VkImage, MemoryBarrierChange> imageBarrierChanges;
};
class RangeRepeatCacheVkCommandBuffer final
: public RangeRepeatCacheVKForCommandBufers
{
public:
typedef std::shared_ptr<RangeRepeatCacheVkCommandBuffer> Ptr;
RangeRepeatCacheVkCommandBuffer(void* object, uint64_t captureKey, Context* context, Callable* callable);
~RangeRepeatCacheVkCommandBuffer() override final;
void OnRangeRepeatRecreateObject(GPADispatchTable const*& table, uint64_t repeatPass) override final;
void OnRangeRepeatRestoreState(GPADispatchTable const*& table, uint64_t repeatPass) override final;
void OnRangeExit(GPADispatchTable const*& table) override final;
void AddCall(Callable* callable) override final;
void SetUsedInRange(bool value) override final;
void ClearCallables() override final;
void OnReset();
void OnReincarnation(playback::Context* context, Callable* callable);
void EnumerateCallablesFromIncarnation(uint64_t timestamp, CallableCache::EnumerateCallablesCallback callback, void* userData);
MemoryBarrierUpdates& GetMemoryBarrierUpdates();
void AddModifiedBuffer(VkBuffer buffer);
std::set<VkBuffer> const& ModifiedBuffers();
VkDevice GetDevice();
private:
void FreeUsedReplacements(GPADispatchTable const*& table);
VkCommandBufferAllocateInfo mCommandBufferInfo;
VkDevice mDevice{VK_NULL_HANDLE};
VkCommandBuffer mCurrentCommandBuffer{VK_NULL_HANDLE};
std::vector<VkCommandBuffer> mSecondaryCommandBuffers;
std::vector<VkCommandBuffer> mUsedReplacements;
// Tracking final barrier changes
MemoryBarrierUpdates mMemoryBarrierUpdates;
std::set<VkBuffer> mModifiedBuffers;
std::vector<CmdBufferIncarnation> mIncarnations;
};
} // namespace vulkan
} // namespace repeat
} // namespace playback
} // namespace gpa