#include "state_tracker/cmd_buffer_state.h"
#include "state_tracker/descriptor_sets.h"
#include "state_tracker/render_pass_state.h"
#include "state_tracker/pipeline_state.h"
#include "state_tracker/buffer_state.h"
#include "state_tracker/image_state.h"
static ShaderObjectStage inline ConvertToShaderObjectStage(VkShaderStageFlagBits stage) { … }
std::string AttachmentInfo::Describe(AttachmentSource source, uint32_t index) const { … }
#ifdef VK_USE_PLATFORM_METAL_EXT
static bool GetMetalExport(const VkEventCreateInfo *info) {
bool retval = false;
auto export_metal_object_info = vku::FindStructInPNextChain<VkExportMetalObjectCreateInfoEXT>(info->pNext);
while (export_metal_object_info) {
if (export_metal_object_info->exportObjectType == VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT) {
retval = true;
break;
}
export_metal_object_info = vku::FindStructInPNextChain<VkExportMetalObjectCreateInfoEXT>(export_metal_object_info->pNext);
}
return retval;
}
#endif
namespace vvl {
Event::Event(VkEvent handle, const VkEventCreateInfo *create_info)
: … { … }
CommandPool::CommandPool(ValidationStateTracker &dev, VkCommandPool handle, const VkCommandPoolCreateInfo *create_info,
VkQueueFlags flags)
: … { … }
void CommandPool::Allocate(const VkCommandBufferAllocateInfo *allocate_info, const VkCommandBuffer *command_buffers) { … }
void CommandPool::Free(uint32_t count, const VkCommandBuffer *command_buffers) { … }
void CommandPool::Reset(const Location &loc) { … }
void CommandPool::Destroy() { … }
void CommandBuffer::SetActiveSubpass(uint32_t subpass) { … }
CommandBuffer::CommandBuffer(ValidationStateTracker &dev, VkCommandBuffer handle, const VkCommandBufferAllocateInfo *allocate_info,
const vvl::CommandPool *pool)
: … { … }
vvl::ImageView *CommandBuffer::GetActiveAttachmentImageViewState(uint32_t index) { … }
const vvl::ImageView *CommandBuffer::GetActiveAttachmentImageViewState(uint32_t index) const { … }
void CommandBuffer::AddChild(std::shared_ptr<StateObject> &child_node) { … }
void CommandBuffer::RemoveChild(std::shared_ptr<StateObject> &child_node) { … }
void CommandBuffer::ResetCBState() { … }
void CommandBuffer::Reset(const Location &loc) { … }
void CommandBuffer::IncrementResources() { … }
void CommandBuffer::ResetPushConstantRangesLayoutIfIncompatible(const vvl::PipelineLayout &pipeline_layout_state) { … }
void CommandBuffer::Destroy() { … }
void CommandBuffer::NotifyInvalidate(const StateObject::NodeList &invalid_nodes, bool unlink) { … }
const CommandBuffer::ImageLayoutMap &CommandBuffer::GetImageSubresourceLayoutMap() const { … }
std::shared_ptr<const ImageSubresourceLayoutMap> CommandBuffer::GetImageSubresourceLayoutMap(VkImage image) const { … }
std::shared_ptr<ImageSubresourceLayoutMap> CommandBuffer::GetImageSubresourceLayoutMap(const vvl::Image &image_state) { … }
static bool SetQueryState(const QueryObject &object, QueryState value, QueryMap *localQueryToStateMap) { … }
void CommandBuffer::BeginQuery(const QueryObject &query_obj) { … }
void CommandBuffer::EndQuery(const QueryObject &query_obj) { … }
bool CommandBuffer::UpdatesQuery(const QueryObject &query_obj) const { … }
static bool SetQueryStateMulti(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, uint32_t perfPass, QueryState value,
QueryMap *localQueryToStateMap) { … }
void CommandBuffer::EndQueries(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) { … }
void CommandBuffer::ResetQueryPool(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) { … }
void CommandBuffer::UpdateSubpassAttachments() { … }
void CommandBuffer::UpdateAttachmentsView(const VkRenderPassBeginInfo *pRenderPassBegin) { … }
void CommandBuffer::BeginRenderPass(Func command, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassContents contents) { … }
void CommandBuffer::NextSubpass(Func command, VkSubpassContents contents) { … }
void CommandBuffer::EndRenderPass(Func command) { … }
void CommandBuffer::BeginRendering(Func command, const VkRenderingInfo *pRenderingInfo) { … }
void CommandBuffer::EndRendering(Func command) { … }
void CommandBuffer::BeginVideoCoding(const VkVideoBeginCodingInfoKHR *pBeginInfo) { … }
void CommandBuffer::EndVideoCoding(const VkVideoEndCodingInfoKHR *pEndCodingInfo) { … }
void CommandBuffer::ControlVideoCoding(const VkVideoCodingControlInfoKHR *pControlInfo) { … }
void vvl::CommandBuffer::EnqueueUpdateVideoInlineQueries(const VkVideoInlineQueryInfoKHR &query_info) { … }
void CommandBuffer::DecodeVideo(const VkVideoDecodeInfoKHR *pDecodeInfo) { … }
void vvl::CommandBuffer::EncodeVideo(const VkVideoEncodeInfoKHR *pEncodeInfo) { … }
void CommandBuffer::Begin(const VkCommandBufferBeginInfo *pBeginInfo) { … }
void CommandBuffer::End(VkResult result) { … }
void CommandBuffer::ExecuteCommands(vvl::span<const VkCommandBuffer> secondary_command_buffers) { … }
void CommandBuffer::PushDescriptorSetState(VkPipelineBindPoint pipelineBindPoint, const vvl::PipelineLayout &pipeline_layout,
uint32_t set, uint32_t descriptorWriteCount,
const VkWriteDescriptorSet *pDescriptorWrites) { … }
void CommandBuffer::UpdateDrawCmd(Func command) { … }
void CommandBuffer::UpdateDispatchCmd(Func command) { … }
void CommandBuffer::UpdateTraceRayCmd(Func command) { … }
void CommandBuffer::UpdatePipelineState(Func command, const VkPipelineBindPoint bind_point) { … }
static bool PushDescriptorCleanup(LastBound &last_bound, uint32_t set_idx) { … }
void CommandBuffer::UpdateLastBoundDescriptorSets(VkPipelineBindPoint pipeline_bind_point,
const vvl::PipelineLayout &pipeline_layout, uint32_t first_set,
uint32_t set_count, const VkDescriptorSet *pDescriptorSets,
std::shared_ptr<vvl::DescriptorSet> &push_descriptor_set,
uint32_t dynamic_offset_count, const uint32_t *p_dynamic_offsets) { … }
void CommandBuffer::UpdateLastBoundDescriptorBuffers(VkPipelineBindPoint pipeline_bind_point,
const vvl::PipelineLayout &pipeline_layout, uint32_t first_set,
uint32_t set_count, const uint32_t *buffer_indicies,
const VkDeviceSize *buffer_offsets) { … }
void CommandBuffer::SetImageLayout(const vvl::Image &image_state, const VkImageSubresourceRange &image_subresource_range,
VkImageLayout layout, VkImageLayout expected_layout) { … }
void CommandBuffer::SetImageViewInitialLayout(const vvl::ImageView &view_state, VkImageLayout layout) { … }
void CommandBuffer::SetImageInitialLayout(const vvl::Image &image_state, const VkImageSubresourceRange &range,
VkImageLayout layout) { … }
void CommandBuffer::SetImageInitialLayout(VkImage image, const VkImageSubresourceRange &range, VkImageLayout layout) { … }
void CommandBuffer::SetImageInitialLayout(const vvl::Image &image_state, const VkImageSubresourceLayers &layers,
VkImageLayout layout) { … }
void CommandBuffer::SetImageViewLayout(const vvl::ImageView &view_state, VkImageLayout layout, VkImageLayout layoutStencil) { … }
void CommandBuffer::RecordCmd(Func command) { … }
void CommandBuffer::RecordStateCmd(Func command, CBDynamicState state) { … }
void CommandBuffer::RecordDynamicState(CBDynamicState state) { … }
void CommandBuffer::RecordTransferCmd(Func command, std::shared_ptr<Bindable> &&buf1, std::shared_ptr<Bindable> &&buf2) { … }
void CommandBuffer::RecordSetEvent(Func command, VkEvent event, VkPipelineStageFlags2KHR stageMask) { … }
void CommandBuffer::RecordResetEvent(Func command, VkEvent event, VkPipelineStageFlags2KHR stageMask) { … }
void CommandBuffer::RecordWaitEvents(Func command, uint32_t eventCount, const VkEvent *pEvents,
VkPipelineStageFlags2KHR src_stage_mask) { … }
void CommandBuffer::RecordBarriers(uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers,
uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { … }
void CommandBuffer::RecordBarriers(const VkDependencyInfoKHR &dep_info) { … }
void CommandBuffer::RecordWriteTimestamp(Func command, VkPipelineStageFlags2KHR pipelineStage, VkQueryPool queryPool,
uint32_t slot) { … }
void CommandBuffer::Submit(VkQueue queue, uint32_t perf_submit_pass, const Location &loc) { … }
void CommandBuffer::Retire(uint32_t perf_submit_pass, const std::function<bool(const QueryObject &)> &is_query_updated_after) { … }
uint32_t CommandBuffer::GetDynamicColorAttachmentCount() const { … }
bool CommandBuffer::HasValidDynamicDepthAttachment() const { … }
bool CommandBuffer::HasValidDynamicStencilAttachment() const { … }
bool CommandBuffer::HasExternalFormatResolveAttachment() const { … }
void CommandBuffer::BindShader(VkShaderStageFlagBits shader_stage, vvl::ShaderObject *shader_object_state) { … }
void CommandBuffer::UnbindResources() { … }
LogObjectList CommandBuffer::GetObjectList(VkShaderStageFlagBits stage) const { … }
LogObjectList CommandBuffer::GetObjectList(VkPipelineBindPoint pipeline_bind_point) const { … }
vvl::Pipeline *CommandBuffer::GetCurrentPipeline(VkPipelineBindPoint pipelineBindPoint) const { … }
void CommandBuffer::GetCurrentPipelineAndDesriptorSets(VkPipelineBindPoint pipelineBindPoint, const vvl::Pipeline **rtn_pipe,
const std::vector<LastBound::PER_SET> **rtn_sets) const { … }
void CommandBuffer::BeginLabel(const char *label_name) { … }
void CommandBuffer::EndLabel() { … }
void CommandBuffer::ReplayLabelCommands(const vvl::span<const LabelCommand> &label_commands,
std::vector<std::string> &label_stack) { … }
std::string CommandBuffer::GetDebugRegionName(const std::vector<LabelCommand> &label_commands, uint32_t label_command_index,
const std::vector<std::string> &initial_label_stack) { … }
std::string CommandBuffer::DescribeInvalidatedState(CBDynamicState dynamic_state) const { … }
}