diff --git a/USAGE_android.md b/USAGE_android.md index cbd49cfb72..f5626feb3f 100644 --- a/USAGE_android.md +++ b/USAGE_android.md @@ -306,6 +306,9 @@ option values. | Capture Specific Frames | debug.gfxrecon.capture_frames | STRING | Specify one or more comma-separated frame ranges to capture. Each range will be written to its own file. A frame range can be specified as a single value, to specify a single frame to capture, or as two hyphenated values, to specify the first and last frame to capture. Frame ranges should be specified in ascending order and cannot overlap. Note that frame numbering is 1-based (i.e. the first frame is frame 1). Example: `200,301-305` will create two capture files, one containing a single frame and one containing five frames. Default is: Empty string (all frames are captured). | | Quit after capturing frame ranges | debug.gfxrecon.quit_after_capture_frames | BOOL | Setting it to `true` will force the application to terminate once all frame ranges specified by `debug.gfxrecon.capture_frames` have been captured. Default is: `false` | | Capture trigger for Android | debug.gfxrecon.capture_android_trigger | BOOL | Set during runtime to `true` to start capturing and to `false` to stop. If not set at all then it is disabled (non-trimmed capture). Default is not set. | +| Use asset file | debug.gfxrecon.capture_use_asset_file | BOOL | When set to `true` assets (images, buffers and descriptors) will be stored separately into an asset file instead of the capture file. | +| Dump assets | debug.gfxrecon.capture_android_dump_assets | BOOL | Setting this triggers a dump of all assets into the asset file. Since android options cannot be set by the layer, dumping is done whenever this option switches between from `false` to `true` or from `true` to `false`. Default is: `false` | +| Write state files | debug.gfxrecon.capture_write_state_files | BOOL | When set to `true` for each frame captured its corresponding state will be stored in a separate capture file. Specifying a specific state file can start replaying from the corresponding frame. Default is: `false` | | Capture File Compression Type | debug.gfxrecon.capture_compression_type | STRING | Compression format to use with the capture file. Valid values are: `LZ4`, `ZLIB`, `ZSTD`, and `NONE`. Default is: `LZ4` | | Capture File Timestamp | debug.gfxrecon.capture_file_timestamp | BOOL | Add a timestamp to the capture file as described by [Timestamps](#timestamps). Default is: `true` | | Capture File Flush After Write | debug.gfxrecon.capture_file_flush | BOOL | Flush output stream after each packet is written to the capture file. Default is: `false` | @@ -467,6 +470,17 @@ An existing capture file can be trimmed by replaying the capture with the captur enabled and a trimming frame range or capture trigger enabled. (However, replay for some content may be fast enough using the trigger property may be difficult.) +### Asset files + +When doing a trimmed capture, `debug.gfxrecon.capture_use_asset_file` gives the +option to dump all assets (images, buffers and descriptors) separetly in a +different capture file called the asset file. When this option is enabled +assets are tracked and only those that are changed during a tracking period +(outside of a trim range) are dumped into the asset file. This first time a +trim range is encountered (or the hotkey is pressed) all assets will be dumped, +but the next time this happens only the assets that have been changed will be +dumped. This should speed up the dumping process. + ### Capture Limitations #### Conflicts With Crash Detection Libraries diff --git a/USAGE_desktop_Vulkan.md b/USAGE_desktop_Vulkan.md index 5dc86208c9..2715566437 100644 --- a/USAGE_desktop_Vulkan.md +++ b/USAGE_desktop_Vulkan.md @@ -261,7 +261,9 @@ option values. | Capture Specific Frames | GFXRECON_CAPTURE_FRAMES | STRING | Specify one or more comma-separated frame ranges to capture. Each range will be written to its own file. A frame range can be specified as a single value, to specify a single frame to capture, or as two hyphenated values, to specify the first and last frame to capture. Frame ranges should be specified in ascending order and cannot overlap. Note that frame numbering is 1-based (i.e. the first frame is frame 1). Example: `200,301-305` will create two capture files, one containing a single frame and one containing five frames. Default is: Empty string (all frames are captured). | | Quit after capturing frame ranges | GFXRECON_QUIT_AFTER_CAPTURE_FRAMES | BOOL | Setting it to `true` will force the application to terminate once all frame ranges specified by `GFXRECON_CAPTURE_FRAMES` have been captured. Default is: `false` | | Hotkey Capture Trigger | GFXRECON_CAPTURE_TRIGGER | STRING | Specify a hotkey (any one of F1-F12, TAB, CONTROL) that will be used to start/stop capture. Example: `F3` will set the capture trigger to F3 hotkey. One capture file will be generated for each pair of start/stop hotkey presses. Default is: Empty string (hotkey capture trigger is disabled). | -| Hotkey Capture Trigger Frames | GFXRECON_CAPTURE_TRIGGER_FRAMES | STRING | Specify a limit on the number of frames to be captured via hotkey. Example: `1` will capture exactly one frame when the trigger key is pressed. Default is: Empty string (no limit) | +| Hotkey Capture Trigger Frames | GFXRECON_CAPTURE_TRIGGER_FRAMES | STRING | Specify a limit on the number of frames to be captured via hotkey. Example: `1` will capture exactly one frame when the trigger key is pressed. Default is: Empty string (no limit) | +| Use asset file | GFXRECON_CAPTURE_USE_ASSET_FILE | BOOL | When set to `true` assets (images, buffers and descriptors) will be stored separately into an asset file instead of the capture file. | +| Write state files | GFXRECON_CAPTURE_WRITE_STATE_FILES | BOOL | When set to `true` for each frame captured its corresponding state will be stored in a separate capture file. Specifying a specific state file can start replaying from the corresponding frame. Default is: `false` | | Capture Specific GPU Queue Submits | GFXRECON_CAPTURE_QUEUE_SUBMITS | STRING | Specify one or more comma-separated GPU queue submit call ranges to capture. Queue submit calls are `vkQueueSubmit` for Vulkan and `ID3D12CommandQueue::ExecuteCommandLists` for DX12. Queue submit ranges work as described above in `GFXRECON_CAPTURE_FRAMES` but on GPU queue submit calls instead of frames. Default is: Empty string (all queue submits are captured). | | Capture File Compression Type | GFXRECON_CAPTURE_COMPRESSION_TYPE | STRING | Compression format to use with the capture file. Valid values are: `LZ4`, `ZLIB`, `ZSTD`, and `NONE`. Default is: `LZ4` | | Capture File Timestamp | GFXRECON_CAPTURE_FILE_TIMESTAMP | BOOL | Add a timestamp to the capture file as described by [Timestamps](#timestamps). Default is: `true` | @@ -431,6 +433,17 @@ configured to capture only from frame 100 through frame 200 into a new capture f `gfxrecon-capture.py -f 100-200 gfxrecon-replay gfxrecon-example-capture.gfxr`` +### Asset files + +When doing a trimmed capture, `GFXRECON_CAPTURE_USE_ASSET_FILE` gives the option to +dump all assets (images, buffers and descriptors) separetly in a different capture +file called the asset file. When this option is enabled assets are tracked and +only those that are changed during a tracking period (outside of a trim range) are +dumped into the asset file. This first time a trim range is encountered (or the +hotkey is pressed) all assets will be dumped, but the next time this happens only +the assets that have been changed will be dumped. This should speed up the dumping +process. + ### Capture Script The `gfxrecon-capture-vulkan.py` tool is a convenience script that can be used to @@ -758,7 +771,7 @@ Optional arguments: Enables dumping of resources that are used as inputs in the commands requested for dumping. --dump-resources-dump-all-image-subresources Enables dumping of all image sub resources (mip map levels and array layers). - --pbi-all + --pbi-all Print all block information. --pbis Print block information between block index1 and block index2. @@ -766,7 +779,7 @@ Optional arguments: Specify the number of asynchronous pipeline-creation jobs as integer. If is negative it will be added to the number of cpu-cores, e.g. -1 -> num_cores - 1. Default: 0 (do not use asynchronous operations) - + ``` ### Key Controls diff --git a/android/framework/decode/CMakeLists.txt b/android/framework/decode/CMakeLists.txt index 3889eab031..1acff513cd 100644 --- a/android/framework/decode/CMakeLists.txt +++ b/android/framework/decode/CMakeLists.txt @@ -4,6 +4,8 @@ target_sources(gfxrecon_decode PRIVATE ${GFXRECON_SOURCE_DIR}/framework/decode/annotation_handler.h ${GFXRECON_SOURCE_DIR}/framework/decode/api_decoder.h + ${GFXRECON_SOURCE_DIR}/framework/decode/asset_file_consumer.h + ${GFXRECON_SOURCE_DIR}/framework/decode/asset_file_consumer.cpp ${GFXRECON_SOURCE_DIR}/framework/decode/common_consumer_base.h ${GFXRECON_SOURCE_DIR}/framework/decode/copy_shaders.h ${GFXRECON_SOURCE_DIR}/framework/decode/custom_vulkan_struct_decoders.h diff --git a/android/scripts/gfxrecon.py b/android/scripts/gfxrecon.py index 6b2084f3dc..82b4cec3e4 100644 --- a/android/scripts/gfxrecon.py +++ b/android/scripts/gfxrecon.py @@ -114,6 +114,7 @@ def CreateReplayParser(): parser.add_argument('--pbi-all', action='store_true', default=False, help='Print all block information.') parser.add_argument('--pbis', metavar='RANGES', default=False, help='Print block information between block index1 and block index2') parser.add_argument('--pcj', '--pipeline-creation-jobs', action='store_true', default=False, help='Specify the number of pipeline-creation-jobs or background-threads.') + parser.add_argument('--reuse-asset-file', metavar='REUSE_ASSET_FILE', help='') return parser def MakeExtrasString(args): @@ -282,6 +283,10 @@ def MakeExtrasString(args): arg_list.append('--pcj') arg_list.append('{}'.format(args.pcj)) + if args.reuse_asset_file: + arg_list.append('--reuse-asset-file') + arg_list.append('{}'.format(args.reuse_asset_file)) + if args.file: arg_list.append(args.file) elif not args.version: diff --git a/framework/decode/CMakeLists.txt b/framework/decode/CMakeLists.txt index 00840de1e4..e452df8b65 100644 --- a/framework/decode/CMakeLists.txt +++ b/framework/decode/CMakeLists.txt @@ -32,6 +32,8 @@ target_sources(gfxrecon_decode PRIVATE ${CMAKE_CURRENT_LIST_DIR}/annotation_handler.h ${CMAKE_CURRENT_LIST_DIR}/api_decoder.h + ${CMAKE_CURRENT_LIST_DIR}/asset_file_consumer.h + ${CMAKE_CURRENT_LIST_DIR}/asset_file_consumer.cpp ${CMAKE_CURRENT_LIST_DIR}/common_consumer_base.h ${CMAKE_CURRENT_LIST_DIR}/copy_shaders.h ${CMAKE_CURRENT_LIST_DIR}/custom_vulkan_struct_decoders.h diff --git a/framework/decode/api_decoder.h b/framework/decode/api_decoder.h index 6fc22d846a..dbdaae3886 100644 --- a/framework/decode/api_decoder.h +++ b/framework/decode/api_decoder.h @@ -78,6 +78,8 @@ class ApiDecoder virtual void DispatchStateEndMarker(uint64_t frame_number) = 0; + virtual void DispatchFrameBeginMarker(uint64_t frame_number){}; + virtual void DispatchFrameEndMarker(uint64_t frame_number) = 0; virtual void DispatchDisplayMessageCommand(format::ThreadId thread_id, const std::string& message) = 0; @@ -190,8 +192,15 @@ class ApiDecoder virtual void DispatchGetDx12RuntimeInfo(const format::Dx12RuntimeInfoCommandHeader& runtime_info_header){}; + virtual void DispatchExecuteBlocksFromFile(format::ThreadId thread_id, + uint32_t n_blocks, + int64_t offset, + const std::string& filename){}; + virtual void SetCurrentBlockIndex(uint64_t block_index){}; + virtual void SetCurrentFileOffset(int64_t offset){}; + virtual void SetCurrentApiCallId(format::ApiCallId api_call_id){}; virtual void DispatchSetTlasToBlasDependencyCommand(format::HandleId tlas, diff --git a/framework/decode/asset_file_consumer.cpp b/framework/decode/asset_file_consumer.cpp new file mode 100644 index 0000000000..2693730a48 --- /dev/null +++ b/framework/decode/asset_file_consumer.cpp @@ -0,0 +1,166 @@ +/* +** Copyright (c) 2024 Valve Corporation +** Copyright (c) 2024 LunarG, Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and associated documentation files (the "Software"), +** to deal in the Software without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Software, and to permit persons to whom the +** Software is furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +** DEALINGS IN THE SOFTWARE. +*/ + +#include "decode/custom_vulkan_struct_decoders.h" +#include "format/format.h" +#include "util/defines.h" +#include "util/logging.h" +#include +#include "asset_file_consumer.h" + +#include +#include +#include + +GFXRECON_BEGIN_NAMESPACE(gfxrecon) +GFXRECON_BEGIN_NAMESPACE(decode) + +void AssetFileConsumer::ProcessFrameBeginMarker(uint64_t frame_number) +{ + current_frame_ = frame_number; + + if (!asset_file_offsets_.empty()) + { + auto entry = asset_file_offsets_.find(frame_number); + if (entry != asset_file_offsets_.end()) + { + GFXRECON_LOG_ERROR("Dublicate asset file entries for frame %" PRIu64 "?", frame_number); + } + + // Copy all entries from previous frame + auto last_frame_entry = asset_file_offsets_.rbegin(); + asset_file_offsets_[frame_number] = last_frame_entry->second; + } + + // fprintf(debug_, "%s() %" PRId64 "\n", __func__, frame_number); + // fsync(fileno(debug_)); +} + +void AssetFileConsumer::ProcessInitBufferCommand(format::HandleId device_id, + format::HandleId buffer_id, + uint64_t data_size, + const uint8_t* data) +{ + GFXRECON_UNREFERENCED_PARAMETER(device_id); + GFXRECON_UNREFERENCED_PARAMETER(data_size); + GFXRECON_UNREFERENCED_PARAMETER(data); + + format::FrameAssetFileOffsets& frame_offsets = asset_file_offsets_[current_frame_]; + frame_offsets[buffer_id] = block_header_file_offset_; + // fprintf(debug_, "buffer %" PRIu64 " -> %" PRId64 "\n", buffer_id, block_header_file_offset_); + // fsync(fileno(debug_)); + + if (buffer_id > greatest_id_) + { + greatest_id_ = buffer_id; + } +} + +void AssetFileConsumer::ProcessInitImageCommand(format::HandleId device_id, + format::HandleId image_id, + uint64_t data_size, + uint32_t aspect, + uint32_t layout, + const std::vector& level_sizes, + const uint8_t* data) +{ + GFXRECON_UNREFERENCED_PARAMETER(device_id); + GFXRECON_UNREFERENCED_PARAMETER(data_size); + GFXRECON_UNREFERENCED_PARAMETER(aspect); + GFXRECON_UNREFERENCED_PARAMETER(layout); + GFXRECON_UNREFERENCED_PARAMETER(level_sizes); + GFXRECON_UNREFERENCED_PARAMETER(data); + + format::FrameAssetFileOffsets& frame_offsets = asset_file_offsets_[current_frame_]; + frame_offsets[image_id] = block_header_file_offset_; + // fprintf(debug_, "image %" PRIu64 " -> %" PRId64 "\n", image_id, block_header_file_offset_); + // fsync(fileno(debug_)); + + if (image_id > greatest_id_) + { + greatest_id_ = image_id; + } +} + +void AssetFileConsumer::Process_vkAllocateDescriptorSets( + const ApiCallInfo& call_info, + VkResult returnValue, + format::HandleId device, + StructPointerDecoder* pAllocateInfo, + HandlePointerDecoder* pDescriptorSets) +{ + GFXRECON_UNREFERENCED_PARAMETER(call_info); + GFXRECON_UNREFERENCED_PARAMETER(returnValue); + GFXRECON_UNREFERENCED_PARAMETER(device); + GFXRECON_UNREFERENCED_PARAMETER(pAllocateInfo); + + if (pDescriptorSets != nullptr && pDescriptorSets->GetPointer() != nullptr) + { + // Get only the first one + const format::HandleId desc_id = pDescriptorSets->GetPointer()[0]; + + format::FrameAssetFileOffsets& frame_offsets = asset_file_offsets_[current_frame_]; + asset_file_offsets_[current_frame_][desc_id] = block_header_file_offset_; + // fprintf(debug_, "%" PRIu64 " -> %" PRId64 "\n", desc_id, block_header_file_offset_); + // fsync(fileno(debug_)); + + if (desc_id > greatest_id_) + { + greatest_id_ = desc_id; + } + } +} + +void AssetFileConsumer::Process_vkUpdateDescriptorSets( + const ApiCallInfo& call_info, + format::HandleId device, + uint32_t descriptorWriteCount, + StructPointerDecoder* pDescriptorWrites, + uint32_t descriptorCopyCount, + StructPointerDecoder* pDescriptorCopies) +{ + if (descriptorWriteCount && pDescriptorWrites != nullptr) + { + Decoded_VkWriteDescriptorSet* writes_meta = pDescriptorWrites->GetMetaStructPointer(); + if (writes_meta != nullptr) + { + const format::HandleId desc_id = writes_meta->dstSet; + + format::FrameAssetFileOffsets& frame_offsets = asset_file_offsets_[current_frame_]; + const auto new_entry = frame_offsets.insert({ desc_id, block_header_file_offset_ }); + if (new_entry.second) + { + // fprintf(debug_, "%" PRIu64 " -> %" PRId64 "\n", desc_id, block_header_file_offset_); + // fsync(fileno(debug_)); + } + + if (desc_id > greatest_id_) + { + greatest_id_ = desc_id; + } + } + } +} + +GFXRECON_END_NAMESPACE(gfxrecon) +GFXRECON_END_NAMESPACE(decode) diff --git a/framework/decode/asset_file_consumer.h b/framework/decode/asset_file_consumer.h new file mode 100644 index 0000000000..c60f207aa6 --- /dev/null +++ b/framework/decode/asset_file_consumer.h @@ -0,0 +1,117 @@ +/* +** Copyright (c) 2024 Valve Corporation +** Copyright (c) 2024 LunarG, Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and associated documentation files (the "Software"), +** to deal in the Software without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Software, and to permit persons to whom the +** Software is furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +** DEALINGS IN THE SOFTWARE. +*/ + +#ifndef GFXRECON_DECODE_ASSET_FILE_CONSUMER_BASE_H +#define GFXRECON_DECODE_ASSET_FILE_CONSUMER_BASE_H + +#include "format/format.h" +#include "generated/generated_vulkan_consumer.h" +#include "util/defines.h" + +#include "util/platform.h" + +#include +#include +#include + +GFXRECON_BEGIN_NAMESPACE(gfxrecon) +GFXRECON_BEGIN_NAMESPACE(decode) + +class AssetFileConsumer : public VulkanConsumer +{ + public: + AssetFileConsumer() : current_frame_(0), greatest_id_(0) + { + // #if defined(VK_USE_PLATFORM_ANDROID_KHR) + // if (util::platform::FileOpen(&debug_, "/storage/emulated/0/Download/AssetFileConsumer2.txt", "a")) + // #else + // if (util::platform::FileOpen(&debug_, "AssetFileConsumer.txt", "a")) + // #endif + // { + // assert(0); + // } + } + + ~AssetFileConsumer() + { + // if (debug_) + // { + // util::platform::FileClose(debug_); + // } + } + + virtual void ProcessFrameBeginMarker(uint64_t frame_number) override; + + virtual void ProcessInitBufferCommand(format::HandleId device_id, + format::HandleId buffer_id, + uint64_t data_size, + const uint8_t* data) override; + + virtual void ProcessInitImageCommand(format::HandleId device_id, + format::HandleId image_id, + uint64_t data_size, + uint32_t aspect, + uint32_t layout, + const std::vector& level_sizes, + const uint8_t* data) override; + + virtual void + Process_vkAllocateDescriptorSets(const ApiCallInfo& call_info, + VkResult returnValue, + format::HandleId device, + StructPointerDecoder* pAllocateInfo, + HandlePointerDecoder* pDescriptorSets) override; + + virtual void + Process_vkUpdateDescriptorSets(const ApiCallInfo& call_info, + format::HandleId device, + uint32_t descriptorWriteCount, + StructPointerDecoder* pDescriptorWrites, + uint32_t descriptorCopyCount, + StructPointerDecoder* pDescriptorCopies) override; + + format::AssetFileOffsets GetFrameAssetFileOffsets() const + { + GFXRECON_WRITE_CONSOLE("%s()", __func__) + GFXRECON_WRITE_CONSOLE(" exporting %zu", asset_file_offsets_.size()) + for (const auto frame : asset_file_offsets_) + { + GFXRECON_WRITE_CONSOLE(" ... %zu", frame.second.size()) + } + + return asset_file_offsets_; + } + + format::HandleId GetGreatestId() const { return greatest_id_; } + + private: + format::AssetFileOffsets asset_file_offsets_; + format::FrameNumber current_frame_; + format::HandleId greatest_id_; + // FILE* debug_; +}; + +GFXRECON_END_NAMESPACE(gfxrecon) +GFXRECON_END_NAMESPACE(decode) + +#endif // GFXRECON_DECODE_ASSET_FILE_CONSUMER_BASE_H diff --git a/framework/decode/common_consumer_base.h b/framework/decode/common_consumer_base.h index 96c0a7f5b9..1b5da92edd 100644 --- a/framework/decode/common_consumer_base.h +++ b/framework/decode/common_consumer_base.h @@ -52,6 +52,8 @@ class CommonConsumerBase : public MetadataConsumerBase, public MarkerConsumerBas virtual void SetCurrentBlockIndex(uint64_t block_index) override { block_index_ = block_index; } + virtual void SetCurrentFileOffset(int64_t offset) override { block_header_file_offset_ = offset; } + virtual void ProcessSetEnvironmentVariablesCommand(format::SetEnvironmentVariablesCommand& header, const char* env_string) {} diff --git a/framework/decode/file_processor.cpp b/framework/decode/file_processor.cpp index 304fe3bc2f..ae859884c4 100644 --- a/framework/decode/file_processor.cpp +++ b/framework/decode/file_processor.cpp @@ -25,13 +25,17 @@ #include "decode/file_processor.h" #include "decode/decode_allocator.h" +#include "format/format.h" #include "format/format_util.h" #include "util/compressor.h" #include "util/logging.h" #include "util/platform.h" #include +#include +#include #include +#include GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(decode) @@ -40,9 +44,9 @@ GFXRECON_BEGIN_NAMESPACE(decode) const uint32_t kFirstFrame = 0; FileProcessor::FileProcessor() : - file_header_{}, file_descriptor_(nullptr), current_frame_number_(kFirstFrame), bytes_read_(0), - error_state_(kErrorInvalidFileDescriptor), annotation_handler_(nullptr), compressor_(nullptr), block_index_(0), - api_call_index_(0), block_limit_(0), capture_uses_frame_markers_(false), first_frame_(kFirstFrame + 1) + current_frame_number_(kFirstFrame), error_state_(kErrorInvalidFileDescriptor), annotation_handler_(nullptr), + compressor_(nullptr), block_index_(0), api_call_index_(0), block_limit_(0), capture_uses_frame_markers_(false), + first_frame_(kFirstFrame + 1) {} FileProcessor::FileProcessor(uint64_t block_limit) : FileProcessor() @@ -58,9 +62,9 @@ FileProcessor::~FileProcessor() compressor_ = nullptr; } - if (file_descriptor_) + for (auto& file : active_files_) { - fclose(file_descriptor_); + util::platform::FileClose(file.second.fd); } DecodeAllocator::DestroyInstance(); @@ -76,32 +80,62 @@ void FileProcessor::WaitDecodersIdle() bool FileProcessor::Initialize(const std::string& filename) { - bool success = false; + bool success = OpenFile(filename); - int32_t result = util::platform::FileOpen(&file_descriptor_, filename.c_str(), "rb"); + if (success) + { + success = SetActiveFile(filename, true); + success = success && ProcessFileHeader(); + } + else + { + GFXRECON_LOG_ERROR("Failed to open file %s", filename.c_str()); + error_state_ = kErrorOpeningFile; + } - if ((result == 0) && (file_descriptor_ != nullptr)) + // Find absolute path of capture file + if (success) { - success = ProcessFileHeader(); + size_t last_slash_pos = filename.find_last_of("\\/"); + if (last_slash_pos != std::string::npos) + { + absolute_path_ = filename.substr(0, last_slash_pos + 1); + } + } - if (success) + return success; +} + +std::string FileProcessor::ApplyAbsolutePath(const std::string& file) +{ + if (absolute_path_.empty()) + { + return file; + } + + return absolute_path_ + file; +} + +bool FileProcessor::OpenFile(const std::string& filename) +{ + if (active_files_.find(filename) == active_files_.end()) + { + FILE* fd; + int result = util::platform::FileOpen(&fd, filename.c_str(), "rb"); + if (result || fd == nullptr) { - filename_ = filename; - error_state_ = kErrorNone; + GFXRECON_LOG_ERROR("Failed to open file %s", filename.c_str()); + error_state_ = kErrorOpeningFile; + return false; } else { - fclose(file_descriptor_); - file_descriptor_ = nullptr; + active_files_.emplace(std::piecewise_construct, std::forward_as_tuple(filename), std::forward_as_tuple(fd)); + error_state_ = kErrorNone; } } - else - { - GFXRECON_LOG_ERROR("Failed to open file %s", filename.c_str()); - error_state_ = kErrorOpeningFile; - } - return success; + return true; } bool FileProcessor::ProcessNextFrame() @@ -115,11 +149,11 @@ bool FileProcessor::ProcessNextFrame() else { // If not EOF, determine reason for invalid state. - if (file_descriptor_ == nullptr) + if (GetFileDescriptor() == nullptr) { error_state_ = kErrorInvalidFileDescriptor; } - else if (ferror(file_descriptor_)) + else if (ferror(GetFileDescriptor())) { error_state_ = kErrorReadingFile; } @@ -182,21 +216,23 @@ bool FileProcessor::ProcessFileHeader() { bool success = false; - if (ReadBytes(&file_header_, sizeof(file_header_))) + ActiveFiles& active_file = active_files_[file_stack_.top().filename]; + + if (ReadBytes(&active_file.file_header, sizeof(active_file.file_header))) { - success = format::ValidateFileHeader(file_header_); + success = format::ValidateFileHeader(active_file.file_header); if (success) { - file_options_.resize(file_header_.num_options); + active_file.file_options.resize(active_file.file_header.num_options); - size_t option_data_size = file_header_.num_options * sizeof(format::FileOptionPair); + size_t option_data_size = active_file.file_header.num_options * sizeof(format::FileOptionPair); - success = ReadBytes(file_options_.data(), option_data_size); + success = ReadBytes(active_file.file_options.data(), option_data_size); if (success) { - for (const auto& option : file_options_) + for (const auto& option : active_file.file_options) { switch (option.key) { @@ -236,6 +272,25 @@ bool FileProcessor::ProcessFileHeader() return success; } +void FileProcessor::DecrementRemainingCommands() +{ + if (!file_stack_.size()) + { + return; + } + + ActiveFileContext& current_file = GetCurrentFile(); + + if (!current_file.execute_till_eof) + { + --current_file.remaining_commands; + if (current_file.remaining_commands == 0) + { + file_stack_.pop(); + } + } +} + bool FileProcessor::ProcessBlocks() { format::BlockHeader block_header; @@ -248,6 +303,11 @@ bool FileProcessor::ProcessBlocks() if (success) { + for (auto decoder : decoders_) + { + decoder->SetCurrentFileOffset(util::platform::FileTell(GetFileDescriptor())); + } + success = ReadBlockHeader(&block_header); for (auto decoder : decoders_) @@ -391,7 +451,7 @@ bool FileProcessor::ProcessBlocks() } else { - if (!feof(file_descriptor_)) + if (!feof(GetFileDescriptor())) { // No data has been read for the current block, so we don't use 'HandleBlockReadError' here, as it // assumes that the block header has been successfully read and will print an incomplete block at @@ -403,11 +463,24 @@ bool FileProcessor::ProcessBlocks() block_index_); error_state_ = kErrorReadingBlockHeader; } + else + { + assert(file_stack_.size()); + + ActiveFileContext& current_file = GetCurrentFile(); + if (current_file.execute_till_eof) + { + file_stack_.pop(); + success = !file_stack_.empty(); + } + } } } ++block_index_; + DecrementRemainingCommands(); } + DecrementRemainingCommands(); return success; } @@ -467,9 +540,12 @@ bool FileProcessor::ReadCompressedParameterBuffer(size_t compressed_buffer_size bool FileProcessor::ReadBytes(void* buffer, size_t buffer_size) { - if (util::platform::FileRead(buffer, buffer_size, file_descriptor_)) + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + if (util::platform::FileRead(buffer, buffer_size, file_entry->second.fd)) { - bytes_read_ += buffer_size; + file_entry->second.bytes_read += buffer_size; return true; } return false; @@ -477,21 +553,77 @@ bool FileProcessor::ReadBytes(void* buffer, size_t buffer_size) bool FileProcessor::SkipBytes(size_t skip_size) { - bool success = util::platform::FileSeek(file_descriptor_, skip_size, util::platform::FileSeekCurrent); + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + bool success = util::platform::FileSeek(file_entry->second.fd, skip_size, util::platform::FileSeekCurrent); if (success) { // These technically count as bytes read/processed. - bytes_read_ += skip_size; + file_entry->second.bytes_read += skip_size; + } + + return success; +} + +bool FileProcessor::SeekActiveFile(const std::string& filename, int64_t offset, util::platform::FileSeekOrigin origin) +{ + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + bool success = util::platform::FileSeek(file_entry->second.fd, offset, origin); + + if (success && origin == util::platform::FileSeekCurrent) + { + // These technically count as bytes read/processed. + file_entry->second.bytes_read += offset; } return success; } +bool FileProcessor::SeekActiveFile(int64_t offset, util::platform::FileSeekOrigin origin) +{ + return SeekActiveFile(file_stack_.top().filename, offset, origin); +} + +bool FileProcessor::SetActiveFile(const std::string& filename, bool eteof) +{ + if (active_files_.find(filename) != active_files_.end()) + { + file_stack_.emplace(filename, eteof); + return true; + } + else + { + return false; + } +} + +bool FileProcessor::SetActiveFile(const std::string& filename, + int64_t offset, + util::platform::FileSeekOrigin origin, + bool eteof) +{ + if (active_files_.find(filename) != active_files_.end()) + { + file_stack_.emplace(filename, eteof); + return SeekActiveFile(filename, offset, origin); + } + else + { + return false; + } +} + void FileProcessor::HandleBlockReadError(Error error_code, const char* error_message) { + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + // Report incomplete block at end of file as a warning, other I/O errors as an error. - if (feof(file_descriptor_) && !ferror(file_descriptor_)) + if (feof(file_entry->second.fd) && !ferror(file_entry->second.fd)) { GFXRECON_LOG_WARNING("Incomplete block at end of file"); } @@ -1842,6 +1974,66 @@ bool FileProcessor::ProcessMetaData(const format::BlockHeader& block_header, for decoder->DispatchSetEnvironmentVariablesCommand(header, env_string); } } + else if (meta_data_type == format::MetaDataType::kExecuteBlocksFromFile) + { + format::ExecuteBlocksFromFile exec_from_file; + success = ReadBytes(&exec_from_file.thread_id, sizeof(exec_from_file.thread_id)); + success = success && ReadBytes(&exec_from_file.n_blocks, sizeof(exec_from_file.n_blocks)); + success = success && ReadBytes(&exec_from_file.offset, sizeof(exec_from_file.offset)); + success = success && ReadBytes(&exec_from_file.filename_length, sizeof(exec_from_file.filename_length)); + + if (success) + { + std::string filename_c_str(exec_from_file.filename_length, '\0'); + success = success && ReadBytes(filename_c_str.data(), exec_from_file.filename_length); + if (success) + { + std::string filename = ApplyAbsolutePath(filename_c_str); + + // Check for self references + if (!filename.compare(file_stack_.top().filename)) + { + GFXRECON_LOG_WARNING( + "ExecuteBlocksFromFile is referencing itself. Probably this is not intentional."); + } + + success = OpenFile(filename); + if (success) + { + for (auto decoder : decoders_) + { + decoder->DispatchExecuteBlocksFromFile( + exec_from_file.thread_id, exec_from_file.n_blocks, exec_from_file.offset, filename); + } + + SetActiveFile( + filename, exec_from_file.offset, util::platform::FileSeekSet, exec_from_file.n_blocks == 0); + // We need to add 1 because it will be decremented right after this function returns + file_stack_.top().remaining_commands = exec_from_file.n_blocks + 1; + } + } + } + + if (!success) + { + HandleBlockReadError(kErrorReadingBlockData, "Failed to read runtime info meta-data block"); + } + } + else if (meta_data_type == format::MetaDataType::kSetBlockIndexCommand) + { + format::SetBlockIndexCommand set_block_index; + success = ReadBytes(&set_block_index.thread_id, sizeof(set_block_index.thread_id)); + success = success && ReadBytes(&set_block_index.block_index, sizeof(set_block_index.block_index)); + + if (success) + { + for (auto decoder : decoders_) + { + block_index_ = set_block_index.block_index; + decoder->SetCurrentBlockIndex(block_index_); + } + } + } else { if ((meta_data_type == format::MetaDataType::kReserved23) || @@ -1880,7 +2072,11 @@ bool FileProcessor::ProcessFrameMarker(const format::BlockHeader& block_header, for (auto decoder : decoders_) { - if (marker_type == format::kEndMarker) + if (marker_type == format::kBeginMarker) + { + decoder->DispatchFrameBeginMarker(frame_number); + } + else if (marker_type == format::kEndMarker) { decoder->DispatchFrameEndMarker(frame_number); } diff --git a/framework/decode/file_processor.h b/framework/decode/file_processor.h index 8b8a9fb6c4..25a91d2f18 100644 --- a/framework/decode/file_processor.h +++ b/framework/decode/file_processor.h @@ -32,9 +32,12 @@ #include "util/defines.h" #include +#include +#include #include #include -#include +#include +#include #include GFXRECON_BEGIN_NAMESPACE(gfxrecon) @@ -92,17 +95,55 @@ class FileProcessor // Returns false if processing failed. Use GetErrorState() to determine error condition for failure case. bool ProcessAllFrames(); - const format::FileHeader& GetFileHeader() const { return file_header_; } + const format::FileHeader& GetFileHeader(const std::string& filename) const + { + auto file_entry = active_files_.find(filename); + assert(file_entry != active_files_.end()); + + return file_entry->second.file_header; + } - const std::vector& GetFileOptions() const { return file_options_; } + const std::vector& GetFileOptions(const std::string& filename) const + { + auto file_entry = active_files_.find(filename); + assert(file_entry != active_files_.end()); + + return file_entry->second.file_options; + } uint32_t GetCurrentFrameNumber() const { return current_frame_number_; } - uint64_t GetNumBytesRead() const { return bytes_read_; } + uint64_t GetNumBytesRead() const + { + if (!file_stack_.empty()) + { + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + return file_entry->second.bytes_read; + } + else + { + return 0; + } + } Error GetErrorState() const { return error_state_; } - bool EntireFileWasProcessed() const { return (feof(file_descriptor_) != 0); } + bool EntireFileWasProcessed() const + { + if (!file_stack_.empty()) + { + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + return (feof(file_entry->second.fd) != 0); + } + else + { + return true; + } + } bool UsesFrameMarkers() const { return capture_uses_frame_markers_; } @@ -144,16 +185,32 @@ class FileProcessor void PrintBlockInfo() const; protected: - FILE* file_descriptor_; uint64_t current_frame_number_; std::vector decoders_; AnnotationHandler* annotation_handler_; Error error_state_; - uint64_t bytes_read_; /// @brief Incremented at the end of every block successfully processed. uint64_t block_index_; + protected: + FILE* GetFileDescriptor() + { + assert(!file_stack_.empty()); + + if (!file_stack_.empty()) + { + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + return file_entry->second.fd; + } + else + { + return nullptr; + } + } + private: bool ProcessFileHeader(); @@ -165,25 +222,100 @@ class FileProcessor size_t expected_uncompressed_size, size_t* uncompressed_buffer_size); - bool IsFileHeaderValid() const { return (file_header_.fourcc == GFXRECON_FOURCC); } + bool IsFileHeaderValid() const + { + assert(!file_stack_.empty()); + + if (!file_stack_.empty()) + { + + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + return (file_entry->second.file_header.fourcc == GFXRECON_FOURCC); + } + else + { + return false; + } + } + + bool IsFileValid() const + { + if (!file_stack_.empty()) + { + auto file_entry = active_files_.find(file_stack_.top().filename); + assert(file_entry != active_files_.end()); + + return (file_entry->second.fd && !feof(file_entry->second.fd) && !ferror(file_entry->second.fd)); + } + else + { + return false; + } + } - bool IsFileValid() const { return (file_descriptor_ && !feof(file_descriptor_) && !ferror(file_descriptor_)); } + bool OpenFile(const std::string& filename); + + bool SeekActiveFile(const std::string& filename, int64_t offset, util::platform::FileSeekOrigin origin); + + bool SeekActiveFile(int64_t offset, util::platform::FileSeekOrigin origin); + + bool SetActiveFile(const std::string& filename, bool eteof); + + bool SetActiveFile(const std::string& filename, int64_t offset, util::platform::FileSeekOrigin origin, bool eteof); + + void DecrementRemainingCommands(); + + std::string ApplyAbsolutePath(const std::string& file); private: - std::string filename_; - format::FileHeader file_header_; - std::vector file_options_; - format::EnabledOptions enabled_options_; - std::vector parameter_buffer_; - std::vector compressed_parameter_buffer_; - util::Compressor* compressor_; - uint64_t api_call_index_; - uint64_t block_limit_; - bool capture_uses_frame_markers_; - uint64_t first_frame_; - bool enable_print_block_info_{ false }; - int64_t block_index_from_{ 0 }; - int64_t block_index_to_{ 0 }; + format::EnabledOptions enabled_options_; + std::vector parameter_buffer_; + std::vector compressed_parameter_buffer_; + util::Compressor* compressor_; + uint64_t api_call_index_; + uint64_t block_limit_; + bool capture_uses_frame_markers_; + uint64_t first_frame_; + bool enable_print_block_info_{ false }; + int64_t block_index_from_{ 0 }; + int64_t block_index_to_{ 0 }; + + struct ActiveFiles + { + ActiveFiles() {} + + ActiveFiles(FILE* fd) : fd(fd) {} + + FILE* fd{ nullptr }; + uint64_t bytes_read{ 0 }; + format::FileHeader file_header{ 0 }; + std::vector file_options; + }; + + std::unordered_map active_files_; + + struct ActiveFileContext + { + ActiveFileContext(const std::string& filename) : filename(filename){}; + ActiveFileContext(const std::string& filename, bool eteof) : filename(filename), execute_till_eof(eteof){}; + + std::string filename; + uint32_t remaining_commands{ 0 }; + bool execute_till_eof{ false }; + }; + std::stack file_stack_; + + std::string absolute_path_; + + private: + ActiveFileContext& GetCurrentFile() + { + assert(file_stack_.size()); + + return file_stack_.top(); + } }; GFXRECON_END_NAMESPACE(decode) diff --git a/framework/decode/marker_consumer_base.h b/framework/decode/marker_consumer_base.h index d76dd05212..73607356e3 100644 --- a/framework/decode/marker_consumer_base.h +++ b/framework/decode/marker_consumer_base.h @@ -40,6 +40,8 @@ class MarkerConsumerBase virtual void ProcessStateEndMarker(uint64_t frame_number) {} + virtual void ProcessFrameBeginMarker(uint64_t frame_number) {} + virtual void ProcessFrameEndMarker(uint64_t frame_number) {} }; diff --git a/framework/decode/marker_json_consumer.h b/framework/decode/marker_json_consumer.h index 45592c8a6d..6721e7c17d 100644 --- a/framework/decode/marker_json_consumer.h +++ b/framework/decode/marker_json_consumer.h @@ -45,6 +45,11 @@ class MarkerJsonConsumer : public Base this->writer_->WriteMarker(format::kNameState, "EndMarker", frame_number); } + virtual void ProcessFrameBeginMarker(uint64_t frame_number) + { + this->writer_->WriteMarker(format::kNameFrame, "BeginMarker", frame_number); + } + virtual void ProcessFrameEndMarker(uint64_t frame_number) { this->writer_->WriteMarker(format::kNameFrame, "EndMarker", frame_number); diff --git a/framework/decode/metadata_consumer_base.h b/framework/decode/metadata_consumer_base.h index c3d950414f..4ace352c19 100644 --- a/framework/decode/metadata_consumer_base.h +++ b/framework/decode/metadata_consumer_base.h @@ -26,6 +26,7 @@ #include "util/defines.h" #include "format/format.h" +#include GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(decode) @@ -35,6 +36,8 @@ GFXRECON_BEGIN_NAMESPACE(decode) class MetadataConsumerBase { public: + MetadataConsumerBase() : block_index_(0), block_header_file_offset_(0) {} + virtual void Process_ExeFileInfo(util::filepath::FileInfo& info_record) {} virtual void ProcessDisplayMessageCommand(const std::string& message) {} virtual void ProcessFillMemoryCommand(uint64_t memory_id, uint64_t offset, uint64_t size, const uint8_t* data) {} @@ -104,11 +107,17 @@ class MetadataConsumerBase virtual void ProcessInitSubresourceCommand(const format::InitSubresourceCommandHeader& command_header, const uint8_t* data) {} + virtual void ProcessExecuteBlocksFromFile(uint32_t n_blocks, int64_t offset, const std::string& filename) {} virtual void SetCurrentBlockIndex(uint64_t block_index) {} + virtual void SetCurrentFileOffset(int64_t offset) {} + protected: uint64_t block_index_; + + // Stores the file offset of the last block header + int64_t block_header_file_offset_; }; GFXRECON_END_NAMESPACE(decode) diff --git a/framework/decode/metadata_json_consumer.h b/framework/decode/metadata_json_consumer.h index 1126f797e8..f8ad44e6ec 100644 --- a/framework/decode/metadata_json_consumer.h +++ b/framework/decode/metadata_json_consumer.h @@ -297,7 +297,16 @@ class MetadataJsonConsumer : public Base json_data[var] = val; } } + WriteBlockEnd(); + } + virtual void ProcessExecuteBlocksFromFile(uint32_t n_blocks, int64_t offset, const std::string& filename) override + { + const JsonOptions& json_options = GetJsonOptions(); + auto& jdata = WriteMetaCommandStart("ExecuteBlocksFromFile"); + FieldToJson(jdata["n_blocks"], n_blocks, json_options); + FieldToJson(jdata["offset"], offset, json_options); + FieldToJson(jdata["filename"], filename, json_options); WriteBlockEnd(); } diff --git a/framework/decode/preload_file_processor.cpp b/framework/decode/preload_file_processor.cpp index 7c9d86f6ae..957a4cf2b1 100644 --- a/framework/decode/preload_file_processor.cpp +++ b/framework/decode/preload_file_processor.cpp @@ -300,7 +300,7 @@ bool PreloadFileProcessor::ProcessBlocks() } else { - if (feof(file_descriptor_) == 0) + if (feof(GetFileDescriptor()) == 0) { // No data has been read for the current block, so we don't use 'HandleBlockReadError' here, as // it assumes that the block header has been successfully read and will print an incomplete @@ -327,7 +327,7 @@ bool PreloadFileProcessor::ReadBytes(void* buffer, size_t buffer_size) if (status_ == PreloadStatus::kReplay) { bytes_read = preload_buffer_.Read(buffer, buffer_size); - bytes_read_ += bytes_read; + // bytes_read_ += bytes_read; if (preload_buffer_.ReplayFinished()) { status_ = PreloadStatus::kInactive; @@ -335,8 +335,8 @@ bool PreloadFileProcessor::ReadBytes(void* buffer, size_t buffer_size) } else { - bytes_read = util::platform::FileRead(buffer, buffer_size, file_descriptor_); - bytes_read_ += bytes_read; + bytes_read = util::platform::FileRead(buffer, buffer_size, GetFileDescriptor()); + // bytes_read_ += bytes_read; } return bytes_read == buffer_size; } diff --git a/framework/decode/replay_options.h b/framework/decode/replay_options.h index fa741af611..c0f08a89e1 100644 --- a/framework/decode/replay_options.h +++ b/framework/decode/replay_options.h @@ -61,6 +61,7 @@ struct ReplayOptions int64_t block_index_from{ -1 }; int64_t block_index_to{ -1 }; int32_t num_pipeline_creation_jobs{ 0 }; + bool reuse_asset_file{ true }; }; GFXRECON_END_NAMESPACE(decode) diff --git a/framework/decode/vulkan_decoder_base.cpp b/framework/decode/vulkan_decoder_base.cpp index 93f60b68b1..38f5c1d956 100644 --- a/framework/decode/vulkan_decoder_base.cpp +++ b/framework/decode/vulkan_decoder_base.cpp @@ -54,6 +54,14 @@ void VulkanDecoderBase::DispatchStateEndMarker(uint64_t frame_number) } } +void VulkanDecoderBase::DispatchFrameBeginMarker(uint64_t frame_number) +{ + for (auto consumer : consumers_) + { + consumer->ProcessFrameBeginMarker(frame_number); + } +} + void VulkanDecoderBase::DispatchFrameEndMarker(uint64_t frame_number) { for (auto consumer : consumers_) @@ -568,5 +576,26 @@ void VulkanDecoderBase::SetCurrentBlockIndex(uint64_t block_index) } } +void VulkanDecoderBase::SetCurrentFileOffset(int64_t offset) +{ + for (auto consumer : consumers_) + { + consumer->SetCurrentFileOffset(offset); + } +} + +void VulkanDecoderBase::DispatchExecuteBlocksFromFile(format::ThreadId thread_id, + uint32_t n_blocks, + int64_t offset, + const std::string& filename) +{ + GFXRECON_UNREFERENCED_PARAMETER(thread_id); + + for (auto consumer : consumers_) + { + consumer->ProcessExecuteBlocksFromFile(n_blocks, offset, filename); + } +} + GFXRECON_END_NAMESPACE(decode) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/decode/vulkan_decoder_base.h b/framework/decode/vulkan_decoder_base.h index ddaa8bd2b8..ee42765da9 100644 --- a/framework/decode/vulkan_decoder_base.h +++ b/framework/decode/vulkan_decoder_base.h @@ -83,6 +83,8 @@ class VulkanDecoderBase : public ApiDecoder virtual void DispatchStateEndMarker(uint64_t frame_number) override; + virtual void DispatchFrameBeginMarker(uint64_t frame_number) override; + virtual void DispatchFrameEndMarker(uint64_t frame_number) override; virtual void DispatchDisplayMessageCommand(format::ThreadId thread_id, const std::string& message) override; @@ -200,6 +202,13 @@ class VulkanDecoderBase : public ApiDecoder virtual void SetCurrentBlockIndex(uint64_t block_index) override; + virtual void SetCurrentFileOffset(int64_t offset) override; + + virtual void DispatchExecuteBlocksFromFile(format::ThreadId thread_id, + uint32_t n_blocks, + int64_t offset, + const std::string& filename) override; + protected: const std::vector& GetConsumers() const { return consumers_; } diff --git a/framework/decode/vulkan_handle_mapping_util.h b/framework/decode/vulkan_handle_mapping_util.h index ff9429fdad..ce314f534a 100644 --- a/framework/decode/vulkan_handle_mapping_util.h +++ b/framework/decode/vulkan_handle_mapping_util.h @@ -29,7 +29,10 @@ #include "util/defines.h" #include "util/logging.h" +#include + #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" #include diff --git a/framework/decode/vulkan_object_info.h b/framework/decode/vulkan_object_info.h index f434945fd9..eeb2431413 100644 --- a/framework/decode/vulkan_object_info.h +++ b/framework/decode/vulkan_object_info.h @@ -34,6 +34,7 @@ #include "util/defines.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" #include #include @@ -172,6 +173,10 @@ struct VulkanObjectInfo { typedef T HandleType; + VulkanObjectInfo(VkObjectType type) : vk_object_type(type) {} + + VkObjectType vk_object_type; + // Standard info stored for all Vulkan objects. HandleType handle{ VK_NULL_HANDLE }; // Handle created for the object during replay. format::HandleId capture_id{ format::kNullHandleId }; // ID assigned to the object at capture. @@ -188,6 +193,8 @@ struct handle_create_result_t template struct VulkanObjectInfoAsync : public VulkanObjectInfo { + VulkanObjectInfoAsync(VkObjectType type) : VulkanObjectInfo(type) {} + // track asynchronous compilation status std::shared_future> future; uint32_t future_handle_index = 0; @@ -197,6 +204,8 @@ struct VulkanObjectInfoAsync : public VulkanObjectInfo template struct VulkanPoolInfo : public VulkanObjectInfo { + VulkanPoolInfo(VkObjectType type) : VulkanObjectInfo(type) {} + std::unordered_set child_ids; // IDs of objects allocated from the pool. }; @@ -204,6 +213,8 @@ struct VulkanPoolInfo : public VulkanObjectInfo template struct VulkanPoolObjectInfo : public VulkanObjectInfo { + VulkanPoolObjectInfo(VkObjectType type) : VulkanObjectInfo(type) {} + format::HandleId pool_id{ format::kNullHandleId }; // ID of the pool that the object was allocated from. }; @@ -211,23 +222,90 @@ struct VulkanPoolObjectInfo : public VulkanObjectInfo // Declarations for Vulkan objects without additional replay state info. // -typedef VulkanObjectInfo EventInfo; -typedef VulkanObjectInfo QueryPoolInfo; -typedef VulkanObjectInfo PipelineLayoutInfo; -typedef VulkanObjectInfo PrivateDataSlotInfo; -typedef VulkanObjectInfo SamplerInfo; -typedef VulkanPoolInfo CommandPoolInfo; -typedef VulkanObjectInfo SamplerYcbcrConversionInfo; -typedef VulkanObjectInfo DisplayModeKHRInfo; -typedef VulkanObjectInfo DebugReportCallbackEXTInfo; -typedef VulkanObjectInfo IndirectCommandsLayoutNVInfo; -typedef VulkanObjectInfo DebugUtilsMessengerEXTInfo; -typedef VulkanObjectInfo AccelerationStructureKHRInfo; -typedef VulkanObjectInfo AccelerationStructureNVInfo; -typedef VulkanObjectInfo PerformanceConfigurationINTELInfo; -typedef VulkanObjectInfo MicromapEXTInfo; -typedef VulkanObjectInfo OpticalFlowSessionNVInfo; -typedef VulkanObjectInfo VideoSessionParametersKHRInfo; +struct EventInfo : public VulkanObjectInfo +{ + EventInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_EVENT) {} +}; + +struct QueryPoolInfo : public VulkanObjectInfo +{ + QueryPoolInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_QUERY_POOL) {} +}; + +struct PipelineLayoutInfo : public VulkanObjectInfo +{ + PipelineLayoutInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_PIPELINE_LAYOUT) {} +}; + +struct PrivateDataSlotInfo : public VulkanObjectInfo +{ + PrivateDataSlotInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_PRIVATE_DATA_SLOT) {} +}; + +struct SamplerInfo : public VulkanObjectInfo +{ + SamplerInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_SAMPLER) {} +}; + +struct CommandPoolInfo : public VulkanPoolInfo +{ + CommandPoolInfo() : VulkanPoolInfo(VK_OBJECT_TYPE_COMMAND_POOL) {} +}; + +struct SamplerYcbcrConversionInfo : public VulkanObjectInfo +{ + SamplerYcbcrConversionInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION) {} +}; + +struct DisplayModeKHRInfo : public VulkanObjectInfo +{ + DisplayModeKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DISPLAY_MODE_KHR) {} +}; + +struct DebugReportCallbackEXTInfo : public VulkanObjectInfo +{ + DebugReportCallbackEXTInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT) {} +}; + +struct IndirectCommandsLayoutNVInfo : public VulkanObjectInfo +{ + IndirectCommandsLayoutNVInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV) {} +}; + +struct DebugUtilsMessengerEXTInfo : public VulkanObjectInfo +{ + DebugUtilsMessengerEXTInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT) {} +}; + +struct AccelerationStructureKHRInfo : public VulkanObjectInfo +{ + AccelerationStructureKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR) {} +}; + +struct AccelerationStructureNVInfo : public VulkanObjectInfo +{ + AccelerationStructureNVInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV) {} +}; + +struct PerformanceConfigurationINTELInfo : public VulkanObjectInfo +{ + PerformanceConfigurationINTELInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL) {} +}; + +struct MicromapEXTInfo : public VulkanObjectInfo +{ + MicromapEXTInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_MICROMAP_EXT) {} +}; + +struct OpticalFlowSessionNVInfo : public VulkanObjectInfo +{ + OpticalFlowSessionNVInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV) {} +}; + +struct VideoSessionParametersKHRInfo : public VulkanObjectInfo +{ + VideoSessionParametersKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR) {} +}; // // Declarations for Vulkan objects with additional replay state info. @@ -235,6 +313,8 @@ typedef VulkanObjectInfo VideoSessionParameters struct InstanceInfo : public VulkanObjectInfo { + InstanceInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_INSTANCE) {} + uint32_t api_version{ VK_MAKE_VERSION(1, 0, 0) }; std::vector enabled_extensions; std::unordered_map array_counts; @@ -249,6 +329,8 @@ struct InstanceInfo : public VulkanObjectInfo struct PhysicalDeviceInfo : public VulkanObjectInfo { + PhysicalDeviceInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_PHYSICAL_DEVICE) {} + VkInstance parent{ VK_NULL_HANDLE }; uint32_t parent_api_version{ 0 }; std::vector parent_enabled_extensions; @@ -276,6 +358,8 @@ struct PhysicalDeviceInfo : public VulkanObjectInfo struct DeviceInfo : public VulkanObjectInfo { + DeviceInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DEVICE) {} + VkPhysicalDevice parent{ VK_NULL_HANDLE }; std::unique_ptr allocator; std::unordered_map array_counts; @@ -300,6 +384,8 @@ struct DeviceInfo : public VulkanObjectInfo struct QueueInfo : public VulkanObjectInfo { + QueueInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_QUEUE) {} + std::unordered_map array_counts; uint32_t family_index; uint32_t queue_index; @@ -307,6 +393,8 @@ struct QueueInfo : public VulkanObjectInfo struct SemaphoreInfo : public VulkanObjectInfo { + SemaphoreInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_SEMAPHORE) {} + bool is_external{ false }; // If a null-swapchain/surface interacts with a semaphore, replay needs to shadow signal it until a future call @@ -322,6 +410,8 @@ struct SemaphoreInfo : public VulkanObjectInfo struct FenceInfo : public VulkanObjectInfo { + FenceInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_FENCE) {} + // If a null-swapchain/surface interacts with a fence, replay needs to to shadow signal it until a future call waits // on it. bool shadow_signaled{ false }; @@ -329,12 +419,16 @@ struct FenceInfo : public VulkanObjectInfo struct DeviceMemoryInfo : public VulkanObjectInfo { + DeviceMemoryInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DEVICE_MEMORY) {} + VulkanResourceAllocator* allocator{ nullptr }; VulkanResourceAllocator::MemoryData allocator_data{ 0 }; }; struct BufferInfo : public VulkanObjectInfo { + BufferInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_BUFFER) {} + // The following values are only used for memory portability. VulkanResourceAllocator::ResourceData allocator_data{ 0 }; @@ -348,11 +442,15 @@ struct BufferInfo : public VulkanObjectInfo struct BufferViewInfo : public VulkanObjectInfo { + BufferViewInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_BUFFER_VIEW) {} + format::HandleId buffer_id{ format::kNullHandleId }; }; struct ImageInfo : public VulkanObjectInfo { + ImageInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_IMAGE) {} + std::unordered_map array_counts; bool is_swapchain_image{ false }; @@ -389,6 +487,8 @@ typedef struct PipelineCacheData struct PipelineCacheInfo : public VulkanObjectInfo { + PipelineCacheInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_PIPELINE_CACHE) {} + std::unordered_map array_counts; // hash id of capture time pipeline cache data to capture and replay time pipeline cache data map; @@ -420,8 +520,8 @@ struct ShaderModuleInfo : public VulkanObjectInfo bool is_array; }; - ShaderModuleInfo() = default; - ShaderModuleInfo(const ShaderModuleInfo& other) + ShaderModuleInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_SHADER_MODULE) {} + ShaderModuleInfo(const ShaderModuleInfo& other) : VulkanObjectInfo(VK_OBJECT_TYPE_SHADER_MODULE) { handle = other.handle; parent_id = other.parent_id; @@ -440,6 +540,8 @@ struct ShaderModuleInfo : public VulkanObjectInfo struct PipelineInfo : public VulkanObjectInfoAsync { + PipelineInfo() : VulkanObjectInfoAsync(VK_OBJECT_TYPE_PIPELINE) {} + std::unordered_map array_counts; // The following information is populated and used only when the @@ -479,6 +581,8 @@ struct PipelineInfo : public VulkanObjectInfoAsync struct DescriptorPoolInfo : public VulkanPoolInfo { + DescriptorPoolInfo() : VulkanPoolInfo(VK_OBJECT_TYPE_DESCRIPTOR_POOL) {} + VkDescriptorPoolCreateFlags flags{}; uint32_t max_sets{ 0 }; uint32_t max_inline_uniform_block_bindings{ 0 }; // For VK_EXT_inline_uniform_block. @@ -488,17 +592,23 @@ struct DescriptorPoolInfo : public VulkanPoolInfo struct DescriptorUpdateTemplateInfo : public VulkanObjectInfo { + DescriptorUpdateTemplateInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE) {} + std::vector descriptor_image_types; std::vector entries; }; struct DisplayKHRInfo : public VulkanObjectInfo { + DisplayKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DISPLAY_KHR) {} + std::unordered_map array_counts; }; struct SurfaceKHRInfo : public VulkanObjectInfo { + SurfaceKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_SURFACE_KHR) {} + Window* window{ nullptr }; std::unordered_map array_counts; bool surface_creation_skipped{ false }; @@ -508,6 +618,8 @@ struct SurfaceKHRInfo : public VulkanObjectInfo struct SwapchainKHRInfo : public VulkanObjectInfo { + SwapchainKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_SWAPCHAIN_KHR) {} + VkSurfaceKHR surface{ VK_NULL_HANDLE }; format::HandleId surface_id{ format::kNullHandleId }; DeviceInfo* device_info{ nullptr }; @@ -545,16 +657,22 @@ struct SwapchainKHRInfo : public VulkanObjectInfo struct ValidationCacheEXTInfo : public VulkanObjectInfo { + ValidationCacheEXTInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_VALIDATION_CACHE_EXT) {} + std::unordered_map array_counts; }; struct ImageViewInfo : public VulkanObjectInfo { + ImageViewInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_IMAGE_VIEW) {} + format::HandleId image_id{ format::kNullHandleId }; }; struct FramebufferInfo : public VulkanObjectInfo { + FramebufferInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_FRAMEBUFFER) {} + VkFramebufferCreateFlags framebuffer_flags{ 0 }; std::unordered_map array_counts; std::vector attachment_image_view_ids; @@ -562,6 +680,8 @@ struct FramebufferInfo : public VulkanObjectInfo struct DeferredOperationKHRInfo : public VulkanObjectInfo { + DeferredOperationKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR) {} + bool pending_state{ false }; // Record CreateRayTracingPipelinesKHR parameters for safety. @@ -573,6 +693,8 @@ struct DeferredOperationKHRInfo : public VulkanObjectInfo { + VideoSessionKHRInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_VIDEO_SESSION_KHR) {} + std::unordered_map array_counts; // The following values are only used for memory portability. @@ -586,11 +708,15 @@ struct VideoSessionKHRInfo : VulkanObjectInfo struct ShaderEXTInfo : VulkanObjectInfoAsync { + ShaderEXTInfo() : VulkanObjectInfoAsync(VK_OBJECT_TYPE_SHADER_EXT) {} + std::unordered_map array_counts; }; struct CommandBufferInfo : public VulkanPoolObjectInfo { + CommandBufferInfo() : VulkanPoolObjectInfo(VK_OBJECT_TYPE_COMMAND_BUFFER) {} + bool is_frame_boundary{ false }; std::vector frame_buffer_ids; std::unordered_map image_layout_barriers; @@ -598,6 +724,8 @@ struct CommandBufferInfo : public VulkanPoolObjectInfo struct RenderPassInfo : public VulkanObjectInfo { + RenderPassInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_RENDER_PASS) {} + std::vector attachment_description_final_layouts; std::vector attachment_descs; @@ -622,6 +750,8 @@ struct RenderPassInfo : public VulkanObjectInfo struct DescriptorSetLayoutInfo : public VulkanObjectInfo { + DescriptorSetLayoutInfo() : VulkanObjectInfo(VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT) {} + struct DescriptorBindingLayout { VkDescriptorType type; @@ -656,6 +786,8 @@ struct DescriptorSetBindingInfo struct DescriptorSetInfo : public VulkanPoolObjectInfo { + DescriptorSetInfo() : VulkanPoolObjectInfo(VK_OBJECT_TYPE_DESCRIPTOR_SET) {} + // One entry per binding using DescriptorBindingsInfo = std::unordered_map; DescriptorBindingsInfo descriptors; diff --git a/framework/decode/vulkan_replay_consumer_base.cpp b/framework/decode/vulkan_replay_consumer_base.cpp index ddb6856a23..65306eb1b4 100644 --- a/framework/decode/vulkan_replay_consumer_base.cpp +++ b/framework/decode/vulkan_replay_consumer_base.cpp @@ -22,6 +22,9 @@ ** DEALINGS IN THE SOFTWARE. */ +#include PROJECT_VERSION_HEADER_FILE + +#include "generated/generated_vulkan_decoder.h" #include "decode/vulkan_replay_consumer_base.h" #include "decode/custom_vulkan_struct_handle_mappers.h" #include "decode/descriptor_update_template_decoder.h" @@ -48,7 +51,6 @@ #include "util/hash.h" #include "util/platform.h" #include "util/logging.h" - #include "spirv_reflect.h" #include "generated/generated_vulkan_enum_to_string.h" @@ -169,12 +171,16 @@ static uint32_t GetHardwareBufferFormatBpp(uint32_t format) #endif VulkanReplayConsumerBase::VulkanReplayConsumerBase(std::shared_ptr application, - const VulkanReplayOptions& options) : + const VulkanReplayOptions& options, + const gfxrecon::format::AssetFileOffsets* asset_file_offsets) : resource_dumper(options, object_info_table_), loader_handle_(nullptr), get_instance_proc_addr_(nullptr), create_instance_proc_(nullptr), application_(application), options_(options), loading_trim_state_(false), replaying_trimmed_capture_(false), - have_imported_semaphores_(false), fps_info_(nullptr), omitted_pipeline_cache_data_(false) + have_imported_semaphores_(false), fps_info_(nullptr), omitted_pipeline_cache_data_(false), + asset_file_offsets_(asset_file_offsets) { + GFXRECON_WRITE_CONSOLE("%s()", __func__) + assert(application_ != nullptr); assert(options.create_resource_allocator != nullptr); @@ -280,6 +286,14 @@ void VulkanReplayConsumerBase::ProcessStateBeginMarker(uint64_t frame_number) // If a trace file has the state begin marker, it must be a trim trace file. replaying_trimmed_capture_ = true; + + // GFXRECON_WRITE_CONSOLE("%s() current_frame_: %" PRIu64, __func__, current_frame_) + GFXRECON_WRITE_CONSOLE("%s() frame_number: %" PRIu64, __func__, frame_number) + + if (notify_frame_state_setup_fp_ != nullptr) + { + notify_frame_state_setup_fp_(1); + } } void VulkanReplayConsumerBase::ProcessStateEndMarker(uint64_t frame_number) @@ -290,6 +304,42 @@ void VulkanReplayConsumerBase::ProcessStateEndMarker(uint64_t frame_number) { fps_info_->ProcessStateEndMarker(frame_number); } + + current_frame_ = frame_number; + GFXRECON_WRITE_CONSOLE("%s() current_frame_: %" PRIu64, __func__, current_frame_) + + if (override_frame_number_fp_ != nullptr) + { + override_frame_number_fp_(current_frame_); + } + + if (notify_frame_state_setup_fp_ != nullptr) + { + notify_frame_state_setup_fp_(0); + } +} + +void VulkanReplayConsumerBase::ProcessFrameBeginMarker(uint64_t frame_number) +{ + // GFXRECON_WRITE_CONSOLE("%s() frame_number: %" PRIu64, __func__, frame_number) + current_frame_ = frame_number; + + if (override_frame_number_fp_ != nullptr) + { + override_frame_number_fp_(current_frame_); + } +} + +void VulkanReplayConsumerBase::ProcessFrameEndMarker(uint64_t frame_number) +{ + // GFXRECON_WRITE_CONSOLE("%s() frame_number: %" PRIu64, __func__, frame_number) + current_frame_ = frame_number + 1; + // GFXRECON_WRITE_CONSOLE("%s() current_frame_: %" PRIu64, __func__, current_frame_) + + if (override_frame_number_fp_ != nullptr) + { + override_frame_number_fp_(current_frame_); + } } void VulkanReplayConsumerBase::ProcessDisplayMessageCommand(const std::string& message) @@ -1050,6 +1100,35 @@ void VulkanReplayConsumerBase::InitializeLoader() } } +// void VulkanReplayConsumerBase::InitializeCaptureLayerCustomFuncs() +// { +// const std::vector capture_layer_filename = { +// #if defined(WIN32) +// "libVkLayer_gfxreconstruct.dll" +// #elif defined(__APPLE__) +// "libVkLayer_gfxreconstruct.dylib" +// #else +// "libVkLayer_gfxreconstruct.so" +// #endif +// }; + +// util::platform::LibraryHandle capture_layer_handle = util::platform::OpenLibrary(capture_layer_filename); + +// if (capture_layer_handle == nullptr) +// { +// GFXRECON_LOG_WARNING("Failed to load GFXR capture layer. Layer's custom functions will not be available"); +// return; +// } + +// override_capture_obj_id_fp = reinterpret_cast( +// util::platform::GetProcAddress(capture_layer_handle, "OverrideIdForNextVulkanObjectGFXR")); + +// if (override_capture_obj_id_fp != nullptr) +// { +// GFXRECON_LOG_WARNING("Failed getting address of \"OverrideIdForNextVulkanObjectGFXR\" from capture layer"); +// } +// } + void VulkanReplayConsumerBase::AddInstanceTable(VkInstance instance) { encode::VulkanDispatchKey dispatch_key = encode::GetVulkanDispatchKey(instance); @@ -2307,6 +2386,18 @@ VulkanReplayConsumerBase::OverrideCreateInstance(VkResult original_result, InitializeLoader(); } + GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) + if (replay_create_info->pApplicationInfo->pApplicationName) + { + GFXRECON_WRITE_CONSOLE(" replay_create_info->pApplicationInfo->pApplicationName: %s", + replay_create_info->pApplicationInfo->pApplicationName) + } + if (replay_create_info->pApplicationInfo->pEngineName) + { + GFXRECON_WRITE_CONSOLE(" replay_create_info->pApplicationInfo->pEngineName: %s", + replay_create_info->pApplicationInfo->pEngineName) + } + std::vector modified_layers; std::vector modified_extensions; VkInstanceCreateInfo modified_create_info = (*replay_create_info); @@ -2488,6 +2579,40 @@ VulkanReplayConsumerBase::OverrideCreateInstance(VkResult original_result, modified_create_info.ppEnabledLayerNames = modified_layers.data(); } + // Reuse asset file. + // Get proc addresses of capture layer's exposed custom functions. + std::vector layer_settings; + std::vector layer_custom_funcs_ptrs; + VkLayerSettingsCreateInfoEXT layer_settings_info; + if (!options_.reuse_asset_file.empty()) + { + static const char* layer_func_names[] = { "SetUniqueIdOffsetGFXR", + "LoadAssetFileOffsetsGFXR", + "OverrideIdForNextVulkanObjectGFXR", + "OverrideFrameNumberGFXR", + "NotifyFrameStateSetupGFXR" }; + + layer_custom_funcs_ptrs.resize(GFXRECON_ARRAY_ELEMENTS(layer_func_names)); + PFN_vkVoidFunction* func_ptr_base = layer_custom_funcs_ptrs.data(); + + layer_settings.resize(GFXRECON_ARRAY_ELEMENTS(layer_func_names)); + for (size_t i = 0; i < layer_settings.size(); ++i) + { + layer_settings[i].pLayerName = GFXRECON_PROJECT_VULKAN_LAYER_NAME; + layer_settings[i].pSettingName = layer_func_names[i]; + layer_settings[i].type = VK_LAYER_SETTING_TYPE_UINT64_EXT; + layer_settings[i].valueCount = 1; + layer_settings[i].pValues = func_ptr_base + i; + } + + layer_settings_info.sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; + layer_settings_info.pNext = modified_create_info.pNext; + layer_settings_info.settingCount = layer_settings.size(); + layer_settings_info.pSettings = layer_settings.data(); + + modified_create_info.pNext = &layer_settings_info; + } + VkResult result = create_instance_proc_(&modified_create_info, GetAllocationCallbacks(pAllocator), replay_instance); if ((replay_instance != nullptr) && (result == VK_SUCCESS)) @@ -2504,6 +2629,68 @@ VulkanReplayConsumerBase::OverrideCreateInstance(VkResult original_result, modified_create_info.ppEnabledExtensionNames + modified_create_info.enabledExtensionCount); } + + if (!options_.reuse_asset_file.empty()) + { + set_unique_id_offset_fp_ = reinterpret_cast(layer_custom_funcs_ptrs[0]); + if (set_unique_id_offset_fp_ == nullptr) + { + GFXRECON_LOG_WARNING("Failed to discover SetUniqueIdOffsetGFXR()"); + } + else + { + GFXRECON_WRITE_CONSOLE("set_unique_id_offset_fp: %p: ", set_unique_id_offset_fp_) + } + + load_asset_file_offsets_fp_ = + reinterpret_cast(layer_custom_funcs_ptrs[1]); + if (load_asset_file_offsets_fp_ == nullptr) + { + GFXRECON_LOG_WARNING("Failed to discover LoadAssetFileOffsetsGFXR()"); + } + else + { + GFXRECON_WRITE_CONSOLE("load_asset_file_offsets_fp: %p: ", load_asset_file_offsets_fp_) + } + + override_capture_obj_id_fp_ = + reinterpret_cast(layer_custom_funcs_ptrs[2]); + if (override_capture_obj_id_fp_ == nullptr) + { + GFXRECON_LOG_WARNING("Failed to discover OverrideIdForNextVulkanObjectGFXR()"); + } + else + { + GFXRECON_WRITE_CONSOLE("override_capture_obj_id_fp: %p: ", override_capture_obj_id_fp_) + } + + override_frame_number_fp_ = + reinterpret_cast(layer_custom_funcs_ptrs[3]); + if (override_frame_number_fp_ == nullptr) + { + GFXRECON_LOG_WARNING("Failed to discover OverrideFrameNumberGFXR()"); + } + else + { + GFXRECON_WRITE_CONSOLE("set_unique_id_offset_fp: %p: ", override_frame_number_fp_) + } + + notify_frame_state_setup_fp_ = + reinterpret_cast(layer_custom_funcs_ptrs[4]); + if (notify_frame_state_setup_fp_ == nullptr) + { + GFXRECON_LOG_WARNING("Failed to discover NotifyFrameStateSetupGFXR()"); + } + else + { + GFXRECON_WRITE_CONSOLE("notify_frame_state_setup_fp_: %p: ", notify_frame_state_setup_fp_) + } + + if (load_asset_file_offsets_fp_ != nullptr && asset_file_offsets_ != nullptr) + { + load_asset_file_offsets_fp_(*asset_file_offsets_); + } + } } return result; @@ -4230,9 +4417,9 @@ VkResult VulkanReplayConsumerBase::OverrideAllocateMemory( VkMemoryAllocateInfo modified_allocate_info = (*replay_allocate_info); VkMemoryOpaqueCaptureAddressAllocateInfo address_info = { - VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO, - modified_allocate_info.pNext, - opaque_address + VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO, + modified_allocate_info.pNext, + opaque_address }; modified_allocate_info.pNext = &address_info; @@ -9632,5 +9819,10 @@ void VulkanReplayConsumerBase::SetCurrentBlockIndex(uint64_t block_index) main_thread_queue_.poll(); } +void VulkanReplayConsumerBase::SetCurrentFileOffset(int64_t offset) +{ + VulkanConsumer::SetCurrentFileOffset(offset); +} + GFXRECON_END_NAMESPACE(decode) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/decode/vulkan_replay_consumer_base.h b/framework/decode/vulkan_replay_consumer_base.h index 572c237450..93c5f35032 100644 --- a/framework/decode/vulkan_replay_consumer_base.h +++ b/framework/decode/vulkan_replay_consumer_base.h @@ -38,6 +38,7 @@ #include "decode/vulkan_resource_initializer.h" #include "decode/vulkan_swapchain.h" #include "format/api_call_id.h" +#include "format/format.h" #include "format/platform_types.h" #include "generated/generated_vulkan_dispatch_table.h" #include "generated/generated_vulkan_consumer.h" @@ -47,9 +48,13 @@ #include "util/logging.h" #include "util/threadpool.h" +#include +#include + #include "application/application.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" #include #include @@ -71,12 +76,16 @@ GFXRECON_BEGIN_NAMESPACE(decode) class VulkanReplayConsumerBase : public VulkanConsumer { public: - VulkanReplayConsumerBase(std::shared_ptr application, const VulkanReplayOptions& options); + VulkanReplayConsumerBase(std::shared_ptr application, + const VulkanReplayOptions& options, + const gfxrecon::format::AssetFileOffsets* asset_file_offsets = nullptr); ~VulkanReplayConsumerBase() override; void SetCurrentBlockIndex(uint64_t block_index) override; + virtual void SetCurrentFileOffset(int64_t offset) override; + void Process_ExeFileInfo(util::filepath::FileInfo& info_record) override { gfxrecon::util::filepath::CheckReplayerName(info_record.AppName); @@ -92,6 +101,10 @@ class VulkanReplayConsumerBase : public VulkanConsumer virtual void ProcessStateEndMarker(uint64_t frame_number) override; + virtual void ProcessFrameBeginMarker(uint64_t frame_number) override; + + virtual void ProcessFrameEndMarker(uint64_t frame_number) override; + virtual void ProcessDisplayMessageCommand(const std::string& message) override; virtual void @@ -295,6 +308,14 @@ class VulkanReplayConsumerBase : public VulkanConsumer } } + void ForwardIdToCaptureLayer(const format::HandleId* id, VkObjectType type) + { + if (override_capture_obj_id_fp_ != nullptr && id != nullptr) + { + override_capture_obj_id_fp_(*id, type); + } + } + template void AddHandles(format::HandleId parent_id, const format::HandleId* ids, @@ -319,6 +340,42 @@ class VulkanReplayConsumerBase : public VulkanConsumer handle_mapping::AddHandleArray(parent_id, ids, ids_len, handles, handles_len, &object_info_table_, AddFunc); } + template + void ForwardIdsToCaptureLayer(const format::HandleId* ids, + size_t ids_len, + const typename T::HandleType* handles, + size_t handles_len, + VkObjectType type) + { + // GFXRECON_WRITE_CONSOLE("%s()", __func__) + + // GFXRECON_WRITE_CONSOLE("GFXRECON_WRITE_CONSOLE: %p", ids); + // GFXRECON_WRITE_CONSOLE("GFXRECON_WRITE_CONSOLE: %zu", ids_len); + // GFXRECON_WRITE_CONSOLE("GFXRECON_WRITE_CONSOLE: %p", handles); + // GFXRECON_WRITE_CONSOLE("GFXRECON_WRITE_CONSOLE: %zu", handles_len); + // GFXRECON_WRITE_CONSOLE("GFXRECON_WRITE_CONSOLE: %u", type); + + if (override_capture_obj_id_fp_ != nullptr && ids != nullptr && handles != nullptr) + { + size_t len = std::min(ids_len, handles_len); + for (size_t i = 0; i < len; ++i) + { + override_capture_obj_id_fp_(ids[i], type); + } + } + } + + void ForwardIdsToCaptureLayer(const format::HandleId* ids, size_t ids_len, VkObjectType type) + { + if (override_capture_obj_id_fp_ != nullptr && ids != nullptr) + { + for (size_t i = 0; i < ids_len; ++i) + { + override_capture_obj_id_fp_(ids[i], type); + } + } + } + template void AddHandlesAsync(format::HandleId parent_id, const format::HandleId* ids, @@ -365,6 +422,17 @@ class VulkanReplayConsumerBase : public VulkanConsumer } } + void ForwardAsyncIdsToCaptureLayer(const format::HandleId* ids, size_t ids_len, VkObjectType type) + { + if (override_capture_obj_id_fp_ != nullptr && ids != nullptr) + { + for (size_t i = 0; i < ids_len; ++i) + { + override_capture_obj_id_fp_(ids[i], type); + } + } + } + //! track arbitrary handles that are currently used by asynchronous operations void TrackAsyncHandles(const std::unordered_set& async_handles, const std::function& sync_fn); @@ -418,8 +486,16 @@ class VulkanReplayConsumerBase : public VulkanConsumer S* (VulkanObjectInfoTable::*GetPoolInfoFunc)(format::HandleId), void (VulkanObjectInfoTable::*AddFunc)(T&&)) { - handle_mapping::AddHandleArray( - parent_id, pool_id, ids, ids_len, handles, handles_len, &object_info_table_, GetPoolInfoFunc, AddFunc); + handle_mapping::AddHandleArray(parent_id, + pool_id, + ids, + ids_len, + handles, + handles_len, + &object_info_table_, + GetPoolInfoFunc, + AddFunc, + override_capture_obj_id_fp_); } void RemoveHandle(format::HandleId id, void (VulkanObjectInfoTable::*RemoveFunc)(format::HandleId)) @@ -1272,6 +1348,8 @@ class VulkanReplayConsumerBase : public VulkanConsumer void InitializeLoader(); + // void InitializeCaptureLayerCustomFuncs(); + void AddInstanceTable(VkInstance instance); void AddDeviceTable(VkDevice device, PFN_vkGetDeviceProcAddr gpa); @@ -1500,6 +1578,14 @@ class VulkanReplayConsumerBase : public VulkanConsumer void* capture_pipeline_cache_data_; bool matched_replay_cache_data_exist_ = false; std::vector matched_replay_cache_data_; + format::FrameNumber current_frame_ = 1; + + const gfxrecon::format::AssetFileOffsets* asset_file_offsets_ = nullptr; + encode::SetUniqueIdOffsetGFXRPtr set_unique_id_offset_fp_ = nullptr; + encode::LoadAssetFileOffsetsGFXRPtr load_asset_file_offsets_fp_ = nullptr; + encode::OverrideCaptureObjectIdFuncPtr override_capture_obj_id_fp_ = nullptr; + encode::OverrideFrameNumberGFXRPtr override_frame_number_fp_ = nullptr; + encode::NotifyFrameStateSetupGFXRPtr notify_frame_state_setup_fp_ = nullptr; }; GFXRECON_END_NAMESPACE(decode) diff --git a/framework/decode/vulkan_replay_options.h b/framework/decode/vulkan_replay_options.h index 93a281e0ab..ce151c05ee 100644 --- a/framework/decode/vulkan_replay_options.h +++ b/framework/decode/vulkan_replay_options.h @@ -101,6 +101,8 @@ struct VulkanReplayOptions : public ReplayOptions bool dump_resources_dump_all_image_subresources{ false }; bool preload_measurement_range{ false }; + + std::string reuse_asset_file; }; GFXRECON_END_NAMESPACE(decode) diff --git a/framework/encode/api_capture_manager.h b/framework/encode/api_capture_manager.h index 6f38c35283..a16d743e62 100644 --- a/framework/encode/api_capture_manager.h +++ b/framework/encode/api_capture_manager.h @@ -26,6 +26,8 @@ #define GFXRECON_ENCODE_API_CAPTURE_MANAGER_H #include "encode/capture_manager.h" +#include "format/format.h" +#include "vulkan/vulkan_core.h" GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(encode) @@ -38,14 +40,19 @@ class ApiCaptureManager // Forwarded Statics static format::HandleId GetUniqueId() { return CommonCaptureManager::GetUniqueId(); } + static format::HandleId GetUniqueId(VkObjectType type) { return CommonCaptureManager::GetUniqueId(type); } static auto AcquireSharedApiCallLock() { return std::move(CommonCaptureManager::AcquireSharedApiCallLock()); } static auto AcquireExclusiveApiCallLock() { return std::move(CommonCaptureManager::AcquireExclusiveApiCallLock()); } // Virtual interface - virtual void CreateStateTracker() = 0; + virtual void CreateStateTracker(bool recapturing = false) = 0; virtual void DestroyStateTracker() = 0; - virtual void WriteTrackedState(util::FileOutputStream* file_stream, format::ThreadId thread_id) = 0; + virtual void WriteTrackedState(util::FileOutputStream* file_stream, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream = nullptr) = 0; + virtual void WriteAssets(util::FileOutputStream* asset_file_stream, format::ThreadId thread_id) = 0; + virtual CaptureSettings::TraceSettings GetDefaultTraceSettings(); format::ApiFamilyId GetApiFamily() const { return api_family_; } @@ -116,8 +123,6 @@ class ApiCaptureManager bool IsTrimHotkeyPressed() { return common_manager_->IsTrimHotkeyPressed(); } - CaptureSettings::RuntimeTriggerState GetRuntimeTriggerState() { return common_manager_->GetRuntimeTriggerState(); } - bool RuntimeTriggerEnabled() { return common_manager_->RuntimeTriggerEnabled(); } bool RuntimeTriggerDisabled() { return common_manager_->RuntimeTriggerDisabled(); } @@ -153,6 +158,7 @@ class ApiCaptureManager uint16_t GetDescriptorMask() const { return common_manager_->GetDescriptorMask(); } uint64_t GetShaderIDMask() const { return common_manager_->GetShaderIDMask(); } uint64_t GetBlockIndex() const { return common_manager_->GetBlockIndex(); } + void SetWriteAssets() const { return common_manager_->SetWriteAssets(); } bool GetForceFileFlush() const { return common_manager_->GetForceFileFlush(); } CaptureSettings::MemoryTrackingMode GetMemoryTrackingMode() const @@ -168,6 +174,7 @@ class ApiCaptureManager const std::string& GetTrimKey() const { return common_manager_->GetTrimKey(); } bool IsTrimEnabled() const { return common_manager_->IsTrimEnabled(); } uint32_t GetCurrentFrame() const { return common_manager_->GetCurrentFrame(); } + uint32_t GetOverrideFrame() const { return common_manager_->GetOverrideFrame(); } CommonCaptureManager::CaptureMode GetCaptureMode() const { return common_manager_->GetCaptureMode(); } bool GetDebugLayerSetting() const { return common_manager_->GetDebugLayerSetting(); } bool GetDebugDeviceLostSetting() const { return common_manager_->GetDebugDeviceLostSetting(); } @@ -194,6 +201,24 @@ class ApiCaptureManager common_manager_->CombineAndWriteToFile(buffers); } + void SetUniqueIdOffset(format::HandleId id) + { + assert(common_manager_ != nullptr); + common_manager_->SetUniqueIdOffset(id); + } + + void OverrideIdForNextVulkanObject(format::HandleId id, VkObjectType type) + { + assert(common_manager_ != nullptr); + common_manager_->OverrideIdForNextVulkanObject(id, type); + } + + void OverrideFrameNumber(format::FrameNumber frame) + { + assert(common_manager_ != nullptr); + common_manager_->OverrideFrame(frame); + } + CommonCaptureManager::ThreadData* GetThreadData() { return common_manager_->GetThreadData(); } util::Compressor* GetCompressor() { return common_manager_->GetCompressor(); } std::mutex& GetMappedMemoryLock() { return common_manager_->GetMappedMemoryLock(); } diff --git a/framework/encode/capture_manager.cpp b/framework/encode/capture_manager.cpp index ca9c99fa7f..a5af04de76 100644 --- a/framework/encode/capture_manager.cpp +++ b/framework/encode/capture_manager.cpp @@ -22,6 +22,12 @@ ** DEALINGS IN THE SOFTWARE. */ +#include "encode/capture_settings.h" +#include "format/format.h" +#include "vulkan/vulkan_core.h" +#include +#include +#include #include PROJECT_VERSION_HEADER_FILE #include "encode/capture_manager.h" @@ -38,6 +44,10 @@ #include "util/page_guard_manager.h" #include "util/platform.h" +#include "decode/file_processor.h" +#include "decode/asset_file_consumer.h" +#include "generated/generated_vulkan_decoder.h" + #include #include #include @@ -49,10 +59,6 @@ extern char** environ; GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(encode) -// One based frame count. -const uint32_t kFirstFrame = 1; -const size_t kFileStreamBufferSize = 256 * 1024; - std::mutex CommonCaptureManager::ThreadData::count_lock_; format::ThreadId CommonCaptureManager::ThreadData::thread_count_ = 0; std::unordered_map CommonCaptureManager::ThreadData::id_map_; @@ -62,7 +68,8 @@ std::mutex CommonCaptureMana thread_local std::unique_ptr CommonCaptureManager::thread_data_; CommonCaptureManager::ApiCallMutexT CommonCaptureManager::api_call_mutex_; -std::atomic CommonCaptureManager::unique_id_counter_{ format::kNullHandleId }; +std::atomic CommonCaptureManager::unique_id_counter_{ static_cast(0) }; +std::stack> CommonCaptureManager::handle_ids_override; CommonCaptureManager::ThreadData::ThreadData() : thread_id_(GetThreadId()), object_id_(format::kNullHandleId), call_id_(format::ApiCallId::ApiCall_Unknown), @@ -99,11 +106,12 @@ CommonCaptureManager::CommonCaptureManager() : page_guard_track_ahb_memory_(false), page_guard_unblock_sigsegv_(false), page_guard_signal_handler_watcher_(false), page_guard_memory_mode_(kMemoryModeShadowInternal), page_guard_external_memory_(false), trim_enabled_(false), trim_boundary_(CaptureSettings::TrimBoundary::kUnknown), trim_current_range_(0), current_frame_(kFirstFrame), - queue_submit_count_(0), capture_mode_(kModeWrite), previous_hotkey_state_(false), + override_frame_(kInvalidFrame), queue_submit_count_(0), capture_mode_(kModeWrite), previous_hotkey_state_(false), previous_runtime_trigger_state_(CaptureSettings::RuntimeTriggerState::kNotUsed), debug_layer_(false), debug_device_lost_(false), screenshot_prefix_(""), screenshots_enabled_(false), disable_dxr_(false), accel_struct_padding_(0), iunknown_wrapping_(false), force_command_serialization_(false), queue_zero_only_(false), - allow_pipeline_compile_required_(false), quit_after_frame_ranges_(false), block_index_(0) + allow_pipeline_compile_required_(false), quit_after_frame_ranges_(false), use_asset_file_(false), block_index_(0), + write_assets_(false), previous_write_assets_(false), write_state_files_(false) {} CommonCaptureManager::~CommonCaptureManager() @@ -192,9 +200,9 @@ bool CommonCaptureManager::LockedCreateInstance(ApiCaptureManager* api // NOTE: moved here from CaptureTracker::Initialize... DRY'r than putting it into the API specific // CreateInstances. For actual multiple simulatenous API support we need to ensure all API capture manager // state trackers are in the correct state given the differing settings that may be present. - if ((capture_mode_ & kModeTrack) == kModeTrack) + if ((capture_mode_ & kModeTrack) == kModeTrack || write_state_files_) { - api_capture_singleton->CreateStateTracker(); + api_capture_singleton->CreateStateTracker(!capture_settings_.GetTraceSettings().reuse_asset_file.empty()); } } else @@ -308,6 +316,15 @@ bool CommonCaptureManager::Initialize(format::ApiFamilyId api_ force_command_serialization_ = trace_settings.force_command_serialization; queue_zero_only_ = trace_settings.queue_zero_only; allow_pipeline_compile_required_ = trace_settings.allow_pipeline_compile_required; + use_asset_file_ = trace_settings.use_asset_file; + write_state_files_ = trace_settings.write_state_files; + + if (!trace_settings.reuse_asset_file.empty()) + { + SetUniqueIdOffset(UINT64_MAX - static_cast(5000)); + asset_file_name_ = trace_settings.reuse_asset_file; + reuse_asset_file = true; + } rv_annotation_info_.gpuva_mask = trace_settings.rv_anotation_info.gpuva_mask; rv_annotation_info_.descriptor_mask = trace_settings.rv_anotation_info.descriptor_mask; @@ -352,7 +369,7 @@ bool CommonCaptureManager::Initialize(format::ApiFamilyId api_ // External memory takes precedence over shadow memory modes. if (use_external_memory) { - page_guard_memory_mode_ = kMemoryModeExternal; + page_guard_memory_mode_ = kMemoryModeExternal; page_guard_external_memory_ = true; } else if (trace_settings.page_guard_persistent_memory) @@ -493,7 +510,7 @@ CommonCaptureManager::ThreadData* CommonCaptureManager::GetThreadData() bool CommonCaptureManager::IsCaptureModeTrack() const { - return (GetCaptureMode() & kModeTrack) == kModeTrack; + return ((GetCaptureMode() & kModeTrack) == kModeTrack) || write_state_files_; } bool CommonCaptureManager::IsCaptureModeWrite() const { @@ -648,17 +665,11 @@ bool CommonCaptureManager::IsTrimHotkeyPressed() return hotkey_pressed; } -CaptureSettings::RuntimeTriggerState CommonCaptureManager::GetRuntimeTriggerState() +bool CommonCaptureManager::RuntimeTriggerEnabled() { CaptureSettings settings; CaptureSettings::LoadRunTimeEnvVarSettings(&settings); - - return settings.GetTraceSettings().runtime_capture_trigger; -} - -bool CommonCaptureManager::RuntimeTriggerEnabled() -{ - CaptureSettings::RuntimeTriggerState state = GetRuntimeTriggerState(); + CaptureSettings::RuntimeTriggerState state = settings.GetTraceSettings().runtime_capture_trigger; bool result = (state == CaptureSettings::RuntimeTriggerState::kEnabled && (previous_runtime_trigger_state_ == CaptureSettings::RuntimeTriggerState::kDisabled || @@ -671,7 +682,9 @@ bool CommonCaptureManager::RuntimeTriggerEnabled() bool CommonCaptureManager::RuntimeTriggerDisabled() { - CaptureSettings::RuntimeTriggerState state = GetRuntimeTriggerState(); + CaptureSettings settings; + CaptureSettings::LoadRunTimeEnvVarSettings(&settings); + CaptureSettings::RuntimeTriggerState state = settings.GetTraceSettings().runtime_capture_trigger; bool result = ((state == CaptureSettings::RuntimeTriggerState::kDisabled || state == CaptureSettings::RuntimeTriggerState::kNotUsed) && @@ -682,6 +695,24 @@ bool CommonCaptureManager::RuntimeTriggerDisabled() return result; } +bool CommonCaptureManager::RuntimeWriteAssetsEnabled() +{ + CaptureSettings settings; + CaptureSettings::LoadRunTimeEnvVarSettings(&settings); + bool write_assets = settings.GetTraceSettings().runtime_write_assets; + + if (previous_write_assets_ != write_assets) + { + write_assets_ = true; + previous_write_assets_ = write_assets; + return true; + } + else + { + return false; + } +} + void CommonCaptureManager::CheckContinueCaptureForWriteMode(format::ApiFamilyId api_family, uint32_t current_boundary_count) { @@ -701,12 +732,20 @@ void CommonCaptureManager::CheckContinueCaptureForWriteMode(format::ApiFamilyId trim_enabled_ = false; trim_boundary_ = CaptureSettings::TrimBoundary::kUnknown; capture_mode_ = kModeDisabled; + + if (use_asset_file_ && asset_file_stream_) + { + asset_file_stream_->Flush(); + asset_file_stream_ = nullptr; + } + // Clean up all of the capture manager's state trackers for (auto& manager_it : api_capture_managers_) { manager_it.first->DestroyStateTracker(); } - compressor_ = nullptr; + compressor_ = nullptr; + write_state_files_ = false; } else if (trim_ranges_[trim_current_range_].first == current_boundary_count) { @@ -775,6 +814,26 @@ void CommonCaptureManager::CheckStartCaptureForTrackMode(format::ApiFamilyId api capture_mode_ = kModeDisabled; } } + else if ((RuntimeWriteAssetsEnabled() || write_assets_) && capture_mode_ == kModeTrack) + { + capture_mode_ |= kModeWrite; + + auto thread_data = GetThreadData(); + assert(thread_data != nullptr); + + if (asset_file_stream_.get() == nullptr) + { + CreateAssetFile(); + } + + for (auto& manager : api_capture_managers_) + { + manager.first->WriteAssets(asset_file_stream_.get(), thread_data->thread_id_); + } + + capture_mode_ = kModeTrack; + write_assets_ = false; + } } bool CommonCaptureManager::ShouldTriggerScreenshot() @@ -842,6 +901,11 @@ void CommonCaptureManager::EndFrame(format::ApiFamilyId api_family) } } + if (IsCaptureModeWrite() && write_state_files_) + { + WriteFrameStateFile(); + } + // Flush after presents to help avoid capture files with incomplete final blocks. if (file_stream_.get() != nullptr) { @@ -854,6 +918,8 @@ void CommonCaptureManager::EndFrame(format::ApiFamilyId api_family) GFXRECON_LOG_INFO("All trim ranges have been captured. Quitting."); exit(EXIT_SUCCESS); } + + WriteFrameMarker(format::MarkerType::kBeginMarker); } void CommonCaptureManager::PreQueueSubmit(format::ApiFamilyId api_family) @@ -917,21 +983,73 @@ std::string CommonCaptureManager::CreateTrimFilename(const std::string& base return util::filepath::InsertFilenamePostfix(base_filename, range_string); } +void CommonCaptureManager::CreateAssetFile() +{ + std::string asset_file_name = CreateAssetFilename(base_filename_); + + GFXRECON_WRITE_CONSOLE("%s() asset_file_name: %s", __func__, asset_file_name.c_str()) + + asset_file_stream_ = + std::make_unique(asset_file_name, kFileStreamBufferSize, reuse_asset_file); + if (asset_file_stream_->IsValid()) + { + if (!reuse_asset_file) + { + WriteFileHeader(asset_file_stream_.get()); + } + } + else + { + GFXRECON_LOG_ERROR("Failed creating/opening asset file %s", asset_file_name.c_str()); + asset_file_stream_ = nullptr; + } +} + +std::string CommonCaptureManager::CreateAssetFilename(const std::string& base_filename) +{ + if (!asset_file_name_.empty()) + { + return asset_file_name_; + } + + asset_file_name_ = base_filename; + + size_t dot_pos = base_filename.rfind('.'); + if (dot_pos != std::string::npos) + { + if (base_filename.substr(dot_pos) == ".gfxr") + { + asset_file_name_.replace(dot_pos, 16, "_asset_file.gfxa"); + } + } + else + { + asset_file_name_ += std::string("_asset_file.gfxa"); + } + + if (timestamp_filename_) + { + asset_file_name_ = util::filepath::GenerateTimestampedFilename(asset_file_name_); + } + + return asset_file_name_; +} + bool CommonCaptureManager::CreateCaptureFile(format::ApiFamilyId api_family, const std::string& base_filename) { - bool success = true; - std::string capture_filename = base_filename; + bool success = true; + capture_filename_ = base_filename; if (timestamp_filename_) { - capture_filename = util::filepath::GenerateTimestampedFilename(capture_filename); + capture_filename_ = util::filepath::GenerateTimestampedFilename(capture_filename_); } - file_stream_ = std::make_unique(capture_filename, kFileStreamBufferSize); + file_stream_ = std::make_unique(capture_filename_, kFileStreamBufferSize); if (file_stream_->IsValid()) { - GFXRECON_LOG_INFO("Recording graphics API capture to %s", capture_filename.c_str()); + GFXRECON_LOG_INFO("Recording graphics API capture to %s", capture_filename_.c_str()); WriteFileHeader(); gfxrecon::util::filepath::FileInfo info{}; @@ -1045,6 +1163,12 @@ bool CommonCaptureManager::CreateCaptureFile(format::ApiFamilyId api_family, con success = false; } + // Create asset file + if (use_asset_file_ && asset_file_stream_.get() == nullptr) + { + CreateAssetFile(); + } + return success; } @@ -1055,10 +1179,120 @@ void CommonCaptureManager::ActivateTrimming() auto thread_data = GetThreadData(); assert(thread_data != nullptr); + if (!write_state_files_) + { + for (auto& manager : api_capture_managers_) + { + manager.first->WriteTrackedState( + file_stream_.get(), thread_data->thread_id_, use_asset_file_ ? asset_file_stream_.get() : nullptr); + } + } +} + +std::string CommonCaptureManager::CreateFrameStateFilename(const std::string& base_filename) const +{ + std::string state_filename = base_filename; + + const std::string state_filename_post = std::string("_state_frame_") + std::to_string(current_frame_); + + size_t dot_pos = base_filename.rfind('.'); + if (dot_pos != std::string::npos) + { + if (base_filename.substr(dot_pos) == ".gfxr") + { + state_filename.insert(dot_pos, state_filename_post); + } + } + else + { + state_filename += state_filename_post; + } + + return state_filename; +} + +void CommonCaptureManager::WriteExecuteFromFile(util::FileOutputStream& out_stream, + const std::string& filename, + format::ThreadId thread_id, + uint32_t n_blocks, + int64_t offset) +{ + // Remove path from filename + std::string relative_file; + const size_t last_slash_pos = filename.find_last_of("\\/"); + if (last_slash_pos != std::string::npos) + { + relative_file = filename.substr(last_slash_pos + 1); + } + else + { + relative_file = filename; + } + + const size_t filename_length = relative_file.length(); + + format::ExecuteBlocksFromFile execute_from_file; + execute_from_file.meta_header.block_header.size = + format::GetMetaDataBlockBaseSize(execute_from_file) + filename_length; + execute_from_file.meta_header.block_header.type = format::kMetaDataBlock; + execute_from_file.meta_header.meta_data_id = + format::MakeMetaDataId(format::ApiFamilyId::ApiFamily_Vulkan, format::MetaDataType::kExecuteBlocksFromFile); + execute_from_file.thread_id = thread_id; + execute_from_file.n_blocks = n_blocks; + execute_from_file.offset = offset; + execute_from_file.filename_length = filename_length; + + out_stream.Write(&execute_from_file, sizeof(execute_from_file)); + out_stream.Write(relative_file.c_str(), filename_length); +} + +void CommonCaptureManager::WriteSetBlockIndex(util::FileOutputStream& out_stream, + format::ThreadId thread_id, + uint64_t block_index) +{ + format::SetBlockIndexCommand set_block_index; + set_block_index.meta_header.block_header.size = format::GetMetaDataBlockBaseSize(set_block_index); + set_block_index.meta_header.block_header.type = format::kMetaDataBlock; + set_block_index.meta_header.meta_data_id = + format::MakeMetaDataId(format::ApiFamilyId::ApiFamily_Vulkan, format::MetaDataType::kSetBlockIndexCommand); + set_block_index.thread_id = thread_id; + set_block_index.block_index = block_index; + + out_stream.Write(&set_block_index, sizeof(set_block_index)); +} + +bool CommonCaptureManager::WriteFrameStateFile() +{ + assert(write_state_files_); + + std::string state_filename = CreateFrameStateFilename(capture_filename_); + + util::FileOutputStream state_file_stream(state_filename, kFileStreamBufferSize); + if (!state_file_stream.IsValid()) + { + assert(0); + return false; + } + + auto thread_data = GetThreadData(); + assert(thread_data != nullptr); + + WriteFileHeader(&state_file_stream); + + WriteSetBlockIndex(state_file_stream, thread_data->thread_id_, block_index_); + for (auto& manager : api_capture_managers_) { - manager.first->WriteTrackedState(file_stream_.get(), thread_data->thread_id_); + manager.first->WriteTrackedState( + &state_file_stream, thread_data->thread_id_, use_asset_file_ ? asset_file_stream_.get() : nullptr); } + + WriteExecuteFromFile( + state_file_stream, file_stream_->GetFilename(), thread_data->thread_id_, 0, file_stream_->GetOffset()); + + state_file_stream.Flush(); + + return true; } void CommonCaptureManager::DeactivateTrimming() @@ -1093,6 +1327,24 @@ void CommonCaptureManager::WriteFileHeader() thread_data->block_index_ = block_index_.load(); } +void CommonCaptureManager::WriteFileHeader(util::FileOutputStream* file_stream) +{ + assert(file_stream != nullptr); + + std::vector option_list; + + BuildOptionList(file_options_, &option_list); + + format::FileHeader file_header; + file_header.fourcc = GFXRECON_FOURCC; + file_header.major_version = 0; + file_header.minor_version = 0; + file_header.num_options = static_cast(option_list.size()); + + WriteToFile(&file_header, sizeof(file_header), file_stream); + WriteToFile(option_list.data(), option_list.size() * sizeof(format::FileOptionPair), file_stream); +} + void CommonCaptureManager::BuildOptionList(const format::EnabledOptions& enabled_options, std::vector* option_list) { @@ -1268,7 +1520,7 @@ void CommonCaptureManager::WriteCreateHeapAllocationCmd(format::ApiFamilyId api_ } } -void CommonCaptureManager::WriteToFile(const void* data, size_t size) +void CommonCaptureManager::WriteToFile(const void* data, size_t size, util::FileOutputStream* file_stream) { if (GetMemoryTrackingMode() == CaptureSettings::MemoryTrackingMode::kUserfaultfd) { @@ -1284,10 +1536,12 @@ void CommonCaptureManager::WriteToFile(const void* data, size_t size) } } - file_stream_->Write(data, size); + util::FileOutputStream* output_stream = (file_stream != nullptr) ? file_stream : file_stream_.get(); + + output_stream->Write(data, size); if (force_file_flush_) { - file_stream_->Flush(); + output_stream->Flush(); } if (GetMemoryTrackingMode() == CaptureSettings::MemoryTrackingMode::kUserfaultfd) @@ -1421,5 +1675,213 @@ void CommonCaptureManager::WriteCaptureOptions(std::string& operation_annotation operation_annotation += "\n }"; } +static const char* VkObjectTypeToStr(VkObjectType type) +{ + switch (type) + { + case VK_OBJECT_TYPE_UNKNOWN: + return GFXRECON_STR(VK_OBJECT_TYPE_UNKNOWN); + break; + case VK_OBJECT_TYPE_INSTANCE: + return GFXRECON_STR(VK_OBJECT_TYPE_INSTANCE); + break; + case VK_OBJECT_TYPE_PHYSICAL_DEVICE: + return GFXRECON_STR(VK_OBJECT_TYPE_PHYSICAL_DEVICE); + break; + case VK_OBJECT_TYPE_DEVICE: + return GFXRECON_STR(VK_OBJECT_TYPE_DEVICE); + break; + case VK_OBJECT_TYPE_QUEUE: + return GFXRECON_STR(VK_OBJECT_TYPE_QUEUE); + break; + case VK_OBJECT_TYPE_SEMAPHORE: + return GFXRECON_STR(VK_OBJECT_TYPE_SEMAPHORE); + break; + case VK_OBJECT_TYPE_COMMAND_BUFFER: + return GFXRECON_STR(VK_OBJECT_TYPE_COMMAND_BUFFER); + break; + case VK_OBJECT_TYPE_FENCE: + return GFXRECON_STR(VK_OBJECT_TYPE_FENCE); + break; + case VK_OBJECT_TYPE_DEVICE_MEMORY: + return GFXRECON_STR(VK_OBJECT_TYPE_DEVICE_MEMORY); + break; + case VK_OBJECT_TYPE_BUFFER: + return GFXRECON_STR(VK_OBJECT_TYPE_BUFFER); + break; + case VK_OBJECT_TYPE_IMAGE: + return GFXRECON_STR(VK_OBJECT_TYPE_IMAGE); + break; + case VK_OBJECT_TYPE_EVENT: + return GFXRECON_STR(VK_OBJECT_TYPE_EVENT); + break; + case VK_OBJECT_TYPE_QUERY_POOL: + return GFXRECON_STR(VK_OBJECT_TYPE_QUERY_POOL); + break; + case VK_OBJECT_TYPE_BUFFER_VIEW: + return GFXRECON_STR(VK_OBJECT_TYPE_BUFFER_VIEW); + break; + case VK_OBJECT_TYPE_IMAGE_VIEW: + return GFXRECON_STR(VK_OBJECT_TYPE_IMAGE_VIEW); + break; + case VK_OBJECT_TYPE_SHADER_MODULE: + return GFXRECON_STR(VK_OBJECT_TYPE_SHADER_MODULE); + break; + case VK_OBJECT_TYPE_PIPELINE_CACHE: + return GFXRECON_STR(VK_OBJECT_TYPE_PIPELINE_CACHE); + break; + case VK_OBJECT_TYPE_PIPELINE_LAYOUT: + return GFXRECON_STR(VK_OBJECT_TYPE_PIPELINE_LAYOUT); + break; + case VK_OBJECT_TYPE_RENDER_PASS: + return GFXRECON_STR(VK_OBJECT_TYPE_RENDER_PASS); + break; + case VK_OBJECT_TYPE_PIPELINE: + return GFXRECON_STR(VK_OBJECT_TYPE_PIPELINE); + break; + case VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT: + return GFXRECON_STR(VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT); + break; + case VK_OBJECT_TYPE_SAMPLER: + return GFXRECON_STR(VK_OBJECT_TYPE_SAMPLER); + break; + case VK_OBJECT_TYPE_DESCRIPTOR_POOL: + return GFXRECON_STR(VK_OBJECT_TYPE_DESCRIPTOR_POOL); + break; + case VK_OBJECT_TYPE_DESCRIPTOR_SET: + return GFXRECON_STR(VK_OBJECT_TYPE_DESCRIPTOR_SET); + break; + case VK_OBJECT_TYPE_FRAMEBUFFER: + return GFXRECON_STR(VK_OBJECT_TYPE_FRAMEBUFFER); + break; + case VK_OBJECT_TYPE_COMMAND_POOL: + return GFXRECON_STR(VK_OBJECT_TYPE_COMMAND_POOL); + break; + case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION: + return GFXRECON_STR(VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION); + break; + case VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE: + return GFXRECON_STR(VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE); + break; + case VK_OBJECT_TYPE_PRIVATE_DATA_SLOT: + return GFXRECON_STR(VK_OBJECT_TYPE_PRIVATE_DATA_SLOT); + break; + case VK_OBJECT_TYPE_SURFACE_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_SURFACE_KHR); + break; + case VK_OBJECT_TYPE_SWAPCHAIN_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_SWAPCHAIN_KHR); + break; + case VK_OBJECT_TYPE_DISPLAY_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_DISPLAY_KHR); + break; + case VK_OBJECT_TYPE_DISPLAY_MODE_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_DISPLAY_MODE_KHR); + break; + case VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT: + return GFXRECON_STR(VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT); + break; + case VK_OBJECT_TYPE_VIDEO_SESSION_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_VIDEO_SESSION_KHR); + break; + case VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR); + break; + case VK_OBJECT_TYPE_CU_MODULE_NVX: + return GFXRECON_STR(VK_OBJECT_TYPE_CU_MODULE_NVX); + break; + case VK_OBJECT_TYPE_CU_FUNCTION_NVX: + return GFXRECON_STR(VK_OBJECT_TYPE_CU_FUNCTION_NVX); + break; + case VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT: + return GFXRECON_STR(VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT); + break; + case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR); + break; + case VK_OBJECT_TYPE_VALIDATION_CACHE_EXT: + return GFXRECON_STR(VK_OBJECT_TYPE_VALIDATION_CACHE_EXT); + break; + case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV: + return GFXRECON_STR(VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV); + break; + case VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL: + return GFXRECON_STR(VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL); + break; + case VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR: + return GFXRECON_STR(VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR); + break; + case VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV: + return GFXRECON_STR(VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV); + break; + case VK_OBJECT_TYPE_CUDA_MODULE_NV: + return GFXRECON_STR(VK_OBJECT_TYPE_CUDA_MODULE_NV); + break; + case VK_OBJECT_TYPE_CUDA_FUNCTION_NV: + return GFXRECON_STR(VK_OBJECT_TYPE_CUDA_FUNCTION_NV); + break; + case VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA: + return GFXRECON_STR(VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA); + break; + case VK_OBJECT_TYPE_MICROMAP_EXT: + return GFXRECON_STR(VK_OBJECT_TYPE_MICROMAP_EXT); + break; + case VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV: + return GFXRECON_STR(VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV); + break; + case VK_OBJECT_TYPE_SHADER_EXT: + return GFXRECON_STR(VK_OBJECT_TYPE_SHADER_EXT); + break; + default: + assert(0); + return "XXX NULL XXX"; + } +} + +void CommonCaptureManager::OverrideIdForNextVulkanObject(format::HandleId id, VkObjectType type) +{ + if (id != format::kNullHandleId) + { + // GFXRECON_WRITE_CONSOLE( + // "[CAPTURE] %s() capture_id: %" PRIu64 " type: %s", __func__, id, VkObjectTypeToStr(type)); + handle_ids_override.push(std::make_pair(id, type)); + } +} + +void CommonCaptureManager::OverrideFrame(format::FrameNumber frame) +{ + GFXRECON_WRITE_CONSOLE("%s(frame: %" PRIu64 ")", __func__, frame) + override_frame_ = frame; +} + +format::HandleId CommonCaptureManager::GetUniqueId(VkObjectType type) +{ + // GFXRECON_WRITE_CONSOLE("%s(type: %s)", __func__, VkObjectTypeToStr(type)); + + if (!handle_ids_override.empty()) + { + assert(type != VK_OBJECT_TYPE_UNKNOWN); + + auto top = handle_ids_override.top(); + if (top.second != type) + { + GFXRECON_LOG_WARNING("%s() Type mismatch. Expected %s requested %s", + __func__, + VkObjectTypeToStr(top.second), + VkObjectTypeToStr(type)) + } + handle_ids_override.pop(); + + // GFXRECON_WRITE_CONSOLE(" Removing from stack %" PRIu64 "(%zu)", top.first, handle_ids_override.size()); + + return top.first; + } + else + { + // GFXRECON_WRITE_CONSOLE(" Incrementing %" PRIu64, unique_id_counter_ + 1); + return ++unique_id_counter_; + } +} + GFXRECON_END_NAMESPACE(encode) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/encode/capture_manager.h b/framework/encode/capture_manager.h index c30710ce17..7f9eb56f03 100644 --- a/framework/encode/capture_manager.h +++ b/framework/encode/capture_manager.h @@ -40,11 +40,16 @@ #include #include #include +#include #include #include #include +#include #include #include "util/file_path.h" +#include "util/logging.h" +#include "util/to_string.h" +#include "vulkan/vulkan_core.h" GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(encode) @@ -55,10 +60,17 @@ class ApiCaptureManager; class CommonCaptureManager { public: + // One based frame count. + static constexpr format::FrameNumber kInvalidFrame = 0; + static constexpr format::FrameNumber kFirstFrame = 1; + static constexpr size_t kFileStreamBufferSize = 256 * 1024; + typedef std::shared_mutex ApiCallMutexT; static format::HandleId GetUniqueId() { return ++unique_id_counter_; } + static format::HandleId GetUniqueId(VkObjectType type); + static auto AcquireSharedApiCallLock() { return std::move(std::shared_lock(api_call_mutex_)); } static auto AcquireExclusiveApiCallLock() { return std::move(std::unique_lock(api_call_mutex_)); } @@ -134,12 +146,12 @@ class CommonCaptureManager bool IsTrimHotkeyPressed(); - CaptureSettings::RuntimeTriggerState GetRuntimeTriggerState(); - bool RuntimeTriggerEnabled(); bool RuntimeTriggerDisabled(); + bool RuntimeWriteAssetsEnabled(); + void WriteDisplayMessageCmd(format::ApiFamilyId api_family, const char* message); void WriteExeFileInfo(format::ApiFamilyId api_family, const gfxrecon::util::filepath::FileInfo& info); @@ -250,7 +262,8 @@ class CommonCaptureManager PageGuardMemoryMode GetPageGuardMemoryMode() const { return page_guard_memory_mode_; } const std::string& GetTrimKey() const { return trim_key_; } bool IsTrimEnabled() const { return trim_enabled_; } - uint32_t GetCurrentFrame() const { return current_frame_; } + format::FrameNumber GetCurrentFrame() const { return current_frame_; } + format::FrameNumber GetOverrideFrame() const { return override_frame_; } CaptureMode GetCaptureMode() const { return capture_mode_; } bool GetDebugLayerSetting() const { return debug_layer_; } bool GetDebugDeviceLostSetting() const { return debug_device_lost_; } @@ -264,12 +277,18 @@ class CommonCaptureManager util::ScreenshotFormat GetScreenShotFormat() const { return screenshot_format_; } std::string CreateTrimFilename(const std::string& base_filename, const util::UintRange& trim_range); + void CreateAssetFile(); + std::string CreateAssetFilename(const std::string& base_filename); + std::string CreateFrameStateFilename(const std::string& base_filename) const; bool CreateCaptureFile(format::ApiFamilyId api_family, const std::string& base_filename); void WriteCaptureOptions(std::string& operation_annotation); void ActivateTrimming(); void DeactivateTrimming(); void WriteFileHeader(); + + void WriteFileHeader(util::FileOutputStream* file_stream); + void BuildOptionList(const format::EnabledOptions& enabled_options, std::vector* option_list); @@ -285,7 +304,7 @@ class CommonCaptureManager void WriteCreateHeapAllocationCmd(format::ApiFamilyId api_family, uint64_t allocation_id, uint64_t allocation_size); - void WriteToFile(const void* data, size_t size); + void WriteToFile(const void* data, size_t size, util::FileOutputStream* file_stream = nullptr); template void CombineAndWriteToFile(const std::pair (&buffers)[N]) @@ -311,6 +330,29 @@ class CommonCaptureManager GetThreadData()->block_index_ = block_index_; } + void SetWriteAssets() { write_assets_ = true; } + + bool WriteFrameStateFile(); + + void SetUniqueIdOffset(format::HandleId id) + { + GFXRECON_WRITE_CONSOLE("%s(id: %" PRIu64 ")", __func__, id); + unique_id_counter_ = id + 1; + } + + void OverrideIdForNextVulkanObject(format::HandleId id, VkObjectType type); + + void OverrideFrame(format::FrameNumber frame); + + private: + void WriteExecuteFromFile(util::FileOutputStream& out_stream, + const std::string& filename, + format::ThreadId thread_id, + uint32_t n_blocks, + int64_t offset); + + void WriteSetBlockIndex(util::FileOutputStream& out_stream, format::ThreadId thread_id, uint64_t block_index); + protected: std::unique_ptr compressor_; std::mutex mapped_memory_lock_; @@ -323,11 +365,12 @@ class CommonCaptureManager static void AtExit(); private: - static std::mutex instance_lock_; - static CommonCaptureManager* singleton_; - static thread_local std::unique_ptr thread_data_; - static std::atomic unique_id_counter_; - static ApiCallMutexT api_call_mutex_; + static std::mutex instance_lock_; + static CommonCaptureManager* singleton_; + static thread_local std::unique_ptr thread_data_; + static std::atomic unique_id_counter_; + static std::stack> handle_ids_override; + static ApiCallMutexT api_call_mutex_; uint32_t instance_count_ = 0; struct ApiInstanceRecord @@ -343,8 +386,10 @@ class CommonCaptureManager capture_settings_; // Settings from the settings file and environment at capture manager creation time. std::unique_ptr file_stream_; + std::unique_ptr asset_file_stream_; format::EnabledOptions file_options_; std::string base_filename_; + std::string capture_filename_; bool timestamp_filename_; bool force_file_flush_; CaptureSettings::MemoryTrackingMode memory_tracking_mode_; @@ -364,7 +409,8 @@ class CommonCaptureManager uint32_t trim_key_frames_; uint32_t trim_key_first_frame_; size_t trim_current_range_; - uint32_t current_frame_; + format::FrameNumber current_frame_; + format::FrameNumber override_frame_; uint32_t queue_submit_count_; CaptureMode capture_mode_; bool previous_hotkey_state_; @@ -380,6 +426,13 @@ class CommonCaptureManager bool queue_zero_only_; bool allow_pipeline_compile_required_; bool quit_after_frame_ranges_; + bool use_asset_file_; + bool write_assets_; + bool previous_write_assets_; + bool write_state_files_; + std::string asset_file_name_; + bool reuse_asset_file{ false }; + bool is_replay_in_frame_state_setup{ false }; struct { diff --git a/framework/encode/capture_settings.cpp b/framework/encode/capture_settings.cpp index 90f18e13d2..fdbdcfb202 100644 --- a/framework/encode/capture_settings.cpp +++ b/framework/encode/capture_settings.cpp @@ -25,6 +25,7 @@ #include "encode/capture_settings.h" #include "util/file_path.h" +#include "util/logging.h" #include "util/strings.h" #include "util/options.h" #include "util/platform.h" @@ -36,6 +37,7 @@ #include #include #include +#include GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(encode) @@ -90,10 +92,18 @@ GFXRECON_BEGIN_NAMESPACE(encode) #define CAPTURE_TRIGGER_FRAMES_UPPER "CAPTURE_TRIGGER_FRAMES" #define CAPTURE_ANDROID_TRIGGER_LOWER "capture_android_trigger" #define CAPTURE_ANDROID_TRIGGER_UPPER "CAPTURE_ANDROID_TRIGGER" +#define CAPTURE_ANDROID_DUMP_ASSETS_LOWER "capture_android_dump_assets" +#define CAPTURE_ANDROID_DUMP_ASSETS_UPPER "CAPTURE_ANDROID_DUMP_ASSETS" #define CAPTURE_IUNKNOWN_WRAPPING_LOWER "capture_iunknown_wrapping" #define CAPTURE_IUNKNOWN_WRAPPING_UPPER "CAPTURE_IUNKNOWN_WRAPPING" #define CAPTURE_QUEUE_SUBMITS_LOWER "capture_queue_submits" #define CAPTURE_QUEUE_SUBMITS_UPPER "CAPTURE_QUEUE_SUBMITS" +#define CAPTURE_USE_ASSET_FILE_LOWER "capture_use_asset_file" +#define CAPTURE_USE_ASSET_FILE_UPPER "CAPTURE_USE_ASSET_FILE" +#define CAPTURE_WRITE_STATE_FILES_LOWER "capture_write_state_files" +#define CAPTURE_WRITE_STATE_FILES_UPPER "CAPTURE_WRITE_STATE_FILES" +#define CAPTURE_REUSE_ASSET_FILE_LOWER "capture_reuse_asset_file" +#define CAPTURE_REUSE_ASSET_FILE_UPPER "CAPTURE_REUSE_ASSET_FILE" #define PAGE_GUARD_COPY_ON_MAP_LOWER "page_guard_copy_on_map" #define PAGE_GUARD_COPY_ON_MAP_UPPER "PAGE_GUARD_COPY_ON_MAP" #define PAGE_GUARD_SEPARATE_READ_LOWER "page_guard_separate_read" @@ -166,6 +176,9 @@ const char kCaptureTriggerEnvVar[] = GFXRECON_ENV_VAR_ const char kCaptureTriggerFramesEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_TRIGGER_FRAMES_LOWER; const char kCaptureIUnknownWrappingEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_IUNKNOWN_WRAPPING_LOWER; const char kCaptureQueueSubmitsEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_QUEUE_SUBMITS_LOWER; +const char kCaptureUseAssetFileEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_USE_ASSET_FILE_LOWER; +const char kCaptureWriteStateFilesEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_WRITE_STATE_FILES_LOWER; +const char kCaptureRecaptureEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_REUSE_ASSET_FILE_LOWER; const char kPageGuardCopyOnMapEnvVar[] = GFXRECON_ENV_VAR_PREFIX PAGE_GUARD_COPY_ON_MAP_LOWER; const char kPageGuardSeparateReadEnvVar[] = GFXRECON_ENV_VAR_PREFIX PAGE_GUARD_SEPARATE_READ_LOWER; const char kPageGuardPersistentMemoryEnvVar[] = GFXRECON_ENV_VAR_PREFIX PAGE_GUARD_PERSISTENT_MEMORY_LOWER; @@ -178,6 +191,7 @@ const char kPageGuardSignalHandlerWatcherMaxRestoresEnvVar[] = GFXRECON_ENV_VAR_ const char kDebugLayerEnvVar[] = GFXRECON_ENV_VAR_PREFIX DEBUG_LAYER_LOWER; const char kDebugDeviceLostEnvVar[] = GFXRECON_ENV_VAR_PREFIX DEBUG_DEVICE_LOST_LOWER; const char kCaptureAndroidTriggerEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_ANDROID_TRIGGER_LOWER; +const char kCaptureAndroidDumpAssetsEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_ANDROID_DUMP_ASSETS_LOWER; const char kDisableDxrEnvVar[] = GFXRECON_ENV_VAR_PREFIX DISABLE_DXR_LOWER; const char kAccelStructPaddingEnvVar[] = GFXRECON_ENV_VAR_PREFIX ACCEL_STRUCT_PADDING_LOWER; const char kForceCommandSerializationEnvVar[] = GFXRECON_ENV_VAR_PREFIX FORCE_COMMAND_SERIALIZATION_LOWER; @@ -198,6 +212,9 @@ const char kCaptureCompressionTypeEnvVar[] = GFXRECON_ENV_VAR_ const char kCaptureFileFlushEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_FILE_FLUSH_UPPER; const char kCaptureFileNameEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_FILE_NAME_UPPER; const char kCaptureFileUseTimestampEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_FILE_USE_TIMESTAMP_UPPER; +const char kCaptureUseAssetFileEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_USE_ASSET_FILE_UPPER; +const char kCaptureWriteStateFilesEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_WRITE_STATE_FILES_UPPER; +const char kCaptureRecaptureEnvVar[] = GFXRECON_ENV_VAR_PREFIX CAPTURE_REUSE_ASSET_FILE_UPPER; const char kLogAllowIndentsEnvVar[] = GFXRECON_ENV_VAR_PREFIX LOG_ALLOW_INDENTS_UPPER; const char kLogBreakOnErrorEnvVar[] = GFXRECON_ENV_VAR_PREFIX LOG_BREAK_ON_ERROR_UPPER; const char kLogDetailedEnvVar[] = GFXRECON_ENV_VAR_PREFIX LOG_DETAILED_UPPER; @@ -270,6 +287,9 @@ const std::string kOptionKeyCaptureTrigger = std::stri const std::string kOptionKeyCaptureTriggerFrames = std::string(kSettingsFilter) + std::string(CAPTURE_TRIGGER_FRAMES_LOWER); const std::string kOptionKeyCaptureIUnknownWrapping = std::string(kSettingsFilter) + std::string(CAPTURE_IUNKNOWN_WRAPPING_LOWER); const std::string kOptionKeyCaptureQueueSubmits = std::string(kSettingsFilter) + std::string(CAPTURE_QUEUE_SUBMITS_LOWER); +const std::string kOptionKeyCaptureUseAssetFile = std::string(kSettingsFilter) + std::string(CAPTURE_USE_ASSET_FILE_LOWER); +const std::string kOptionKeyCaptureWriteStateFiles = std::string(kSettingsFilter) + std::string(CAPTURE_WRITE_STATE_FILES_LOWER); +const std::string kOptionKeyCaptureRecapture = std::string(kSettingsFilter) + std::string(CAPTURE_REUSE_ASSET_FILE_LOWER); const std::string kOptionKeyPageGuardCopyOnMap = std::string(kSettingsFilter) + std::string(PAGE_GUARD_COPY_ON_MAP_LOWER); const std::string kOptionKeyPageGuardSeparateRead = std::string(kSettingsFilter) + std::string(PAGE_GUARD_SEPARATE_READ_LOWER); const std::string kOptionKeyPageGuardPersistentMemory = std::string(kSettingsFilter) + std::string(PAGE_GUARD_PERSISTENT_MEMORY_LOWER); @@ -345,6 +365,17 @@ void CaptureSettings::LoadRunTimeEnvVarSettings(CaptureSettings* settings) { settings->trace_settings_.trim_boundary = TrimBoundary::kFrames; } + + value = util::platform::GetEnv(kCaptureAndroidDumpAssetsEnvVar); + if (value.empty()) + { + settings->trace_settings_.runtime_write_assets = false; + } + else + { + settings->trace_settings_.runtime_write_assets = + ParseBoolString(value, settings->trace_settings_.runtime_write_assets); + } } #endif } @@ -407,6 +438,9 @@ void CaptureSettings::LoadOptionsEnvVar(OptionsMap* options) LoadSingleOptionEnvVar(options, kCaptureTriggerEnvVar, kOptionKeyCaptureTrigger); LoadSingleOptionEnvVar(options, kCaptureTriggerFramesEnvVar, kOptionKeyCaptureTriggerFrames); LoadSingleOptionEnvVar(options, kCaptureQueueSubmitsEnvVar, kOptionKeyCaptureQueueSubmits); + LoadSingleOptionEnvVar(options, kCaptureUseAssetFileEnvVar, kOptionKeyCaptureUseAssetFile); + LoadSingleOptionEnvVar(options, kCaptureWriteStateFilesEnvVar, kOptionKeyCaptureWriteStateFiles); + LoadSingleOptionEnvVar(options, kCaptureRecaptureEnvVar, kOptionKeyCaptureRecapture); // Page guard environment variables LoadSingleOptionEnvVar(options, kPageGuardCopyOnMapEnvVar, kOptionKeyPageGuardCopyOnMap); @@ -544,6 +578,19 @@ void CaptureSettings::ProcessOptions(OptionsMap* options, CaptureSettings* setti settings->trace_settings_.quit_after_frame_ranges = ParseBoolString( FindOption(options, kOptionKeyQuitAfterCaptureFrames), settings->trace_settings_.quit_after_frame_ranges); + settings->trace_settings_.use_asset_file = + ParseBoolString(FindOption(options, kOptionKeyCaptureUseAssetFile), settings->trace_settings_.use_asset_file); + + settings->trace_settings_.write_state_files = ParseBoolString(FindOption(options, kOptionKeyCaptureWriteStateFiles), + settings->trace_settings_.write_state_files); + + settings->trace_settings_.reuse_asset_file = FindOption(options, kOptionKeyCaptureRecapture); + + GFXRECON_WRITE_CONSOLE("%s()", __func__) + GFXRECON_WRITE_CONSOLE(" use_asset_file: %u", settings->trace_settings_.use_asset_file); + GFXRECON_WRITE_CONSOLE(" write_state_files: %u", settings->trace_settings_.write_state_files); + GFXRECON_WRITE_CONSOLE(" reuse_asset_file: %s", settings->trace_settings_.reuse_asset_file.c_str()); + // Page guard environment variables settings->trace_settings_.page_guard_copy_on_map = ParseBoolString( FindOption(options, kOptionKeyPageGuardCopyOnMap), settings->trace_settings_.page_guard_copy_on_map); diff --git a/framework/encode/capture_settings.h b/framework/encode/capture_settings.h index 28dc72e02b..12f5a67af8 100644 --- a/framework/encode/capture_settings.h +++ b/framework/encode/capture_settings.h @@ -102,6 +102,7 @@ class CaptureSettings std::string trim_key; uint32_t trim_key_frames{ 0 }; RuntimeTriggerState runtime_capture_trigger{ kNotUsed }; + bool runtime_write_assets{ false }; int page_guard_signal_handler_watcher_max_restores{ 1 }; bool page_guard_copy_on_map{ util::PageGuardManager::kDefaultEnableCopyOnMap }; bool page_guard_separate_read{ util::PageGuardManager::kDefaultEnableSeparateRead }; @@ -118,6 +119,9 @@ class CaptureSettings bool queue_zero_only{ false }; bool allow_pipeline_compile_required{ false }; bool quit_after_frame_ranges{ false }; + bool use_asset_file{ false }; + bool write_state_files{ false }; + std::string reuse_asset_file; // An optimization for the page_guard memory tracking mode that eliminates the need for shadow memory by // overriding vkAllocateMemory so that all host visible allocations use the external memory extension with a diff --git a/framework/encode/custom_exported_layer_funcs.h b/framework/encode/custom_exported_layer_funcs.h new file mode 100644 index 0000000000..083dd755c0 --- /dev/null +++ b/framework/encode/custom_exported_layer_funcs.h @@ -0,0 +1,54 @@ +/* +** Copyright (c) 2024 Valve Corporation +** Copyright (c) 2024 LunarG, Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and associated documentation files (the "Software"), +** to deal in the Software without restriction, including without limitation +** the rights to use, copy, modify, merge, publish, distribute, sublicense, +** and/or sell copies of the Software, and to permit persons to whom the +** Software is furnished to do so, subject to the following conditions: +** +** The above copyright notice and this permission notice shall be included in +** all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +** DEALINGS IN THE SOFTWARE. +*/ + +#ifndef GFXRECON_LAYER_CUSTOM_EXPORTED_FUNCS_H +#define GFXRECON_LAYER_CUSTOM_EXPORTED_FUNCS_H + +#include "format/format.h" +#include + +GFXRECON_BEGIN_NAMESPACE(gfxrecon) +GFXRECON_BEGIN_NAMESPACE(encode) + +// clang-format off +using GetBlockIndexGFXR_ptr = void(*)(void); +using DumpAssetsGFXR_ptr = void(*)(void); +using SetUniqueIdOffsetGFXRPtr = void(*)(format::HandleId); +using LoadAssetFileOffsetsGFXRPtr = void(*)(const format::AssetFileOffsets&); +using OverrideCaptureObjectIdFuncPtr = void(*)(format::HandleId, VkObjectType); +using OverrideFrameNumberGFXRPtr = void(*)(format::FrameNumber); +using NotifyFrameStateSetupGFXRPtr = void(*)(uint32_t); +// clang-format on + +VKAPI_ATTR uint64_t VKAPI_CALL GetBlockIndexGFXR(); +VKAPI_ATTR void VKAPI_CALL DumpAssetsGFXR(); +VKAPI_ATTR void VKAPI_CALL SetUniqueIdOffsetGFXR(format::HandleId offset); +VKAPI_ATTR void VKAPI_CALL LoadAssetFileOffsetsGFXR(const format::AssetFileOffsets& offsets); +VKAPI_ATTR void VKAPI_CALL OverrideIdForNextVulkanObjectGFXR(format::HandleId id, VkObjectType type); +VKAPI_ATTR void VKAPI_CALL OverrideFrameNumberGFXR(format::FrameNumber frame); +VKAPI_ATTR void VKAPI_CALL NotifyFrameStateSetupGFXR(uint32_t is_in_frame_state_setup); + +GFXRECON_END_NAMESPACE(encode) +GFXRECON_END_NAMESPACE(gfxrecon) + +#endif // GFXRECON_LAYER_CUSTOM_EXPORTED_FUNCS_H diff --git a/framework/encode/custom_layer_func_table.h b/framework/encode/custom_layer_func_table.h index 80f0885aea..3d5976a15e 100644 --- a/framework/encode/custom_layer_func_table.h +++ b/framework/encode/custom_layer_func_table.h @@ -24,16 +24,24 @@ #ifndef GFXRECON_LAYER_CUSTOM_FUNC_TABLE_H #define GFXRECON_LAYER_CUSTOM_FUNC_TABLE_H +#include "encode/custom_exported_layer_funcs.h" #include "util/defines.h" -#include "custom_vulkan_api_call_encoders.h" #include GFXRECON_BEGIN_NAMESPACE(gfxrecon) +// clang-format off const std::unordered_map custom_func_table = { - { "GetBlockIndexGFXR", reinterpret_cast(encode::GetBlockIndexGFXR) } + { "GetBlockIndexGFXR", reinterpret_cast(encode::GetBlockIndexGFXR) }, + { "DumpAssetsGFXR", reinterpret_cast(encode::DumpAssetsGFXR) }, + { "SetUniqueIdOffsetGFXR", reinterpret_cast(encode::SetUniqueIdOffsetGFXR) }, + { "LoadAssetFileOffsetsGFXR", reinterpret_cast(encode::LoadAssetFileOffsetsGFXR) }, + { "OverrideIdForNextVulkanObjectGFXR", reinterpret_cast(encode::OverrideIdForNextVulkanObjectGFXR) }, + { "OverrideFrameNumberGFXR", reinterpret_cast(encode::OverrideFrameNumberGFXR) }, + { "NotifyFrameStateSetupGFXR", reinterpret_cast(encode::NotifyFrameStateSetupGFXR) }, }; +// clang-format on GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/encode/custom_vulkan_api_call_encoders.cpp b/framework/encode/custom_vulkan_api_call_encoders.cpp index 48a06ac48e..2f48adb364 100644 --- a/framework/encode/custom_vulkan_api_call_encoders.cpp +++ b/framework/encode/custom_vulkan_api_call_encoders.cpp @@ -33,9 +33,11 @@ #include "encode/vulkan_capture_manager.h" #include "encode/vulkan_handle_wrapper_util.h" #include "format/api_call_id.h" +#include "format/format.h" #include "generated/generated_vulkan_struct_encoders.h" #include "generated/generated_vulkan_struct_handle_wrappers.h" #include "util/defines.h" +#include "vulkan/vulkan_core.h" #include @@ -403,6 +405,42 @@ VKAPI_ATTR uint64_t VKAPI_CALL GetBlockIndexGFXR() return manager->GetBlockIndex(); } +VKAPI_ATTR void VKAPI_CALL DumpAssetsGFXR() +{ + VulkanCaptureManager* manager = VulkanCaptureManager::Get(); + manager->SetWriteAssets(); +} + +VKAPI_ATTR void VKAPI_CALL LoadAssetFileOffsetsGFXR(const format::AssetFileOffsets& offsets) +{ + VulkanCaptureManager* manager = VulkanCaptureManager::Get(); + manager->LoadAssetFileOffsets(offsets); +} + +VKAPI_ATTR void VKAPI_CALL SetUniqueIdOffsetGFXR(format::HandleId offset) +{ + VulkanCaptureManager* manager = VulkanCaptureManager::Get(); + manager->SetUniqueIdOffset(offset); +} + +VKAPI_ATTR void VKAPI_CALL OverrideIdForNextVulkanObjectGFXR(format::HandleId id, VkObjectType type) +{ + VulkanCaptureManager* manager = VulkanCaptureManager::Get(); + manager->OverrideIdForNextVulkanObject(id, type); +} + +VKAPI_ATTR void VKAPI_CALL OverrideFrameNumberGFXR(format::FrameNumber frame) +{ + VulkanCaptureManager* manager = VulkanCaptureManager::Get(); + manager->OverrideFrameNumber(frame); +} + +VKAPI_ATTR void VKAPI_CALL NotifyFrameStateSetupGFXR(uint32_t is_in_frame_state_setup) +{ + VulkanCaptureManager* manager = VulkanCaptureManager::Get(); + manager->NotifyFrameStateSetup(is_in_frame_state_setup); +} + VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, diff --git a/framework/encode/custom_vulkan_api_call_encoders.h b/framework/encode/custom_vulkan_api_call_encoders.h index 7c9869fa43..acf6753319 100644 --- a/framework/encode/custom_vulkan_api_call_encoders.h +++ b/framework/encode/custom_vulkan_api_call_encoders.h @@ -26,8 +26,10 @@ #include "util/defines.h" #include "format/format.h" +#include "custom_exported_layer_funcs.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(encode) @@ -62,8 +64,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyAccelerationStructureKHR(VkDevice VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR* pInfo); -VKAPI_ATTR uint64_t VKAPI_CALL GetBlockIndexGFXR(); - VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, diff --git a/framework/encode/custom_vulkan_encoder_commands.h b/framework/encode/custom_vulkan_encoder_commands.h index c472558fdb..d7b0a5a011 100644 --- a/framework/encode/custom_vulkan_encoder_commands.h +++ b/framework/encode/custom_vulkan_encoder_commands.h @@ -816,7 +816,7 @@ struct CustomEncoderPostCall static void Dispatch(VulkanCaptureManager* manager, Args... args) { - manager->PreProcess_vkCreateDescriptorUpdateTemplate(args...); + manager->PostProcess_vkCreateDescriptorUpdateTemplate(args...); } }; @@ -826,7 +826,7 @@ struct CustomEncoderPostCall static void Dispatch(VulkanCaptureManager* manager, Args... args) { - manager->PreProcess_vkCreateDescriptorUpdateTemplateKHR(args...); + manager->PostProcess_vkCreateDescriptorUpdateTemplateKHR(args...); } }; @@ -1190,6 +1190,526 @@ struct CustomEncoderPostCall } }; +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBindPipeline(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, VkResult result, Args... args) + { + manager->PostProcess_vkCreateGraphicsPipelines(result, args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, VkResult result, Args... args) + { + manager->PostProcess_vkCreateComputePipelines(result, args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, VkResult result, Args... args) + { + manager->PostProcess_vkCreateRayTracingPipelinesKHR(result, args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBindDescriptorSets(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBindDescriptorSets2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdTraceRaysIndirect2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdTraceRaysIndirectKHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdTraceRaysNV(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdTraceRaysKHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDispatch(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDispatchIndirect(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDispatchBase(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDispatchBaseKHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDraw(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawIndexed(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawIndirect(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawIndexedIndirect(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawIndirectCount(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawIndexedIndirectCount(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawIndirectCountKHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawIndexedIndirectCountKHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyBuffer(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyImage(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyBufferToImage(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyImageToBuffer(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyBuffer2(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyImage2(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyBufferToImage2(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyImageToBuffer2(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyBuffer2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyImage2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyBufferToImage2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdCopyImageToBuffer2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBlitImage(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBlitImage2(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBlitImage2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdUpdateBuffer(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdFillBuffer(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdClearColorImage(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdClearDepthStencilImage(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdResolveImage(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdResolveImage2(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdResolveImage2KHR(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawMeshTasksNV(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawMeshTasksIndirectNV(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawMeshTasksIndirectCountNV(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawMeshTasksEXT(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawMeshTasksIndirectEXT(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdDrawMeshTasksIndirectCountEXT(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBeginRendering(args...); + } +}; + +template <> +struct CustomEncoderPostCall +{ + template + static void Dispatch(VulkanCaptureManager* manager, Args... args) + { + manager->PostProcess_vkCmdBeginRendering(args...); + } +}; + GFXRECON_END_NAMESPACE(encode) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/encode/d3d12_capture_manager.cpp b/framework/encode/d3d12_capture_manager.cpp index 1cd0f6d1c5..cf0e297524 100644 --- a/framework/encode/d3d12_capture_manager.cpp +++ b/framework/encode/d3d12_capture_manager.cpp @@ -169,9 +169,11 @@ void D3D12CaptureManager::EndCommandListMethodCallCapture(ID3D12CommandList_Wrap EndMethodCallCapture(); } -void D3D12CaptureManager::WriteTrackedState(util::FileOutputStream* file_stream, format::ThreadId thread_id) +void D3D12CaptureManager::WriteTrackedState(util::FileOutputStream* file_stream, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream) { - Dx12StateWriter state_writer(file_stream, GetCompressor(), thread_id); + Dx12StateWriter state_writer(file_stream, GetCompressor(), thread_id, asset_file_stream); state_tracker_->WriteState(&state_writer, GetCurrentFrame()); } diff --git a/framework/encode/d3d12_capture_manager.h b/framework/encode/d3d12_capture_manager.h index 16b510d7fb..ddddb77792 100644 --- a/framework/encode/d3d12_capture_manager.h +++ b/framework/encode/d3d12_capture_manager.h @@ -765,11 +765,18 @@ class D3D12CaptureManager : public ApiCaptureManager virtual ~D3D12CaptureManager() {} - virtual void CreateStateTracker() override { state_tracker_ = std::make_unique(); } + virtual void CreateStateTracker(bool recapturing = false) override + { + state_tracker_ = std::make_unique(); + } virtual void DestroyStateTracker() override { state_tracker_ = nullptr; } - virtual void WriteTrackedState(util::FileOutputStream* file_stream, format::ThreadId thread_id) override; + virtual void WriteTrackedState(util::FileOutputStream* file_stream, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream = nullptr) override; + + virtual void WriteAssets(util::FileOutputStream* assert_file_stream, format::ThreadId thread_id) override {} void PreAcquireSwapChainImages(IDXGISwapChain_Wrapper* wrapper, IUnknown* command_queue, diff --git a/framework/encode/dx12_state_writer.cpp b/framework/encode/dx12_state_writer.cpp index fabf0d9b6d..b8e4756986 100644 --- a/framework/encode/dx12_state_writer.cpp +++ b/framework/encode/dx12_state_writer.cpp @@ -36,7 +36,8 @@ GFXRECON_BEGIN_NAMESPACE(encode) Dx12StateWriter::Dx12StateWriter(util::FileOutputStream* output_stream, util::Compressor* compressor, - format::ThreadId thread_id) : + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream) : output_stream_(output_stream), compressor_(compressor), thread_id_(thread_id), encoder_(¶meter_stream_) { diff --git a/framework/encode/dx12_state_writer.h b/framework/encode/dx12_state_writer.h index 96969a1256..0ea0b856a8 100644 --- a/framework/encode/dx12_state_writer.h +++ b/framework/encode/dx12_state_writer.h @@ -50,17 +50,19 @@ GFXRECON_BEGIN_NAMESPACE(encode) class Dx12StateWriter { public: - Dx12StateWriter(util::FileOutputStream* output_stream, util::Compressor* compressor, format::ThreadId thread_id); + Dx12StateWriter(util::FileOutputStream* output_stream, + util::Compressor* compressor, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream = nullptr); ~Dx12StateWriter(); - + #ifdef GFXRECON_AGS_SUPPORT void WriteState(const Dx12StateTable& state_table, const AgsStateTable& ags_state_table, uint64_t frame_number); #else void WriteState(const Dx12StateTable& state_table, uint64_t frame_number); #endif // GFXRECON_AGS_SUPPORT - private: struct ResourceSnapshotInfo { diff --git a/framework/encode/test/main.cpp b/framework/encode/test/main.cpp index 900acbc3f5..a3500393c3 100644 --- a/framework/encode/test/main.cpp +++ b/framework/encode/test/main.cpp @@ -36,8 +36,10 @@ const auto kBufferHandle = gfxrecon::format::FromHandleId(0xabcd); const gfxrecon::format::HandleId kBufferId = 12; -gfxrecon::format::HandleId GetHandleId() +gfxrecon::format::HandleId GetHandleId(VkObjectType type) { + GFXRECON_UNREFERENCED_PARAMETER(type); + return kBufferId; } diff --git a/framework/encode/vulkan_capture_manager.cpp b/framework/encode/vulkan_capture_manager.cpp index f25d8a38d9..8a1acb87a9 100644 --- a/framework/encode/vulkan_capture_manager.cpp +++ b/framework/encode/vulkan_capture_manager.cpp @@ -22,11 +22,16 @@ ** DEALINGS IN THE SOFTWARE. */ +#include "encode/vulkan_handle_wrappers.h" +#include "format/format.h" +#include "vulkan/vulkan_core.h" +#include #include PROJECT_VERSION_HEADER_FILE #include "encode/struct_pointer_encoder.h" #include "encode/vulkan_capture_manager.h" - +#include "encode/custom_layer_func_table.h" +#include "encode/capture_manager.h" #include "encode/vulkan_handle_wrapper_util.h" #include "encode/vulkan_state_writer.h" #include "format/format_util.h" @@ -97,10 +102,30 @@ void VulkanCaptureManager::DestroyInstance() singleton_->common_manager_->DestroyInstance(singleton_); } -void VulkanCaptureManager::WriteTrackedState(util::FileOutputStream* file_stream, format::ThreadId thread_id) +void VulkanCaptureManager::WriteTrackedState(util::FileOutputStream* file_stream, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream) +{ + assert(state_tracker_ != nullptr); + + format::FrameNumber frame = + GetOverrideFrame() != CommonCaptureManager::kInvalidFrame ? (GetOverrideFrame() + 1) : GetCurrentFrame(); + + GFXRECON_WRITE_CONSOLE("%s()", __func__) + GFXRECON_WRITE_CONSOLE(" GetOverrideFrame(): %" PRIu64, GetOverrideFrame()) + GFXRECON_WRITE_CONSOLE(" GetCurrentFrame(): %" PRIu64, GetCurrentFrame()) + + uint64_t n_blocks = state_tracker_->WriteState(file_stream, thread_id, asset_file_stream, GetCompressor(), frame); + common_manager_->IncrementBlockIndex(n_blocks); +} + +void VulkanCaptureManager::WriteAssets(util::FileOutputStream* asset_file_stream, format::ThreadId thread_id) { - VulkanStateWriter state_writer(file_stream, GetCompressor(), thread_id); - uint64_t n_blocks = state_tracker_->WriteState(&state_writer, GetCurrentFrame()); + assert(state_tracker_ != nullptr); + format::FrameNumber frame = + GetOverrideFrame() != CommonCaptureManager::kInvalidFrame ? GetOverrideFrame() : GetCurrentFrame(); + + uint64_t n_blocks = state_tracker_->WriteAssets(asset_file_stream, thread_id, GetCompressor(), frame); common_manager_->IncrementBlockIndex(n_blocks); } @@ -584,6 +609,18 @@ VkResult VulkanCaptureManager::OverrideCreateInstance(const VkInstanceCreateInfo { VkResult result = VK_ERROR_INITIALIZATION_FAILED; + GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) + if (pCreateInfo->pApplicationInfo->pApplicationName) + { + GFXRECON_WRITE_CONSOLE(" pCreateInfo->pApplicationInfo->pApplicationName: %s", + pCreateInfo->pApplicationInfo->pApplicationName) + } + if (pCreateInfo->pApplicationInfo->pEngineName) + { + GFXRECON_WRITE_CONSOLE(" pCreateInfo->pApplicationInfo->pEngineName: %s", + pCreateInfo->pApplicationInfo->pEngineName) + } + if (CreateInstance()) { if (singleton_->IsPageGuardMemoryModeExternal()) @@ -655,6 +692,41 @@ VkResult VulkanCaptureManager::OverrideCreateInstance(const VkInstanceCreateInfo VK_VERSION_MINOR(api_version), VK_VERSION_PATCH(api_version)); } + + const VkLayerSettingsCreateInfoEXT* layer_settings_ext = + graphics::vulkan_struct_get_pnext(pCreateInfo); + if (layer_settings_ext != nullptr && layer_settings_ext->settingCount) + { + GFXRECON_LOG_INFO("%s() Discovered VkLayerSettingsCreateInfoEXT", __func__) + + for (uint32_t i = 0; i < layer_settings_ext->settingCount; ++i) + { + if (util::platform::StringCompare( + layer_settings_ext->pSettings[i].pLayerName, + GFXRECON_PROJECT_VULKAN_LAYER_NAME "\0", + util::platform::StringLength(GFXRECON_PROJECT_VULKAN_LAYER_NAME "\0")) || + !layer_settings_ext->pSettings[i].valueCount) + { + continue; + } + + auto table_entry = custom_func_table.find(layer_settings_ext->pSettings[i].pSettingName); + if (table_entry != custom_func_table.end()) + { + // Cast the const away + PFN_vkVoidFunction* func_ptr = reinterpret_cast( + const_cast(layer_settings_ext->pSettings[i].pValues)); + + GFXRECON_WRITE_CONSOLE(" %s -> %p", table_entry->first.c_str(), table_entry->second); + *func_ptr = table_entry->second; + } + else + { + GFXRECON_LOG_WARNING(" There is no function named \"%s\" exposed by the capture layer.", + layer_settings_ext->pSettings[i].pSettingName); + } + } + } } return result; @@ -1717,7 +1789,7 @@ void VulkanCaptureManager::ProcessReferenceToAndroidHardwareBuffer(VkDevice devi #endif // Only store buffer IDs and reference count if a creation command is written to the capture file. - format::HandleId memory_id = GetUniqueId(); + format::HandleId memory_id = GetUniqueId(VK_OBJECT_TYPE_UNKNOWN); HardwareBufferInfo& ahb_info = hardware_buffers_[hardware_buffer]; ahb_info.memory_id = memory_id; @@ -1807,7 +1879,7 @@ void VulkanCaptureManager::ProcessReferenceToAndroidHardwareBuffer(VkDevice devi { // The AHB is not CPU-readable, so store only the creation command. // Only store buffer IDs and reference count if a creation command is written to the capture file. - format::HandleId memory_id = GetUniqueId(); + format::HandleId memory_id = GetUniqueId(VK_OBJECT_TYPE_UNKNOWN); HardwareBufferInfo& ahb_info = hardware_buffers_[hardware_buffer]; ahb_info.memory_id = memory_id; @@ -2411,6 +2483,13 @@ void VulkanCaptureManager::PreProcess_vkQueueSubmit(VkQueue queue, GFXRECON_UNREFERENCED_PARAMETER(pSubmits); GFXRECON_UNREFERENCED_PARAMETER(fence); + // This must be done before QueueSubmitWriteFillMemoryCmd is called + // and tracked mapped memory regions are resetted + if (IsCaptureModeTrack()) + { + state_tracker_->TrackSubmission(submitCount, pSubmits); + } + QueueSubmitWriteFillMemoryCmd(); PreQueueSubmit(); @@ -2438,6 +2517,13 @@ void VulkanCaptureManager::PreProcess_vkQueueSubmit2(VkQueue queue, GFXRECON_UNREFERENCED_PARAMETER(pSubmits); GFXRECON_UNREFERENCED_PARAMETER(fence); + // This must be done before QueueSubmitWriteFillMemoryCmd is called + // and tracked mapped memory regions are resetted + if (IsCaptureModeTrack()) + { + state_tracker_->TrackSubmission(submitCount, pSubmits); + } + QueueSubmitWriteFillMemoryCmd(); PreQueueSubmit(); @@ -2495,7 +2581,7 @@ void VulkanCaptureManager::QueueSubmitWriteFillMemoryCmd() } } -void VulkanCaptureManager::PreProcess_vkCreateDescriptorUpdateTemplate( +void VulkanCaptureManager::PostProcess_vkCreateDescriptorUpdateTemplate( VkResult result, VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, @@ -2511,7 +2597,7 @@ void VulkanCaptureManager::PreProcess_vkCreateDescriptorUpdateTemplate( } } -void VulkanCaptureManager::PreProcess_vkCreateDescriptorUpdateTemplateKHR( +void VulkanCaptureManager::PostProcess_vkCreateDescriptorUpdateTemplateKHR( VkResult result, VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, @@ -2809,6 +2895,714 @@ void VulkanCaptureManager::PostProcess_vkCreateShaderModule(VkResult if (result == VK_SUCCESS) { graphics::vulkan_check_buffer_references(pCreateInfo->pCode, pCreateInfo->codeSize); + + vulkan_wrappers::ShaderModuleWrapper* shader_wrapper = + vulkan_wrappers::GetWrapper(*pShaderModule); + if (shader_wrapper != nullptr) + { + gfxrecon::util::SpirVParsingUtil spirv_util; + if (!spirv_util.SPIRVReflectPerformReflectionOnShaderModule( + pCreateInfo->codeSize, pCreateInfo->pCode, shader_wrapper->used_descriptors_info)) + { + GFXRECON_LOG_WARNING("Reflection on shader %" PRIu64 "failed", shader_wrapper->handle_id); + } + } + } +} + +void VulkanCaptureManager::PostProcess_vkCmdBindPipeline(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); + } +} + +void VulkanCaptureManager::PostProcess_vkCreateGraphicsPipelines(VkResult result, + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkGraphicsPipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines) +{ + if (result == VK_SUCCESS && createInfoCount && pPipelines != nullptr) + { + for (uint32_t p = 0; p < createInfoCount; ++p) + { + vulkan_wrappers::PipelineWrapper* ppl_wrapper = + vulkan_wrappers::GetWrapper(pPipelines[p]); + assert(ppl_wrapper != nullptr); + + for (uint32_t s = 0; s < pCreateInfos[p].stageCount; ++s) + { + const vulkan_wrappers::ShaderModuleWrapper* shader_wrapper = + vulkan_wrappers::GetWrapper( + pCreateInfos[p].pStages[s].module); + assert(shader_wrapper != nullptr); + + ppl_wrapper->bound_shaders.push_back(*shader_wrapper); + } + } + } +} + +void VulkanCaptureManager::PostProcess_vkCreateComputePipelines(VkResult result, + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkComputePipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines) +{ + if (result == VK_SUCCESS && createInfoCount && pPipelines != nullptr) + { + for (uint32_t p = 0; p < createInfoCount; ++p) + { + vulkan_wrappers::PipelineWrapper* ppl_wrapper = + vulkan_wrappers::GetWrapper(pPipelines[p]); + assert(ppl_wrapper != nullptr); + + const vulkan_wrappers::ShaderModuleWrapper* shader_wrapper = + vulkan_wrappers::GetWrapper(pCreateInfos[p].stage.module); + assert(shader_wrapper != nullptr); + + ppl_wrapper->bound_shaders.push_back(*shader_wrapper); + } + } +} + +void VulkanCaptureManager::PostProcess_vkCreateRayTracingPipelinesKHR( + VkResult result, + VkDevice device, + VkDeferredOperationKHR deferredOperation, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines) +{ + if (result == VK_SUCCESS && createInfoCount && pPipelines != nullptr) + { + for (uint32_t p = 0; p < createInfoCount; ++p) + { + vulkan_wrappers::PipelineWrapper* ppl_wrapper = + vulkan_wrappers::GetWrapper(pPipelines[p]); + assert(ppl_wrapper != nullptr); + + for (uint32_t s = 0; s < pCreateInfos[p].stageCount; ++s) + { + const vulkan_wrappers::ShaderModuleWrapper* shader_wrapper = + vulkan_wrappers::GetWrapper( + pCreateInfos[p].pStages[s].module); + assert(shader_wrapper != nullptr); + + ppl_wrapper->bound_shaders.push_back(*shader_wrapper); + } + } + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDraw(VkCommandBuffer commandBuffer, + uint32_t vertexCount, + uint32_t instanceCount, + uint32_t firstVertex, + uint32_t firstInstance) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawIndexed(VkCommandBuffer commandBuffer, + uint32_t indexCount, + uint32_t instanceCount, + uint32_t firstIndex, + int32_t vertexOffset, + uint32_t firstInstance) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawIndexed( + commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawIndexedIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawIndirectCount( + commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawIndexedIndirectCount( + commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawIndirectCountKHR( + commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawIndexedIndirectCountKHR( + commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDispatch(VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDispatchIndirect(commandBuffer, buffer, offset); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDispatchBase(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDispatchBase( + commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDispatchBaseKHR( + commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdTraceRaysNV(VkCommandBuffer commandBuffer, + VkBuffer raygenShaderBindingTableBuffer, + VkDeviceSize raygenShaderBindingOffset, + VkBuffer missShaderBindingTableBuffer, + VkDeviceSize missShaderBindingOffset, + VkDeviceSize missShaderBindingStride, + VkBuffer hitShaderBindingTableBuffer, + VkDeviceSize hitShaderBindingOffset, + VkDeviceSize hitShaderBindingStride, + VkBuffer callableShaderBindingTableBuffer, + VkDeviceSize callableShaderBindingOffset, + VkDeviceSize callableShaderBindingStride, + uint32_t width, + uint32_t height, + uint32_t depth) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdTraceRaysNV(commandBuffer, + raygenShaderBindingTableBuffer, + raygenShaderBindingOffset, + missShaderBindingTableBuffer, + missShaderBindingOffset, + missShaderBindingStride, + hitShaderBindingTableBuffer, + hitShaderBindingOffset, + hitShaderBindingStride, + callableShaderBindingTableBuffer, + callableShaderBindingOffset, + callableShaderBindingStride, + width, + height, + depth); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdTraceRaysKHR( + VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + uint32_t width, + uint32_t height, + uint32_t depth) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdTraceRaysKHR(commandBuffer, + pRaygenShaderBindingTable, + pMissShaderBindingTable, + pHitShaderBindingTable, + pCallableShaderBindingTable, + width, + height, + depth); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdTraceRaysIndirectKHR( + VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + VkDeviceAddress indirectDeviceAddress) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdTraceRaysIndirectKHR(commandBuffer, + pRaygenShaderBindingTable, + pMissShaderBindingTable, + pHitShaderBindingTable, + pCallableShaderBindingTable, + indirectDeviceAddress); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, + VkDeviceAddress indirectDeviceAddress) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdTraceRaysIndirect2KHR(commandBuffer, indirectDeviceAddress); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t firstSet, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets, + uint32_t dynamicOffsetCount, + const uint32_t* pDynamicOffsets) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdBindDescriptorSets(commandBuffer, + pipelineBindPoint, + layout, + firstSet, + descriptorSetCount, + pDescriptorSets, + dynamicOffsetCount, + pDynamicOffsets); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdBindDescriptorSets2KHR( + VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdBindDescriptorSets2KHR(commandBuffer, pBindDescriptorSetsInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyBuffer(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferCopy* pRegions) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageCopy* pRegions) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyImage( + commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkBufferImageCopy* pRegions) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyBufferToImage( + commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferImageCopy* pRegions) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyImageToBuffer( + commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyBuffer2(VkCommandBuffer commandBuffer, + const VkCopyBufferInfo2* pCopyBufferInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyBuffer2(commandBuffer, pCopyBufferInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyImage2(VkCommandBuffer commandBuffer, + const VkCopyImageInfo2* pCopyImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyImage2(commandBuffer, pCopyImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyBufferToImage2(commandBuffer, pCopyBufferToImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyImageToBuffer2(commandBuffer, pCopyImageToBufferInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, + const VkCopyBufferInfo2* pCopyBufferInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyBuffer2KHR(commandBuffer, pCopyBufferInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer, + const VkCopyImageInfo2* pCopyImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyImage2KHR(commandBuffer, pCopyImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyBufferToImage2KHR( + VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyBufferToImage2KHR(commandBuffer, pCopyBufferToImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdCopyImageToBuffer2KHR( + VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdCopyImageToBuffer2KHR(commandBuffer, pCopyImageToBufferInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdBlitImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageBlit* pRegions, + VkFilter filter) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdBlitImage( + commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdBlitImage2(VkCommandBuffer commandBuffer, + const VkBlitImageInfo2* pBlitImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdBlitImage2(commandBuffer, pBlitImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer, + const VkBlitImageInfo2* pBlitImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdBlitImage2KHR(commandBuffer, pBlitImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdUpdateBuffer( + VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdFillBuffer( + VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdClearColorImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearColorValue* pColor, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearDepthStencilValue* pDepthStencil, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdClearDepthStencilImage( + commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdResolveImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageResolve* pRegions) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdResolveImage( + commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdResolveImage2(VkCommandBuffer commandBuffer, + const VkResolveImageInfo2* pResolveImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdResolveImage2(commandBuffer, pResolveImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer, + const VkResolveImageInfo2* pResolveImageInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdResolveImage2(commandBuffer, pResolveImageInfo); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, + uint32_t taskCount, + uint32_t firstTask) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawMeshTasksNV(commandBuffer, taskCount, firstTask); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawMeshTasksIndirectNV( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawMeshTasksIndirectNV(commandBuffer, buffer, offset, drawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawMeshTasksIndirectCountNV( + commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawMeshTasksEXT(commandBuffer, groupCountX, groupCountY, groupCountZ); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawMeshTasksIndirectEXT( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawMeshTasksIndirectEXT(commandBuffer, buffer, offset, drawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackCmdDrawMeshTasksIndirectCountEXT( + commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); + } +} + +void VulkanCaptureManager::PostProcess_vkCmdBeginRendering(VkCommandBuffer commandBuffer, + const VkRenderingInfo* pRenderingInfo) +{ + if (IsCaptureModeTrack()) + { + state_tracker_->TrackBeginRendering(commandBuffer, pRenderingInfo); + } +} + +void VulkanCaptureManager::LoadAssetFileOffsets(const format::AssetFileOffsets& offsets) +{ + GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__); + + if (IsCaptureModeTrack()) + { + assert(state_tracker_ != nullptr); + state_tracker_->LoadAssetFileOffsets(offsets); } } diff --git a/framework/encode/vulkan_capture_manager.h b/framework/encode/vulkan_capture_manager.h index 7f65dc3464..ef4da9d4a8 100644 --- a/framework/encode/vulkan_capture_manager.h +++ b/framework/encode/vulkan_capture_manager.h @@ -42,6 +42,7 @@ #include "util/defines.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" #include #include @@ -1203,17 +1204,17 @@ class VulkanCaptureManager : public ApiCaptureManager void PreProcess_vkQueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence); - void PreProcess_vkCreateDescriptorUpdateTemplate(VkResult result, - VkDevice device, - const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); + void PostProcess_vkCreateDescriptorUpdateTemplate(VkResult result, + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); - void PreProcess_vkCreateDescriptorUpdateTemplateKHR(VkResult result, - VkDevice device, - const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); + void PostProcess_vkCreateDescriptorUpdateTemplateKHR(VkResult result, + VkDevice device, + const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); void PreProcess_vkGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo); @@ -1270,18 +1271,305 @@ class VulkanCaptureManager : public ApiCaptureManager const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); + void PostProcess_vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t firstSet, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets, + uint32_t dynamicOffsetCount, + const uint32_t* pDynamicOffsets); + + void PostProcess_vkCmdBindDescriptorSets2KHR(VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo); + + void PostProcess_vkCmdCopyBuffer(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferCopy* pRegions); + + void PostProcess_vkCmdCopyImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageCopy* pRegions); + + void PostProcess_vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + + void PostProcess_vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + + void PostProcess_vkCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo); + + void PostProcess_vkCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo); + + void PostProcess_vkCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo); + + void PostProcess_vkCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo); + + void PostProcess_vkCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo); + + void PostProcess_vkCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo); + + void PostProcess_vkCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo); + + void PostProcess_vkCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo); + + void PostProcess_vkCmdBlitImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageBlit* pRegions, + VkFilter filter); + + void PostProcess_vkCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo); + + void PostProcess_vkCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo); + + void PostProcess_vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize dataSize, + const void* pData); + + void PostProcess_vkCmdFillBuffer( + VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); + + void PostProcess_vkCmdClearColorImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearColorValue* pColor, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + + void PostProcess_vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearDepthStencilValue* pDepthStencil, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + + void PostProcess_vkCmdBindPipeline(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline); + + void PostProcess_vkCreateGraphicsPipelines(VkResult result, + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkGraphicsPipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + + void PostProcess_vkCreateComputePipelines(VkResult result, + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkComputePipelineCreateInfo* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + + void PostProcess_vkCreateRayTracingPipelinesKHR(VkResult result, + VkDevice device, + VkDeferredOperationKHR deferredOperation, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + + void PostProcess_vkCmdDraw(VkCommandBuffer commandBuffer, + uint32_t vertexCount, + uint32_t instanceCount, + uint32_t firstVertex, + uint32_t firstInstance); + + void PostProcess_vkCmdDrawIndexed(VkCommandBuffer commandBuffer, + uint32_t indexCount, + uint32_t instanceCount, + uint32_t firstIndex, + int32_t vertexOffset, + uint32_t firstInstance); + + void PostProcess_vkCmdDrawIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void PostProcess_vkCmdDrawIndexedIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void PostProcess_vkCmdDrawIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void PostProcess_vkCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void PostProcess_vkCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void PostProcess_vkCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void PostProcess_vkCmdDispatch(VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + + void PostProcess_vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); + + void PostProcess_vkCmdDispatchBase(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + + void PostProcess_vkCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + + void PostProcess_vkCmdTraceRaysNV(VkCommandBuffer commandBuffer, + VkBuffer raygenShaderBindingTableBuffer, + VkDeviceSize raygenShaderBindingOffset, + VkBuffer missShaderBindingTableBuffer, + VkDeviceSize missShaderBindingOffset, + VkDeviceSize missShaderBindingStride, + VkBuffer hitShaderBindingTableBuffer, + VkDeviceSize hitShaderBindingOffset, + VkDeviceSize hitShaderBindingStride, + VkBuffer callableShaderBindingTableBuffer, + VkDeviceSize callableShaderBindingOffset, + VkDeviceSize callableShaderBindingStride, + uint32_t width, + uint32_t height, + uint32_t depth); + + void PostProcess_vkCmdTraceRaysKHR(VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + uint32_t width, + uint32_t height, + uint32_t depth); + + void PostProcess_vkCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + VkDeviceAddress indirectDeviceAddress); + + void PostProcess_vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress); + + void PostProcess_vkCmdResolveImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageResolve* pRegions); + + void PostProcess_vkCmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo); + + void PostProcess_vkCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo); + + void PostProcess_vkCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); + + void PostProcess_vkCmdDrawMeshTasksIndirectNV( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void PostProcess_vkCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void PostProcess_vkCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + + void PostProcess_vkCmdDrawMeshTasksIndirectEXT( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void PostProcess_vkCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void PostProcess_vkCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo); + + void LoadAssetFileOffsets(const format::AssetFileOffsets& offsets); + #if defined(__ANDROID__) void OverrideGetPhysicalDeviceSurfacePresentModesKHR(uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); #endif + void NotifyFrameStateSetup(uint32_t is_in_frame_state_setup) + { + GFXRECON_WRITE_CONSOLE("%s(is_in_frame_state_setup: %u)", __func__, is_in_frame_state_setup) + if (state_tracker_ != nullptr) + { + state_tracker_->NotifyFrameStateSetup(!!is_in_frame_state_setup); + } + } + protected: VulkanCaptureManager() : ApiCaptureManager(format::ApiFamilyId::ApiFamily_Vulkan) {} virtual ~VulkanCaptureManager() {} - virtual void CreateStateTracker() override + virtual void CreateStateTracker(bool recapturing = false) override { - state_tracker_ = std::make_unique(); + state_tracker_ = std::make_unique(recapturing); } virtual void DestroyStateTracker() override @@ -1289,7 +1577,11 @@ class VulkanCaptureManager : public ApiCaptureManager state_tracker_ = nullptr; } - virtual void WriteTrackedState(util::FileOutputStream* file_stream, format::ThreadId thread_id) override; + virtual void WriteTrackedState(util::FileOutputStream* file_stream, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream = nullptr) override; + + virtual void WriteAssets(util::FileOutputStream* asset_file_stream, format::ThreadId thread_id) override; private: struct HardwareBufferInfo diff --git a/framework/encode/vulkan_handle_wrapper_util.h b/framework/encode/vulkan_handle_wrapper_util.h index 4dfb973b29..833ba8d709 100644 --- a/framework/encode/vulkan_handle_wrapper_util.h +++ b/framework/encode/vulkan_handle_wrapper_util.h @@ -32,6 +32,8 @@ #include "generated/generated_vulkan_dispatch_table.h" #include "generated/generated_vulkan_state_table.h" #include "util/defines.h" +#include "util/logging.h" +#include "vulkan/vulkan_core.h" #include #include @@ -54,7 +56,7 @@ static const VkCommandPool kTempCommandPool = UINT64_TO_VK_HANDLE(VkCommandPool, std::numeric_limits::max() - 2); static const format::HandleId kTempCommandPoolId = std::numeric_limits::max() - 2; static const format::HandleId kTempCommandBufferId = std::numeric_limits::max() - 3; -typedef format::HandleId (*PFN_GetHandleId)(); +typedef format::HandleId (*PFN_GetHandleId)(VkObjectType); extern VulkanStateHandleTable state_handle_table_; @@ -75,7 +77,7 @@ inline format::HandleId GetTempWrapperId(const VkCommandPool } template -format::HandleId GetWrappedId(const typename Wrapper::HandleType& handle) +format::HandleId GetWrappedId(const typename Wrapper::HandleType& handle, bool log_warning = true) { if (handle == VK_NULL_HANDLE) { @@ -90,16 +92,19 @@ format::HandleId GetWrappedId(const typename Wrapper::HandleType& handle) auto wrapper = state_handle_table_.GetWrapper(handle); if (wrapper == nullptr) { - GFXRECON_LOG_WARNING("vulkan_wrappers::GetWrappedId() couldn't find Handle: %" PRIu64 - "'s wrapper. It might have been destroyed", - handle); + if (log_warning) + { + GFXRECON_LOG_WARNING("vulkan_wrappers::GetWrappedId() couldn't find Handle: 0x%" PRIx64 + "'s wrapper. It might have been destroyed", + handle); + } return format::kNullHandleId; } return wrapper->handle_id; } template -Wrapper* GetWrapper(const typename Wrapper::HandleType& handle) +Wrapper* GetWrapper(const typename Wrapper::HandleType& handle, bool log_warning = true) { if (handle == VK_NULL_HANDLE) { @@ -108,9 +113,12 @@ Wrapper* GetWrapper(const typename Wrapper::HandleType& handle) auto wrapper = state_handle_table_.GetWrapper(handle); if (wrapper == nullptr) { - GFXRECON_LOG_WARNING("vulkan_wrappers::GetWrapper() couldn't find Handle: %" PRIu64 - "'s wrapper. It might have been destroyed", - handle); + if (log_warning) + { + GFXRECON_LOG_WARNING("vulkan_wrappers::GetWrapper() couldn't find Handle: 0x%" PRIx64 + "'s wrapper. It might have been destroyed", + handle); + } } return wrapper; } @@ -181,7 +189,7 @@ void CreateWrappedDispatchHandle(typename ParentWrapper::HandleType parent, Wrapper* wrapper = new Wrapper; wrapper->dispatch_key = *reinterpret_cast(*handle); wrapper->handle = (*handle); - wrapper->handle_id = get_id(); + wrapper->handle_id = get_id(wrapper->vk_object_type); if (parent != VK_NULL_HANDLE) { @@ -210,7 +218,7 @@ void CreateWrappedNonDispatchHandle(typename Wrapper::HandleType* handle, PFN_Ge { Wrapper* wrapper = new Wrapper; wrapper->handle = (*handle); - wrapper->handle_id = get_id(); + wrapper->handle_id = get_id(wrapper->vk_object_type); if (!state_handle_table_.InsertWrapper(wrapper)) { GFXRECON_LOG_WARNING("Create a duplicated Handle: %" PRIu64 @@ -270,6 +278,10 @@ inline void CreateWrappedHandlelayer_table_ref = &parent_wrapper->layer_table; parent_wrapper->child_physical_devices.push_back(wrapper); } + else + { + get_id(wrapper->vk_object_type); + } } template <> @@ -325,6 +337,10 @@ inline void CreateWrappedHandle( wrapper->layer_table_ref = &parent_wrapper->layer_table; parent_wrapper->child_queues.push_back(wrapper); } + else + { + get_id(wrapper->vk_object_type); + } } template <> @@ -406,6 +422,10 @@ inline void CreateWrappedHandle(*handle); parent_wrapper->child_displays.push_back(wrapper); } + else + { + get_id(wrapper->vk_object_type); + } } } @@ -443,6 +463,10 @@ inline void CreateWrappedHandleparent_swapchains.insert(co_parent); parent_wrapper->child_images.push_back(wrapper); } + else + { + get_id(wrapper->vk_object_type); + } } // Override for display mode creation/retrieval, which requires the handle wrapper to be owned by a parent to ensure @@ -477,6 +501,10 @@ inline void CreateWrappedHandle(*handle); parent_wrapper->child_display_modes.push_back(wrapper); } + else + { + get_id(wrapper->vk_object_type); + } } template diff --git a/framework/encode/vulkan_handle_wrappers.h b/framework/encode/vulkan_handle_wrappers.h index 1f8b1f6dac..1e19f8ef96 100644 --- a/framework/encode/vulkan_handle_wrappers.h +++ b/framework/encode/vulkan_handle_wrappers.h @@ -35,11 +35,15 @@ #include "util/page_guard_manager.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" +#include #include #include #include +#include #include +#include #include GFXRECON_BEGIN_NAMESPACE(gfxrecon) @@ -55,6 +59,10 @@ struct HandleWrapper { typedef T HandleType; + HandleWrapper(VkObjectType type) : vk_object_type(type) {} + + const VkObjectType vk_object_type; + // Dispatch table key for dispatchable handles. Must be the first struct member to be compatible with the // loader defined handles. void* dispatch_key{ nullptr }; @@ -70,36 +78,85 @@ struct HandleWrapper // Type definitions for handle wrappers that do not require additional state info. // -// clang-format off -struct ShaderModuleWrapper : public HandleWrapper {}; -// struct PipelineCacheWrapper : public HandleWrapper {}; -struct SamplerWrapper : public HandleWrapper {}; -struct SamplerYcbcrConversionWrapper : public HandleWrapper {}; -struct DebugReportCallbackEXTWrapper : public HandleWrapper {}; -struct DebugUtilsMessengerEXTWrapper : public HandleWrapper {}; -struct ValidationCacheEXTWrapper : public HandleWrapper {}; -struct IndirectCommandsLayoutNVWrapper : public HandleWrapper {}; -struct PerformanceConfigurationINTELWrapper : public HandleWrapper {}; -struct MicromapEXTWrapper : public HandleWrapper {}; -struct OpticalFlowSessionNVWrapper : public HandleWrapper {}; -struct VideoSessionKHRWrapper : public HandleWrapper {}; -struct VideoSessionParametersKHRWrapper : public HandleWrapper {}; -struct ShaderEXTWrapper : public HandleWrapper {}; - -// This handle type has a create function, but no destroy function. The handle wrapper will be owned by its parent VkDisplayKHR -// handle wrapper, which will filter duplicate handle retrievals and ensure that the wrapper is destroyed. -struct DisplayModeKHRWrapper : public HandleWrapper {}; -// clang-format on +struct SamplerYcbcrConversionWrapper : public HandleWrapper +{ + SamplerYcbcrConversionWrapper() : HandleWrapper(VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION) {} +}; + +struct DebugReportCallbackEXTWrapper : public HandleWrapper +{ + DebugReportCallbackEXTWrapper() : HandleWrapper(VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT) {} +}; + +struct DebugUtilsMessengerEXTWrapper : public HandleWrapper +{ + DebugUtilsMessengerEXTWrapper() : HandleWrapper(VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT) {} +}; + +struct ValidationCacheEXTWrapper : public HandleWrapper +{ + ValidationCacheEXTWrapper() : HandleWrapper(VK_OBJECT_TYPE_VALIDATION_CACHE_EXT) {} +}; + +struct IndirectCommandsLayoutNVWrapper : public HandleWrapper +{ + IndirectCommandsLayoutNVWrapper() : HandleWrapper(VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV) {} +}; + +struct PerformanceConfigurationINTELWrapper : public HandleWrapper +{ + PerformanceConfigurationINTELWrapper() : HandleWrapper(VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL) {} +}; + +struct MicromapEXTWrapper : public HandleWrapper +{ + MicromapEXTWrapper() : HandleWrapper(VK_OBJECT_TYPE_MICROMAP_EXT) {} +}; + +struct OpticalFlowSessionNVWrapper : public HandleWrapper +{ + OpticalFlowSessionNVWrapper() : HandleWrapper(VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV) {} +}; + +struct VideoSessionKHRWrapper : public HandleWrapper +{ + VideoSessionKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_VIDEO_SESSION_KHR) {} +}; + +struct VideoSessionParametersKHRWrapper : public HandleWrapper +{ + VideoSessionParametersKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR) {} +}; + +struct ShaderEXTWrapper : public HandleWrapper +{ + ShaderEXTWrapper() : HandleWrapper(VK_OBJECT_TYPE_SHADER_EXT) {} +}; + +// This handle type has a create function, but no destroy function. The handle wrapper will be owned by its parent +// VkDisplayKHR handle wrapper, which will filter duplicate handle retrievals and ensure that the wrapper is destroyed. +struct DisplayModeKHRWrapper : public HandleWrapper +{ + DisplayModeKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_DISPLAY_MODE_KHR) {} +}; // // Declarations for handle wrappers that require additional state info. // +struct ShaderModuleWrapper : public HandleWrapper +{ + ShaderModuleWrapper() : HandleWrapper(VK_OBJECT_TYPE_SHADER_MODULE) {} + vulkan_state_info::ShaderReflectionDescriptorSetsInfos used_descriptors_info; +}; + // This handle type is retrieved and has no destroy function. The handle wrapper will be owned by its parent // VkPhysicalDevice handle wrapper, which will filter duplicate handle retrievals and ensure that the wrapper is // destroyed. struct DisplayKHRWrapper : public HandleWrapper { + DisplayKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_DISPLAY_KHR) {} + std::vector child_display_modes; }; @@ -107,6 +164,8 @@ struct DisplayKHRWrapper : public HandleWrapper // handle wrapper, which will filter duplicate handle retrievals and ensure that the wrapper is destroyed. struct PhysicalDeviceWrapper : public HandleWrapper { + PhysicalDeviceWrapper() : HandleWrapper(VK_OBJECT_TYPE_PHYSICAL_DEVICE) {} + VulkanInstanceTable* layer_table_ref{ nullptr }; std::vector child_displays; uint32_t instance_api_version{ 0 }; @@ -125,6 +184,8 @@ struct PhysicalDeviceWrapper : public HandleWrapper struct InstanceWrapper : public HandleWrapper { + InstanceWrapper() : HandleWrapper(VK_OBJECT_TYPE_INSTANCE) {} + VulkanInstanceTable layer_table; std::vector child_physical_devices; bool have_device_properties{ false }; @@ -133,11 +194,15 @@ struct InstanceWrapper : public HandleWrapper struct QueueWrapper : public HandleWrapper { + QueueWrapper() : HandleWrapper(VK_OBJECT_TYPE_QUEUE) {} + VulkanDeviceTable* layer_table_ref{ nullptr }; }; struct DeviceWrapper : public HandleWrapper { + DeviceWrapper() : HandleWrapper(VK_OBJECT_TYPE_DEVICE) {} + VulkanDeviceTable layer_table; PhysicalDeviceWrapper* physical_device{ nullptr }; std::vector child_queues; @@ -149,6 +214,8 @@ struct DeviceWrapper : public HandleWrapper struct FenceWrapper : public HandleWrapper { + FenceWrapper() : HandleWrapper(VK_OBJECT_TYPE_FENCE) {} + // Signaled state at creation to be compared with signaled state at snapshot write. If states are different, the // create parameters will need to be modified to reflect the state at snapshot write. bool created_signaled{ false }; @@ -157,34 +224,13 @@ struct FenceWrapper : public HandleWrapper struct EventWrapper : public HandleWrapper { - DeviceWrapper* device{ nullptr }; -}; - -struct DeviceMemoryWrapper : public HandleWrapper -{ - uint32_t memory_type_index{ std::numeric_limits::max() }; - VkDeviceSize allocation_size{ 0 }; - // This is the device which was used to allocate the memory. - // Spec states if the memory can be mapped, the mapping device must be this device. - // The device wrapper will be initialized when allocating the memory. Some handling - // like StateTracker::TrackTlasToBlasDependencies may use it before mapping - // the memory. - DeviceWrapper* parent_device{ nullptr }; - const void* mapped_data{ nullptr }; - VkDeviceSize mapped_offset{ 0 }; - VkDeviceSize mapped_size{ 0 }; - VkMemoryMapFlags mapped_flags{ 0 }; - void* external_allocation{ nullptr }; - uintptr_t shadow_allocation{ util::PageGuardManager::kNullShadowHandle }; - AHardwareBuffer* hardware_buffer{ nullptr }; - format::HandleId hardware_buffer_memory_id{ format::kNullHandleId }; + EventWrapper() : HandleWrapper(VK_OBJECT_TYPE_EVENT) {} - // State tracking info for memory with device addresses. - format::HandleId device_id{ format::kNullHandleId }; - VkDeviceAddress address{ 0 }; + DeviceWrapper* device{ nullptr }; }; -struct BufferWrapper : public HandleWrapper +struct DescriptorSetWrapper; +struct AssetWrapperBase { DeviceWrapper* bind_device{ nullptr }; const void* bind_pnext{ nullptr }; @@ -193,22 +239,26 @@ struct BufferWrapper : public HandleWrapper format::HandleId bind_memory_id{ format::kNullHandleId }; VkDeviceSize bind_offset{ 0 }; uint32_t queue_family_index{ 0 }; - VkDeviceSize created_size{ 0 }; + + VkDeviceSize size{ 0 }; + bool dirty{ true }; + + std::unordered_set descriptor_sets_bound_to; +}; + +struct BufferWrapper : public HandleWrapper, AssetWrapperBase +{ + BufferWrapper() : HandleWrapper(VK_OBJECT_TYPE_BUFFER) {} // State tracking info for buffers with device addresses. format::HandleId device_id{ format::kNullHandleId }; VkDeviceAddress address{ 0 }; }; -struct ImageWrapper : public HandleWrapper +struct ImageWrapper : public HandleWrapper, AssetWrapperBase { - DeviceWrapper* bind_device{ nullptr }; - const void* bind_pnext{ nullptr }; - std::unique_ptr bind_pnext_memory; + ImageWrapper() : HandleWrapper(VK_OBJECT_TYPE_IMAGE) {} - format::HandleId bind_memory_id{ format::kNullHandleId }; - VkDeviceSize bind_offset{ 0 }; - uint32_t queue_family_index{ 0 }; VkImageType image_type{ VK_IMAGE_TYPE_2D }; VkFormat format{ VK_FORMAT_UNDEFINED }; VkExtent3D extent{ 0, 0, 0 }; @@ -221,19 +271,66 @@ struct ImageWrapper : public HandleWrapper std::set parent_swapchains; }; +struct SamplerWrapper : public HandleWrapper +{ + SamplerWrapper() : HandleWrapper(VK_OBJECT_TYPE_SAMPLER) {} + + std::unordered_set descriptor_sets_bound_to; +}; + +struct DeviceMemoryWrapper : public HandleWrapper +{ + DeviceMemoryWrapper() : HandleWrapper(VK_OBJECT_TYPE_DEVICE_MEMORY) {} + + uint32_t memory_type_index{ std::numeric_limits::max() }; + VkDeviceSize allocation_size{ 0 }; + // This is the device which was used to allocate the memory. + // Spec states if the memory can be mapped, the mapping device must be this device. + // The device wrapper will be initialized when allocating the memory. Some handling + // like StateTracker::TrackTlasToBlasDependencies may use it before mapping + // the memory. + DeviceWrapper* parent_device{ nullptr }; + const void* mapped_data{ nullptr }; + VkDeviceSize mapped_offset{ 0 }; + VkDeviceSize mapped_size{ 0 }; + VkMemoryMapFlags mapped_flags{ 0 }; + void* external_allocation{ nullptr }; + uintptr_t shadow_allocation{ util::PageGuardManager::kNullShadowHandle }; + AHardwareBuffer* hardware_buffer{ nullptr }; + format::HandleId hardware_buffer_memory_id{ format::kNullHandleId }; + + // State tracking info for memory with device addresses. + format::HandleId device_id{ format::kNullHandleId }; + VkDeviceAddress address{ 0 }; + + std::unordered_set bound_assets; + std::mutex asset_map_lock; +}; + struct BufferViewWrapper : public HandleWrapper { + BufferViewWrapper() : HandleWrapper(VK_OBJECT_TYPE_BUFFER_VIEW) {} + format::HandleId buffer_id{ format::kNullHandleId }; + BufferWrapper* buffer{ nullptr }; + + std::unordered_set descriptor_sets_bound_to; }; struct ImageViewWrapper : public HandleWrapper { + ImageViewWrapper() : HandleWrapper(VK_OBJECT_TYPE_IMAGE_VIEW) {} + format::HandleId image_id{ format::kNullHandleId }; ImageWrapper* image{ nullptr }; + + std::unordered_set descriptor_sets_bound_to; }; struct FramebufferWrapper : public HandleWrapper { + FramebufferWrapper() : HandleWrapper(VK_OBJECT_TYPE_FRAMEBUFFER) {} + // Creation info for objects used to create the framebuffer, which may have been destroyed after creation. format::HandleId render_pass_id{ format::kNullHandleId }; format::ApiCallId render_pass_create_call_id{ format::ApiCallId::ApiCall_Unknown }; @@ -247,6 +344,8 @@ struct FramebufferWrapper : public HandleWrapper struct SemaphoreWrapper : public HandleWrapper { + SemaphoreWrapper() : HandleWrapper(VK_OBJECT_TYPE_SEMAPHORE) {} + // Track semaphore signaled state. State is signaled when a sempahore is submitted to QueueSubmit, QueueBindSparse, // AcquireNextImageKHR, or AcquireNextImage2KHR as a signal semaphore. State is not signaled when a semaphore is // submitted to QueueSubmit, QueueBindSparse, or QueuePresentKHR as a wait semaphore. Initial state after creation @@ -258,6 +357,8 @@ struct SemaphoreWrapper : public HandleWrapper struct QueryPoolWrapper : public HandleWrapper { + QueryPoolWrapper() : HandleWrapper(VK_OBJECT_TYPE_QUERY_POOL) {} + DeviceWrapper* device{ nullptr }; VkQueryType query_type{}; uint32_t query_count{ 0 }; @@ -266,15 +367,102 @@ struct QueryPoolWrapper : public HandleWrapper struct RenderPassWrapper : public HandleWrapper { - // Final image attachment layouts to be used for processing image layout transitions after calls to - // vkCmdEndRenderPass. - std::vector attachment_final_layouts; + RenderPassWrapper() : HandleWrapper(VK_OBJECT_TYPE_RENDER_PASS) {} + + struct + { + // Final image attachment layouts to be used for processing image layout transitions after calls to + // vkCmdEndRenderPass. + std::vector attachment_final_layouts; + std::vector store_op; + std::vector stencil_store_op; + } attachment_info; +}; + +struct DescriptorUpdateTemplateWrapper : public HandleWrapper +{ + DescriptorUpdateTemplateWrapper() : HandleWrapper(VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE) {} + + // Members for general wrapper support. + UpdateTemplateInfo info; +}; + +struct DescriptorSetLayoutWrapper : public HandleWrapper +{ + DescriptorSetLayoutWrapper() : HandleWrapper(VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT) {} + + // Members for trimming state tracking. + std::vector binding_info; +}; + +struct DescriptorPoolWrapper; +struct DescriptorSetWrapper : public HandleWrapper +{ + DescriptorSetWrapper() : HandleWrapper(VK_OBJECT_TYPE_DESCRIPTOR_SET) {} + + // Members for general wrapper support. + // Pool from which set was allocated. The set must be removed from the pool's allocation list when destroyed. + DescriptorPoolWrapper* parent_pool{ nullptr }; + + // Members for trimming state tracking. + DeviceWrapper* device{ nullptr }; + + // Map for descriptor binding index to array of descriptor info. + std::unordered_map bindings; + + // Creation info for objects used to allocate the descriptor set, which may have been destroyed after descriptor set + // allocation. + vulkan_state_info::CreateDependencyInfo set_layout_dependency; + + bool dirty{ true }; +}; + +struct DescriptorPoolWrapper : public HandleWrapper +{ + DescriptorPoolWrapper() : HandleWrapper(VK_OBJECT_TYPE_DESCRIPTOR_POOL) {} + + // Members for general wrapper support. + // Track descriptor set info, which must be destroyed on descriptor pool reset. + std::unordered_map child_sets; +}; + +struct PipelineLayoutWrapper : public HandleWrapper +{ + PipelineLayoutWrapper() : HandleWrapper(VK_OBJECT_TYPE_PIPELINE_LAYOUT) {} + + // Creation info for objects used to create the pipeline layout, which may have been destroyed after pipeline layout + // creation. + std::shared_ptr layout_dependencies; +}; + +struct PipelineWrapper : public HandleWrapper +{ + PipelineWrapper() : HandleWrapper(VK_OBJECT_TYPE_PIPELINE) {} + + // Creation info for objects used to create the pipeline, which may have been destroyed after pipeline creation. + std::vector shader_module_dependencies; + vulkan_state_info::CreateDependencyInfo render_pass_dependency; + vulkan_state_info::CreateDependencyInfo layout_dependency; + std::shared_ptr + layout_dependencies; // Shared with PipelineLayoutWrapper + + // Ray tracing pipeline's shader group handle data + format::HandleId device_id{ format::kNullHandleId }; + std::vector shader_group_handle_data; + vulkan_state_info::CreateDependencyInfo deferred_operation; + + // TODO: Base pipeline + // TODO: Pipeline cache + + std::vector bound_shaders; }; struct AccelerationStructureKHRWrapper; struct CommandPoolWrapper; struct CommandBufferWrapper : public HandleWrapper { + CommandBufferWrapper() : HandleWrapper(VK_OBJECT_TYPE_COMMAND_BUFFER) {} + VulkanDeviceTable* layer_table_ref{ nullptr }; // Members for general wrapper support. @@ -319,35 +507,20 @@ struct CommandBufferWrapper : public HandleWrapper uint32_t offset; }; std::vector> tlas_build_info_map; -}; -struct PipelineLayoutWrapper : public HandleWrapper -{ - // Creation info for objects used to create the pipeline layout, which may have been destroyed after pipeline layout - // creation. - std::shared_ptr layout_dependencies; -}; - -struct PipelineWrapper : public HandleWrapper -{ - // Creation info for objects used to create the pipeline, which may have been destroyed after pipeline creation. - std::vector shader_module_dependencies; - vulkan_state_info::CreateDependencyInfo render_pass_dependency; - vulkan_state_info::CreateDependencyInfo layout_dependency; - std::shared_ptr - layout_dependencies; // Shared with PipelineLayoutWrapper + const PipelineWrapper* bound_pipelines[vulkan_state_info::PipelineBindPoints::kBindPoint_count]{ nullptr }; - // Ray tracing pipeline's shader group handle data - format::HandleId device_id{ format::kNullHandleId }; - std::vector shader_group_handle_data; - vulkan_state_info::CreateDependencyInfo deferred_operation; + std::unordered_map + bound_descriptors[vulkan_state_info::PipelineBindPoints::kBindPoint_count]; - // TODO: Base pipeline - // TODO: Pipeline cache + std::unordered_set modified_assets; + std::vector secondaries; }; struct DeferredOperationKHRWrapper : public HandleWrapper { + DeferredOperationKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR) {} + // Record CreateRayTracingPipelinesKHR parameters for safety. HandleUnwrapMemory handle_unwrap_memory; std::vector create_infos; @@ -359,45 +532,10 @@ struct DeferredOperationKHRWrapper : public HandleWrapper -{ - // Members for general wrapper support. - UpdateTemplateInfo info; -}; - -struct DescriptorSetLayoutWrapper : public HandleWrapper -{ - // Members for trimming state tracking. - std::vector binding_info; -}; - -struct DescriptorPoolWrapper; -struct DescriptorSetWrapper : public HandleWrapper -{ - // Members for general wrapper support. - // Pool from which set was allocated. The set must be removed from the pool's allocation list when destroyed. - DescriptorPoolWrapper* parent_pool{ nullptr }; - - // Members for trimming state tracking. - DeviceWrapper* device{ nullptr }; - - // Map for descriptor binding index to array of descriptor info. - std::unordered_map bindings; - - // Creation info for objects used to allocate the descriptor set, which may have been destroyed after descriptor set - // allocation. - vulkan_state_info::CreateDependencyInfo set_layout_dependency; -}; - -struct DescriptorPoolWrapper : public HandleWrapper -{ - // Members for general wrapper support. - // Track descriptor set info, which must be destroyed on descriptor pool reset. - std::unordered_map child_sets; -}; - struct CommandPoolWrapper : public HandleWrapper { + CommandPoolWrapper() : HandleWrapper(VK_OBJECT_TYPE_COMMAND_POOL) {} + // Members for general wrapper support. // Track command buffer info, which must be destroyed on command pool reset. std::unordered_map child_buffers; @@ -448,6 +586,8 @@ struct GroupSurfacePresentModes struct SurfaceKHRWrapper : public HandleWrapper { + SurfaceKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_SURFACE_KHR) {} + // Track results from calls to vkGetPhysicalDeviceSurfaceSupportKHR to write to the state snapshot after surface // creation. The call is only written to the state snapshot if it was previously called by the application. // Keys are the VkPhysicalDevice handle ID. @@ -462,6 +602,8 @@ struct SurfaceKHRWrapper : public HandleWrapper struct SwapchainKHRWrapper : public HandleWrapper { + SwapchainKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_SWAPCHAIN_KHR) {} + // Members for general wrapper support. std::vector child_images; @@ -483,21 +625,31 @@ struct SwapchainKHRWrapper : public HandleWrapper struct AccelerationStructureKHRWrapper : public HandleWrapper { + AccelerationStructureKHRWrapper() : HandleWrapper(VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR) {} + // State tracking info for buffers with device addresses. format::HandleId device_id{ format::kNullHandleId }; VkDeviceAddress address{ 0 }; // List of BLASes this AS references. Used only while tracking. std::vector blas; + + std::unordered_set descriptor_sets_bound_to; }; struct AccelerationStructureNVWrapper : public HandleWrapper { + AccelerationStructureNVWrapper() : HandleWrapper(VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV) {} + + std::unordered_set descriptor_sets_bound_to; + // TODO: Determine what additional state tracking is needed. }; struct PrivateDataSlotWrapper : public HandleWrapper { + PrivateDataSlotWrapper() : HandleWrapper(VK_OBJECT_TYPE_PRIVATE_DATA_SLOT) {} + DeviceWrapper* device{ nullptr }; VkObjectType object_type{ VK_OBJECT_TYPE_UNKNOWN }; uint64_t object_handle{ 0 }; @@ -506,6 +658,8 @@ struct PrivateDataSlotWrapper : public HandleWrapper struct PipelineCacheWrapper : public HandleWrapper { + PipelineCacheWrapper() : HandleWrapper(VK_OBJECT_TYPE_PIPELINE_CACHE) {} + DeviceWrapper* device{ nullptr }; VkPipelineCacheCreateInfo create_info; std::vector cache_data; diff --git a/framework/encode/vulkan_state_info.h b/framework/encode/vulkan_state_info.h index 97f9af567b..03977c7d37 100644 --- a/framework/encode/vulkan_state_info.h +++ b/framework/encode/vulkan_state_info.h @@ -25,10 +25,12 @@ #include "format/format.h" #include "util/defines.h" +#include "util/logging.h" #include "util/memory_output_stream.h" #include "encode/handle_unwrap_memory.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" #include #include @@ -73,8 +75,11 @@ struct DescriptorInfo std::unique_ptr handle_ids; // Image, buffer, or buffer view IDs depending on type. std::unique_ptr sampler_ids; // Sampler IDs for image type. std::unique_ptr images; + std::unique_ptr storage_images; std::unique_ptr buffers; - std::unique_ptr texel_buffer_views; + std::unique_ptr storage_buffers; + std::unique_ptr uniform_texel_buffer_views; + std::unique_ptr storage_texel_buffer_views; std::unique_ptr acceleration_structures; std::unique_ptr inline_uniform_block; std::unique_ptr mutable_type; @@ -134,6 +139,91 @@ enum CommandHandleType : uint32_t NumHandleTypes // THIS MUST BE THE LAST ENUM VALUE ! }; +struct ShaderReflectionDescriptorInfo +{ + ShaderReflectionDescriptorInfo( + VkDescriptorType type, bool readonly, uint32_t accessed, uint32_t count, bool is_array) : + type(type), + readonly(readonly), accessed(accessed), count(count), is_array(is_array) + {} + + ShaderReflectionDescriptorInfo(const ShaderReflectionDescriptorInfo& other) : + type(other.type), readonly(other.readonly), accessed(other.accessed), count(other.count), + is_array(other.is_array) + {} + + VkDescriptorType type; + bool readonly; + uint32_t accessed; + uint32_t count; + bool is_array; +}; + +// One entry per descriptor binding +using ShaderReflectionDescriptorSetInfo = std::unordered_map; + +// One entry per descriptor set +using ShaderReflectionDescriptorSetsInfos = std::unordered_map; + +enum PipelineBindPoints +{ + kBindPoint_graphics = 0, + kBindPoint_compute, + kBindPoint_ray_tracing, + + kBindPoint_count +}; + +static PipelineBindPoints VkPipelinePointToPipelinePoint(VkPipelineBindPoint bind_point) +{ + switch (bind_point) + { + case VK_PIPELINE_BIND_POINT_GRAPHICS: + return kBindPoint_graphics; + case VK_PIPELINE_BIND_POINT_COMPUTE: + return kBindPoint_compute; + case VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR: + return kBindPoint_ray_tracing; + default: + GFXRECON_LOG_ERROR("Unrecognized/unsupported pipeline binding point (%u)", bind_point); + assert(0); + return kBindPoint_graphics; + } +} + +static void VkShaderStageFlagsToPipelinePoint(VkShaderStageFlags stage_flags, std::vector& points) +{ + if (((stage_flags & VK_SHADER_STAGE_VERTEX_BIT) == VK_SHADER_STAGE_VERTEX_BIT) || + ((stage_flags & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) || + ((stage_flags & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) || + ((stage_flags & VK_SHADER_STAGE_GEOMETRY_BIT) == VK_SHADER_STAGE_GEOMETRY_BIT) || + ((stage_flags & VK_SHADER_STAGE_FRAGMENT_BIT) == VK_SHADER_STAGE_FRAGMENT_BIT)) + { + points.push_back(kBindPoint_graphics); + } + + if ((stage_flags & VK_SHADER_STAGE_COMPUTE_BIT) == VK_SHADER_STAGE_COMPUTE_BIT) + { + points.push_back(kBindPoint_graphics); + } + + if (((stage_flags & VK_SHADER_STAGE_RAYGEN_BIT_KHR) == VK_SHADER_STAGE_RAYGEN_BIT_KHR) || + ((stage_flags & VK_SHADER_STAGE_ANY_HIT_BIT_KHR) == VK_SHADER_STAGE_ANY_HIT_BIT_KHR) || + ((stage_flags & VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR) == VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR) || + ((stage_flags & VK_SHADER_STAGE_MISS_BIT_KHR) == VK_SHADER_STAGE_MISS_BIT_KHR) || + ((stage_flags & VK_SHADER_STAGE_INTERSECTION_BIT_KHR) == VK_SHADER_STAGE_INTERSECTION_BIT_KHR) || + ((stage_flags & VK_SHADER_STAGE_CALLABLE_BIT_KHR) == VK_SHADER_STAGE_CALLABLE_BIT_KHR)) + { + points.push_back(kBindPoint_ray_tracing); + } + + if (((stage_flags & VK_SHADER_STAGE_TASK_BIT_EXT) == VK_SHADER_STAGE_TASK_BIT_EXT) || + ((stage_flags & VK_SHADER_STAGE_MESH_BIT_EXT) == VK_SHADER_STAGE_MESH_BIT_EXT)) + { + GFXRECON_LOG_ERROR("shader stages 0x%x not handled", stage_flags); + } +} + GFXRECON_END_NAMESPACE(vulkan_state_info) GFXRECON_END_NAMESPACE(encode) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/encode/vulkan_state_tracker.cpp b/framework/encode/vulkan_state_tracker.cpp index 22f619500c..6a90917fef 100644 --- a/framework/encode/vulkan_state_tracker.cpp +++ b/framework/encode/vulkan_state_tracker.cpp @@ -22,18 +22,30 @@ #include "encode/vulkan_state_tracker.h" +#include "decode/vulkan_object_info.h" +#include "encode/vulkan_handle_wrappers.h" #include "encode/vulkan_state_info.h" #include "encode/custom_vulkan_struct_handle_wrappers.h" #include "encode/vulkan_handle_wrapper_util.h" +#include "encode/vulkan_state_table_base.h" #include "encode/vulkan_track_struct.h" #include "graphics/vulkan_struct_get_pnext.h" +#include "util/logging.h" +#include "util/platform.h" +#include "Vulkan-Utility-Libraries/vk_format_utils.h" +#include "util/to_string.h" +#include "vulkan/vulkan_core.h" + +#include "util/page_status_tracker.h" #include +#include +#include GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(encode) -VulkanStateTracker::VulkanStateTracker() {} +VulkanStateTracker::VulkanStateTracker(bool recapturing) : is_in_frame_state_setup_(recapturing) {} VulkanStateTracker::~VulkanStateTracker() {} @@ -51,6 +63,14 @@ void VulkanStateTracker::TrackCommandExecution(vulkan_wrappers::CommandBufferWra wrapper->pending_layouts.clear(); wrapper->recorded_queries.clear(); wrapper->tlas_build_info_map.clear(); + wrapper->modified_assets.clear(); + wrapper->secondaries.clear(); + for (uint32_t point = vulkan_state_info::kBindPoint_graphics; point != vulkan_state_info::kBindPoint_count; + ++point) + { + wrapper->bound_descriptors[point].clear(); + wrapper->bound_pipelines[point] = nullptr; + } for (size_t i = 0; i < vulkan_state_info::CommandHandleType::NumHandleTypes; ++i) { @@ -91,6 +111,14 @@ void VulkanStateTracker::TrackResetCommandPool(VkCommandPool command_pool) entry.second->pending_layouts.clear(); entry.second->recorded_queries.clear(); entry.second->tlas_build_info_map.clear(); + entry.second->modified_assets.clear(); + entry.second->secondaries.clear(); + for (uint32_t point = vulkan_state_info::kBindPoint_graphics; point != vulkan_state_info::kBindPoint_count; + ++point) + { + entry.second->bound_descriptors[point].clear(); + entry.second->bound_pipelines[point] = nullptr; + } for (size_t i = 0; i < vulkan_state_info::CommandHandleType::NumHandleTypes; ++i) { @@ -344,6 +372,13 @@ void VulkanStateTracker::TrackBufferMemoryBinding( wrapper->bind_offset = memoryOffset; wrapper->bind_pnext = nullptr; + vulkan_wrappers::DeviceMemoryWrapper* mem_wrapper = + vulkan_wrappers::GetWrapper(memory); + assert(mem_wrapper != nullptr); + mem_wrapper->asset_map_lock.lock(); + mem_wrapper->bound_assets.emplace(wrapper); + mem_wrapper->asset_map_lock.unlock(); + if (bind_info_pnext != nullptr) { wrapper->bind_pnext = vulkan_trackers::TrackStruct(bind_info_pnext, wrapper->bind_pnext_memory); @@ -408,6 +443,13 @@ void VulkanStateTracker::TrackImageMemoryBinding( wrapper->bind_offset = memoryOffset; wrapper->bind_pnext = nullptr; + vulkan_wrappers::DeviceMemoryWrapper* mem_wrapper = + vulkan_wrappers::GetWrapper(memory); + assert(mem_wrapper != nullptr); + mem_wrapper->asset_map_lock.lock(); + mem_wrapper->bound_assets.emplace(wrapper); + mem_wrapper->asset_map_lock.unlock(); + if (bind_info_pnext != nullptr) { wrapper->bind_pnext = vulkan_trackers::TrackStruct(bind_info_pnext, wrapper->bind_pnext_memory); @@ -439,6 +481,26 @@ void VulkanStateTracker::TrackBeginRenderPass(VkCommandBuffer command_buffer, co vulkan_wrappers::GetWrapper(begin_info->renderPass); wrapper->render_pass_framebuffer = vulkan_wrappers::GetWrapper(begin_info->framebuffer); + + if (wrapper->render_pass_framebuffer != nullptr) + { + for (size_t i = 0; i < wrapper->render_pass_framebuffer->attachments.size(); ++i) + { + if (wrapper->render_pass_framebuffer->attachments[i]->is_swapchain_image) + { + continue; + } + + const bool has_stencil = vkuFormatHasStencil(wrapper->render_pass_framebuffer->attachments[i]->format); + if ((!has_stencil && + wrapper->active_render_pass->attachment_info.store_op[i] == VK_ATTACHMENT_STORE_OP_STORE) || + (has_stencil && + wrapper->active_render_pass->attachment_info.stencil_store_op[i] == VK_ATTACHMENT_STORE_OP_STORE)) + { + wrapper->modified_assets.insert(wrapper->render_pass_framebuffer->attachments[i]); + } + } + } } void VulkanStateTracker::TrackEndRenderPass(VkCommandBuffer command_buffer) @@ -453,12 +515,12 @@ void VulkanStateTracker::TrackEndRenderPass(VkCommandBuffer command_buffer) assert((framebuffer_wrapper != nullptr) && (render_pass_wrapper != nullptr)); uint32_t attachment_count = static_cast(framebuffer_wrapper->attachments.size()); - assert(attachment_count <= render_pass_wrapper->attachment_final_layouts.size()); + assert(attachment_count <= render_pass_wrapper->attachment_info.attachment_final_layouts.size()); for (uint32_t i = 0; i < attachment_count; ++i) { wrapper->pending_layouts[framebuffer_wrapper->attachments[i]] = - render_pass_wrapper->attachment_final_layouts[i]; + render_pass_wrapper->attachment_info.attachment_final_layouts[i]; } // Clear the active render pass state now that the pass has ended. @@ -479,6 +541,8 @@ void VulkanStateTracker::TrackExecuteCommands(VkCommandBuffer command_buf auto secondary_wrapper = vulkan_wrappers::GetWrapper(command_buffers[i]); assert(secondary_wrapper != nullptr); + primary_wrapper->secondaries.push_back(secondary_wrapper); + for (const auto& layout_entry : secondary_wrapper->pending_layouts) { primary_wrapper->pending_layouts[layout_entry.first] = layout_entry.second; @@ -630,6 +694,8 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w auto wrapper = vulkan_wrappers::GetWrapper(write->dstSet); assert(wrapper != nullptr); + wrapper->dirty = !is_in_frame_state_setup_; + // Descriptor update rules specify that a write descriptorCount that is greater than the binding's count // will result in updates to consecutive bindings, where the next binding is dstBinding+1 and // starting from array element 0. Track the current count, binding, and array element to handle @@ -670,6 +736,13 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w dst_sampler_ids[i] = vulkan_wrappers::GetWrappedId(src_info[i].sampler); memcpy(&dst_info[i], &src_info[i], sizeof(dst_info[i])); + + vulkan_wrappers::SamplerWrapper* sampler_wrapper = + vulkan_wrappers::GetWrapper(src_info[i].sampler); + if (sampler_wrapper != nullptr) + { + sampler_wrapper->descriptor_sets_bound_to.insert(wrapper); + } } break; } @@ -687,11 +760,28 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w dst_image_ids[i] = vulkan_wrappers::GetWrappedId(src_info[i].imageView); memcpy(&dst_info[i], &src_info[i], sizeof(dst_info[i])); + + vulkan_wrappers::ImageViewWrapper* image_view_wrapper = + vulkan_wrappers::GetWrapper(src_info[i].imageView); + if (image_view_wrapper != nullptr) + { + image_view_wrapper->descriptor_sets_bound_to.insert(wrapper); + if (image_view_wrapper->image != nullptr) + { + image_view_wrapper->image->descriptor_sets_bound_to.insert(wrapper); + } + } + + vulkan_wrappers::SamplerWrapper* sampler_wrapper = + vulkan_wrappers::GetWrapper(src_info[i].sampler); + if (sampler_wrapper != nullptr) + { + sampler_wrapper->descriptor_sets_bound_to.insert(wrapper); + } } break; } case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: - case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: { format::HandleId* dst_image_ids = &binding.handle_ids[current_dst_array_element]; @@ -703,13 +793,43 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w dst_image_ids[i] = vulkan_wrappers::GetWrappedId(src_info[i].imageView); memcpy(&dst_info[i], &src_info[i], sizeof(dst_info[i])); + + vulkan_wrappers::ImageViewWrapper* image_view_wrapper = + vulkan_wrappers::GetWrapper(src_info[i].imageView); + if (image_view_wrapper != nullptr) + { + image_view_wrapper->descriptor_sets_bound_to.insert(wrapper); + if (image_view_wrapper->image != nullptr) + { + image_view_wrapper->image->descriptor_sets_bound_to.insert(wrapper); + } + } + } + break; + } + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: + { + format::HandleId* dst_image_ids = &binding.handle_ids[current_dst_array_element]; + VkDescriptorImageInfo* dst_info = &binding.storage_images[current_dst_array_element]; + const VkDescriptorImageInfo* src_info = &write->pImageInfo[current_src_array_element]; + + for (uint32_t i = 0; i < current_writes; ++i) + { + dst_image_ids[i] = + vulkan_wrappers::GetWrappedId(src_info[i].imageView); + memcpy(&dst_info[i], &src_info[i], sizeof(dst_info[i])); + + vulkan_wrappers::ImageViewWrapper* image_view_wrapper = + vulkan_wrappers::GetWrapper(src_info[i].imageView); + if (image_view_wrapper != nullptr && image_view_wrapper->image != nullptr) + { + image_view_wrapper->image->descriptor_sets_bound_to.insert(wrapper); + } } break; } case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: { format::HandleId* dst_buffer_ids = &binding.handle_ids[current_dst_array_element]; VkDescriptorBufferInfo* dst_info = &binding.buffers[current_dst_array_element]; @@ -720,21 +840,85 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w dst_buffer_ids[i] = vulkan_wrappers::GetWrappedId(src_info[i].buffer); memcpy(&dst_info[i], &src_info[i], sizeof(dst_info[i])); + + vulkan_wrappers::BufferWrapper* buffer_wrapper = + vulkan_wrappers::GetWrapper(src_info[i].buffer); + if (buffer_wrapper != nullptr) + { + buffer_wrapper->descriptor_sets_bound_to.insert(wrapper); + } + } + break; + } + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + { + format::HandleId* dst_buffer_ids = &binding.handle_ids[current_dst_array_element]; + VkDescriptorBufferInfo* dst_info = &binding.storage_buffers[current_dst_array_element]; + const VkDescriptorBufferInfo* src_info = &write->pBufferInfo[current_src_array_element]; + + for (uint32_t i = 0; i < current_writes; ++i) + { + dst_buffer_ids[i] = + vulkan_wrappers::GetWrappedId(src_info[i].buffer); + memcpy(&dst_info[i], &src_info[i], sizeof(dst_info[i])); + + vulkan_wrappers::BufferWrapper* buffer_wrapper = + vulkan_wrappers::GetWrapper(src_info[i].buffer); + if (buffer_wrapper != nullptr) + { + buffer_wrapper->descriptor_sets_bound_to.insert(wrapper); + } } break; } case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: + { + format::HandleId* dst_view_ids = &binding.handle_ids[current_dst_array_element]; + VkBufferView* dst_info = &binding.uniform_texel_buffer_views[current_dst_array_element]; + const VkBufferView* src_info = &write->pTexelBufferView[current_src_array_element]; + + for (uint32_t i = 0; i < current_writes; ++i) + { + dst_view_ids[i] = + vulkan_wrappers::GetWrappedId(src_info[i]); + dst_info[i] = src_info[i]; + + vulkan_wrappers::BufferViewWrapper* buffer_view_wrapper = + vulkan_wrappers::GetWrapper(src_info[i]); + if (buffer_view_wrapper != nullptr) + { + buffer_view_wrapper->descriptor_sets_bound_to.insert(wrapper); + if (buffer_view_wrapper->buffer != nullptr) + { + buffer_view_wrapper->buffer->descriptor_sets_bound_to.insert(wrapper); + } + } + } + break; + } case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: { format::HandleId* dst_view_ids = &binding.handle_ids[current_dst_array_element]; - VkBufferView* dst_info = &binding.texel_buffer_views[current_dst_array_element]; - const VkBufferView* src_info = &write->pTexelBufferView[current_src_array_element]; + VkBufferView* dst_info = &binding.storage_texel_buffer_views[current_dst_array_element]; + const VkBufferView* src_info = &write->pTexelBufferView[current_src_array_element]; for (uint32_t i = 0; i < current_writes; ++i) { dst_view_ids[i] = vulkan_wrappers::GetWrappedId(src_info[i]); dst_info[i] = src_info[i]; + + vulkan_wrappers::BufferViewWrapper* buffer_view_wrapper = + vulkan_wrappers::GetWrapper(src_info[i]); + if (buffer_view_wrapper != nullptr) + { + buffer_view_wrapper->descriptor_sets_bound_to.insert(wrapper); + if (buffer_view_wrapper->buffer != nullptr) + { + buffer_view_wrapper->buffer->descriptor_sets_bound_to.insert(wrapper); + } + } } break; } @@ -753,8 +937,29 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w } break; case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV: - // TODO - break; + { + const VkWriteDescriptorSetAccelerationStructureNV* write_accel_struct = + graphics::vulkan_struct_get_pnext(write); + + if (write_accel_struct != nullptr) + { + const VkAccelerationStructureNV* src_accel_struct = + &write_accel_struct->pAccelerationStructures[current_src_array_element]; + + for (uint32_t i = 0; i < current_writes; ++i) + { + vulkan_wrappers::AccelerationStructureNVWrapper* accel_struct_wrapper = + vulkan_wrappers::GetWrapper( + src_accel_struct[i]); + if (accel_struct_wrapper != nullptr) + { + accel_struct_wrapper->descriptor_sets_bound_to.insert(wrapper); + } + } + } + } + break; + case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: { auto write_accel_struct = @@ -774,6 +979,14 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w vulkan_wrappers::GetWrappedId( src_accel_struct[i]); dst_accel_struct[i] = src_accel_struct[i]; + + vulkan_wrappers::AccelerationStructureKHRWrapper* accel_struct_wrapper = + vulkan_wrappers::GetWrapper( + src_accel_struct[i]); + if (accel_struct_wrapper != nullptr) + { + accel_struct_wrapper->descriptor_sets_bound_to.insert(wrapper); + } } } } @@ -808,6 +1021,8 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w auto src_wrapper = vulkan_wrappers::GetWrapper(copy->srcSet); assert((dst_wrapper != nullptr) && (src_wrapper != nullptr)); + dst_wrapper->dirty = !is_in_frame_state_setup_; + // Descriptor update rules specify that a write descriptorCount that is greater than the binding's count // will result in updates to/from consecutive bindings. uint32_t current_count = copy->descriptorCount; @@ -845,12 +1060,24 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w &src_binding.images[current_src_array_element], (sizeof(VkDescriptorImageInfo) * current_copies)); } + if (src_binding.storage_images != nullptr) + { + memcpy(&dst_binding.storage_images[current_dst_array_element], + &src_binding.storage_images[current_src_array_element], + (sizeof(VkDescriptorImageInfo) * current_copies)); + } if (src_binding.buffers != nullptr) { memcpy(&dst_binding.buffers[current_dst_array_element], &src_binding.buffers[current_src_array_element], (sizeof(VkDescriptorBufferInfo) * current_copies)); } + if (src_binding.storage_buffers != nullptr) + { + memcpy(&dst_binding.storage_buffers[current_dst_array_element], + &src_binding.storage_buffers[current_src_array_element], + (sizeof(VkDescriptorBufferInfo) * current_copies)); + } if (src_binding.acceleration_structures != nullptr) { memcpy(&dst_binding.acceleration_structures[current_dst_array_element], @@ -863,10 +1090,16 @@ void VulkanStateTracker::TrackUpdateDescriptorSets(uint32_t w &src_binding.inline_uniform_block[current_src_array_element], current_copies); } - if (src_binding.texel_buffer_views != nullptr) + if (src_binding.uniform_texel_buffer_views != nullptr) + { + memcpy(&dst_binding.uniform_texel_buffer_views[current_dst_array_element], + &src_binding.uniform_texel_buffer_views[current_src_array_element], + (sizeof(VkBufferView) * current_copies)); + } + if (src_binding.storage_texel_buffer_views != nullptr) { - memcpy(&dst_binding.texel_buffer_views[current_dst_array_element], - &src_binding.texel_buffer_views[current_src_array_element], + memcpy(&dst_binding.storage_texel_buffer_views[current_dst_array_element], + &src_binding.storage_texel_buffer_views[current_src_array_element], (sizeof(VkBufferView) * current_copies)); } if (src_binding.mutable_type != nullptr) @@ -927,6 +1160,8 @@ void VulkanStateTracker::TrackUpdateDescriptorSetWithTemplate(VkDescriptorSet auto wrapper = vulkan_wrappers::GetWrapper(set); const uint8_t* bytes = reinterpret_cast(data); + wrapper->dirty = !is_in_frame_state_setup_; + for (const auto& entry : template_info->image_info) { // Descriptor update rules specify that a write descriptorCount that is greater than the binding's count @@ -948,9 +1183,19 @@ void VulkanStateTracker::TrackUpdateDescriptorSetWithTemplate(VkDescriptorSet bool* written_start = &binding.written[current_array_element]; std::fill(written_start, written_start + current_writes, true); + if (binding.type != entry.type) + { + GFXRECON_LOG_WARNING("%s() Descriptors mismatch: %u != %u", __func__, binding.type, entry.type); + } + const bool immutable_image = binding.type == VK_DESCRIPTOR_TYPE_SAMPLER || + binding.type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER || + binding.type == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE || + binding.type == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; + format::HandleId* dst_sampler_ids = &binding.sampler_ids[current_array_element]; format::HandleId* dst_image_ids = &binding.handle_ids[current_array_element]; - VkDescriptorImageInfo* dst_info = &binding.images[current_array_element]; + VkDescriptorImageInfo* dst_info = immutable_image ? &binding.images[current_array_element] + : &binding.storage_images[current_array_element]; const uint8_t* src_address = bytes + current_offset; for (uint32_t i = 0; i < current_writes; ++i) @@ -1010,8 +1255,16 @@ void VulkanStateTracker::TrackUpdateDescriptorSetWithTemplate(VkDescriptorSet bool* written_start = &binding.written[current_array_element]; std::fill(written_start, written_start + current_writes, true); + if (binding.type != entry.type) + { + GFXRECON_LOG_WARNING("%s() Descriptors mismatch: %u != %u", __func__, binding.type, entry.type); + } + const bool immutable_buffer = binding.type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC || + binding.type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + format::HandleId* dst_buffer_ids = &binding.handle_ids[current_array_element]; - VkDescriptorBufferInfo* dst_info = &binding.buffers[current_array_element]; + VkDescriptorBufferInfo* dst_info = immutable_buffer ? &binding.buffers[current_array_element] + : &binding.storage_buffers[current_array_element]; const uint8_t* src_address = bytes + current_offset; for (uint32_t i = 0; i < current_writes; ++i) @@ -1052,7 +1305,7 @@ void VulkanStateTracker::TrackUpdateDescriptorSetWithTemplate(VkDescriptorSet { auto& binding = wrapper->bindings[current_binding]; - assert(binding.texel_buffer_views != nullptr); + assert(binding.uniform_texel_buffer_views != nullptr); // Check count for consecutive updates. uint32_t current_writes = std::min(current_count, (binding.count - current_array_element)); @@ -1060,9 +1313,16 @@ void VulkanStateTracker::TrackUpdateDescriptorSetWithTemplate(VkDescriptorSet bool* written_start = &binding.written[current_array_element]; std::fill(written_start, written_start + current_writes, true); + if (binding.type != entry.type) + { + GFXRECON_LOG_WARNING("%s() Descriptors mismatch: %u != %u", __func__, binding.type, entry.type); + } + const bool immutable_buffer = binding.type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER; + format::HandleId* dst_view_ids = &binding.handle_ids[current_array_element]; - VkBufferView* dst_info = &binding.texel_buffer_views[current_array_element]; - const uint8_t* src_address = bytes + current_offset; + VkBufferView* dst_info = immutable_buffer ? &binding.uniform_texel_buffer_views[current_array_element] + : &binding.storage_texel_buffer_views[current_array_element]; + const uint8_t* src_address = bytes + current_offset; for (uint32_t i = 0; i < current_writes; ++i) { @@ -1188,6 +1448,7 @@ void VulkanStateTracker::TrackResetDescriptorPool(VkDescriptorPool descriptor_po std::unique_lock lock(state_table_mutex_); for (const auto& set_entry : wrapper->child_sets) { + DestroyState(set_entry.second); state_table_.RemoveWrapper(set_entry.second); } } @@ -1491,6 +1752,7 @@ void VulkanStateTracker::DestroyState(vulkan_wrappers::DescriptorPoolWrapper* wr std::unique_lock lock(state_table_mutex_); for (const auto& entry : wrapper->child_sets) { + DestroyState(entry.second); state_table_.RemoveWrapper(entry.second); } } @@ -1531,99 +1793,397 @@ void VulkanStateTracker::DestroyState(vulkan_wrappers::AccelerationStructureKHRW { as_device_addresses_map.erase(entry); } + + for (auto entry : wrapper->descriptor_sets_bound_to) + { + entry->dirty = !is_in_frame_state_setup_; + } + + wrapper->descriptor_sets_bound_to.clear(); } -void VulkanStateTracker::TrackTlasToBlasDependencies(uint32_t command_buffer_count, - const VkCommandBuffer* command_buffers) +void VulkanStateTracker::DestroyState(vulkan_wrappers::AccelerationStructureNVWrapper* wrapper) { - if (!command_buffer_count || !command_buffers) + assert(wrapper != nullptr); + + for (auto entry : wrapper->descriptor_sets_bound_to) { - return; + entry->dirty = !is_in_frame_state_setup_; } - for (uint32_t c = 0; c < command_buffer_count; ++c) + wrapper->descriptor_sets_bound_to.clear(); +} + +void VulkanStateTracker::DestroyState(vulkan_wrappers::ImageWrapper* wrapper) +{ + if (wrapper->bind_memory_id != format::kNullHandleId) { - const vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = - vulkan_wrappers::GetWrapper(command_buffers[c]); + vulkan_wrappers::DeviceMemoryWrapper* mem_wrapper = + state_table_.GetDeviceMemoryWrapper(wrapper->bind_memory_id); - for (const auto& tlas_build_info : cmd_buf_wrapper->tlas_build_info_map) + if (mem_wrapper != nullptr) { - // Sanity checks. Build infos with one of these 0 should not be inserted in the map - assert(tlas_build_info.second.address); - assert(tlas_build_info.second.blas_count); - - // Find to which device memory this address belongs - const VkDeviceAddress address = tlas_build_info.second.address; - const vulkan_wrappers::DeviceMemoryWrapper* dev_mem_wrapper = nullptr; - for (const auto& dev_mem : device_memory_addresses_map) + mem_wrapper->asset_map_lock.lock(); + auto bind_entry = mem_wrapper->bound_assets.find(wrapper); + if (bind_entry != mem_wrapper->bound_assets.end()) { - if (address >= dev_mem.second->address && - address < dev_mem.second->address + dev_mem.second->allocation_size) - { - dev_mem_wrapper = dev_mem.second; - break; - } + mem_wrapper->bound_assets.erase(bind_entry); } + mem_wrapper->asset_map_lock.unlock(); + } + } - assert(dev_mem_wrapper); - if (!dev_mem_wrapper) - { - continue; - } + for (auto entry : wrapper->descriptor_sets_bound_to) + { + entry->dirty = !is_in_frame_state_setup_; + } - assert(dev_mem_wrapper->address); - assert(address >= dev_mem_wrapper->address); + wrapper->descriptor_sets_bound_to.clear(); +} - // Calculate total offset: - // address: The address of the buffer where the - // VkAccelerationStructureInstanceKHRs are located. - // base_address: The device address of the device memory where - // the buffer is bound. - // buffer_offset: The offset within the buffer as provided in the - // BuildAccelerationStructureKHR command. - const VkDeviceAddress base_address = dev_mem_wrapper->address; - const VkDeviceAddress buffer_offset = tlas_build_info.second.offset; - const VkDeviceSize total_offset = (address - base_address) + buffer_offset; +void VulkanStateTracker::DestroyState(vulkan_wrappers::ImageViewWrapper* wrapper) +{ + assert(wrapper != nullptr); - const VkAccelerationStructureInstanceKHR* instances = nullptr; - const util::PageGuardManager* manager = util::PageGuardManager::Get(); + for (auto entry : wrapper->descriptor_sets_bound_to) + { + entry->dirty = !is_in_frame_state_setup_; + } - // Check with page guard manager first. The memory might be already and the - // PageGuardManager can provide the pointer - if (manager) + wrapper->descriptor_sets_bound_to.clear(); +} + +void VulkanStateTracker::DestroyState(vulkan_wrappers::BufferWrapper* wrapper) +{ + if (wrapper->bind_memory_id != format::kNullHandleId) + { + vulkan_wrappers::DeviceMemoryWrapper* mem_wrapper = + state_table_.GetDeviceMemoryWrapper(wrapper->bind_memory_id); + + if (mem_wrapper != nullptr) + { + mem_wrapper->asset_map_lock.lock(); + auto bind_entry = mem_wrapper->bound_assets.find(wrapper); + if (bind_entry != mem_wrapper->bound_assets.end()) { - const void* mapped_memory = manager->GetMappedMemory(dev_mem_wrapper->handle_id); - if (mapped_memory) - { - instances = reinterpret_cast( - static_cast(mapped_memory) + total_offset); - } + mem_wrapper->bound_assets.erase(bind_entry); } + mem_wrapper->asset_map_lock.unlock(); + } + } - const uint32_t blas_count = tlas_build_info.second.blas_count; - bool needs_unmapping = false; - if (!instances) + for (auto entry : wrapper->descriptor_sets_bound_to) + { + entry->dirty = !is_in_frame_state_setup_; + } + + wrapper->descriptor_sets_bound_to.clear(); +} + +void VulkanStateTracker::DestroyState(vulkan_wrappers::BufferViewWrapper* wrapper) +{ + assert(wrapper != nullptr); + + for (auto entry : wrapper->descriptor_sets_bound_to) + { + entry->dirty = !is_in_frame_state_setup_; + } + + wrapper->descriptor_sets_bound_to.clear(); +} + +void VulkanStateTracker::DestroyState(vulkan_wrappers::SamplerWrapper* wrapper) +{ + assert(wrapper != nullptr); + + for (auto entry : wrapper->descriptor_sets_bound_to) + { + entry->dirty = !is_in_frame_state_setup_; + } + + wrapper->descriptor_sets_bound_to.clear(); +} + +void VulkanStateTracker::DestroyState(vulkan_wrappers::DescriptorSetWrapper* wrapper) +{ + for (auto& entry : wrapper->bindings) + { + vulkan_state_info::DescriptorInfo& binding = entry.second; + switch (binding.type) + { + case VK_DESCRIPTOR_TYPE_SAMPLER: + case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: + case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: + case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: { - // If PageGuardManager is not used or if it couldn't find the memory id it means that - // we need to map the memory. - VkDevice device = dev_mem_wrapper->parent_device->handle; - const VulkanDeviceTable* device_table = vulkan_wrappers::GetDeviceTable(device); - const VkDeviceSize map_size = sizeof(VkAccelerationStructureInstanceKHR) * blas_count; - void* mapped_memory = nullptr; - const VkResult result = - device_table->MapMemory(device, dev_mem_wrapper->handle, total_offset, map_size, 0, &mapped_memory); + assert(binding.count); + assert(binding.images); - if (result == VK_SUCCESS) + if (binding.type == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE || + binding.type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER || + binding.type == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT) { - needs_unmapping = true; + for (uint32_t i = 0; i < binding.count; ++i) + { + vulkan_wrappers::ImageViewWrapper* image_view_wrapper = + vulkan_wrappers::GetWrapper(binding.images[i].imageView, + false); + if (image_view_wrapper != nullptr) + { + auto img_view_desc_entry = image_view_wrapper->descriptor_sets_bound_to.find(wrapper); + if (img_view_desc_entry != image_view_wrapper->descriptor_sets_bound_to.end()) + { + image_view_wrapper->descriptor_sets_bound_to.erase(img_view_desc_entry); + } - instances = reinterpret_cast(mapped_memory); + if (image_view_wrapper->image != nullptr) + { + auto img_desc_entry = image_view_wrapper->image->descriptor_sets_bound_to.find(wrapper); + if (img_desc_entry != image_view_wrapper->image->descriptor_sets_bound_to.end()) + { + image_view_wrapper->image->descriptor_sets_bound_to.erase(img_desc_entry); + } + } + } + } + + if (binding.type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER || + binding.type == VK_DESCRIPTOR_TYPE_SAMPLER) + { + for (uint32_t i = 0; i < binding.count; ++i) + { + vulkan_wrappers::SamplerWrapper* sampler_wrapper = + vulkan_wrappers::GetWrapper(binding.images[i].sampler, + false); + if (sampler_wrapper != nullptr) + { + auto desc_entry = sampler_wrapper->descriptor_sets_bound_to.find(wrapper); + if (desc_entry != sampler_wrapper->descriptor_sets_bound_to.end()) + { + sampler_wrapper->descriptor_sets_bound_to.erase(desc_entry); + } + } + } + } } } + break; - if (instances) + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: { - vulkan_wrappers::AccelerationStructureKHRWrapper* tlas_wrapper = tlas_build_info.first; + assert(binding.count); + assert(binding.storage_images); + + for (uint32_t i = 0; i < binding.count; ++i) + { + vulkan_wrappers::ImageViewWrapper* image_view_wrapper = + vulkan_wrappers::GetWrapper( + binding.storage_images[i].imageView, false); + if (image_view_wrapper != nullptr) + { + auto img_view_desc_entry = image_view_wrapper->descriptor_sets_bound_to.find(wrapper); + if (img_view_desc_entry != image_view_wrapper->descriptor_sets_bound_to.end()) + { + image_view_wrapper->descriptor_sets_bound_to.erase(img_view_desc_entry); + } + + if (image_view_wrapper->image != nullptr) + { + auto img_desc_entry = image_view_wrapper->image->descriptor_sets_bound_to.find(wrapper); + if (img_desc_entry != image_view_wrapper->image->descriptor_sets_bound_to.end()) + { + image_view_wrapper->image->descriptor_sets_bound_to.erase(img_desc_entry); + } + } + } + } + } + break; + + case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: + { + const bool is_storage = binding.type == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; + + assert(binding.count); + assert((is_storage && binding.storage_texel_buffer_views) || + (!is_storage && binding.uniform_texel_buffer_views)); + + for (uint32_t i = 0; i < binding.count; ++i) + { + vulkan_wrappers::BufferViewWrapper* buf_view_wrapper = + vulkan_wrappers::GetWrapper( + is_storage ? binding.storage_texel_buffer_views[i] : binding.uniform_texel_buffer_views[i], + false); + if (buf_view_wrapper != nullptr) + { + auto view_entry = buf_view_wrapper->descriptor_sets_bound_to.find(wrapper); + if (view_entry != buf_view_wrapper->descriptor_sets_bound_to.end()) + { + buf_view_wrapper->descriptor_sets_bound_to.erase(view_entry); + } + + if (buf_view_wrapper->buffer != nullptr) + { + auto buf_entry = buf_view_wrapper->buffer->descriptor_sets_bound_to.find(wrapper); + if (buf_entry != buf_view_wrapper->buffer->descriptor_sets_bound_to.end()) + { + buf_view_wrapper->buffer->descriptor_sets_bound_to.erase(buf_entry); + } + } + } + } + } + break; + + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + { + const bool is_storage = (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) || + (binding.type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC); + + assert(binding.count); + assert((is_storage && binding.storage_buffers) || (!is_storage && binding.buffers)); + + for (uint32_t i = 0; i < binding.count; ++i) + { + vulkan_wrappers::BufferWrapper* buf_wrapper = + vulkan_wrappers::GetWrapper( + is_storage ? binding.storage_buffers[i].buffer : binding.buffers[i].buffer, false); + if (buf_wrapper != nullptr) + { + auto entry = buf_wrapper->descriptor_sets_bound_to.find(wrapper); + if (entry != buf_wrapper->descriptor_sets_bound_to.end()) + { + buf_wrapper->descriptor_sets_bound_to.erase(entry); + } + } + } + } + break; + + case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: + { + assert(binding.count); + assert(binding.acceleration_structures); + + for (uint32_t i = 0; i < binding.count; ++i) + { + vulkan_wrappers::AccelerationStructureKHRWrapper* accel_wrapper = + vulkan_wrappers::GetWrapper( + binding.acceleration_structures[i], false); + if (accel_wrapper != nullptr) + { + auto entry = accel_wrapper->descriptor_sets_bound_to.find(wrapper); + if (entry != accel_wrapper->descriptor_sets_bound_to.end()) + { + accel_wrapper->descriptor_sets_bound_to.erase(entry); + } + } + } + } + break; + + default: + GFXRECON_LOG_WARNING("%s() Descriptor type %u not handled", __func__, binding.type); + break; + } + } +} + +void VulkanStateTracker::TrackTlasToBlasDependencies(uint32_t command_buffer_count, + const VkCommandBuffer* command_buffers) +{ + if (!command_buffer_count || !command_buffers) + { + return; + } + + for (uint32_t c = 0; c < command_buffer_count; ++c) + { + const vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(command_buffers[c]); + + for (const auto& tlas_build_info : cmd_buf_wrapper->tlas_build_info_map) + { + // Sanity checks. Build infos with one of these 0 should not be inserted in the map + assert(tlas_build_info.second.address); + assert(tlas_build_info.second.blas_count); + + // Find to which device memory this address belongs + const VkDeviceAddress address = tlas_build_info.second.address; + const vulkan_wrappers::DeviceMemoryWrapper* dev_mem_wrapper = nullptr; + for (const auto& dev_mem : device_memory_addresses_map) + { + if (address >= dev_mem.second->address && + address < dev_mem.second->address + dev_mem.second->allocation_size) + { + dev_mem_wrapper = dev_mem.second; + break; + } + } + + assert(dev_mem_wrapper); + if (!dev_mem_wrapper) + { + continue; + } + + assert(dev_mem_wrapper->address); + assert(address >= dev_mem_wrapper->address); + + // Calculate total offset: + // address: The address of the buffer where the + // VkAccelerationStructureInstanceKHRs are located. + // base_address: The device address of the device memory where + // the buffer is bound. + // buffer_offset: The offset within the buffer as provided in the + // BuildAccelerationStructureKHR command. + const VkDeviceAddress base_address = dev_mem_wrapper->address; + const VkDeviceAddress buffer_offset = tlas_build_info.second.offset; + const VkDeviceSize total_offset = (address - base_address) + buffer_offset; + + const VkAccelerationStructureInstanceKHR* instances = nullptr; + const util::PageGuardManager* manager = util::PageGuardManager::Get(); + + // Check with page guard manager first. The memory might be already and the + // PageGuardManager can provide the pointer + if (manager) + { + const void* mapped_memory = manager->GetMappedMemory(dev_mem_wrapper->handle_id); + if (mapped_memory) + { + instances = reinterpret_cast( + static_cast(mapped_memory) + total_offset); + } + } + + const uint32_t blas_count = tlas_build_info.second.blas_count; + bool needs_unmapping = false; + if (!instances) + { + // If PageGuardManager is not used or if it couldn't find the memory id it means that + // we need to map the memory. + VkDevice device = dev_mem_wrapper->parent_device->handle; + const VulkanDeviceTable* device_table = vulkan_wrappers::GetDeviceTable(device); + const VkDeviceSize map_size = sizeof(VkAccelerationStructureInstanceKHR) * blas_count; + void* mapped_memory = nullptr; + const VkResult result = + device_table->MapMemory(device, dev_mem_wrapper->handle, total_offset, map_size, 0, &mapped_memory); + + if (result == VK_SUCCESS) + { + needs_unmapping = true; + + instances = reinterpret_cast(mapped_memory); + } + } + + if (instances) + { + vulkan_wrappers::AccelerationStructureKHRWrapper* tlas_wrapper = tlas_build_info.first; for (uint32_t b = 0; b < blas_count; ++b) { @@ -1650,5 +2210,810 @@ void VulkanStateTracker::TrackTlasToBlasDependencies(uint32_t comm } } +void VulkanStateTracker::TrackCmdBindDescriptorSets(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t firstSet, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets, + uint32_t dynamicOffsetCount, + const uint32_t* pDynamicOffsets) +{ + if (pDescriptorSets != nullptr && commandBuffer != VK_NULL_HANDLE) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + assert(cmd_buf_wrapper != nullptr); + + for (uint32_t i = 0; i < descriptorSetCount; ++i) + { + vulkan_wrappers::DescriptorSetWrapper* desc_set_wrapper = + vulkan_wrappers::GetWrapper(pDescriptorSets[i]); + + const vulkan_state_info::PipelineBindPoints bind_point = + vulkan_state_info::VkPipelinePointToPipelinePoint(pipelineBindPoint); + cmd_buf_wrapper->bound_descriptors[bind_point][firstSet + i] = desc_set_wrapper; + } + } +} + +void VulkanStateTracker::TrackCmdBindDescriptorSets2KHR(VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo) +{ + if (pBindDescriptorSetsInfo != nullptr && pBindDescriptorSetsInfo->pDescriptorSets != nullptr && + commandBuffer != VK_NULL_HANDLE) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + assert(cmd_buf_wrapper != nullptr); + + for (uint32_t i = 0; i < pBindDescriptorSetsInfo->descriptorSetCount; ++i) + { + vulkan_wrappers::DescriptorSetWrapper* desc_set_wrapper = + vulkan_wrappers::GetWrapper( + pBindDescriptorSetsInfo->pDescriptorSets[i]); + + std::vector bind_points; + vulkan_state_info::VkShaderStageFlagsToPipelinePoint(pBindDescriptorSetsInfo->stageFlags, bind_points); + for (auto bind_point : bind_points) + { + cmd_buf_wrapper->bound_descriptors[bind_point][pBindDescriptorSetsInfo->firstSet + i] = + desc_set_wrapper; + } + } + } +} + +void VulkanStateTracker::TrackCmdBindPipeline(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline) +{ + if (commandBuffer != VK_NULL_HANDLE && pipeline != VK_NULL_HANDLE) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + assert(cmd_buf_wrapper); + + const vulkan_wrappers::PipelineWrapper* ppl_wrapper = + vulkan_wrappers::GetWrapper(pipeline); + assert(ppl_wrapper != nullptr); + + vulkan_state_info::PipelineBindPoints bind_point = + vulkan_state_info::VkPipelinePointToPipelinePoint(pipelineBindPoint); + cmd_buf_wrapper->bound_pipelines[bind_point] = ppl_wrapper; + } +} + +void VulkanStateTracker::InsertImageAssetInCommandBuffer(VkCommandBuffer command_buffer, VkImage image) +{ + if (command_buffer != VK_NULL_HANDLE && image != VK_NULL_HANDLE) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(command_buffer); + assert(cmd_buf_wrapper != nullptr); + + vulkan_wrappers::ImageWrapper* image_wrapper = + vulkan_wrappers::GetWrapper(image); + assert(image_wrapper != nullptr); + + cmd_buf_wrapper->modified_assets.insert(image_wrapper); + } +} + +void VulkanStateTracker::InsertBufferAssetInCommandBuffer(VkCommandBuffer command_buffer, VkBuffer buffer) +{ + if (command_buffer != VK_NULL_HANDLE && buffer != VK_NULL_HANDLE) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(command_buffer); + assert(cmd_buf_wrapper != nullptr); + + vulkan_wrappers::BufferWrapper* buffer_wrapper = + vulkan_wrappers::GetWrapper(buffer); + assert(buffer_wrapper != nullptr); + + cmd_buf_wrapper->modified_assets.insert(buffer_wrapper); + } +} + +void VulkanStateTracker::TrackCmdCopyBuffer(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferCopy* pRegions) +{ + InsertBufferAssetInCommandBuffer(commandBuffer, dstBuffer); +} + +void VulkanStateTracker::TrackCmdCopyImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageCopy* pRegions) +{ + InsertImageAssetInCommandBuffer(commandBuffer, dstImage); +} + +void VulkanStateTracker::TrackCmdCopyBufferToImage(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkBufferImageCopy* pRegions) +{ + InsertImageAssetInCommandBuffer(commandBuffer, dstImage); +} + +void VulkanStateTracker::TrackCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferImageCopy* pRegions) +{ + InsertBufferAssetInCommandBuffer(commandBuffer, dstBuffer); +} + +void VulkanStateTracker::TrackCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo) +{ + if (pCopyBufferInfo != nullptr) + { + InsertBufferAssetInCommandBuffer(commandBuffer, pCopyBufferInfo->dstBuffer); + } +} + +void VulkanStateTracker::TrackCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo) +{ + if (pCopyImageInfo != nullptr) + { + InsertImageAssetInCommandBuffer(commandBuffer, pCopyImageInfo->dstImage); + } +} + +void VulkanStateTracker::TrackCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) +{ + if (pCopyBufferToImageInfo != nullptr) + { + InsertImageAssetInCommandBuffer(commandBuffer, pCopyBufferToImageInfo->dstImage); + } +} + +void VulkanStateTracker::TrackCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) +{ + if (pCopyImageToBufferInfo != nullptr) + { + InsertBufferAssetInCommandBuffer(commandBuffer, pCopyImageToBufferInfo->dstBuffer); + } +} + +void VulkanStateTracker::TrackCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo) +{ + if (pCopyBufferInfo != nullptr) + { + InsertBufferAssetInCommandBuffer(commandBuffer, pCopyBufferInfo->dstBuffer); + } +} + +void VulkanStateTracker::TrackCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo) +{ + if (pCopyImageInfo != nullptr) + { + InsertImageAssetInCommandBuffer(commandBuffer, pCopyImageInfo->dstImage); + } +} + +void VulkanStateTracker::TrackCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) +{ + if (pCopyBufferToImageInfo != nullptr) + { + InsertImageAssetInCommandBuffer(commandBuffer, pCopyBufferToImageInfo->dstImage); + } +} + +void VulkanStateTracker::TrackCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) +{ + if (pCopyImageToBufferInfo != nullptr) + { + InsertBufferAssetInCommandBuffer(commandBuffer, pCopyImageToBufferInfo->dstBuffer); + } +} + +void VulkanStateTracker::TrackCmdBlitImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageBlit* pRegions, + VkFilter filter) +{ + InsertImageAssetInCommandBuffer(commandBuffer, dstImage); +} + +void VulkanStateTracker::TrackCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo) +{ + if (pBlitImageInfo != nullptr) + { + InsertImageAssetInCommandBuffer(commandBuffer, pBlitImageInfo->dstImage); + } +} + +void VulkanStateTracker::TrackCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo) +{ + TrackCmdBlitImage2(commandBuffer, pBlitImageInfo); +} + +void VulkanStateTracker::TrackCmdUpdateBuffer( + VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData) +{ + InsertBufferAssetInCommandBuffer(commandBuffer, dstBuffer); +} + +void VulkanStateTracker::TrackCmdFillBuffer( + VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) +{ + InsertBufferAssetInCommandBuffer(commandBuffer, dstBuffer); +} + +void VulkanStateTracker::TrackCmdClearColorImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearColorValue* pColor, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges) +{ + InsertImageAssetInCommandBuffer(commandBuffer, image); +} + +void VulkanStateTracker::TrackCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearDepthStencilValue* pDepthStencil, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges) +{ + InsertImageAssetInCommandBuffer(commandBuffer, image); +} + +void VulkanStateTracker::TrackCmdResolveImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageResolve* pRegions) +{ + InsertImageAssetInCommandBuffer(commandBuffer, dstImage); +} + +void VulkanStateTracker::TrackCmdResolveImage2(VkCommandBuffer commandBuffer, + const VkResolveImageInfo2* pResolveImageInfo) +{ + if (pResolveImageInfo != nullptr) + { + InsertImageAssetInCommandBuffer(commandBuffer, pResolveImageInfo->dstImage); + } +} + +void VulkanStateTracker::TrackCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) +{ + if (taskCount) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); + } +} + +void VulkanStateTracker::TrackCmdDrawMeshTasksIndirectNV( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + if (drawCount) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); + } +} + +void VulkanStateTracker::TrackCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (maxDrawCount) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); + } +} + +void VulkanStateTracker::TrackCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + if (groupCountX && groupCountY && groupCountZ) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); + } +} + +void VulkanStateTracker::TrackCmdDrawMeshTasksIndirectEXT( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + if (drawCount) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); + } +} + +void VulkanStateTracker::TrackCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + if (maxDrawCount) + { + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); + } +} + +void VulkanStateTracker::TrackMappedAssetsWrites() +{ + util::PageGuardManager* manager = util::PageGuardManager::Get(); + if (manager == nullptr) + { + return; + } + + std::unordered_map memories_page_status; + manager->GetDirtyMemoryRegions(memories_page_status); + const size_t page_size = util::platform::GetSystemPageSize(); + + for (const auto& entry : memories_page_status) + { + vulkan_wrappers::DeviceMemoryWrapper* dev_mem_wrapper = state_table_.GetDeviceMemoryWrapper(entry.first); + assert(dev_mem_wrapper != nullptr); + + dev_mem_wrapper->asset_map_lock.lock(); + for (auto& asset : dev_mem_wrapper->bound_assets) + { + if (asset->dirty || !asset->size) + { + continue; + } + + const size_t first_page = asset->bind_offset / page_size; + const size_t last_page = (asset->bind_offset + asset->size - 1) / page_size; + assert(first_page <= last_page); + assert(first_page <= entry.second.size()); + + for (size_t page = first_page; page < entry.second.size() && page <= last_page; ++page) + { + if (entry.second[page]) + { + asset->dirty = !is_in_frame_state_setup_; + break; + } + } + } + dev_mem_wrapper->asset_map_lock.unlock(); + } +} + +void VulkanStateTracker::TrackPipelineDescriptors(vulkan_wrappers::CommandBufferWrapper* command_wrapper, + vulkan_state_info::PipelineBindPoints ppl_bind_point) +{ + assert(command_wrapper != nullptr); + assert(ppl_bind_point < vulkan_state_info::PipelineBindPoints::kBindPoint_count); + + const vulkan_wrappers::PipelineWrapper* ppl_wrapper = command_wrapper->bound_pipelines[ppl_bind_point]; + if (ppl_wrapper != nullptr) + { + for (const auto& stage : ppl_wrapper->bound_shaders) + { + for (const auto& set : stage.used_descriptors_info) + { + const uint32_t desc_set_index = set.first; + for (const auto& desc : set.second) + { + if (desc.second.accessed) + { + const uint32_t binding_index = desc.first; + const vulkan_wrappers::DescriptorSetWrapper* desc_set_wrapper = + command_wrapper->bound_descriptors[ppl_bind_point][desc_set_index]; + assert(desc_set_wrapper); + + const auto& descriptor_binding = desc_set_wrapper->bindings.find(binding_index); + if (descriptor_binding == desc_set_wrapper->bindings.end()) + { + continue; + } + + switch (descriptor_binding->second.type) + { + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: + { + for (uint32_t a = 0; a < descriptor_binding->second.count; ++a) + { + vulkan_wrappers::ImageViewWrapper* img_view_wrapper = + vulkan_wrappers::GetWrapper( + descriptor_binding->second.storage_images[a].imageView); + + if (img_view_wrapper != nullptr && img_view_wrapper->image != nullptr) + { + command_wrapper->modified_assets.insert(img_view_wrapper->image); + } + } + } + break; + + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + { + for (uint32_t a = 0; a < descriptor_binding->second.count; ++a) + { + vulkan_wrappers::BufferWrapper* buf_wrapper = + vulkan_wrappers::GetWrapper( + descriptor_binding->second.storage_buffers[a].buffer); + if (buf_wrapper != nullptr) + { + command_wrapper->modified_assets.insert(buf_wrapper); + } + } + } + break; + + case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: + { + for (uint32_t a = 0; a < descriptor_binding->second.count; ++a) + { + vulkan_wrappers::BufferViewWrapper* buf_view_wrapper = + vulkan_wrappers::GetWrapper( + descriptor_binding->second.storage_texel_buffer_views[a]); + if (buf_view_wrapper != nullptr && buf_view_wrapper->buffer != nullptr) + { + command_wrapper->modified_assets.insert(buf_view_wrapper->buffer); + } + } + } + break; + + // Rest of descriptors are immutable within a shader + default: + break; + } + } + } + } + } + } +} + +void VulkanStateTracker::TrackCmdDraw(VkCommandBuffer commandBuffer, + uint32_t vertexCount, + uint32_t instanceCount, + uint32_t firstVertex, + uint32_t firstInstance) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDrawIndexed(VkCommandBuffer commandBuffer, + uint32_t indexCount, + uint32_t instanceCount, + uint32_t firstIndex, + int32_t vertexOffset, + uint32_t firstInstance) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDrawIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDrawIndexedIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDrawIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_graphics); +} + +void VulkanStateTracker::TrackCmdDispatch(VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_compute); +} + +void VulkanStateTracker::TrackCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_compute); +} + +void VulkanStateTracker::TrackCmdDispatchBase(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_compute); +} + +void VulkanStateTracker::TrackCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_compute); +} + +void VulkanStateTracker::TrackCmdTraceRaysNV(VkCommandBuffer commandBuffer, + VkBuffer raygenShaderBindingTableBuffer, + VkDeviceSize raygenShaderBindingOffset, + VkBuffer missShaderBindingTableBuffer, + VkDeviceSize missShaderBindingOffset, + VkDeviceSize missShaderBindingStride, + VkBuffer hitShaderBindingTableBuffer, + VkDeviceSize hitShaderBindingOffset, + VkDeviceSize hitShaderBindingStride, + VkBuffer callableShaderBindingTableBuffer, + VkDeviceSize callableShaderBindingOffset, + VkDeviceSize callableShaderBindingStride, + uint32_t width, + uint32_t height, + uint32_t depth) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_ray_tracing); +} + +void VulkanStateTracker::TrackCmdTraceRaysKHR(VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + uint32_t width, + uint32_t height, + uint32_t depth) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_ray_tracing); +} + +void VulkanStateTracker::TrackCmdTraceRaysIndirectKHR( + VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + VkDeviceAddress indirectDeviceAddress) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_ray_tracing); +} + +void VulkanStateTracker::TrackCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, + VkDeviceAddress indirectDeviceAddress) +{ + vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + TrackPipelineDescriptors(cmd_buf_wrapper, vulkan_state_info::PipelineBindPoints::kBindPoint_ray_tracing); +} + +void VulkanStateTracker::MarkReferencedAssetsAsDirty(vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper) +{ + assert(cmd_buf_wrapper != nullptr); + + for (auto asset : cmd_buf_wrapper->modified_assets) + { + assert(asset); + asset->dirty = !is_in_frame_state_setup_; + } +} + +void VulkanStateTracker::TrackSubmission(uint32_t submitCount, const VkSubmitInfo* pSubmits) +{ + if (pSubmits != nullptr && submitCount) + { + for (uint32_t s = 0; s < submitCount; ++s) + { + for (uint32_t c = 0; c < pSubmits[s].commandBufferCount; ++c) + { + vulkan_wrappers::CommandBufferWrapper* primary = + vulkan_wrappers::GetWrapper(pSubmits[s].pCommandBuffers[c]); + MarkReferencedAssetsAsDirty(primary); + + for (const auto secondary : primary->secondaries) + { + MarkReferencedAssetsAsDirty(secondary); + } + } + } + + TrackMappedAssetsWrites(); + } +} + +void VulkanStateTracker::TrackSubmission(uint32_t submitCount, const VkSubmitInfo2* pSubmits) +{ + if (pSubmits != nullptr && submitCount) + { + for (uint32_t s = 0; s < submitCount; ++s) + { + for (uint32_t c = 0; c < pSubmits[s].commandBufferInfoCount; ++c) + { + vulkan_wrappers::CommandBufferWrapper* primary = + vulkan_wrappers::GetWrapper( + pSubmits[s].pCommandBufferInfos[c].commandBuffer); + MarkReferencedAssetsAsDirty(primary); + + for (const auto secondary : primary->secondaries) + { + MarkReferencedAssetsAsDirty(secondary); + } + } + } + + TrackMappedAssetsWrites(); + } +} + +void VulkanStateTracker::TrackBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo) +{ + if (commandBuffer != VK_NULL_HANDLE && pRenderingInfo != nullptr) + { + vulkan_wrappers::CommandBufferWrapper* wrapper = + vulkan_wrappers::GetWrapper(commandBuffer); + assert(wrapper != nullptr); + + for (uint32_t i = 0; i < pRenderingInfo->colorAttachmentCount; ++i) + { + if (pRenderingInfo->pColorAttachments[i].storeOp == VK_ATTACHMENT_STORE_OP_STORE) + { + vulkan_wrappers::ImageViewWrapper* img_view_wrapper = + vulkan_wrappers::GetWrapper( + pRenderingInfo->pColorAttachments[i].imageView); + assert(img_view_wrapper != nullptr); + + wrapper->modified_assets.insert(img_view_wrapper->image); + } + } + + if (pRenderingInfo->pDepthAttachment != nullptr && + pRenderingInfo->pDepthAttachment->storeOp == VK_ATTACHMENT_STORE_OP_STORE) + { + vulkan_wrappers::ImageViewWrapper* img_view_wrapper = + vulkan_wrappers::GetWrapper( + pRenderingInfo->pDepthAttachment->imageView); + assert(img_view_wrapper != nullptr); + + wrapper->modified_assets.insert(img_view_wrapper->image); + } + + if (pRenderingInfo->pStencilAttachment != nullptr && + pRenderingInfo->pStencilAttachment->storeOp == VK_ATTACHMENT_STORE_OP_STORE) + { + vulkan_wrappers::ImageViewWrapper* img_view_wrapper = + vulkan_wrappers::GetWrapper( + pRenderingInfo->pStencilAttachment->imageView); + assert(img_view_wrapper != nullptr); + + wrapper->modified_assets.insert(img_view_wrapper->image); + } + } +} + +void VulkanStateTracker::LoadAssetFileOffsets(const format::AssetFileOffsets& offsets) +{ + GFXRECON_WRITE_CONSOLE("%s()", __func__) + GFXRECON_WRITE_CONSOLE(" importing %zu", offsets.size()) + for (const auto frame : offsets) + { + GFXRECON_WRITE_CONSOLE(" ... %zu", frame.second.size()) + } + + asset_file_offsets_ = offsets; +} + GFXRECON_END_NAMESPACE(encode) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/encode/vulkan_state_tracker.h b/framework/encode/vulkan_state_tracker.h index 768602f3a3..2cdae3c557 100644 --- a/framework/encode/vulkan_state_tracker.h +++ b/framework/encode/vulkan_state_tracker.h @@ -25,6 +25,7 @@ #include "encode/descriptor_update_template_info.h" #include "encode/vulkan_handle_wrappers.h" +#include "encode/vulkan_state_info.h" #include "generated/generated_vulkan_state_table.h" #include "encode/vulkan_state_tracker_initializers.h" #include "encode/vulkan_state_writer.h" @@ -37,6 +38,7 @@ #include "util/memory_output_stream.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" #include #include @@ -48,19 +50,42 @@ GFXRECON_BEGIN_NAMESPACE(encode) class VulkanStateTracker { public: - VulkanStateTracker(); + VulkanStateTracker(bool recapturing = false); ~VulkanStateTracker(); - uint64_t WriteState(VulkanStateWriter* writer, uint64_t frame_number) + uint64_t WriteState(util::FileOutputStream* file_stream, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream, + util::Compressor* compressor, + uint64_t frame_number) { - if (writer != nullptr) - { - std::unique_lock lock(state_table_mutex_); - return writer->WriteState(state_table_, frame_number); - } + CopyAssetFileOffsetsFromLastFrame(frame_number); - return 0; + VulkanStateWriter state_writer(file_stream, + compressor, + thread_id, + asset_file_stream, + asset_file_stream != nullptr ? &asset_file_offsets_[frame_number] : nullptr); + + std::unique_lock lock(state_table_mutex_); + return state_writer.WriteState(state_table_, frame_number); + } + + uint64_t WriteAssets(util::FileOutputStream* asset_file_stream, + format::ThreadId thread_id, + util::Compressor* compressor, + uint64_t frame_number) + { + assert(asset_file_stream != nullptr); + + CopyAssetFileOffsetsFromLastFrame(frame_number); + + VulkanStateWriter state_writer( + nullptr, compressor, thread_id, asset_file_stream, &asset_file_offsets_[frame_number]); + + std::unique_lock lock(state_table_mutex_); + return state_writer.WriteAssets(state_table_, frame_number); } template @@ -87,7 +112,8 @@ class VulkanStateTracker create_info, create_call_id, std::make_shared(create_parameter_buffer->GetData(), - create_parameter_buffer->GetDataSize())); + create_parameter_buffer->GetDataSize()), + &asset_file_offsets_); } } } @@ -117,7 +143,7 @@ class VulkanStateTracker if (state_table_.InsertWrapper(wrapper->handle_id, wrapper)) { vulkan_state_tracker::InitializePoolObjectState( - parent_handle, wrapper, i, alloc_info, create_call_id, create_parameters); + parent_handle, wrapper, i, alloc_info, create_call_id, create_parameters, &asset_file_offsets_); } } } @@ -411,6 +437,264 @@ class VulkanStateTracker void TrackTlasToBlasDependencies(uint32_t command_buffer_count, const VkCommandBuffer* command_buffers); + void TrackCmdBindDescriptorSets(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t firstSet, + uint32_t descriptorSetCount, + const VkDescriptorSet* pDescriptorSets, + uint32_t dynamicOffsetCount, + const uint32_t* pDynamicOffsets); + + void TrackCmdBindDescriptorSets2KHR(VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo); + + void + TrackCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); + + void TrackCmdCopyBuffer(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferCopy* pRegions); + + void TrackCmdCopyImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageCopy* pRegions); + + void TrackCmdCopyBufferToImage(VkCommandBuffer commandBuffer, + VkBuffer srcBuffer, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + + void TrackCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkBuffer dstBuffer, + uint32_t regionCount, + const VkBufferImageCopy* pRegions); + + void TrackCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo); + + void TrackCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo); + + void TrackCmdCopyBufferToImage2(VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo); + + void TrackCmdCopyImageToBuffer2(VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo); + + void TrackCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo); + + void TrackCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo); + + void TrackCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo); + + void TrackCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo); + + void TrackCmdBlitImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageBlit* pRegions, + VkFilter filter); + + void TrackCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo); + + void TrackCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo); + + void TrackCmdUpdateBuffer(VkCommandBuffer commandBuffer, + VkBuffer dstBuffer, + VkDeviceSize dstOffset, + VkDeviceSize dataSize, + const void* pData); + + void TrackCmdFillBuffer( + VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); + + void TrackCmdClearColorImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearColorValue* pColor, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + + void TrackCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, + VkImage image, + VkImageLayout imageLayout, + const VkClearDepthStencilValue* pDepthStencil, + uint32_t rangeCount, + const VkImageSubresourceRange* pRanges); + + void TrackCmdDraw(VkCommandBuffer commandBuffer, + uint32_t vertexCount, + uint32_t instanceCount, + uint32_t firstVertex, + uint32_t firstInstance); + + void TrackCmdDrawIndexed(VkCommandBuffer commandBuffer, + uint32_t indexCount, + uint32_t instanceCount, + uint32_t firstIndex, + int32_t vertexOffset, + uint32_t firstInstance); + + void TrackCmdDrawIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void TrackCmdDrawIndexedIndirect( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void TrackCmdDrawIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void TrackCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void TrackCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void TrackCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void + TrackCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); + + void TrackCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); + + void TrackCmdDispatchBase(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + + void TrackCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, + uint32_t baseGroupX, + uint32_t baseGroupY, + uint32_t baseGroupZ, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + + void TrackCmdTraceRaysNV(VkCommandBuffer commandBuffer, + VkBuffer raygenShaderBindingTableBuffer, + VkDeviceSize raygenShaderBindingOffset, + VkBuffer missShaderBindingTableBuffer, + VkDeviceSize missShaderBindingOffset, + VkDeviceSize missShaderBindingStride, + VkBuffer hitShaderBindingTableBuffer, + VkDeviceSize hitShaderBindingOffset, + VkDeviceSize hitShaderBindingStride, + VkBuffer callableShaderBindingTableBuffer, + VkDeviceSize callableShaderBindingOffset, + VkDeviceSize callableShaderBindingStride, + uint32_t width, + uint32_t height, + uint32_t depth); + + void TrackCmdTraceRaysKHR(VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + uint32_t width, + uint32_t height, + uint32_t depth); + + void TrackCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, + const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, + const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, + VkDeviceAddress indirectDeviceAddress); + + void TrackCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress); + + void TrackCmdResolveImage(VkCommandBuffer commandBuffer, + VkImage srcImage, + VkImageLayout srcImageLayout, + VkImage dstImage, + VkImageLayout dstImageLayout, + uint32_t regionCount, + const VkImageResolve* pRegions); + + void TrackCmdResolveImage2(VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo); + + void TrackCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); + + void TrackCmdDrawMeshTasksIndirectNV( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void TrackCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void TrackCmdDrawMeshTasksEXT(VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + + void TrackCmdDrawMeshTasksIndirectEXT( + VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); + + void TrackCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkBuffer countBuffer, + VkDeviceSize countBufferOffset, + uint32_t maxDrawCount, + uint32_t stride); + + void TrackSubmission(uint32_t submitCount, const VkSubmitInfo* pSubmits); + + void TrackSubmission(uint32_t submitCount, const VkSubmitInfo2* pSubmits); + + void TrackBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo); + + void LoadAssetFileOffsets(const format::AssetFileOffsets& offsets); + + void NotifyFrameStateSetup(uint32_t is_in_frame_state_setup) + { + GFXRECON_WRITE_CONSOLE("%s(is_in_frame_state_setup: %u)", __func__, is_in_frame_state_setup) + is_in_frame_state_setup_ = is_in_frame_state_setup; + } + private: template void AddGroupHandles(ParentHandle parent_handle, @@ -476,8 +760,51 @@ class VulkanStateTracker void DestroyState(vulkan_wrappers::AccelerationStructureKHRWrapper* wrapper); + void DestroyState(vulkan_wrappers::AccelerationStructureNVWrapper* wrapper); + + void DestroyState(vulkan_wrappers::ImageWrapper* wrapper); + + void DestroyState(vulkan_wrappers::ImageViewWrapper* wrapper); + + void DestroyState(vulkan_wrappers::BufferWrapper* wrapper); + + void DestroyState(vulkan_wrappers::BufferViewWrapper* wrapper); + + void DestroyState(vulkan_wrappers::SamplerWrapper* wrapper); + + void DestroyState(vulkan_wrappers::DescriptorSetWrapper* wrapper); + void TrackQuerySubmissions(vulkan_wrappers::CommandBufferWrapper* command_wrapper); + void TrackPipelineDescriptors(vulkan_wrappers::CommandBufferWrapper* command_wrapper, + vulkan_state_info::PipelineBindPoints ppl_bind_point); + + void InsertImageAssetInCommandBuffer(VkCommandBuffer command_buffer, VkImage image); + + void InsertBufferAssetInCommandBuffer(VkCommandBuffer command_buffer, VkBuffer buffer); + + void TrackMappedAssetsWrites(); + + void MarkReferencedAssetsAsDirty(vulkan_wrappers::CommandBufferWrapper* cmd_buf_wrapper); + + void CopyAssetFileOffsetsFromLastFrame(format::FrameNumber frame_number) + { + if (!asset_file_offsets_.empty()) + { + auto entry = asset_file_offsets_.find(frame_number); + if (entry == asset_file_offsets_.end()) + { + // Copy all entries from previous frame + auto last_frame_entry = asset_file_offsets_.rbegin(); + asset_file_offsets_[frame_number] = last_frame_entry->second; + } + else + { + GFXRECON_LOG_INFO("Dublicate asset file entries for frame %" PRIu64, frame_number); + } + } + } + std::mutex state_table_mutex_; VulkanStateTable state_table_; @@ -486,6 +813,9 @@ class VulkanStateTracker // Keeps track of acceleration structures' device addresses std::unordered_map as_device_addresses_map; + + format::AssetFileOffsets asset_file_offsets_; + bool is_in_frame_state_setup_; }; GFXRECON_END_NAMESPACE(encode) diff --git a/framework/encode/vulkan_state_tracker_initializers.h b/framework/encode/vulkan_state_tracker_initializers.h index 9178376771..4eca94e582 100644 --- a/framework/encode/vulkan_state_tracker_initializers.h +++ b/framework/encode/vulkan_state_tracker_initializers.h @@ -35,6 +35,7 @@ #include "graphics/vulkan_struct_get_pnext.h" #include "vulkan/vulkan.h" +#include "vulkan/vulkan_core.h" #include #include @@ -68,7 +69,8 @@ void InitializeState(ParentHandle parent_handle, Wrapper* wrapper, const CreateInfo* create_info, format::ApiCallId create_call_id, - vulkan_state_info::CreateParameters create_parameters) + vulkan_state_info::CreateParameters create_parameters, + format::AssetFileOffsets* asset_file_offsets = nullptr) { assert(wrapper != nullptr); assert(create_parameters != nullptr); @@ -86,7 +88,8 @@ void InitializeGroupObjectState(ParentHandle parent_handl Wrapper* wrapper, const CreateInfo* create_info, format::ApiCallId create_call_id, - vulkan_state_info::CreateParameters create_parameters) + vulkan_state_info::CreateParameters create_parameters, + format::AssetFileOffsets* asset_file_offsets = nullptr) { // The secondary handle is only used by sepcializations. GFXRECON_UNREFERENCED_PARAMETER(secondary_handle); @@ -100,7 +103,8 @@ inline void InitializeStateattachmentCount; ++i) { - wrapper->attachment_final_layouts.push_back(create_info->pAttachments[i].finalLayout); + wrapper->attachment_info.attachment_final_layouts.push_back(create_info->pAttachments[i].finalLayout); + wrapper->attachment_info.store_op.push_back(create_info->pAttachments[i].storeOp); + wrapper->attachment_info.stencil_store_op.push_back(create_info->pAttachments[i].stencilStoreOp); } } } @@ -348,7 +363,8 @@ inline void InitializeStateattachmentCount; ++i) { - wrapper->attachment_final_layouts.push_back(create_info->pAttachments[i].finalLayout); + wrapper->attachment_info.attachment_final_layouts.push_back(create_info->pAttachments[i].finalLayout); + wrapper->attachment_info.store_op.push_back(create_info->pAttachments[i].storeOp); + wrapper->attachment_info.stencil_store_op.push_back(create_info->pAttachments[i].stencilStoreOp); } } } @@ -376,7 +394,8 @@ InitializeGroupObjectStatepStages != nullptr)); @@ -527,7 +548,8 @@ InitializeGroupObjectStatepStages != nullptr)); @@ -571,7 +593,8 @@ inline void InitializeStatecreate_call_id = create_call_id; wrapper->create_parameters = std::move(create_parameters); - wrapper->created_size = create_info->size; + wrapper->size = create_info->size; // TODO: Do we need to track the queue family that the buffer is actually used with? if ((create_info->queueFamilyIndexCount > 0) && (create_info->pQueueFamilyIndices != nullptr)) { wrapper->queue_family_index = create_info->pQueueFamilyIndices[0]; } + + if (asset_file_offsets != nullptr && !asset_file_offsets->empty()) + { + auto last_frame_entry = asset_file_offsets->rbegin(); + if (last_frame_entry->second.find(wrapper->handle_id) != last_frame_entry->second.end()) + { + wrapper->dirty = false; + } + } } // Images created with vkCreateImage. @@ -619,7 +652,8 @@ inline void InitializeStatequeue_family_index = create_info->pQueueFamilyIndices[0]; } + + const VulkanDeviceTable* device_table = vulkan_wrappers::GetDeviceTable(parent_handle); + VkMemoryRequirements image_mem_reqs; + assert(wrapper->handle != VK_NULL_HANDLE); + device_table->GetImageMemoryRequirements(parent_handle, wrapper->handle, &image_mem_reqs); + wrapper->size = image_mem_reqs.size; + + if (asset_file_offsets != nullptr && !asset_file_offsets->empty()) + { + auto last_frame_entry = asset_file_offsets->rbegin(); + if (last_frame_entry->second.find(wrapper->handle_id) != last_frame_entry->second.end()) + { + wrapper->dirty = false; + } + } } template <> @@ -651,7 +700,8 @@ inline void InitializeStatecreate_parameters = std::move(create_parameters); auto buffer = vulkan_wrappers::GetWrapper(create_info->buffer); + wrapper->buffer = buffer; wrapper->buffer_id = buffer->handle_id; } @@ -734,7 +787,8 @@ inline void InitializeState(binding_info.count); descriptor_info.images = std::make_unique(binding_info.count); break; + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: + descriptor_info.storage_images = std::make_unique(binding_info.count); + break; case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: descriptor_info.buffers = std::make_unique(binding_info.count); break; + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + descriptor_info.storage_buffers = std::make_unique(binding_info.count); + break; case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: + descriptor_info.uniform_texel_buffer_views = std::make_unique(binding_info.count); + break; case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: - descriptor_info.texel_buffer_views = std::make_unique(binding_info.count); + descriptor_info.storage_texel_buffer_views = std::make_unique(binding_info.count); break; case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK: descriptor_info.inline_uniform_block = std::make_unique(binding_info.count); @@ -873,10 +936,13 @@ inline void InitializePoolObjectState(VkDevice par std::make_unique(binding_info.count); break; case VK_DESCRIPTOR_TYPE_MUTABLE_VALVE: - descriptor_info.sampler_ids = std::make_unique(binding_info.count); - descriptor_info.images = std::make_unique(binding_info.count); - descriptor_info.buffers = std::make_unique(binding_info.count); - descriptor_info.texel_buffer_views = std::make_unique(binding_info.count); + descriptor_info.sampler_ids = std::make_unique(binding_info.count); + descriptor_info.images = std::make_unique(binding_info.count); + descriptor_info.storage_images = std::make_unique(binding_info.count); + descriptor_info.buffers = std::make_unique(binding_info.count); + descriptor_info.storage_buffers = std::make_unique(binding_info.count); + descriptor_info.uniform_texel_buffer_views = std::make_unique(binding_info.count); + descriptor_info.storage_texel_buffer_views = std::make_unique(binding_info.count); descriptor_info.acceleration_structures = std::make_unique(binding_info.count); descriptor_info.mutable_type = std::make_unique(binding_info.count); @@ -896,6 +962,15 @@ inline void InitializePoolObjectState(VkDevice par wrapper->set_layout_dependency.handle_id = layout_wrapper->handle_id; wrapper->set_layout_dependency.create_call_id = layout_wrapper->create_call_id; wrapper->set_layout_dependency.create_parameters = layout_wrapper->create_parameters; + + if (asset_file_offsets != nullptr && !asset_file_offsets->empty()) + { + auto last_frame_entry = asset_file_offsets->rbegin(); + if (last_frame_entry->second.find(wrapper->handle_id) != last_frame_entry->second.end()) + { + wrapper->dirty = false; + } + } } GFXRECON_END_NAMESPACE(vulkan_state_tracker) diff --git a/framework/encode/vulkan_state_writer.cpp b/framework/encode/vulkan_state_writer.cpp index 904851e2d5..27a2ff418a 100644 --- a/framework/encode/vulkan_state_writer.cpp +++ b/framework/encode/vulkan_state_writer.cpp @@ -24,13 +24,17 @@ #include "encode/vulkan_state_writer.h" #include "encode/struct_pointer_encoder.h" +#include "encode/vulkan_handle_wrappers.h" #include "encode/vulkan_state_info.h" +#include "format/format.h" #include "format/format_util.h" #include "util/logging.h" +#include "vulkan/vulkan_core.h" #include #include #include +#include #include #include @@ -41,6 +45,7 @@ GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(encode) +// static FILE* debug = nullptr; const uint32_t kDefaultQueueFamilyIndex = 0; static bool IsMemoryCoherent(VkMemoryPropertyFlags property_flags) @@ -78,22 +83,82 @@ static bool IsImageReadable(VkMemoryPropertyFlags property (memory_wrapper->mapped_size == VK_WHOLE_SIZE))))); } -VulkanStateWriter::VulkanStateWriter(util::FileOutputStream* output_stream, - util::Compressor* compressor, - format::ThreadId thread_id) : +VulkanStateWriter::VulkanStateWriter(util::FileOutputStream* output_stream, + util::Compressor* compressor, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream, + format::FrameAssetFileOffsets* asset_file_offsets) : output_stream_(output_stream), - compressor_(compressor), thread_id_(thread_id), encoder_(¶meter_stream_) + compressor_(compressor), thread_id_(thread_id), encoder_(¶meter_stream_), asset_file_stream_(asset_file_stream), + asset_file_offsets_(asset_file_offsets) { - assert(output_stream != nullptr); + assert(output_stream != nullptr || asset_file_stream != nullptr); } VulkanStateWriter::~VulkanStateWriter() {} +static void +WriteFrameMarker(format::MarkerType marker_type, uint64_t frame_number, util::FileOutputStream* output_stream) +{ + assert(output_stream != nullptr); + + // fprintf(debug, "%s() %" PRId64 "\n", __func__, frame_number); + + format::Marker marker_cmd; + uint64_t header_size = sizeof(format::Marker); + marker_cmd.header.size = sizeof(marker_cmd.marker_type) + sizeof(marker_cmd.frame_number); + marker_cmd.header.type = format::BlockType::kFrameMarkerBlock; + marker_cmd.marker_type = marker_type; + marker_cmd.frame_number = frame_number; + + output_stream->Write(&marker_cmd, sizeof(marker_cmd)); +} + +uint64_t VulkanStateWriter::WriteAssets(const VulkanStateTable& state_table, uint64_t frame_number) +{ + assert(asset_file_stream_ != nullptr); + + blocks_written_ = 0; + + // #if defined(VK_USE_PLATFORM_ANDROID_KHR) + // debug = fopen("/storage/emulated/0/Download/WriteState.txt", "a"); + // #else + // debug = fopen("WriteState.txt", "a"); + // #endif + + // assert(debug); + + WriteFrameMarker(format::MarkerType::kBeginMarker, frame_number, asset_file_stream_); + + WriteResourceMemoryState(state_table, false); + WriteDescriptorSetStateWithAssetFile(state_table); + + // fsync(fileno(debug)); + // fclose(debug); + + return blocks_written_; +} + uint64_t VulkanStateWriter::WriteState(const VulkanStateTable& state_table, uint64_t frame_number) { // clang-format off blocks_written_ = 0; +// #if defined(VK_USE_PLATFORM_ANDROID_KHR) +// debug = fopen("/storage/emulated/0/Download/WriteState.txt", "a"); +// #else +// debug = fopen("WriteState.txt", "a"); +// #endif + + // if(debug == nullptr) + // { + // GFXRECON_WRITE_CONSOLE("debug == nullptr") + // } + + GFXRECON_WRITE_CONSOLE("%s(frame: %" PRIu64 ")", __func__, frame_number); + + auto started = std::chrono::high_resolution_clock::now(); + format::Marker marker; marker.header.size = sizeof(marker.marker_type) + sizeof(marker.frame_number); marker.header.type = format::kStateMarkerBlock; @@ -104,6 +169,11 @@ uint64_t VulkanStateWriter::WriteState(const VulkanStateTable& state_table, uint // For the Begin Marker meta command ++blocks_written_; + if (asset_file_stream_ != nullptr) + { + WriteFrameMarker(format::MarkerType::kBeginMarker, frame_number, asset_file_stream_); + } + // Instance, device, and queue creation. StandardCreateWrite(state_table); WritePhysicalDeviceState(state_table); @@ -135,7 +205,7 @@ uint64_t VulkanStateWriter::WriteState(const VulkanStateTable& state_table, uint // Bind memory after buffer/image creation and memory allocation. The buffer/image needs to be created before memory // allocation for extensions like dedicated allocation that require a valid buffer/image handle at memory allocation. - WriteResourceMemoryState(state_table); + WriteResourceMemoryState(state_table, true); // Map memory after uploading resource data to buffers and images, which may require mapping resource memory ranges. WriteMappedMemoryState(state_table); @@ -161,7 +231,14 @@ uint64_t VulkanStateWriter::WriteState(const VulkanStateTable& state_table, uint // Descriptor creation. StandardCreateWrite(state_table); StandardCreateWrite(state_table); - WriteDescriptorSetState(state_table); + if (asset_file_stream_ != nullptr) + { + WriteDescriptorSetStateWithAssetFile(state_table); + } + else + { + WriteDescriptorSetState(state_table); + } // Query object creation. WriteQueryPoolState(state_table); @@ -184,9 +261,24 @@ uint64_t VulkanStateWriter::WriteState(const VulkanStateTable& state_table, uint marker.marker_type = format::kEndMarker; output_stream_->Write(&marker, sizeof(marker)); + if (asset_file_stream_) + { + asset_file_stream_->Flush(); + } + + // fsync(fileno(debug)); + // fclose(debug); + // For the EndMarker meta command ++blocks_written_; + auto done = std::chrono::high_resolution_clock::now(); + uint32_t time = std::chrono::duration_cast(done - started).count(); + GFXRECON_WRITE_CONSOLE("--------------------------------------") + GFXRECON_WRITE_CONSOLE("%s()", __func__) + GFXRECON_WRITE_CONSOLE(" saved in %u ms", time); + GFXRECON_WRITE_CONSOLE("--------------------------------------") + return blocks_written_; // clang-format on } @@ -914,6 +1006,190 @@ void VulkanStateWriter::WriteDescriptorSetState(const VulkanStateTable& state_ta } } +void VulkanStateWriter::WriteDescriptorSetStateWithAssetFile(const VulkanStateTable& state_table) +{ + assert(asset_file_stream_ != nullptr); + assert(asset_file_offsets_ != nullptr); + + std::set processed; + + std::unordered_map temp_ds_layouts; + + // First pass over descriptor set table to determine which dependencies need to be created temporarily. + state_table.VisitWrappers([&](const vulkan_wrappers::DescriptorSetWrapper* wrapper) { + assert(wrapper != nullptr); + + auto ds_layout_wrapper = state_table.GetDescriptorSetLayoutWrapper(wrapper->set_layout_dependency.handle_id); + if (ds_layout_wrapper == nullptr) + { + // The object no longer exists, so a temporary object must be created. + auto dep_create_parameters = wrapper->set_layout_dependency.create_parameters.get(); + const auto& dep_inserted = + temp_ds_layouts.insert(std::make_pair(wrapper->set_layout_dependency.handle_id, dep_create_parameters)); + + // Create a temporary object on first encounter. + if (dep_inserted.second) + { + if (wrapper->dirty) + { + const int64_t offset = asset_file_stream_->GetOffset(); + (*asset_file_offsets_)[wrapper->handle_id] = offset; + WriteFunctionCall( + wrapper->set_layout_dependency.create_call_id, dep_create_parameters, asset_file_stream_); + if (output_stream_ != nullptr) + { + WriteExecuteFromFile(asset_file_stream_->GetFilename(), 1, offset); + } + } + else + { + if (output_stream_ != nullptr) + { + if ((*asset_file_offsets_).find(wrapper->handle_id) != (*asset_file_offsets_).end()) + { + const int64_t offset = (*asset_file_offsets_)[wrapper->handle_id]; + WriteExecuteFromFile(asset_file_stream_->GetFilename(), 1, offset); + } + else + { + GFXRECON_LOG_WARNING( + "%s() Desc set %" PRIu64 " was not in offset map", __func__, wrapper->handle_id); + } + } + } + } + } + }); + + state_table.VisitWrappers([&](vulkan_wrappers::DescriptorSetWrapper* wrapper) { + assert(wrapper != nullptr); + + uint32_t n_blocks = 0; + int64_t offset; + if (wrapper->dirty) + { + offset = asset_file_stream_->GetOffset(); + } + else + { + if ((*asset_file_offsets_).find(wrapper->handle_id) != (*asset_file_offsets_).end()) + { + offset = (*asset_file_offsets_)[wrapper->handle_id]; + } + else + { + GFXRECON_LOG_WARNING("%s() Desc set %" PRIu64 " was not in offset map", __func__, wrapper->handle_id); + } + } + + // Filter duplicate calls to vkAllocateDescriptorSets for descriptor sets that were allocated by the same + // API call and reference the same parameter buffer. + const auto new_entry = processed.insert(wrapper->create_parameters.get()); + if (new_entry.second) + { + if (wrapper->dirty) + { + // Write descriptor set creation call and add the parameter buffer to the processed set. + WriteFunctionCall(wrapper->create_call_id, wrapper->create_parameters.get(), asset_file_stream_); + } + + ++n_blocks; + } + + VkWriteDescriptorSet write = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET }; + write.dstSet = wrapper->handle; + + for (const auto& binding_entry : wrapper->bindings) + { + const vulkan_state_info::DescriptorInfo* binding = &binding_entry.second; + bool active = false; + + write.dstBinding = binding_entry.first; + + for (uint32_t i = 0; i < binding->count; ++i) + { + VkDescriptorType descriptor_type; + bool write_descriptor = CheckDescriptorStatus(binding, i, state_table, &descriptor_type); + + if (active != write_descriptor) + { + if (!active) + { + // Start of an active descriptor write range. + active = true; + write.dstArrayElement = i; + write.descriptorType = descriptor_type; + } + else + { + // End of an active descriptor write range. + active = false; + write.descriptorCount = i - write.dstArrayElement; + if (wrapper->dirty) + { + WriteDescriptorUpdateCommand( + wrapper->device->handle_id, binding, &write, asset_file_stream_); + } + ++n_blocks; + } + } + else if (active && (descriptor_type != write.descriptorType)) + { + // Mutable descriptor type change within an active write range + // End current range + write.descriptorCount = i - write.dstArrayElement; + if (wrapper->dirty) + { + WriteDescriptorUpdateCommand(wrapper->device->handle_id, binding, &write, asset_file_stream_); + } + ++n_blocks; + + // Start new range + write.descriptorType = descriptor_type; + write.dstArrayElement = i; + } + } + + // Process final range, when last item in array contained an active write. + if (active) + { + write.descriptorCount = binding->count - write.dstArrayElement; + + if (wrapper->dirty) + { + WriteDescriptorUpdateCommand(wrapper->device->handle_id, binding, &write, asset_file_stream_); + } + ++n_blocks; + } + } + + // Don't write when n_blocks is zero because it will be translated + // as execute till the end of file + if (output_stream_ != nullptr && n_blocks) + { + WriteExecuteFromFile(asset_file_stream_->GetFilename(), n_blocks, offset); + } + + if (wrapper->dirty) + { + wrapper->dirty = false; + (*asset_file_offsets_)[wrapper->handle_id] = offset; + + // fprintf(debug, "%" PRIu64 " -> %" PRId64 "\n", wrapper->handle_id, offset); + } + else + { + wrapper->dirty = false; + } + }); + + // Temporary object destruction. + for (const auto& entry : temp_ds_layouts) + { + DestroyTemporaryDeviceObject(format::ApiCall_vkDestroyDescriptorSetLayout, entry.first, entry.second); + } +} + void VulkanStateWriter::WriteQueryPoolState(const VulkanStateTable& state_table) { std::unordered_map> @@ -1318,7 +1594,7 @@ void VulkanStateWriter::ProcessBufferMemory(const vulkan_wrappers::DeviceWrapper if (snapshot_entry.need_staging_copy) { VkResult result = resource_util.ReadFromBufferResource( - buffer_wrapper->handle, buffer_wrapper->created_size, 0, buffer_wrapper->queue_family_index, data); + buffer_wrapper->handle, buffer_wrapper->size, 0, buffer_wrapper->queue_family_index, data); if (result == VK_SUCCESS) { @@ -1337,7 +1613,7 @@ void VulkanStateWriter::ProcessBufferMemory(const vulkan_wrappers::DeviceWrapper result = device_table->MapMemory(device_wrapper->handle, memory_wrapper->handle, buffer_wrapper->bind_offset, - buffer_wrapper->created_size, + buffer_wrapper->size, 0, &map_ptr); @@ -1354,15 +1630,15 @@ void VulkanStateWriter::ProcessBufferMemory(const vulkan_wrappers::DeviceWrapper if ((result == VK_SUCCESS) && !IsMemoryCoherent(snapshot_entry.memory_properties)) { InvalidateMappedMemoryRange( - device_wrapper, memory_wrapper->handle, buffer_wrapper->bind_offset, buffer_wrapper->created_size); + device_wrapper, memory_wrapper->handle, buffer_wrapper->bind_offset, buffer_wrapper->size); } } if (bytes != nullptr) { - GFXRECON_CHECK_CONVERSION_DATA_LOSS(size_t, buffer_wrapper->created_size); + GFXRECON_CHECK_CONVERSION_DATA_LOSS(size_t, buffer_wrapper->size); - size_t data_size = static_cast(buffer_wrapper->created_size); + size_t data_size = static_cast(buffer_wrapper->size); format::InitBufferCommandHeader upload_cmd; upload_cmd.meta_header.block_header.type = format::kMetaDataBlock; @@ -1406,6 +1682,151 @@ void VulkanStateWriter::ProcessBufferMemory(const vulkan_wrappers::DeviceWrapper } } +void VulkanStateWriter::ProcessBufferMemoryWithAssetFile(const vulkan_wrappers::DeviceWrapper* device_wrapper, + const std::vector& buffer_snapshot_info, + graphics::VulkanResourcesUtil& resource_util) +{ + assert(device_wrapper != nullptr); + assert(asset_file_stream_ != nullptr); + + const VulkanDeviceTable* device_table = &device_wrapper->layer_table; + + for (const auto& snapshot_entry : buffer_snapshot_info) + { + vulkan_wrappers::BufferWrapper* buffer_wrapper = snapshot_entry.buffer_wrapper; + const vulkan_wrappers::DeviceMemoryWrapper* memory_wrapper = snapshot_entry.memory_wrapper; + const uint8_t* bytes = nullptr; + std::vector data; + + assert((buffer_wrapper != nullptr)); + + if (buffer_wrapper->dirty) + { + assert(memory_wrapper != nullptr); + buffer_wrapper->dirty = false; + + if (snapshot_entry.need_staging_copy) + { + VkResult result = resource_util.ReadFromBufferResource( + buffer_wrapper->handle, buffer_wrapper->size, 0, buffer_wrapper->queue_family_index, data); + + if (result == VK_SUCCESS) + { + bytes = data.data(); + } + } + else + { + assert((memory_wrapper->mapped_data == nullptr) || (memory_wrapper->mapped_offset == 0)); + + VkResult result = VK_SUCCESS; + + if (memory_wrapper->mapped_data == nullptr) + { + void* map_ptr = nullptr; + result = device_table->MapMemory(device_wrapper->handle, + memory_wrapper->handle, + buffer_wrapper->bind_offset, + buffer_wrapper->size, + 0, + &map_ptr); + + if (result == VK_SUCCESS) + { + bytes = reinterpret_cast(map_ptr); + } + } + else + { + bytes = reinterpret_cast(memory_wrapper->mapped_data) + buffer_wrapper->bind_offset; + } + + if ((result == VK_SUCCESS) && !IsMemoryCoherent(snapshot_entry.memory_properties)) + { + InvalidateMappedMemoryRange( + device_wrapper, memory_wrapper->handle, buffer_wrapper->bind_offset, buffer_wrapper->size); + } + } + + assert(bytes); + + if (bytes != nullptr) + { + GFXRECON_CHECK_CONVERSION_DATA_LOSS(size_t, buffer_wrapper->size); + + size_t data_size = static_cast(buffer_wrapper->size); + format::InitBufferCommandHeader upload_cmd; + + upload_cmd.meta_header.block_header.type = format::kMetaDataBlock; + upload_cmd.meta_header.meta_data_id = format::MakeMetaDataId(format::ApiFamilyId::ApiFamily_Vulkan, + format::MetaDataType::kInitBufferCommand); + upload_cmd.thread_id = thread_id_; + upload_cmd.device_id = device_wrapper->handle_id; + upload_cmd.buffer_id = buffer_wrapper->handle_id; + upload_cmd.data_size = data_size; + + if (compressor_ != nullptr) + { + size_t compressed_size = compressor_->Compress(data_size, bytes, &compressed_parameter_buffer_, 0); + + if ((compressed_size > 0) && (compressed_size < data_size)) + { + upload_cmd.meta_header.block_header.type = format::BlockType::kCompressedMetaDataBlock; + + bytes = compressed_parameter_buffer_.data(); + data_size = compressed_size; + } + } + + // Calculate size of packet with compressed or uncompressed data size. + upload_cmd.meta_header.block_header.size = format::GetMetaDataBlockBaseSize(upload_cmd) + data_size; + + const int64_t offset = asset_file_stream_->GetOffset(); + asset_file_stream_->Write(&upload_cmd, sizeof(upload_cmd)); + asset_file_stream_->Write(bytes, data_size); + (*asset_file_offsets_)[buffer_wrapper->handle_id] = offset; + + // fprintf(debug, "buffer %" PRIu64 " -> %" PRId64 "\n", buffer_wrapper->handle_id, offset); + + if (output_stream_ != nullptr) + { + WriteExecuteFromFile(asset_file_stream_->GetFilename(), 1, offset); + } + + ++blocks_written_; + + if (!snapshot_entry.need_staging_copy && memory_wrapper->mapped_data == nullptr) + { + device_table->UnmapMemory(device_wrapper->handle, memory_wrapper->handle); + } + } + else + { + GFXRECON_LOG_ERROR("Trimming state snapshot failed to retrieve memory content for buffer %" PRIu64, + buffer_wrapper->handle_id); + } + } + else + { + buffer_wrapper->dirty = false; + + if (output_stream_ != nullptr) + { + if ((*asset_file_offsets_).find(buffer_wrapper->handle_id) != (*asset_file_offsets_).end()) + { + const int64_t offset = (*asset_file_offsets_)[buffer_wrapper->handle_id]; + WriteExecuteFromFile(asset_file_stream_->GetFilename(), 1, offset); + } + else + { + GFXRECON_LOG_WARNING( + "%s() Buffer %" PRIu64 " was not in offset map", __func__, buffer_wrapper->handle_id); + } + } + } + } +} + void VulkanStateWriter::ProcessImageMemory(const vulkan_wrappers::DeviceWrapper* device_wrapper, const std::vector& image_snapshot_info, graphics::VulkanResourcesUtil& resource_util) @@ -1555,14 +1976,205 @@ void VulkanStateWriter::ProcessImageMemory(const vulkan_wrappers::DeviceWrapper* } } +void VulkanStateWriter::ProcessImageMemoryWithAssetFile(const vulkan_wrappers::DeviceWrapper* device_wrapper, + const std::vector& image_snapshot_info, + graphics::VulkanResourcesUtil& resource_util) +{ + assert(device_wrapper != nullptr); + assert(asset_file_stream_ != nullptr); + + const VulkanDeviceTable* device_table = &device_wrapper->layer_table; + + for (const auto& snapshot_entry : image_snapshot_info) + { + vulkan_wrappers::ImageWrapper* image_wrapper = snapshot_entry.image_wrapper; + const vulkan_wrappers::DeviceMemoryWrapper* memory_wrapper = snapshot_entry.memory_wrapper; + const uint8_t* bytes = nullptr; + std::vector data; + + assert(image_wrapper != nullptr); + + if (image_wrapper->dirty) + { + assert((image_wrapper->is_swapchain_image && memory_wrapper == nullptr) || + (!image_wrapper->is_swapchain_image && memory_wrapper != nullptr)); + + image_wrapper->dirty = false; + + if (snapshot_entry.need_staging_copy) + { + std::vector subresource_offsets; + std::vector subresource_sizes; + bool scaling_supported; + + VkResult result = resource_util.ReadFromImageResourceStaging(image_wrapper->handle, + image_wrapper->format, + image_wrapper->image_type, + image_wrapper->extent, + image_wrapper->mip_levels, + image_wrapper->array_layers, + image_wrapper->tiling, + image_wrapper->samples, + image_wrapper->current_layout, + image_wrapper->queue_family_index, + snapshot_entry.aspect, + data, + subresource_offsets, + subresource_sizes, + scaling_supported, + true); + + if (result == VK_SUCCESS) + { + bytes = data.data(); + } + } + else if (!image_wrapper->is_swapchain_image) + { + assert((memory_wrapper != nullptr) && + ((memory_wrapper->mapped_data == nullptr) || (memory_wrapper->mapped_offset == 0))); + + VkResult result = VK_SUCCESS; + + if (memory_wrapper->mapped_data == nullptr) + { + void* map_ptr = nullptr; + result = device_table->MapMemory(device_wrapper->handle, + memory_wrapper->handle, + image_wrapper->bind_offset, + snapshot_entry.resource_size, + 0, + &map_ptr); + + if (result == VK_SUCCESS) + { + bytes = reinterpret_cast(map_ptr); + } + } + else + { + bytes = reinterpret_cast(memory_wrapper->mapped_data) + image_wrapper->bind_offset; + } + + if ((result == VK_SUCCESS) && !IsMemoryCoherent(snapshot_entry.memory_properties)) + { + InvalidateMappedMemoryRange(device_wrapper, + memory_wrapper->handle, + image_wrapper->bind_offset, + snapshot_entry.resource_size); + } + } + + if (!image_wrapper->is_swapchain_image) + { + format::InitImageCommandHeader upload_cmd; + + // Packet size without the resource data. + upload_cmd.meta_header.block_header.size = format::GetMetaDataBlockBaseSize(upload_cmd); + upload_cmd.meta_header.block_header.type = format::kMetaDataBlock; + upload_cmd.meta_header.meta_data_id = format::MakeMetaDataId(format::ApiFamilyId::ApiFamily_Vulkan, + format::MetaDataType::kInitImageCommand); + upload_cmd.thread_id = thread_id_; + upload_cmd.device_id = device_wrapper->handle_id; + upload_cmd.image_id = image_wrapper->handle_id; + upload_cmd.aspect = snapshot_entry.aspect; + upload_cmd.layout = image_wrapper->current_layout; + + if (bytes != nullptr) + { + GFXRECON_CHECK_CONVERSION_DATA_LOSS(size_t, snapshot_entry.resource_size); + + size_t data_size = static_cast(snapshot_entry.resource_size); + + // Store uncompressed data size in packet. + upload_cmd.data_size = data_size; + upload_cmd.level_count = image_wrapper->mip_levels; + + if (compressor_ != nullptr) + { + size_t compressed_size = + compressor_->Compress(data_size, bytes, &compressed_parameter_buffer_, 0); + + if ((compressed_size > 0) && (compressed_size < data_size)) + { + upload_cmd.meta_header.block_header.type = format::BlockType::kCompressedMetaDataBlock; + + bytes = compressed_parameter_buffer_.data(); + data_size = compressed_size; + } + } + + // Calculate size of packet with compressed or uncompressed data size. + assert(!snapshot_entry.level_sizes.empty() && + (snapshot_entry.level_sizes.size() == upload_cmd.level_count)); + size_t levels_size = snapshot_entry.level_sizes.size() * sizeof(snapshot_entry.level_sizes[0]); + + upload_cmd.meta_header.block_header.size += levels_size + data_size; + + const int64_t offset = asset_file_stream_->GetOffset(); + (*asset_file_offsets_)[image_wrapper->handle_id] = offset; + asset_file_stream_->Write(&upload_cmd, sizeof(upload_cmd)); + asset_file_stream_->Write(snapshot_entry.level_sizes.data(), levels_size); + asset_file_stream_->Write(bytes, data_size); + + // fprintf(debug, "image %" PRIu64 " -> %" PRId64 "\n", image_wrapper->handle_id, offset); + + if (output_stream_ != nullptr) + { + WriteExecuteFromFile(asset_file_stream_->GetFilename(), 1, offset); + } + + if (!snapshot_entry.need_staging_copy && memory_wrapper->mapped_data == nullptr) + { + device_table->UnmapMemory(device_wrapper->handle, memory_wrapper->handle); + } + } + else + { + if (output_stream_ != nullptr) + { + // Write a packet without resource data; replay must still perform a layout transition at image + // initialization. + upload_cmd.data_size = 0; + upload_cmd.level_count = 0; + + output_stream_->Write(&upload_cmd, sizeof(upload_cmd)); + } + } + + ++blocks_written_; + } + } + else + { + image_wrapper->dirty = false; + + if (output_stream_ != nullptr) + { + if ((*asset_file_offsets_).find(image_wrapper->handle_id) != (*asset_file_offsets_).end()) + { + const int64_t offset = (*asset_file_offsets_)[image_wrapper->handle_id]; + WriteExecuteFromFile(asset_file_stream_->GetFilename(), 1, offset); + } + else + { + GFXRECON_LOG_WARNING( + "%s() Image %" PRIu64 " was not in offset map", __func__, image_wrapper->handle_id); + } + } + } + } +} + void VulkanStateWriter::WriteBufferMemoryState(const VulkanStateTable& state_table, DeviceResourceTables* resources, VkDeviceSize* max_resource_size, - VkDeviceSize* max_staging_copy_size) + VkDeviceSize* max_staging_copy_size, + bool write_memory_state) { assert((resources != nullptr) && (max_resource_size != nullptr) && (max_staging_copy_size != nullptr)); - state_table.VisitWrappers([&](const vulkan_wrappers::BufferWrapper* wrapper) { + state_table.VisitWrappers([&](vulkan_wrappers::BufferWrapper* wrapper) { assert(wrapper != nullptr); // Perform memory binding. @@ -1572,50 +2184,54 @@ void VulkanStateWriter::WriteBufferMemoryState(const VulkanStateTable& state_tab if (memory_wrapper != nullptr) { const vulkan_wrappers::DeviceWrapper* device_wrapper = wrapper->bind_device; - const VulkanDeviceTable* device_table = &device_wrapper->layer_table; - - assert((device_wrapper != nullptr) && (device_table != nullptr)); - - // Write memory requirements query before bind command. - VkMemoryRequirements memory_requirements; - - device_table->GetBufferMemoryRequirements(device_wrapper->handle, wrapper->handle, &memory_requirements); + assert(device_wrapper != nullptr); - encoder_.EncodeHandleIdValue(device_wrapper->handle_id); - encoder_.EncodeHandleIdValue(wrapper->handle_id); - EncodeStructPtr(&encoder_, &memory_requirements); + if (write_memory_state) + { + // Write memory requirements query before bind command. + VkMemoryRequirements memory_requirements; + const VulkanDeviceTable* device_table = &device_wrapper->layer_table; + assert(device_table != nullptr); - WriteFunctionCall(format::ApiCall_vkGetBufferMemoryRequirements, ¶meter_stream_); - parameter_stream_.Clear(); + device_table->GetBufferMemoryRequirements( + device_wrapper->handle, wrapper->handle, &memory_requirements); - // Write memory bind command. - if (wrapper->bind_pnext == nullptr) - { encoder_.EncodeHandleIdValue(device_wrapper->handle_id); encoder_.EncodeHandleIdValue(wrapper->handle_id); - encoder_.EncodeHandleIdValue(memory_wrapper->handle_id); - encoder_.EncodeUInt64Value(wrapper->bind_offset); - encoder_.EncodeEnumValue(VK_SUCCESS); + EncodeStructPtr(&encoder_, &memory_requirements); - WriteFunctionCall(format::ApiCall_vkBindBufferMemory, ¶meter_stream_); - } - else - { - encoder_.EncodeHandleIdValue(device_wrapper->handle_id); - encoder_.EncodeUInt32Value(1); - - VkBindBufferMemoryInfo info = {}; - info.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO; - info.pNext = wrapper->bind_pnext; - info.buffer = wrapper->handle; - info.memory = memory_wrapper->handle; - info.memoryOffset = wrapper->bind_offset; - EncodeStructArray(&encoder_, &info, 1); - encoder_.EncodeEnumValue(VK_SUCCESS); + WriteFunctionCall(format::ApiCall_vkGetBufferMemoryRequirements, ¶meter_stream_); + parameter_stream_.Clear(); + + // Write memory bind command. + if (wrapper->bind_pnext == nullptr) + { + encoder_.EncodeHandleIdValue(device_wrapper->handle_id); + encoder_.EncodeHandleIdValue(wrapper->handle_id); + encoder_.EncodeHandleIdValue(memory_wrapper->handle_id); + encoder_.EncodeUInt64Value(wrapper->bind_offset); + encoder_.EncodeEnumValue(VK_SUCCESS); - WriteFunctionCall(format::ApiCall_vkBindBufferMemory2, ¶meter_stream_); + WriteFunctionCall(format::ApiCall_vkBindBufferMemory, ¶meter_stream_); + } + else + { + encoder_.EncodeHandleIdValue(device_wrapper->handle_id); + encoder_.EncodeUInt32Value(1); + + VkBindBufferMemoryInfo info = {}; + info.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO; + info.pNext = wrapper->bind_pnext; + info.buffer = wrapper->handle; + info.memory = memory_wrapper->handle; + info.memoryOffset = wrapper->bind_offset; + EncodeStructArray(&encoder_, &info, 1); + encoder_.EncodeEnumValue(VK_SUCCESS); + + WriteFunctionCall(format::ApiCall_vkBindBufferMemory2, ¶meter_stream_); + } + parameter_stream_.Clear(); } - parameter_stream_.Clear(); // Group buffers with memory bindings by device for memory snapshot. ResourceSnapshotQueueFamilyTable& snapshot_table = (*resources)[device_wrapper]; @@ -1627,14 +2243,14 @@ void VulkanStateWriter::WriteBufferMemoryState(const VulkanStateTable& state_tab snapshot_info.memory_properties = GetMemoryProperties(device_wrapper, memory_wrapper); snapshot_info.need_staging_copy = !IsBufferReadable(snapshot_info.memory_properties, memory_wrapper); - if ((*max_resource_size) < wrapper->created_size) + if ((*max_resource_size) < wrapper->size) { - (*max_resource_size) = wrapper->created_size; + (*max_resource_size) = wrapper->size; } - if (snapshot_info.need_staging_copy && ((*max_staging_copy_size) < wrapper->created_size)) + if (snapshot_info.need_staging_copy && ((*max_staging_copy_size) < wrapper->size)) { - (*max_staging_copy_size) = wrapper->created_size; + (*max_staging_copy_size) = wrapper->size; } snapshot_entry.buffers.emplace_back(snapshot_info); @@ -1645,11 +2261,12 @@ void VulkanStateWriter::WriteBufferMemoryState(const VulkanStateTable& state_tab void VulkanStateWriter::WriteImageMemoryState(const VulkanStateTable& state_table, DeviceResourceTables* resources, VkDeviceSize* max_resource_size, - VkDeviceSize* max_staging_copy_size) + VkDeviceSize* max_staging_copy_size, + bool write_memory_state) { assert((resources != nullptr) && (max_resource_size != nullptr) && (max_staging_copy_size != nullptr)); - state_table.VisitWrappers([&](const vulkan_wrappers::ImageWrapper* wrapper) { + state_table.VisitWrappers([&](vulkan_wrappers::ImageWrapper* wrapper) { assert(wrapper != nullptr); // Perform memory binding. @@ -1660,50 +2277,53 @@ void VulkanStateWriter::WriteImageMemoryState(const VulkanStateTable& state_tabl (!wrapper->is_swapchain_image && memory_wrapper != nullptr)) { const vulkan_wrappers::DeviceWrapper* device_wrapper = wrapper->bind_device; - const VulkanDeviceTable* device_table = &device_wrapper->layer_table; - - assert((device_wrapper != nullptr) && (device_table != nullptr)); + assert(device_wrapper != nullptr); // Write memory requirements query before bind command. - VkMemoryRequirements memory_requirements; - - device_table->GetImageMemoryRequirements(device_wrapper->handle, wrapper->handle, &memory_requirements); - - encoder_.EncodeHandleIdValue(device_wrapper->handle_id); - encoder_.EncodeHandleIdValue(wrapper->handle_id); - EncodeStructPtr(&encoder_, &memory_requirements); + if (write_memory_state) + { + VkMemoryRequirements memory_requirements; + const VulkanDeviceTable* device_table = &device_wrapper->layer_table; + assert(device_table != nullptr); - WriteFunctionCall(format::ApiCall_vkGetImageMemoryRequirements, ¶meter_stream_); - parameter_stream_.Clear(); + device_table->GetImageMemoryRequirements(device_wrapper->handle, wrapper->handle, &memory_requirements); - // Write memory bind command. - if (wrapper->bind_pnext == nullptr) - { encoder_.EncodeHandleIdValue(device_wrapper->handle_id); encoder_.EncodeHandleIdValue(wrapper->handle_id); - encoder_.EncodeHandleIdValue(memory_wrapper->handle_id); - encoder_.EncodeUInt64Value(wrapper->bind_offset); - encoder_.EncodeEnumValue(VK_SUCCESS); + EncodeStructPtr(&encoder_, &memory_requirements); - WriteFunctionCall(format::ApiCall_vkBindImageMemory, ¶meter_stream_); - } - else - { - encoder_.EncodeHandleIdValue(device_wrapper->handle_id); - encoder_.EncodeUInt32Value(1); - - VkBindImageMemoryInfo info = {}; - info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO; - info.pNext = wrapper->bind_pnext; - info.image = wrapper->handle; - info.memory = memory_wrapper->handle; - info.memoryOffset = wrapper->bind_offset; - EncodeStructArray(&encoder_, &info, 1); - encoder_.EncodeEnumValue(VK_SUCCESS); + WriteFunctionCall(format::ApiCall_vkGetImageMemoryRequirements, ¶meter_stream_); + parameter_stream_.Clear(); + + // Write memory bind command. + if (wrapper->bind_pnext == nullptr) + { + encoder_.EncodeHandleIdValue(device_wrapper->handle_id); + encoder_.EncodeHandleIdValue(wrapper->handle_id); + encoder_.EncodeHandleIdValue(memory_wrapper->handle_id); + encoder_.EncodeUInt64Value(wrapper->bind_offset); + encoder_.EncodeEnumValue(VK_SUCCESS); - WriteFunctionCall(format::ApiCall_vkBindImageMemory2, ¶meter_stream_); + WriteFunctionCall(format::ApiCall_vkBindImageMemory, ¶meter_stream_); + } + else + { + encoder_.EncodeHandleIdValue(device_wrapper->handle_id); + encoder_.EncodeUInt32Value(1); + + VkBindImageMemoryInfo info = {}; + info.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO; + info.pNext = wrapper->bind_pnext; + info.image = wrapper->handle; + info.memory = memory_wrapper->handle; + info.memoryOffset = wrapper->bind_offset; + EncodeStructArray(&encoder_, &info, 1); + encoder_.EncodeEnumValue(VK_SUCCESS); + + WriteFunctionCall(format::ApiCall_vkBindImageMemory2, ¶meter_stream_); + } + parameter_stream_.Clear(); } - parameter_stream_.Clear(); VkMemoryPropertyFlags memory_properties = 0; if (memory_wrapper != nullptr) @@ -1771,7 +2391,7 @@ void VulkanStateWriter::WriteImageMemoryState(const VulkanStateTable& state_tabl snapshot_entry.images.emplace_back(snapshot_info); // Write image subresource layout queries for linear/host-visible images. - if (is_writable) + if (is_writable && write_memory_state) { VkImageAspectFlags aspect_flags = aspect; @@ -1831,14 +2451,16 @@ void VulkanStateWriter::WriteImageSubresourceLayouts(const vulkan_wrappers::Imag } } -void VulkanStateWriter::WriteResourceMemoryState(const VulkanStateTable& state_table) +void VulkanStateWriter::WriteResourceMemoryState(const VulkanStateTable& state_table, bool write_memory_state) { DeviceResourceTables resources; VkDeviceSize max_resource_size = 0; VkDeviceSize max_staging_copy_size = 0; - WriteBufferMemoryState(state_table, &resources, &max_resource_size, &max_staging_copy_size); - WriteImageMemoryState(state_table, &resources, &max_resource_size, &max_staging_copy_size); + auto started = std::chrono::high_resolution_clock::now(); + + WriteBufferMemoryState(state_table, &resources, &max_resource_size, &max_staging_copy_size, write_memory_state); + WriteImageMemoryState(state_table, &resources, &max_resource_size, &max_staging_copy_size, write_memory_state); // Write resource memory content. for (const auto& resource_entry : resources) @@ -1861,41 +2483,63 @@ void VulkanStateWriter::WriteResourceMemoryState(const VulkanStateTable& state_t if (result == VK_SUCCESS) { - format::BeginResourceInitCommand begin_cmd; - begin_cmd.meta_header.block_header.size = format::GetMetaDataBlockBaseSize(begin_cmd); - begin_cmd.meta_header.block_header.type = format::kMetaDataBlock; - begin_cmd.meta_header.meta_data_id = format::MakeMetaDataId( - format::ApiFamilyId::ApiFamily_Vulkan, format::MetaDataType::kBeginResourceInitCommand); - begin_cmd.thread_id = thread_id_; - begin_cmd.device_id = device_wrapper->handle_id; - begin_cmd.max_resource_size = max_resource_size; - begin_cmd.max_copy_size = max_staging_copy_size; - - output_stream_->Write(&begin_cmd, sizeof(begin_cmd)); - ++blocks_written_; + if (output_stream_ != nullptr) + { + format::BeginResourceInitCommand begin_cmd; + begin_cmd.meta_header.block_header.size = format::GetMetaDataBlockBaseSize(begin_cmd); + begin_cmd.meta_header.block_header.type = format::kMetaDataBlock; + begin_cmd.meta_header.meta_data_id = format::MakeMetaDataId( + format::ApiFamilyId::ApiFamily_Vulkan, format::MetaDataType::kBeginResourceInitCommand); + begin_cmd.thread_id = thread_id_; + begin_cmd.device_id = device_wrapper->handle_id; + begin_cmd.max_resource_size = max_resource_size; + begin_cmd.max_copy_size = max_staging_copy_size; + + output_stream_->Write(&begin_cmd, sizeof(begin_cmd)); + ++blocks_written_; + } for (const auto& queue_family_entry : resource_entry.second) { - ProcessBufferMemory(device_wrapper, queue_family_entry.second.buffers, resource_util); - ProcessImageMemory(device_wrapper, queue_family_entry.second.images, resource_util); + if (asset_file_stream_ != nullptr) + { + ProcessBufferMemoryWithAssetFile(device_wrapper, queue_family_entry.second.buffers, resource_util); + ProcessImageMemoryWithAssetFile(device_wrapper, queue_family_entry.second.images, resource_util); + } + else + { + ProcessBufferMemory(device_wrapper, queue_family_entry.second.buffers, resource_util); + ProcessImageMemory(device_wrapper, queue_family_entry.second.images, resource_util); + } } - format::EndResourceInitCommand end_cmd; - end_cmd.meta_header.block_header.size = format::GetMetaDataBlockBaseSize(end_cmd); - end_cmd.meta_header.block_header.type = format::kMetaDataBlock; - end_cmd.meta_header.meta_data_id = format::MakeMetaDataId(format::ApiFamilyId::ApiFamily_Vulkan, - format::MetaDataType::kEndResourceInitCommand); - end_cmd.thread_id = thread_id_; - end_cmd.device_id = device_wrapper->handle_id; - - output_stream_->Write(&end_cmd, sizeof(end_cmd)); - ++blocks_written_; + if (output_stream_ != nullptr) + { + format::EndResourceInitCommand end_cmd; + end_cmd.meta_header.block_header.size = format::GetMetaDataBlockBaseSize(end_cmd); + end_cmd.meta_header.block_header.type = format::kMetaDataBlock; + end_cmd.meta_header.meta_data_id = format::MakeMetaDataId( + format::ApiFamilyId::ApiFamily_Vulkan, format::MetaDataType::kEndResourceInitCommand); + end_cmd.thread_id = thread_id_; + end_cmd.device_id = device_wrapper->handle_id; + + output_stream_->Write(&end_cmd, sizeof(end_cmd)); + ++blocks_written_; + } } else { GFXRECON_LOG_ERROR("Failed to create a staging buffer to process trim state"); } } + + auto done = std::chrono::high_resolution_clock::now(); + uint32_t time = std::chrono::duration_cast(done - started).count(); + + GFXRECON_WRITE_CONSOLE("--------------------------------------") + GFXRECON_WRITE_CONSOLE("%s()", __func__) + GFXRECON_WRITE_CONSOLE(" saved in %u ms", time); + GFXRECON_WRITE_CONSOLE("--------------------------------------") } void VulkanStateWriter::WriteMappedMemoryState(const VulkanStateTable& state_table) @@ -2368,7 +3012,8 @@ void VulkanStateWriter::WriteCommandBufferCommands(const vulkan_wrappers::Comman void VulkanStateWriter::WriteDescriptorUpdateCommand(format::HandleId device_id, const vulkan_state_info::DescriptorInfo* binding, - VkWriteDescriptorSet* write) + VkWriteDescriptorSet* write, + util::FileOutputStream* output_stream) { assert((binding != nullptr) && (write != nullptr)); @@ -2389,19 +3034,25 @@ void VulkanStateWriter::WriteDescriptorUpdateCommand(format::HandleId case VK_DESCRIPTOR_TYPE_SAMPLER: case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: - case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: write->pImageInfo = &binding->images[write->dstArrayElement]; break; + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: + write->pImageInfo = &binding->storage_images[write->dstArrayElement]; + break; case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: - case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: write->pBufferInfo = &binding->buffers[write->dstArrayElement]; break; + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + write->pBufferInfo = &binding->storage_buffers[write->dstArrayElement]; + break; case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: + write->pTexelBufferView = &binding->uniform_texel_buffer_views[write->dstArrayElement]; + break; case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: - write->pTexelBufferView = &binding->texel_buffer_views[write->dstArrayElement]; + write->pTexelBufferView = &binding->storage_texel_buffer_views[write->dstArrayElement]; break; case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK: if (binding->inline_uniform_block != nullptr) @@ -2441,7 +3092,7 @@ void VulkanStateWriter::WriteDescriptorUpdateCommand(format::HandleId encoder_.EncodeUInt32Value(0); EncodeStructArray(&encoder_, copy, 0); - WriteFunctionCall(format::ApiCallId::ApiCall_vkUpdateDescriptorSets, ¶meter_stream_); + WriteFunctionCall(format::ApiCallId::ApiCall_vkUpdateDescriptorSets, ¶meter_stream_, output_stream); parameter_stream_.Clear(); } @@ -2672,7 +3323,9 @@ void VulkanStateWriter::DestroyTemporaryDeviceObject(format::ApiCallId // TODO: This is the same code used by CaptureManager to write function call data. It could be moved to a format // utility. -void VulkanStateWriter::WriteFunctionCall(format::ApiCallId call_id, util::MemoryOutputStream* parameter_buffer) +void VulkanStateWriter::WriteFunctionCall(format::ApiCallId call_id, + util::MemoryOutputStream* parameter_buffer, + util::FileOutputStream* output_stream) { assert(parameter_buffer != nullptr); @@ -2728,11 +3381,17 @@ void VulkanStateWriter::WriteFunctionCall(format::ApiCallId call_id, util::Memor uncompressed_header.block_header.size = packet_size; } - // Write appropriate function call block header. - output_stream_->Write(header_pointer, header_size); - - // Write parameter data. - output_stream_->Write(data_pointer, data_size); + // Write appropriate function call block header and parameter data + if (output_stream != nullptr) + { + output_stream->Write(header_pointer, header_size); + output_stream->Write(data_pointer, data_size); + } + else + { + output_stream_->Write(header_pointer, header_size); + output_stream_->Write(data_pointer, data_size); + } ++blocks_written_; } @@ -3317,5 +3976,36 @@ bool VulkanStateWriter::IsFramebufferValid(const vulkan_wrappers::FramebufferWra return valid; } +void VulkanStateWriter::WriteExecuteFromFile(const std::string& filename, uint32_t n_blocks, int64_t offset) +{ + // Remove path from filename + std::string relative_file; + const size_t last_slash_pos = filename.find_last_of("\\/"); + if (last_slash_pos != std::string::npos) + { + relative_file = filename.substr(last_slash_pos + 1); + } + else + { + relative_file = filename; + } + + const size_t filename_length = relative_file.length(); + + format::ExecuteBlocksFromFile execute_from_file; + execute_from_file.meta_header.block_header.size = + format::GetMetaDataBlockBaseSize(execute_from_file) + filename_length; + execute_from_file.meta_header.block_header.type = format::kMetaDataBlock; + execute_from_file.meta_header.meta_data_id = + format::MakeMetaDataId(format::ApiFamilyId::ApiFamily_Vulkan, format::MetaDataType::kExecuteBlocksFromFile); + execute_from_file.thread_id = thread_id_; + execute_from_file.n_blocks = n_blocks; + execute_from_file.offset = offset; + execute_from_file.filename_length = filename_length; + + output_stream_->Write(&execute_from_file, sizeof(execute_from_file)); + output_stream_->Write(relative_file.c_str(), filename_length); +} + GFXRECON_END_NAMESPACE(encode) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/encode/vulkan_state_writer.h b/framework/encode/vulkan_state_writer.h index 3a2dbc2065..fe0df8f0ca 100644 --- a/framework/encode/vulkan_state_writer.h +++ b/framework/encode/vulkan_state_writer.h @@ -38,7 +38,9 @@ #include "vulkan/vulkan.h" +#include #include +#include #include GFXRECON_BEGIN_NAMESPACE(gfxrecon) @@ -47,18 +49,24 @@ GFXRECON_BEGIN_NAMESPACE(encode) class VulkanStateWriter { public: - VulkanStateWriter(util::FileOutputStream* output_stream, util::Compressor* compressor, format::ThreadId thread_id); + VulkanStateWriter(util::FileOutputStream* output_stream, + util::Compressor* compressor, + format::ThreadId thread_id, + util::FileOutputStream* asset_file_stream = nullptr, + format::FrameAssetFileOffsets* frame_asset_file_offsets = nullptr); ~VulkanStateWriter(); // Returns number of blocks written to the output_stream. uint64_t WriteState(const VulkanStateTable& state_table, uint64_t frame_number); + uint64_t WriteAssets(const VulkanStateTable& state_table, uint64_t frame_number); + private: // Data structures for processing resource memory snapshots. struct BufferSnapshotInfo { - const vulkan_wrappers::BufferWrapper* buffer_wrapper{ nullptr }; + vulkan_wrappers::BufferWrapper* buffer_wrapper{ nullptr }; const vulkan_wrappers::DeviceMemoryWrapper* memory_wrapper{ nullptr }; VkMemoryPropertyFlags memory_properties{}; bool need_staging_copy{ false }; @@ -66,7 +74,7 @@ class VulkanStateWriter struct ImageSnapshotInfo { - const vulkan_wrappers::ImageWrapper* image_wrapper{ nullptr }; + vulkan_wrappers::ImageWrapper* image_wrapper{ nullptr }; const vulkan_wrappers::DeviceMemoryWrapper* memory_wrapper{ nullptr }; VkMemoryPropertyFlags memory_properties{}; bool need_staging_copy{ false }; @@ -128,6 +136,8 @@ class VulkanStateWriter void WriteDescriptorSetState(const VulkanStateTable& state_table); + void WriteDescriptorSetStateWithAssetFile(const VulkanStateTable& state_table); + void WriteQueryPoolState(const VulkanStateTable& state_table); void WriteSurfaceKhrState(const VulkanStateTable& state_table); @@ -149,24 +159,34 @@ class VulkanStateWriter const std::vector& buffer_snapshot_info, graphics::VulkanResourcesUtil& resource_util); + void ProcessBufferMemoryWithAssetFile(const vulkan_wrappers::DeviceWrapper* device_wrapper, + const std::vector& buffer_snapshot_info, + graphics::VulkanResourcesUtil& resource_util); + void ProcessImageMemory(const vulkan_wrappers::DeviceWrapper* device_wrapper, const std::vector& image_snapshot_info, graphics::VulkanResourcesUtil& resource_util); + void ProcessImageMemoryWithAssetFile(const vulkan_wrappers::DeviceWrapper* device_wrapper, + const std::vector& image_snapshot_info, + graphics::VulkanResourcesUtil& resource_util); + void WriteBufferMemoryState(const VulkanStateTable& state_table, DeviceResourceTables* resources, VkDeviceSize* max_resource_size, - VkDeviceSize* max_staging_copy_size); + VkDeviceSize* max_staging_copy_size, + bool write_memory_state); void WriteImageMemoryState(const VulkanStateTable& state_table, DeviceResourceTables* resources, VkDeviceSize* max_resource_size, - VkDeviceSize* max_staging_copy_size); + VkDeviceSize* max_staging_copy_size, + bool write_memory_state); void WriteImageSubresourceLayouts(const vulkan_wrappers::ImageWrapper* image_wrapper, VkImageAspectFlags aspect_flags); - void WriteResourceMemoryState(const VulkanStateTable& state_table); + void WriteResourceMemoryState(const VulkanStateTable& state_table, bool write_memory_state); void WriteMappedMemoryState(const VulkanStateTable& state_table); @@ -234,7 +254,8 @@ class VulkanStateWriter void WriteDescriptorUpdateCommand(format::HandleId device_id, const vulkan_state_info::DescriptorInfo* binding, - VkWriteDescriptorSet* write); + VkWriteDescriptorSet* write, + util::FileOutputStream* output_stream = nullptr); void WriteQueryPoolReset(format::HandleId device_id, const std::vector& query_pool_wrappers); @@ -267,7 +288,9 @@ class VulkanStateWriter format::HandleId object_id, const util::MemoryOutputStream* create_parameters); - void WriteFunctionCall(format::ApiCallId call_id, util::MemoryOutputStream* parameter_buffer); + void WriteFunctionCall(format::ApiCallId call_id, + util::MemoryOutputStream* parameter_buffer, + util::FileOutputStream* output_stream = nullptr); void WriteFillMemoryCmd(format::HandleId memory_id, VkDeviceSize offset, VkDeviceSize size, const void* data); @@ -346,6 +369,8 @@ class VulkanStateWriter void WriteTlasToBlasDependenciesMetadata(const VulkanStateTable& state_table); + void WriteExecuteFromFile(const std::string& filename, uint32_t n_blocks, int64_t offset); + private: util::FileOutputStream* output_stream_; util::Compressor* compressor_; @@ -354,6 +379,9 @@ class VulkanStateWriter util::MemoryOutputStream parameter_stream_; ParameterEncoder encoder_; uint64_t blocks_written_; + + util::FileOutputStream* asset_file_stream_; + format::FrameAssetFileOffsets* asset_file_offsets_; }; GFXRECON_END_NAMESPACE(encode) diff --git a/framework/format/format.h b/framework/format/format.h index c5abe9f274..b40788a781 100644 --- a/framework/format/format.h +++ b/framework/format/format.h @@ -33,7 +33,9 @@ #include "util/driver_info.h" #include +#include #include +#include #define GFXRECON_FOURCC GFXRECON_MAKE_FOURCC('G', 'F', 'X', 'R') #define GFXRECON_FILE_EXTENSION ".gfxr" @@ -57,6 +59,11 @@ typedef uint32_t FormatEncodeType; typedef HandleEncodeType HandleId; typedef uint64_t ThreadId; +typedef uint64_t FrameNumber; + +typedef std::unordered_map FrameAssetFileOffsets; +// This must be an ordered map +typedef std::map AssetFileOffsets; const uint32_t kCompressedBlockTypeBit = 0x80000000; const size_t kUuidSize = 16; @@ -154,6 +161,8 @@ enum class MetaDataType : uint16_t kReserved30 = 30, kReserved31 = 31, kSetEnvironmentVariablesCommand = 32, + kExecuteBlocksFromFile = 33, + kSetBlockIndexCommand = 34 }; // MetaDataId is stored in the capture file and its type must be uint32_t to avoid breaking capture file compatibility. @@ -661,6 +670,30 @@ struct SetEnvironmentVariablesCommand // containing a list of environment variables and their values }; +struct ExecuteBlocksFromFile +{ + MetaDataHeader meta_header; + format::ThreadId thread_id; + + // Number of commands to execute from file. + // 0 means execute till the end of file. + uint32_t n_blocks; + + // The offset from the start of the file to start executing + int64_t offset; + + // Number of characters in file name + uint32_t filename_length; +}; + +struct SetBlockIndexCommand +{ + MetaDataHeader meta_header; + format::ThreadId thread_id; + + uint64_t block_index; +}; + // Restore size_t to normal behavior. #undef size_t diff --git a/framework/generated/generated_vulkan_api_call_encoders.cpp b/framework/generated/generated_vulkan_api_call_encoders.cpp index f0b5e9ec71..f82e3a64fa 100644 --- a/framework/generated/generated_vulkan_api_call_encoders.cpp +++ b/framework/generated/generated_vulkan_api_call_encoders.cpp @@ -58,6 +58,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateInstance( const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) auto api_call_lock = VulkanCaptureManager::AcquireExclusiveApiCallLock(); bool omit_output_data = false; @@ -89,6 +90,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyInstance( VkInstance instance, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -126,6 +128,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -174,6 +177,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -208,6 +212,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties( VkFormat format, VkFormatProperties* pFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -247,6 +252,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties( VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -294,6 +300,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -328,6 +335,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties( uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -362,6 +370,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -397,6 +406,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice( const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -441,6 +451,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDevice( VkDevice device, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -479,6 +490,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceQueue( uint32_t queueIndex, VkQueue* pQueue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -518,6 +530,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit( const VkSubmitInfo* pSubmits, VkFence fence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -558,6 +571,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit( VKAPI_ATTR VkResult VKAPI_CALL QueueWaitIdle( VkQueue queue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -592,6 +606,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueWaitIdle( VKAPI_ATTR VkResult VKAPI_CALL DeviceWaitIdle( VkDevice device) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -629,6 +644,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AllocateMemory( const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -674,6 +690,7 @@ VKAPI_ATTR void VKAPI_CALL FreeMemory( VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -715,6 +732,7 @@ VKAPI_ATTR VkResult VKAPI_CALL MapMemory( VkMemoryMapFlags flags, void** ppData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -761,6 +779,7 @@ VKAPI_ATTR void VKAPI_CALL UnmapMemory( VkDevice device, VkDeviceMemory memory) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -795,6 +814,7 @@ VKAPI_ATTR VkResult VKAPI_CALL FlushMappedMemoryRanges( uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -836,6 +856,7 @@ VKAPI_ATTR VkResult VKAPI_CALL InvalidateMappedMemoryRanges( uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -877,6 +898,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceMemoryCommitment( VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -913,6 +935,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory( VkDeviceMemory memory, VkDeviceSize memoryOffset) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -953,6 +976,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory( VkDeviceMemory memory, VkDeviceSize memoryOffset) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -992,6 +1016,7 @@ VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements( VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1027,6 +1052,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements( VkImage image, VkMemoryRequirements* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1063,6 +1089,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements( uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1104,6 +1131,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties( uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1145,6 +1173,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse( const VkBindSparseInfo* pBindInfo, VkFence fence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1188,6 +1217,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateFence( const VkAllocationCallbacks* pAllocator, VkFence* pFence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1238,6 +1268,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyFence( VkFence fence, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1276,6 +1307,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ResetFences( uint32_t fenceCount, const VkFence* pFences) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1313,6 +1345,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetFenceStatus( VkDevice device, VkFence fence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1352,6 +1385,7 @@ VKAPI_ATTR VkResult VKAPI_CALL WaitForFences( VkBool32 waitAll, uint64_t timeout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1393,6 +1427,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSemaphore( const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1443,6 +1478,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySemaphore( VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1482,6 +1518,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateEvent( const VkAllocationCallbacks* pAllocator, VkEvent* pEvent) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1532,6 +1569,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyEvent( VkEvent event, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1569,6 +1607,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetEventStatus( VkDevice device, VkEvent event) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1605,6 +1644,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SetEvent( VkDevice device, VkEvent event) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1641,6 +1681,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ResetEvent( VkDevice device, VkEvent event) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1679,6 +1720,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateQueryPool( const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1729,6 +1771,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyQueryPool( VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1772,6 +1815,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetQueryPoolResults( VkDeviceSize stride, VkQueryResultFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1822,6 +1866,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateBuffer( const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1867,6 +1912,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyBuffer( VkBuffer buffer, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1906,6 +1952,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateBufferView( const VkAllocationCallbacks* pAllocator, VkBufferView* pView) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1959,6 +2006,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyBufferView( VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -1998,6 +2046,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage( const VkAllocationCallbacks* pAllocator, VkImage* pImage) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2043,6 +2092,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyImage( VkImage image, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2082,6 +2132,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout( const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2119,6 +2170,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImageView( const VkAllocationCallbacks* pAllocator, VkImageView* pView) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2172,6 +2224,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyImageView( VkImageView imageView, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2211,6 +2264,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule( const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2264,6 +2318,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyShaderModule( VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2303,6 +2358,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineCache( const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2353,6 +2409,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyPipelineCache( VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2392,6 +2449,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPipelineCacheData( size_t* pDataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2438,6 +2496,7 @@ VKAPI_ATTR VkResult VKAPI_CALL MergePipelineCaches( uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2477,6 +2536,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyPipeline( VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2516,6 +2576,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout( const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2569,6 +2630,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyPipelineLayout( VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2608,6 +2670,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSampler( const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2661,6 +2724,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySampler( VkSampler sampler, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2700,6 +2764,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorSetLayout( const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2753,6 +2818,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDescriptorSetLayout( VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2792,6 +2858,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorPool( const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2842,6 +2909,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDescriptorPool( VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2880,6 +2948,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ResetDescriptorPool( VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2919,6 +2988,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets( const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -2972,6 +3042,7 @@ VKAPI_ATTR VkResult VKAPI_CALL FreeDescriptorSets( uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3016,6 +3087,7 @@ VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets( uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3058,6 +3130,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer( const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3111,6 +3184,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyFramebuffer( VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3150,6 +3224,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass( const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3200,6 +3275,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyRenderPass( VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3238,6 +3314,7 @@ VKAPI_ATTR void VKAPI_CALL GetRenderAreaGranularity( VkRenderPass renderPass, VkExtent2D* pGranularity) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3274,6 +3351,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateCommandPool( const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3324,6 +3402,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyCommandPool( VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3362,6 +3441,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ResetCommandPool( VkCommandPool commandPool, VkCommandPoolResetFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3400,6 +3480,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AllocateCommandBuffers( const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3453,6 +3534,7 @@ VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers( uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3491,6 +3573,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer( VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3529,6 +3612,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer( VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer( VkCommandBuffer commandBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3564,6 +3648,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ResetCommandBuffer( VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3601,6 +3686,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindPipeline( VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3637,6 +3723,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetViewport( uint32_t viewportCount, const VkViewport* pViewports) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3674,6 +3761,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetScissor( uint32_t scissorCount, const VkRect2D* pScissors) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3709,6 +3797,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth( VkCommandBuffer commandBuffer, float lineWidth) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3744,6 +3833,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias( float depthBiasClamp, float depthBiasSlopeFactor) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3779,6 +3869,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetBlendConstants( VkCommandBuffer commandBuffer, const float blendConstants[4]) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3813,6 +3904,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBounds( float minDepthBounds, float maxDepthBounds) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3848,6 +3940,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilCompareMask( VkStencilFaceFlags faceMask, uint32_t compareMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3883,6 +3976,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilWriteMask( VkStencilFaceFlags faceMask, uint32_t writeMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3918,6 +4012,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilReference( VkStencilFaceFlags faceMask, uint32_t reference) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3958,6 +4053,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets( uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -3999,6 +4095,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer( VkDeviceSize offset, VkIndexType indexType) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4037,6 +4134,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers( const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4076,6 +4174,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDraw( uint32_t firstVertex, uint32_t firstInstance) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4116,6 +4215,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndexed( int32_t vertexOffset, uint32_t firstInstance) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4156,6 +4256,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndirect( uint32_t drawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4195,6 +4296,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirect( uint32_t drawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4233,6 +4335,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDispatch( uint32_t groupCountY, uint32_t groupCountZ) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4269,6 +4372,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDispatchIndirect( VkBuffer buffer, VkDeviceSize offset) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4306,6 +4410,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer( uint32_t regionCount, const VkBufferCopy* pRegions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4347,6 +4452,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyImage( uint32_t regionCount, const VkImageCopy* pRegions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4391,6 +4497,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBlitImage( const VkImageBlit* pRegions, VkFilter filter) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4434,6 +4541,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage( uint32_t regionCount, const VkBufferImageCopy* pRegions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4475,6 +4583,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer( uint32_t regionCount, const VkBufferImageCopy* pRegions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4515,6 +4624,7 @@ VKAPI_ATTR void VKAPI_CALL CmdUpdateBuffer( VkDeviceSize dataSize, const void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4554,6 +4664,7 @@ VKAPI_ATTR void VKAPI_CALL CmdFillBuffer( VkDeviceSize size, uint32_t data) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4594,6 +4705,7 @@ VKAPI_ATTR void VKAPI_CALL CmdClearColorImage( uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4635,6 +4747,7 @@ VKAPI_ATTR void VKAPI_CALL CmdClearDepthStencilImage( uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4675,6 +4788,7 @@ VKAPI_ATTR void VKAPI_CALL CmdClearAttachments( uint32_t rectCount, const VkClearRect* pRects) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4716,6 +4830,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResolveImage( uint32_t regionCount, const VkImageResolve* pRegions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4755,6 +4870,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetEvent( VkEvent event, VkPipelineStageFlags stageMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4790,6 +4906,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResetEvent( VkEvent event, VkPipelineStageFlags stageMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4833,6 +4950,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWaitEvents( uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4887,6 +5005,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier( uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4934,6 +5053,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginQuery( uint32_t query, VkQueryControlFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -4970,6 +5090,7 @@ VKAPI_ATTR void VKAPI_CALL CmdEndQuery( VkQueryPool queryPool, uint32_t query) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5006,6 +5127,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResetQueryPool( uint32_t firstQuery, uint32_t queryCount) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5043,6 +5165,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteTimestamp( VkQueryPool queryPool, uint32_t query) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5084,6 +5207,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyQueryPoolResults( VkDeviceSize stride, VkQueryResultFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5127,6 +5251,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPushConstants( uint32_t size, const void* pValues) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5165,6 +5290,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass( const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5202,6 +5328,7 @@ VKAPI_ATTR void VKAPI_CALL CmdNextSubpass( VkCommandBuffer commandBuffer, VkSubpassContents contents) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5234,6 +5361,7 @@ VKAPI_ATTR void VKAPI_CALL CmdNextSubpass( VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass( VkCommandBuffer commandBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5267,6 +5395,7 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands( uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5302,6 +5431,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2( uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5343,6 +5473,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2( uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5386,6 +5517,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeatures( uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5422,6 +5554,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMask( VkCommandBuffer commandBuffer, uint32_t deviceMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5460,6 +5593,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDispatchBase( uint32_t groupCountY, uint32_t groupCountZ) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5499,6 +5633,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroups( uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5548,6 +5683,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2( const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5586,6 +5722,7 @@ VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2( const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5625,6 +5762,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2( uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5663,6 +5801,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5696,6 +5835,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5730,6 +5870,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2( VkFormat format, VkFormatProperties2* pFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5765,6 +5906,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2( const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5809,6 +5951,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2( uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5843,6 +5986,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5878,6 +6022,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2( uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5914,6 +6059,7 @@ VKAPI_ATTR void VKAPI_CALL TrimCommandPool( VkCommandPool commandPool, VkCommandPoolTrimFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5949,6 +6095,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceQueue2( const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -5987,6 +6134,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSamplerYcbcrConversion( const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6037,6 +6185,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySamplerYcbcrConversion( VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6076,6 +6225,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplate( const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6129,6 +6279,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplate( VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6167,6 +6318,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferProperties( const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6202,6 +6354,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFenceProperties( const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6237,6 +6390,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphoreProperties( const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6272,6 +6426,7 @@ VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutSupport( const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6314,6 +6469,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCount( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6357,6 +6513,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCount( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6397,6 +6554,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2( const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6447,6 +6605,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass2( const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6485,6 +6644,7 @@ VKAPI_ATTR void VKAPI_CALL CmdNextSubpass2( const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6519,6 +6679,7 @@ VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass2( VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6554,6 +6715,7 @@ VKAPI_ATTR void VKAPI_CALL ResetQueryPool( uint32_t firstQuery, uint32_t queryCount) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6590,6 +6752,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreCounterValue( VkSemaphore semaphore, uint64_t* pValue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6634,6 +6797,7 @@ VKAPI_ATTR VkResult VKAPI_CALL WaitSemaphores( const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6674,6 +6838,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SignalSemaphore( VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6713,6 +6878,7 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddress( VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6752,6 +6918,7 @@ VKAPI_ATTR uint64_t VKAPI_CALL GetBufferOpaqueCaptureAddress( VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6791,6 +6958,7 @@ VKAPI_ATTR uint64_t VKAPI_CALL GetDeviceMemoryOpaqueCaptureAddress( VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6831,6 +6999,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceToolProperties( uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6876,6 +7045,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreatePrivateDataSlot( const VkAllocationCallbacks* pAllocator, VkPrivateDataSlot* pPrivateDataSlot) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6926,6 +7096,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyPrivateDataSlot( VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -6966,6 +7137,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SetPrivateData( VkPrivateDataSlot privateDataSlot, uint64_t data) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7008,6 +7180,7 @@ VKAPI_ATTR void VKAPI_CALL GetPrivateData( VkPrivateDataSlot privateDataSlot, uint64_t* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7045,6 +7218,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetEvent2( VkEvent event, const VkDependencyInfo* pDependencyInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7083,6 +7257,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResetEvent2( VkEvent event, VkPipelineStageFlags2 stageMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7119,6 +7294,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWaitEvents2( const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7157,6 +7333,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier2( VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7195,6 +7372,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteTimestamp2( VkQueryPool queryPool, uint32_t query) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7232,6 +7410,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit2( const VkSubmitInfo2* pSubmits, VkFence fence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7273,6 +7452,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer2( VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7309,6 +7489,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyImage2( VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7345,6 +7526,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage2( VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7381,6 +7563,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer2( VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7417,6 +7600,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBlitImage2( VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7453,6 +7637,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResolveImage2( VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7489,6 +7674,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRendering( VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7524,6 +7710,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRendering( VKAPI_ATTR void VKAPI_CALL CmdEndRendering( VkCommandBuffer commandBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7556,6 +7743,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCullMode( VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7589,6 +7777,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetFrontFace( VkCommandBuffer commandBuffer, VkFrontFace frontFace) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7622,6 +7811,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetPrimitiveTopology( VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7656,6 +7846,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetViewportWithCount( uint32_t viewportCount, const VkViewport* pViewports) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7691,6 +7882,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetScissorWithCount( uint32_t scissorCount, const VkRect2D* pScissors) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7730,6 +7922,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers2( const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7768,6 +7961,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthTestEnable( VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7801,6 +7995,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthWriteEnable( VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7834,6 +8029,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthCompareOp( VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7867,6 +8063,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBoundsTestEnable( VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7900,6 +8097,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilTestEnable( VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7937,6 +8135,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilOp( VkStencilOp depthFailOp, VkCompareOp compareOp) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -7974,6 +8173,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRasterizerDiscardEnable( VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8007,6 +8207,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBiasEnable( VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8040,6 +8241,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetPrimitiveRestartEnable( VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8074,6 +8276,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceBufferMemoryRequirements( const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8109,6 +8312,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceImageMemoryRequirements( const VkDeviceImageMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8148,6 +8352,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceImageSparseMemoryRequirements( uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8187,6 +8392,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR( VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8226,6 +8432,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR( VkSurfaceKHR surface, VkBool32* pSupported) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8271,6 +8478,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilitiesKHR( VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8316,6 +8524,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR( uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8362,6 +8571,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR( uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8408,6 +8618,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR( const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8461,6 +8672,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR( VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8500,6 +8712,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR( uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8553,6 +8766,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR( VkFence fence, uint32_t* pImageIndex) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8599,6 +8813,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR( VkQueue queue, const VkPresentInfoKHR* pPresentInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto api_call_lock = VulkanCaptureManager::AcquireExclusiveApiCallLock(); @@ -8628,6 +8843,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupPresentCapabilitiesKHR( VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8671,6 +8887,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHR( VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8716,6 +8933,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDevicePresentRectanglesKHR( uint32_t* pRectCount, VkRect2D* pRects) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8761,6 +8979,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHR( const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8808,6 +9027,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPropertiesKHR( uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8857,6 +9077,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlanePropertiesKHR( uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8907,6 +9128,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneSupportedDisplaysKHR( uint32_t* pDisplayCount, VkDisplayKHR* pDisplays) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -8958,6 +9180,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModePropertiesKHR( uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9010,6 +9233,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayModeKHR( const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9062,6 +9286,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilitiesKHR( uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9108,6 +9333,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9163,6 +9389,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSharedSwapchainsKHR( const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9218,6 +9445,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateXlibSurfaceKHR( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9269,6 +9497,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXlibPresentationSupportKHR( Display* dpy, VisualID visualID) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9309,6 +9538,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateXcbSurfaceKHR( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9360,6 +9590,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXcbPresentationSupportKHR( xcb_connection_t* connection, xcb_visualid_t visual_id) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9400,6 +9631,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateWaylandSurfaceKHR( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9450,6 +9682,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display* display) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9489,6 +9722,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateAndroidSurfaceKHR( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9540,6 +9774,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateWin32SurfaceKHR( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9589,6 +9824,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9626,6 +9862,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoCapabilitiesKHR( const VkVideoProfileInfoKHR* pVideoProfile, VkVideoCapabilitiesKHR* pCapabilities) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9671,6 +9908,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoFormatPropertiesKHR( uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9717,6 +9955,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateVideoSessionKHR( const VkAllocationCallbacks* pAllocator, VkVideoSessionKHR* pVideoSession) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9767,6 +10006,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyVideoSessionKHR( VkVideoSessionKHR videoSession, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9806,6 +10046,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetVideoSessionMemoryRequirementsKHR( uint32_t* pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9852,6 +10093,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindVideoSessionMemoryKHR( uint32_t bindSessionMemoryInfoCount, const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9895,6 +10137,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateVideoSessionParametersKHR( const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9948,6 +10191,7 @@ VKAPI_ATTR VkResult VKAPI_CALL UpdateVideoSessionParametersKHR( VkVideoSessionParametersKHR videoSessionParameters, const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -9986,6 +10230,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyVideoSessionParametersKHR( VkVideoSessionParametersKHR videoSessionParameters, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10023,6 +10268,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginVideoCodingKHR( VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR* pBeginInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10059,6 +10305,7 @@ VKAPI_ATTR void VKAPI_CALL CmdEndVideoCodingKHR( VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR* pEndCodingInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10092,6 +10339,7 @@ VKAPI_ATTR void VKAPI_CALL CmdControlVideoCodingKHR( VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR* pCodingControlInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10125,6 +10373,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDecodeVideoKHR( VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pDecodeInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10161,6 +10410,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderingKHR( VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10196,6 +10446,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderingKHR( VKAPI_ATTR void VKAPI_CALL CmdEndRenderingKHR( VkCommandBuffer commandBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10228,6 +10479,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10261,6 +10513,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10295,6 +10548,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR( VkFormat format, VkFormatProperties2* pFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10330,6 +10584,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR( const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10374,6 +10629,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR( uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10408,6 +10664,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10443,6 +10700,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10481,6 +10739,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHR( uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10517,6 +10776,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHR( VkCommandBuffer commandBuffer, uint32_t deviceMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10555,6 +10815,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHR( uint32_t groupCountY, uint32_t groupCountZ) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10594,6 +10855,7 @@ VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR( VkCommandPool commandPool, VkCommandPoolTrimFlags flags) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10629,6 +10891,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHR( uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10678,6 +10941,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHR( const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10713,6 +10977,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHR( const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10761,6 +11026,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHR( HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10806,6 +11072,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHR( const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10854,6 +11121,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHR( int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10899,6 +11167,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHR( const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10933,6 +11202,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreWin32HandleKHR( VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -10973,6 +11243,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHR( const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11019,6 +11290,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHR( VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11059,6 +11331,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHR( const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11109,6 +11382,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR( uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11151,6 +11425,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR( const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11204,6 +11479,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR( VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11243,6 +11519,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2KHR( const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11293,6 +11570,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass2KHR( const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11331,6 +11609,7 @@ VKAPI_ATTR void VKAPI_CALL CmdNextSubpass2KHR( const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11365,6 +11644,7 @@ VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass2KHR( VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11398,6 +11678,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainStatusKHR( VkDevice device, VkSwapchainKHR swapchain) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11435,6 +11716,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFencePropertiesKHR( const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11469,6 +11751,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ImportFenceWin32HandleKHR( VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11509,6 +11792,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetFenceWin32HandleKHR( const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11555,6 +11839,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ImportFenceFdKHR( VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11595,6 +11880,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetFenceFdKHR( const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11644,6 +11930,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceQueueFamilyPerformanceQuer VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11690,6 +11977,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11724,6 +12012,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireProfilingLockKHR( VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11759,6 +12048,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireProfilingLockKHR( VKAPI_ATTR void VKAPI_CALL ReleaseProfilingLockKHR( VkDevice device) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11792,6 +12082,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR( const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11840,6 +12131,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR( uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11888,6 +12180,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayProperties2KHR( uint32_t* pPropertyCount, VkDisplayProperties2KHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11937,6 +12230,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlaneProperties2KHR( uint32_t* pPropertyCount, VkDisplayPlaneProperties2KHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -11987,6 +12281,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModeProperties2KHR( uint32_t* pPropertyCount, VkDisplayModeProperties2KHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12037,6 +12332,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilities2KHR( const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12084,6 +12380,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2KHR( const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12122,6 +12419,7 @@ VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2KHR( const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12161,6 +12459,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2KHR( uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12201,6 +12500,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSamplerYcbcrConversionKHR( const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12251,6 +12551,7 @@ VKAPI_ATTR void VKAPI_CALL DestroySamplerYcbcrConversionKHR( VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12289,6 +12590,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHR( uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12330,6 +12632,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHR( uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12371,6 +12674,7 @@ VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutSupportKHR( const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12413,6 +12717,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountKHR( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12456,6 +12761,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountKHR( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12495,6 +12801,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreCounterValueKHR( VkSemaphore semaphore, uint64_t* pValue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12539,6 +12846,7 @@ VKAPI_ATTR VkResult VKAPI_CALL WaitSemaphoresKHR( const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12579,6 +12887,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SignalSemaphoreKHR( VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12619,6 +12928,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceFragmentShadingRatesKHR( uint32_t* pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12663,6 +12973,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetFragmentShadingRateKHR( const VkExtent2D* pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12697,6 +13008,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRenderingAttachmentLocationsKHR( VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfoKHR* pLocationInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12730,6 +13042,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRenderingInputAttachmentIndicesKHR( VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfoKHR* pInputAttachmentIndexInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12765,6 +13078,7 @@ VKAPI_ATTR VkResult VKAPI_CALL WaitForPresentKHR( uint64_t presentId, uint64_t timeout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12803,6 +13117,7 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressKHR( VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12842,6 +13157,7 @@ VKAPI_ATTR uint64_t VKAPI_CALL GetBufferOpaqueCaptureAddressKHR( VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12881,6 +13197,7 @@ VKAPI_ATTR uint64_t VKAPI_CALL GetDeviceMemoryOpaqueCaptureAddressKHR( VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12921,6 +13238,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDeferredOperationKHR( const VkAllocationCallbacks* pAllocator, VkDeferredOperationKHR* pDeferredOperation) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -12970,6 +13288,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDeferredOperationKHR( VkDeferredOperationKHR operation, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13007,6 +13326,7 @@ VKAPI_ATTR uint32_t VKAPI_CALL GetDeferredOperationMaxConcurrencyKHR( VkDevice device, VkDeferredOperationKHR operation) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13043,6 +13363,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDeferredOperationResultKHR( VkDevice device, VkDeferredOperationKHR operation) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13079,6 +13400,7 @@ VKAPI_ATTR VkResult VKAPI_CALL DeferredOperationJoinKHR( VkDevice device, VkDeferredOperationKHR operation) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13117,6 +13439,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutablePropertiesKHR( uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13166,6 +13489,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableStatisticsKHR( uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13215,6 +13539,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableInternalRepresentationsKHR( uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13263,6 +13588,7 @@ VKAPI_ATTR VkResult VKAPI_CALL MapMemory2KHR( const VkMemoryMapInfoKHR* pMemoryMapInfo, void** ppData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13309,6 +13635,7 @@ VKAPI_ATTR VkResult VKAPI_CALL UnmapMemory2KHR( VkDevice device, const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13349,6 +13676,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceVideoEncodeQualityLevelPropertie const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13395,6 +13723,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetEncodedVideoSessionParametersKHR( size_t* pDataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13443,6 +13772,7 @@ VKAPI_ATTR void VKAPI_CALL CmdEncodeVideoKHR( VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13480,6 +13810,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetEvent2KHR( VkEvent event, const VkDependencyInfo* pDependencyInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13518,6 +13849,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResetEvent2KHR( VkEvent event, VkPipelineStageFlags2 stageMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13554,6 +13886,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWaitEvents2KHR( const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13592,6 +13925,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier2KHR( VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13630,6 +13964,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteTimestamp2KHR( VkQueryPool queryPool, uint32_t query) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13667,6 +14002,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit2KHR( const VkSubmitInfo2* pSubmits, VkFence fence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13711,6 +14047,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarker2AMD( VkDeviceSize dstOffset, uint32_t marker) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13748,6 +14085,7 @@ VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointData2NV( uint32_t* pCheckpointDataCount, VkCheckpointData2NV* pCheckpointData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13782,6 +14120,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer2KHR( VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13818,6 +14157,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyImage2KHR( VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13854,6 +14194,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage2KHR( VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13890,6 +14231,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer2KHR( VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13926,6 +14268,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBlitImage2KHR( VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13962,6 +14305,7 @@ VKAPI_ATTR void VKAPI_CALL CmdResolveImage2KHR( VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -13998,6 +14342,7 @@ VKAPI_ATTR void VKAPI_CALL CmdTraceRaysIndirect2KHR( VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14032,6 +14377,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceBufferMemoryRequirementsKHR( const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14067,6 +14413,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceImageMemoryRequirementsKHR( const VkDeviceImageMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14106,6 +14453,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceImageSparseMemoryRequirementsKHR( uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14147,6 +14495,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer2KHR( VkDeviceSize size, VkIndexType indexType) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14184,6 +14533,7 @@ VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularityKHR( const VkRenderingAreaInfoKHR* pRenderingAreaInfo, VkExtent2D* pGranularity) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14219,6 +14569,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayoutKHR( const VkDeviceImageSubresourceInfoKHR* pInfo, VkSubresourceLayout2KHR* pLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14258,6 +14609,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2KHR( const VkImageSubresource2KHR* pSubresource, VkSubresourceLayout2KHR* pLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14294,6 +14646,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixPropertiesKHR( uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesKHR* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14338,6 +14691,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleKHR( uint32_t lineStippleFactor, uint16_t lineStipplePattern) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14373,6 +14727,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsKHR( uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14419,6 +14774,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsKHR( uint64_t* pTimestamps, uint64_t* pMaxDeviation) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14464,6 +14820,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets2KHR( VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14500,6 +14857,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPushConstants2KHR( VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14536,6 +14894,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet2KHR( VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14572,6 +14931,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDescriptorBufferOffsets2EXT( VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14608,6 +14968,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorBufferEmbeddedSamplers2EXT( VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14645,6 +15006,7 @@ VKAPI_ATTR void VKAPI_CALL FrameBoundaryANDROID( VkSemaphore semaphore, VkImage image) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14681,6 +15043,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT( const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14731,6 +15094,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDebugReportCallbackEXT( VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14774,6 +15138,7 @@ VKAPI_ATTR void VKAPI_CALL DebugReportMessageEXT( const char* pLayerPrefix, const char* pMessage) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14813,6 +15178,7 @@ VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT( VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14852,6 +15218,7 @@ VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT( VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14891,6 +15258,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14923,6 +15291,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT( VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerEndEXT( VkCommandBuffer commandBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14955,6 +15324,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -14992,6 +15362,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindTransformFeedbackBuffersEXT( const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15032,6 +15403,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginTransformFeedbackEXT( const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15071,6 +15443,7 @@ VKAPI_ATTR void VKAPI_CALL CmdEndTransformFeedbackEXT( const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15110,6 +15483,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginQueryIndexedEXT( VkQueryControlFlags flags, uint32_t index) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15148,6 +15522,7 @@ VKAPI_ATTR void VKAPI_CALL CmdEndQueryIndexedEXT( uint32_t query, uint32_t index) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15188,6 +15563,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectByteCountEXT( uint32_t counterOffset, uint32_t vertexStride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15226,6 +15602,7 @@ VKAPI_ATTR uint32_t VKAPI_CALL GetImageViewHandleNVX( VkDevice device, const VkImageViewHandleInfoNVX* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15266,6 +15643,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetImageViewAddressNVX( VkImageView imageView, VkImageViewAddressPropertiesNVX* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15314,6 +15692,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15357,6 +15736,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15399,6 +15779,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetShaderInfoAMD( size_t* pInfoSize, void* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15447,6 +15828,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateStreamDescriptorSurfaceGGP( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15502,6 +15884,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15552,6 +15935,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV( VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15598,6 +15982,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateViSurfaceNN( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15647,6 +16032,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginConditionalRenderingEXT( VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15682,6 +16068,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginConditionalRenderingEXT( VKAPI_ATTR void VKAPI_CALL CmdEndConditionalRenderingEXT( VkCommandBuffer commandBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15716,6 +16103,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV( uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15751,6 +16139,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT( VkPhysicalDevice physicalDevice, VkDisplayKHR display) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15788,6 +16177,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT( Display* dpy, VkDisplayKHR display) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15827,6 +16217,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT( RROutput rrOutput, VkDisplayKHR* pDisplay) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15877,6 +16268,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT( VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15921,6 +16313,7 @@ VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT( VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -15960,6 +16353,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT( const VkAllocationCallbacks* pAllocator, VkFence* pFence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16012,6 +16406,7 @@ VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT( const VkAllocationCallbacks* pAllocator, VkFence* pFence) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16064,6 +16459,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT( VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16109,6 +16505,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRefreshCycleDurationGOOGLE( VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16154,6 +16551,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPastPresentationTimingGOOGLE( uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16200,6 +16598,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT( uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16235,6 +16634,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEnableEXT( VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16268,6 +16668,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleModeEXT( VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16303,6 +16704,7 @@ VKAPI_ATTR void VKAPI_CALL SetHdrMetadataEXT( const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16340,6 +16742,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateIOSSurfaceMVK( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16391,6 +16794,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateMacOSSurfaceMVK( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16440,6 +16844,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectNameEXT( VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16481,6 +16886,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectTagEXT( VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16522,6 +16928,7 @@ VKAPI_ATTR void VKAPI_CALL QueueBeginDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16554,6 +16961,7 @@ VKAPI_ATTR void VKAPI_CALL QueueBeginDebugUtilsLabelEXT( VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT( VkQueue queue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16586,6 +16994,7 @@ VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16619,6 +17028,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16651,6 +17061,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT( VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT( VkCommandBuffer commandBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16683,6 +17094,7 @@ VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16718,6 +17130,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDebugUtilsMessengerEXT( const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16768,6 +17181,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyDebugUtilsMessengerEXT( VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16807,6 +17221,7 @@ VKAPI_ATTR void VKAPI_CALL SubmitDebugUtilsMessageEXT( VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16843,6 +17258,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16887,6 +17303,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryAndroidHardwareBufferANDROID( const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16933,6 +17350,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetSampleLocationsEXT( VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -16967,6 +17385,7 @@ VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMultisamplePropertiesEXT( VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17002,6 +17421,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetImageDrmFormatModifierPropertiesEXT( VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17047,6 +17467,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateValidationCacheEXT( const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17097,6 +17518,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyValidationCacheEXT( VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17136,6 +17558,7 @@ VKAPI_ATTR VkResult VKAPI_CALL MergeValidationCachesEXT( uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17176,6 +17599,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetValidationCacheDataEXT( size_t* pDataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17221,6 +17645,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindShadingRateImageNV( VkImageView imageView, VkImageLayout imageLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17257,6 +17682,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetViewportShadingRatePaletteNV( uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17294,6 +17720,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCoarseSampleOrderNV( uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17331,6 +17758,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureNV( const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17384,6 +17812,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyAccelerationStructureNV( VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17422,6 +17851,7 @@ VKAPI_ATTR void VKAPI_CALL GetAccelerationStructureMemoryRequirementsNV( const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17460,6 +17890,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindAccelerationStructureMemoryNV( uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17507,6 +17938,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructureNV( VkBuffer scratch, VkDeviceSize scratchOffset) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17552,6 +17984,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureNV( VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17600,6 +18033,7 @@ VKAPI_ATTR void VKAPI_CALL CmdTraceRaysNV( uint32_t height, uint32_t depth) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17650,6 +18084,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesKHR( size_t dataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17700,6 +18135,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesNV( size_t dataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17748,6 +18184,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetAccelerationStructureHandleNV( size_t dataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17796,6 +18233,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteAccelerationStructuresPropertiesNV( VkQueryPool queryPool, uint32_t firstQuery) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17834,6 +18272,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CompileDeferredNV( VkPipeline pipeline, uint32_t shader) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17873,6 +18312,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryHostPointerPropertiesEXT( const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17920,6 +18360,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarkerAMD( VkDeviceSize dstOffset, uint32_t marker) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -17957,6 +18398,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsEXT( uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18003,6 +18445,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsEXT( uint64_t* pTimestamps, uint64_t* pMaxDeviation) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18049,6 +18492,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksNV( uint32_t taskCount, uint32_t firstTask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18086,6 +18530,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectNV( uint32_t drawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18127,6 +18572,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectCountNV( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18167,6 +18613,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetExclusiveScissorEnableNV( uint32_t exclusiveScissorCount, const VkBool32* pExclusiveScissorEnables) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18204,6 +18651,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetExclusiveScissorNV( uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18239,6 +18687,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCheckpointNV( VkCommandBuffer commandBuffer, const void* pCheckpointMarker) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18273,6 +18722,7 @@ VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointDataNV( uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18307,6 +18757,7 @@ VKAPI_ATTR VkResult VKAPI_CALL InitializePerformanceApiINTEL( VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18342,6 +18793,7 @@ VKAPI_ATTR VkResult VKAPI_CALL InitializePerformanceApiINTEL( VKAPI_ATTR void VKAPI_CALL UninitializePerformanceApiINTEL( VkDevice device) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18374,6 +18826,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceMarkerINTEL( VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18410,6 +18863,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceStreamMarkerINTEL( VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18446,6 +18900,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceOverrideINTEL( VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18483,6 +18938,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquirePerformanceConfigurationINTEL( const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18531,6 +18987,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ReleasePerformanceConfigurationINTEL( VkDevice device, VkPerformanceConfigurationINTEL configuration) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18570,6 +19027,7 @@ VKAPI_ATTR VkResult VKAPI_CALL QueueSetPerformanceConfigurationINTEL( VkQueue queue, VkPerformanceConfigurationINTEL configuration) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18607,6 +19065,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPerformanceParameterINTEL( VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18651,6 +19110,7 @@ VKAPI_ATTR void VKAPI_CALL SetLocalDimmingAMD( VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18687,6 +19147,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImagePipeSurfaceFUCHSIA( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18738,6 +19199,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateMetalSurfaceEXT( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18787,6 +19249,7 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressEXT( VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18827,6 +19290,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceToolPropertiesEXT( uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18871,6 +19335,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixPropertiesNV( uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18915,6 +19380,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSupportedFramebufferMixedSamples uint32_t* pCombinationCount, VkFramebufferMixedSamplesCombinationNV* pCombinations) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -18960,6 +19426,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModes2EXT( uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19007,6 +19474,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireFullScreenExclusiveModeEXT( VkDevice device, VkSwapchainKHR swapchain) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19043,6 +19511,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ReleaseFullScreenExclusiveModeEXT( VkDevice device, VkSwapchainKHR swapchain) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19080,6 +19549,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModes2EXT( const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19128,6 +19598,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateHeadlessSurfaceEXT( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19178,6 +19649,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleEXT( uint32_t lineStippleFactor, uint16_t lineStipplePattern) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19214,6 +19686,7 @@ VKAPI_ATTR void VKAPI_CALL ResetQueryPoolEXT( uint32_t firstQuery, uint32_t queryCount) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19249,6 +19722,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCullModeEXT( VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19282,6 +19756,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetFrontFaceEXT( VkCommandBuffer commandBuffer, VkFrontFace frontFace) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19315,6 +19790,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetPrimitiveTopologyEXT( VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19349,6 +19825,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetViewportWithCountEXT( uint32_t viewportCount, const VkViewport* pViewports) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19384,6 +19861,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetScissorWithCountEXT( uint32_t scissorCount, const VkRect2D* pScissors) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19423,6 +19901,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers2EXT( const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19461,6 +19940,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19494,6 +19974,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthWriteEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19527,6 +20008,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthCompareOpEXT( VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19560,6 +20042,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBoundsTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19593,6 +20076,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19630,6 +20114,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( VkStencilOp depthFailOp, VkCompareOp compareOp) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19667,6 +20152,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImageEXT( VkDevice device, const VkCopyMemoryToImageInfoEXT* pCopyMemoryToImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19706,6 +20192,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemoryEXT( VkDevice device, const VkCopyImageToMemoryInfoEXT* pCopyImageToMemoryInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19745,6 +20232,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImageEXT( VkDevice device, const VkCopyImageToImageInfoEXT* pCopyImageToImageInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19785,6 +20273,7 @@ VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayoutEXT( uint32_t transitionCount, const VkHostImageLayoutTransitionInfoEXT* pTransitions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19827,6 +20316,7 @@ VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2EXT( const VkImageSubresource2KHR* pSubresource, VkSubresourceLayout2KHR* pLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19862,6 +20352,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ReleaseSwapchainImagesEXT( VkDevice device, const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19902,6 +20393,7 @@ VKAPI_ATTR void VKAPI_CALL GetGeneratedCommandsMemoryRequirementsNV( const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19939,6 +20431,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPreprocessGeneratedCommandsNV( VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -19976,6 +20469,7 @@ VKAPI_ATTR void VKAPI_CALL CmdExecuteGeneratedCommandsNV( VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20015,6 +20509,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindPipelineShaderGroupNV( VkPipeline pipeline, uint32_t groupIndex) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20052,6 +20547,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNV( const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20105,6 +20601,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNV( VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20142,6 +20639,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias2EXT( VkCommandBuffer commandBuffer, const VkDepthBiasInfoEXT* pDepthBiasInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20176,6 +20674,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireDrmDisplayEXT( int32_t drmFd, VkDisplayKHR display) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20215,6 +20714,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDrmDisplayEXT( uint32_t connectorId, VkDisplayKHR* display) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20266,6 +20766,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreatePrivateDataSlotEXT( const VkAllocationCallbacks* pAllocator, VkPrivateDataSlot* pPrivateDataSlot) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20316,6 +20817,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyPrivateDataSlotEXT( VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20356,6 +20858,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SetPrivateDataEXT( VkPrivateDataSlot privateDataSlot, uint64_t data) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20398,6 +20901,7 @@ VKAPI_ATTR void VKAPI_CALL GetPrivateDataEXT( VkPrivateDataSlot privateDataSlot, uint64_t* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20435,6 +20939,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetFragmentShadingRateEnumNV( VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20470,6 +20975,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDeviceFaultInfoEXT( VkDeviceFaultCountsEXT* pFaultCounts, VkDeviceFaultInfoEXT* pFaultInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20513,6 +21019,7 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireWinrtDisplayNV( VkPhysicalDevice physicalDevice, VkDisplayKHR display) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20550,6 +21057,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetWinrtDisplayNV( uint32_t deviceRelativeId, VkDisplayKHR* pDisplay) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20600,6 +21108,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDirectFBSurfaceEXT( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20650,6 +21159,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceDirectFBPresentationSupportEXT( uint32_t queueFamilyIndex, IDirectFB* dfb) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20690,6 +21200,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetVertexInputEXT( uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20727,6 +21238,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryZirconHandleFUCHSIA( const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20775,6 +21287,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryZirconHandlePropertiesFUCHSIA( zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20819,6 +21332,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreZirconHandleFUCHSIA( VkDevice device, const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20859,6 +21373,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreZirconHandleFUCHSIA( const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20906,6 +21421,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindInvocationMaskHUAWEI( VkImageView imageView, VkImageLayout imageLayout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20941,6 +21457,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryRemoteAddressNV( const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo, VkRemoteAddressNV* pAddress) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -20987,6 +21504,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetPatchControlPointsEXT( VkCommandBuffer commandBuffer, uint32_t patchControlPoints) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21020,6 +21538,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRasterizerDiscardEnableEXT( VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21053,6 +21572,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthBiasEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21086,6 +21606,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLogicOpEXT( VkCommandBuffer commandBuffer, VkLogicOp logicOp) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21119,6 +21640,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetPrimitiveRestartEnableEXT( VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21154,6 +21676,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateScreenSurfaceQNX( const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21204,6 +21727,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceScreenPresentationSupportQNX( uint32_t queueFamilyIndex, struct _screen_window* window) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21242,6 +21766,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetColorWriteEn uint32_t attachmentCount, const VkBool32* pColorWriteEnables) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21280,6 +21805,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMultiEXT( uint32_t firstInstance, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21322,6 +21848,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMultiIndexedEXT( uint32_t stride, const int32_t* pVertexOffset) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21362,6 +21889,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateMicromapEXT( const VkAllocationCallbacks* pAllocator, VkMicromapEXT* pMicromap) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21415,6 +21943,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyMicromapEXT( VkMicromapEXT micromap, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21453,6 +21982,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBuildMicromapsEXT( uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21492,6 +22022,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BuildMicromapsEXT( uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21534,6 +22065,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyMicromapEXT( VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21575,6 +22107,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyMicromapToMemoryEXT( VkDeferredOperationKHR deferredOperation, const VkCopyMicromapToMemoryInfoEXT* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21616,6 +22149,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToMicromapEXT( VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToMicromapInfoEXT* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21661,6 +22195,7 @@ VKAPI_ATTR VkResult VKAPI_CALL WriteMicromapsPropertiesEXT( void* pData, size_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21708,6 +22243,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyMicromapEXT( VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21744,6 +22280,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyMicromapToMemoryEXT( VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21780,6 +22317,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyMemoryToMicromapEXT( VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21820,6 +22358,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteMicromapsPropertiesEXT( VkQueryPool queryPool, uint32_t firstQuery) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21858,6 +22397,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceMicromapCompatibilityEXT( const VkMicromapVersionInfoEXT* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21894,6 +22434,7 @@ VKAPI_ATTR void VKAPI_CALL GetMicromapBuildSizesEXT( const VkMicromapBuildInfoEXT* pBuildInfo, VkMicromapBuildSizesInfoEXT* pSizeInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21934,6 +22475,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawClusterHUAWEI( uint32_t groupCountY, uint32_t groupCountZ) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -21970,6 +22512,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawClusterIndirectHUAWEI( VkBuffer buffer, VkDeviceSize offset) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22005,6 +22548,7 @@ VKAPI_ATTR void VKAPI_CALL SetDeviceMemoryPriorityEXT( VkDeviceMemory memory, float priority) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22040,6 +22584,7 @@ VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutHostMappingInfoVALVE( const VkDescriptorSetBindingReferenceVALVE* pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22078,6 +22623,7 @@ VKAPI_ATTR void VKAPI_CALL GetDescriptorSetHostMappingVALVE( VkDescriptorSet descriptorSet, void** ppData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22113,6 +22659,7 @@ VKAPI_ATTR void VKAPI_CALL GetPipelineIndirectMemoryRequirementsNV( const VkComputePipelineCreateInfo* pCreateInfo, VkMemoryRequirements2* pMemoryRequirements) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22151,6 +22698,7 @@ VKAPI_ATTR void VKAPI_CALL CmdUpdatePipelineIndirectBufferNV( VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22185,6 +22733,7 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetPipelineIndirectDeviceAddressNV( VkDevice device, const VkPipelineIndirectDeviceAddressInfoNV* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22224,6 +22773,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthClampEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthClampEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22257,6 +22807,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetPolygonModeEXT( VkCommandBuffer commandBuffer, VkPolygonMode polygonMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22290,6 +22841,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRasterizationSamplesEXT( VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22324,6 +22876,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetSampleMaskEXT( VkSampleCountFlagBits samples, const VkSampleMask* pSampleMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22358,6 +22911,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetAlphaToCoverageEnableEXT( VkCommandBuffer commandBuffer, VkBool32 alphaToCoverageEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22391,6 +22945,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetAlphaToOneEnableEXT( VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22424,6 +22979,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLogicOpEnableEXT( VkCommandBuffer commandBuffer, VkBool32 logicOpEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22459,6 +23015,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetColorBlendEnableEXT( uint32_t attachmentCount, const VkBool32* pColorBlendEnables) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22496,6 +23053,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetColorBlendEquationEXT( uint32_t attachmentCount, const VkColorBlendEquationEXT* pColorBlendEquations) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22533,6 +23091,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetColorWriteMaskEXT( uint32_t attachmentCount, const VkColorComponentFlags* pColorWriteMasks) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22568,6 +23127,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetTessellationDomainOriginEXT( VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22601,6 +23161,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRasterizationStreamEXT( VkCommandBuffer commandBuffer, uint32_t rasterizationStream) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22634,6 +23195,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetConservativeRasterizationModeEXT( VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22667,6 +23229,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetExtraPrimitiveOverestimationSizeEXT( VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22700,6 +23263,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthClipEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthClipEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22733,6 +23297,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetSampleLocationsEnableEXT( VkCommandBuffer commandBuffer, VkBool32 sampleLocationsEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22768,6 +23333,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetColorBlendAdvancedEXT( uint32_t attachmentCount, const VkColorBlendAdvancedEXT* pColorBlendAdvanced) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22803,6 +23369,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetProvokingVertexModeEXT( VkCommandBuffer commandBuffer, VkProvokingVertexModeEXT provokingVertexMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22836,6 +23403,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLineRasterizationModeEXT( VkCommandBuffer commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22869,6 +23437,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleEnableEXT( VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22902,6 +23471,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetDepthClipNegativeOneToOneEXT( VkCommandBuffer commandBuffer, VkBool32 negativeOneToOne) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22935,6 +23505,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingEnableNV( VkCommandBuffer commandBuffer, VkBool32 viewportWScalingEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -22970,6 +23541,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetViewportSwizzleNV( uint32_t viewportCount, const VkViewportSwizzleNV* pViewportSwizzles) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23005,6 +23577,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCoverageToColorEnableNV( VkCommandBuffer commandBuffer, VkBool32 coverageToColorEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23038,6 +23611,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCoverageToColorLocationNV( VkCommandBuffer commandBuffer, uint32_t coverageToColorLocation) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23071,6 +23645,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCoverageModulationModeNV( VkCommandBuffer commandBuffer, VkCoverageModulationModeNV coverageModulationMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23104,6 +23679,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCoverageModulationTableEnableNV( VkCommandBuffer commandBuffer, VkBool32 coverageModulationTableEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23138,6 +23714,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCoverageModulationTableNV( uint32_t coverageModulationTableCount, const float* pCoverageModulationTable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23172,6 +23749,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetShadingRateImageEnableNV( VkCommandBuffer commandBuffer, VkBool32 shadingRateImageEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23205,6 +23783,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRepresentativeFragmentTestEnableNV( VkCommandBuffer commandBuffer, VkBool32 representativeFragmentTestEnable) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23238,6 +23817,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetCoverageReductionModeNV( VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23272,6 +23852,7 @@ VKAPI_ATTR void VKAPI_CALL GetShaderModuleIdentifierEXT( VkShaderModule shaderModule, VkShaderModuleIdentifierEXT* pIdentifier) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23307,6 +23888,7 @@ VKAPI_ATTR void VKAPI_CALL GetShaderModuleCreateInfoIdentifierEXT( const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModuleIdentifierEXT* pIdentifier) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23346,6 +23928,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceOpticalFlowImageFormatsNV( uint32_t* pFormatCount, VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23392,6 +23975,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateOpticalFlowSessionNV( const VkAllocationCallbacks* pAllocator, VkOpticalFlowSessionNV* pSession) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23442,6 +24026,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyOpticalFlowSessionNV( VkOpticalFlowSessionNV session, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23482,6 +24067,7 @@ VKAPI_ATTR VkResult VKAPI_CALL BindOpticalFlowSessionImageNV( VkImageView view, VkImageLayout layout) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23522,6 +24108,7 @@ VKAPI_ATTR void VKAPI_CALL CmdOpticalFlowExecuteNV( VkOpticalFlowSessionNV session, const VkOpticalFlowExecuteInfoNV* pExecuteInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23559,6 +24146,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateShadersEXT( const VkAllocationCallbacks* pAllocator, VkShaderEXT* pShaders) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23613,6 +24201,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyShaderEXT( VkShaderEXT shader, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23652,6 +24241,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetShaderBinaryDataEXT( size_t* pDataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23698,6 +24288,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindShadersEXT( const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23735,6 +24326,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetFramebufferTilePropertiesQCOM( uint32_t* pPropertiesCount, VkTilePropertiesQCOM* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23780,6 +24372,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetDynamicRenderingTilePropertiesQCOM( const VkRenderingInfo* pRenderingInfo, VkTilePropertiesQCOM* pProperties) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23827,6 +24420,7 @@ VKAPI_ATTR VkResult VKAPI_CALL SetLatencySleepModeNV( VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV* pSleepModeInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23865,6 +24459,7 @@ VKAPI_ATTR VkResult VKAPI_CALL LatencySleepNV( VkSwapchainKHR swapchain, const VkLatencySleepInfoNV* pSleepInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23906,6 +24501,7 @@ VKAPI_ATTR void VKAPI_CALL SetLatencyMarkerNV( VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23941,6 +24537,7 @@ VKAPI_ATTR void VKAPI_CALL GetLatencyTimingsNV( VkSwapchainKHR swapchain, VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -23975,6 +24572,7 @@ VKAPI_ATTR void VKAPI_CALL QueueNotifyOutOfBandNV( VkQueue queue, const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24008,6 +24606,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetAttachmentFeedbackLoopEnableEXT( VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24043,6 +24642,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR( const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24088,6 +24688,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyAccelerationStructureKHR( VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24127,6 +24728,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructuresKHR( const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24166,6 +24768,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructuresIndirectKHR( const uint32_t* pIndirectStrides, const uint32_t* const* ppMaxPrimitiveCounts) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24207,6 +24810,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyAccelerationStructureToMemoryKHR( VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24248,6 +24852,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToAccelerationStructureKHR( VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24293,6 +24898,7 @@ VKAPI_ATTR VkResult VKAPI_CALL WriteAccelerationStructuresPropertiesKHR( void* pData, size_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24340,6 +24946,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureKHR( VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24376,6 +24983,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureToMemoryKHR( VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24412,6 +25020,7 @@ VKAPI_ATTR void VKAPI_CALL CmdCopyMemoryToAccelerationStructureKHR( VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24448,6 +25057,7 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetAccelerationStructureDeviceAddressKHR( VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24491,6 +25101,7 @@ VKAPI_ATTR void VKAPI_CALL CmdWriteAccelerationStructuresPropertiesKHR( VkQueryPool queryPool, uint32_t firstQuery) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24529,6 +25140,7 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceAccelerationStructureCompatibilityKHR( const VkAccelerationStructureVersionInfoKHR* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24566,6 +25178,7 @@ VKAPI_ATTR void VKAPI_CALL GetAccelerationStructureBuildSizesKHR( const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24611,6 +25224,7 @@ VKAPI_ATTR void VKAPI_CALL CmdTraceRaysKHR( uint32_t height, uint32_t depth) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24654,6 +25268,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingCaptureReplayShaderGroupHandlesKHR( size_t dataSize, void* pData) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24704,6 +25319,7 @@ VKAPI_ATTR void VKAPI_CALL CmdTraceRaysIndirectKHR( const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24743,6 +25359,7 @@ VKAPI_ATTR VkDeviceSize VKAPI_CALL GetRayTracingShaderGroupStackSizeKHR( uint32_t group, VkShaderGroupShaderKHR groupShader) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24781,6 +25398,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRayTracingPipelineStackSizeKHR( VkCommandBuffer commandBuffer, uint32_t pipelineStackSize) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24816,6 +25434,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksEXT( uint32_t groupCountY, uint32_t groupCountZ) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24854,6 +25473,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectEXT( uint32_t drawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); @@ -24895,6 +25515,7 @@ VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectCountEXT( uint32_t maxDrawCount, uint32_t stride) { +// GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__) VulkanCaptureManager* manager = VulkanCaptureManager::Get(); GFXRECON_ASSERT(manager != nullptr); auto force_command_serialization = manager->GetForceCommandSerialization(); diff --git a/framework/generated/generated_vulkan_replay_consumer.cpp b/framework/generated/generated_vulkan_replay_consumer.cpp index 61734cd1a7..0b0b59f30f 100644 --- a/framework/generated/generated_vulkan_replay_consumer.cpp +++ b/framework/generated/generated_vulkan_replay_consumer.cpp @@ -48,9 +48,11 @@ void VulkanReplayConsumer::Process_vkCreateInstance( StructPointerDecoder* pAllocator, HandlePointerDecoder* pInstance) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) if (!pInstance->IsNull()) { pInstance->SetHandleLength(1); } InstanceInfo handle_info; pInstance->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pInstance->GetPointer(), VK_OBJECT_TYPE_INSTANCE); VkResult replay_result = OverrideCreateInstance(returnValue, pCreateInfo, pAllocator, pInstance); CheckResult("vkCreateInstance", returnValue, replay_result, call_info); @@ -63,6 +65,7 @@ void VulkanReplayConsumer::Process_vkDestroyInstance( format::HandleId instance, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -77,10 +80,12 @@ void VulkanReplayConsumer::Process_vkEnumeratePhysicalDevices( PointerDecoder* pPhysicalDeviceCount, HandlePointerDecoder* pPhysicalDevices) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); pPhysicalDeviceCount->IsNull() ? nullptr : pPhysicalDeviceCount->AllocateOutputData(1, GetOutputArrayCount("vkEnumeratePhysicalDevices", returnValue, instance, kInstanceArrayEnumeratePhysicalDevices, pPhysicalDeviceCount, pPhysicalDevices, &VulkanObjectInfoTable::GetInstanceInfo)); if (!pPhysicalDevices->IsNull()) { pPhysicalDevices->SetHandleLength(*pPhysicalDeviceCount->GetOutputPointer()); } std::vector handle_info(*pPhysicalDeviceCount->GetOutputPointer()); + ForwardIdsToCaptureLayer(pPhysicalDevices->GetPointer(), pPhysicalDevices->GetLength(), pPhysicalDevices->GetHandlePointer(), *pPhysicalDeviceCount->GetOutputPointer(), VK_OBJECT_TYPE_PHYSICAL_DEVICE); for (size_t i = 0; i < *pPhysicalDeviceCount->GetOutputPointer(); ++i) { pPhysicalDevices->SetConsumerData(i, &handle_info[i]); } VkResult replay_result = OverrideEnumeratePhysicalDevices(GetInstanceTable(in_instance->handle)->EnumeratePhysicalDevices, returnValue, in_instance, pPhysicalDeviceCount, pPhysicalDevices); @@ -95,6 +100,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceFeatures( format::HandleId physicalDevice, StructPointerDecoder* pFeatures) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkPhysicalDeviceFeatures* out_pFeatures = pFeatures->IsNull() ? nullptr : pFeatures->AllocateOutputData(1); @@ -107,6 +113,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceFormatProperties( VkFormat format, StructPointerDecoder* pFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkFormatProperties* out_pFormatProperties = pFormatProperties->IsNull() ? nullptr : pFormatProperties->AllocateOutputData(1); @@ -124,6 +131,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceImageFormatProperties( VkImageCreateFlags flags, StructPointerDecoder* pImageFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkImageFormatProperties* out_pImageFormatProperties = pImageFormatProperties->IsNull() ? nullptr : pImageFormatProperties->AllocateOutputData(1); @@ -136,6 +144,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceProperties( format::HandleId physicalDevice, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(1); @@ -148,6 +157,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceQueueFamilyProperties( PointerDecoder* pQueueFamilyPropertyCount, StructPointerDecoder* pQueueFamilyProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pQueueFamilyPropertyCount = pQueueFamilyPropertyCount->IsNull() ? nullptr : pQueueFamilyPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceQueueFamilyProperties", VK_SUCCESS, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceQueueFamilyProperties, pQueueFamilyPropertyCount, pQueueFamilyProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkQueueFamilyProperties* out_pQueueFamilyProperties = pQueueFamilyProperties->IsNull() ? nullptr : pQueueFamilyProperties->AllocateOutputData(*out_pQueueFamilyPropertyCount); @@ -162,6 +172,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceMemoryProperties( format::HandleId physicalDevice, StructPointerDecoder* pMemoryProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pMemoryProperties->IsNull() ? nullptr : pMemoryProperties->AllocateOutputData(1); @@ -176,12 +187,14 @@ void VulkanReplayConsumer::Process_vkCreateDevice( StructPointerDecoder* pAllocator, HandlePointerDecoder* pDevice) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pDevice->IsNull()) { pDevice->SetHandleLength(1); } DeviceInfo handle_info; pDevice->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pDevice->GetPointer(), VK_OBJECT_TYPE_DEVICE); VkResult replay_result = OverrideCreateDevice(returnValue, in_physicalDevice, pCreateInfo, pAllocator, pDevice); CheckResult("vkCreateDevice", returnValue, replay_result, call_info); @@ -194,6 +207,7 @@ void VulkanReplayConsumer::Process_vkDestroyDevice( format::HandleId device, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); OverrideDestroyDevice(GetDeviceTable(in_device->handle)->DestroyDevice, in_device, pAllocator); @@ -207,10 +221,12 @@ void VulkanReplayConsumer::Process_vkGetDeviceQueue( uint32_t queueIndex, HandlePointerDecoder* pQueue) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pQueue->IsNull()) { pQueue->SetHandleLength(1); } QueueInfo handle_info; pQueue->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pQueue->GetPointer(), VK_OBJECT_TYPE_QUEUE); OverrideGetDeviceQueue(GetDeviceTable(in_device->handle)->GetDeviceQueue, in_device, queueFamilyIndex, queueIndex, pQueue); @@ -225,6 +241,7 @@ void VulkanReplayConsumer::Process_vkQueueSubmit( StructPointerDecoder* pSubmits, format::HandleId fence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_queue = GetObjectInfoTable().GetQueueInfo(queue); MapStructArrayHandles(pSubmits->GetMetaStructPointer(), pSubmits->GetLength(), GetObjectInfoTable()); @@ -239,6 +256,7 @@ void VulkanReplayConsumer::Process_vkQueueWaitIdle( VkResult returnValue, format::HandleId queue) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); VkResult replay_result = GetDeviceTable(in_queue)->QueueWaitIdle(in_queue); @@ -250,6 +268,7 @@ void VulkanReplayConsumer::Process_vkDeviceWaitIdle( VkResult returnValue, format::HandleId device) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkResult replay_result = GetDeviceTable(in_device)->DeviceWaitIdle(in_device); @@ -264,12 +283,14 @@ void VulkanReplayConsumer::Process_vkAllocateMemory( StructPointerDecoder* pAllocator, HandlePointerDecoder* pMemory) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pAllocateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pMemory->IsNull()) { pMemory->SetHandleLength(1); } DeviceMemoryInfo handle_info; pMemory->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pMemory->GetPointer(), VK_OBJECT_TYPE_DEVICE_MEMORY); VkResult replay_result = OverrideAllocateMemory(GetDeviceTable(in_device->handle)->AllocateMemory, returnValue, in_device, pAllocateInfo, pAllocator, pMemory); CheckResult("vkAllocateMemory", returnValue, replay_result, call_info); @@ -283,6 +304,7 @@ void VulkanReplayConsumer::Process_vkFreeMemory( format::HandleId memory, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_memory = GetObjectInfoTable().GetDeviceMemoryInfo(memory); @@ -300,6 +322,7 @@ void VulkanReplayConsumer::Process_vkMapMemory( VkMemoryMapFlags flags, PointerDecoder* ppData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_memory = GetObjectInfoTable().GetDeviceMemoryInfo(memory); void** out_ppData = ppData->IsNull() ? nullptr : ppData->AllocateOutputData(1); @@ -315,6 +338,7 @@ void VulkanReplayConsumer::Process_vkUnmapMemory( format::HandleId device, format::HandleId memory) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_memory = GetObjectInfoTable().GetDeviceMemoryInfo(memory); @@ -328,6 +352,7 @@ void VulkanReplayConsumer::Process_vkFlushMappedMemoryRanges( uint32_t memoryRangeCount, StructPointerDecoder* pMemoryRanges) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pMemoryRanges->GetMetaStructPointer(), pMemoryRanges->GetLength(), GetObjectInfoTable()); @@ -343,6 +368,7 @@ void VulkanReplayConsumer::Process_vkInvalidateMappedMemoryRanges( uint32_t memoryRangeCount, StructPointerDecoder* pMemoryRanges) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pMemoryRanges->GetMetaStructPointer(), pMemoryRanges->GetLength(), GetObjectInfoTable()); @@ -357,6 +383,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceMemoryCommitment( format::HandleId memory, PointerDecoder* pCommittedMemoryInBytes) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeviceMemory in_memory = MapHandle(memory, &VulkanObjectInfoTable::GetDeviceMemoryInfo); VkDeviceSize* out_pCommittedMemoryInBytes = pCommittedMemoryInBytes->IsNull() ? nullptr : pCommittedMemoryInBytes->AllocateOutputData(1, static_cast(0)); @@ -372,6 +399,7 @@ void VulkanReplayConsumer::Process_vkBindBufferMemory( format::HandleId memory, VkDeviceSize memoryOffset) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_buffer = GetObjectInfoTable().GetBufferInfo(buffer); auto in_memory = GetObjectInfoTable().GetDeviceMemoryInfo(memory); @@ -388,6 +416,7 @@ void VulkanReplayConsumer::Process_vkBindImageMemory( format::HandleId memory, VkDeviceSize memoryOffset) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_image = GetObjectInfoTable().GetImageInfo(image); auto in_memory = GetObjectInfoTable().GetDeviceMemoryInfo(memory); @@ -402,6 +431,7 @@ void VulkanReplayConsumer::Process_vkGetBufferMemoryRequirements( format::HandleId buffer, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkMemoryRequirements* out_pMemoryRequirements = pMemoryRequirements->IsNull() ? nullptr : pMemoryRequirements->AllocateOutputData(1); @@ -415,6 +445,7 @@ void VulkanReplayConsumer::Process_vkGetImageMemoryRequirements( format::HandleId image, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkImage in_image = MapHandle(image, &VulkanObjectInfoTable::GetImageInfo); VkMemoryRequirements* out_pMemoryRequirements = pMemoryRequirements->IsNull() ? nullptr : pMemoryRequirements->AllocateOutputData(1); @@ -429,6 +460,7 @@ void VulkanReplayConsumer::Process_vkGetImageSparseMemoryRequirements( PointerDecoder* pSparseMemoryRequirementCount, StructPointerDecoder* pSparseMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkImage in_image = MapHandle(image, &VulkanObjectInfoTable::GetImageInfo); uint32_t* out_pSparseMemoryRequirementCount = pSparseMemoryRequirementCount->IsNull() ? nullptr : pSparseMemoryRequirementCount->AllocateOutputData(1, GetOutputArrayCount("vkGetImageSparseMemoryRequirements", VK_SUCCESS, image, kImageArrayGetImageSparseMemoryRequirements, pSparseMemoryRequirementCount, pSparseMemoryRequirements, &VulkanObjectInfoTable::GetImageInfo)); @@ -450,6 +482,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSparseImageFormatPropertie PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceSparseImageFormatProperties", VK_SUCCESS, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceSparseImageFormatProperties, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkSparseImageFormatProperties* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(*out_pPropertyCount); @@ -467,6 +500,7 @@ void VulkanReplayConsumer::Process_vkQueueBindSparse( StructPointerDecoder* pBindInfo, format::HandleId fence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_queue = GetObjectInfoTable().GetQueueInfo(queue); MapStructArrayHandles(pBindInfo->GetMetaStructPointer(), pBindInfo->GetLength(), GetObjectInfoTable()); @@ -484,11 +518,13 @@ void VulkanReplayConsumer::Process_vkCreateFence( StructPointerDecoder* pAllocator, HandlePointerDecoder* pFence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkFenceCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pFence->IsNull()) { pFence->SetHandleLength(1); } VkFence* out_pFence = pFence->GetHandlePointer(); +ForwardIdToCaptureLayer(pFence->GetPointer(), VK_OBJECT_TYPE_FENCE); VkResult replay_result = GetDeviceTable(in_device)->CreateFence(in_device, in_pCreateInfo, in_pAllocator, out_pFence); CheckResult("vkCreateFence", returnValue, replay_result, call_info); @@ -502,6 +538,7 @@ void VulkanReplayConsumer::Process_vkDestroyFence( format::HandleId fence, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkFence in_fence = MapHandle(fence, &VulkanObjectInfoTable::GetFenceInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -517,6 +554,7 @@ void VulkanReplayConsumer::Process_vkResetFences( uint32_t fenceCount, HandlePointerDecoder* pFences) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkFence* in_pFences = MapHandles(pFences, fenceCount, &VulkanObjectInfoTable::GetFenceInfo); @@ -530,6 +568,7 @@ void VulkanReplayConsumer::Process_vkGetFenceStatus( format::HandleId device, format::HandleId fence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_fence = GetObjectInfoTable().GetFenceInfo(fence); @@ -546,6 +585,7 @@ void VulkanReplayConsumer::Process_vkWaitForFences( VkBool32 waitAll, uint64_t timeout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapHandles(pFences, fenceCount, &VulkanObjectInfoTable::GetFenceInfo); @@ -561,11 +601,13 @@ void VulkanReplayConsumer::Process_vkCreateSemaphore( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSemaphore) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSemaphoreCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSemaphore->IsNull()) { pSemaphore->SetHandleLength(1); } VkSemaphore* out_pSemaphore = pSemaphore->GetHandlePointer(); +ForwardIdToCaptureLayer(pSemaphore->GetPointer(), VK_OBJECT_TYPE_SEMAPHORE); VkResult replay_result = GetDeviceTable(in_device)->CreateSemaphore(in_device, in_pCreateInfo, in_pAllocator, out_pSemaphore); CheckResult("vkCreateSemaphore", returnValue, replay_result, call_info); @@ -579,6 +621,7 @@ void VulkanReplayConsumer::Process_vkDestroySemaphore( format::HandleId semaphore, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSemaphore in_semaphore = MapHandle(semaphore, &VulkanObjectInfoTable::GetSemaphoreInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -595,11 +638,13 @@ void VulkanReplayConsumer::Process_vkCreateEvent( StructPointerDecoder* pAllocator, HandlePointerDecoder* pEvent) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkEventCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pEvent->IsNull()) { pEvent->SetHandleLength(1); } VkEvent* out_pEvent = pEvent->GetHandlePointer(); +ForwardIdToCaptureLayer(pEvent->GetPointer(), VK_OBJECT_TYPE_EVENT); VkResult replay_result = GetDeviceTable(in_device)->CreateEvent(in_device, in_pCreateInfo, in_pAllocator, out_pEvent); CheckResult("vkCreateEvent", returnValue, replay_result, call_info); @@ -613,6 +658,7 @@ void VulkanReplayConsumer::Process_vkDestroyEvent( format::HandleId event, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -627,6 +673,7 @@ void VulkanReplayConsumer::Process_vkGetEventStatus( format::HandleId device, format::HandleId event) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_event = GetObjectInfoTable().GetEventInfo(event); @@ -640,6 +687,7 @@ void VulkanReplayConsumer::Process_vkSetEvent( format::HandleId device, format::HandleId event) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); @@ -653,6 +701,7 @@ void VulkanReplayConsumer::Process_vkResetEvent( format::HandleId device, format::HandleId event) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); @@ -668,11 +717,13 @@ void VulkanReplayConsumer::Process_vkCreateQueryPool( StructPointerDecoder* pAllocator, HandlePointerDecoder* pQueryPool) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkQueryPoolCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pQueryPool->IsNull()) { pQueryPool->SetHandleLength(1); } VkQueryPool* out_pQueryPool = pQueryPool->GetHandlePointer(); +ForwardIdToCaptureLayer(pQueryPool->GetPointer(), VK_OBJECT_TYPE_QUERY_POOL); VkResult replay_result = GetDeviceTable(in_device)->CreateQueryPool(in_device, in_pCreateInfo, in_pAllocator, out_pQueryPool); CheckResult("vkCreateQueryPool", returnValue, replay_result, call_info); @@ -686,6 +737,7 @@ void VulkanReplayConsumer::Process_vkDestroyQueryPool( format::HandleId queryPool, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -706,6 +758,7 @@ void VulkanReplayConsumer::Process_vkGetQueryPoolResults( VkDeviceSize stride, VkQueryResultFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_queryPool = GetObjectInfoTable().GetQueryPoolInfo(queryPool); if (!pData->IsNull()) { pData->AllocateOutputData(dataSize); } @@ -722,10 +775,12 @@ void VulkanReplayConsumer::Process_vkCreateBuffer( StructPointerDecoder* pAllocator, HandlePointerDecoder* pBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pBuffer->IsNull()) { pBuffer->SetHandleLength(1); } BufferInfo handle_info; pBuffer->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pBuffer->GetPointer(), VK_OBJECT_TYPE_BUFFER); VkResult replay_result = OverrideCreateBuffer(GetDeviceTable(in_device->handle)->CreateBuffer, returnValue, in_device, pCreateInfo, pAllocator, pBuffer); CheckResult("vkCreateBuffer", returnValue, replay_result, call_info); @@ -739,6 +794,7 @@ void VulkanReplayConsumer::Process_vkDestroyBuffer( format::HandleId buffer, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_buffer = GetObjectInfoTable().GetBufferInfo(buffer); @@ -754,12 +810,14 @@ void VulkanReplayConsumer::Process_vkCreateBufferView( StructPointerDecoder* pAllocator, HandlePointerDecoder* pView) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkBufferViewCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pView->IsNull()) { pView->SetHandleLength(1); } VkBufferView* out_pView = pView->GetHandlePointer(); +ForwardIdToCaptureLayer(pView->GetPointer(), VK_OBJECT_TYPE_BUFFER_VIEW); VkResult replay_result = GetDeviceTable(in_device)->CreateBufferView(in_device, in_pCreateInfo, in_pAllocator, out_pView); CheckResult("vkCreateBufferView", returnValue, replay_result, call_info); @@ -773,6 +831,7 @@ void VulkanReplayConsumer::Process_vkDestroyBufferView( format::HandleId bufferView, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkBufferView in_bufferView = MapHandle(bufferView, &VulkanObjectInfoTable::GetBufferViewInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -789,12 +848,14 @@ void VulkanReplayConsumer::Process_vkCreateImage( StructPointerDecoder* pAllocator, HandlePointerDecoder* pImage) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pImage->IsNull()) { pImage->SetHandleLength(1); } ImageInfo handle_info; pImage->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pImage->GetPointer(), VK_OBJECT_TYPE_IMAGE); VkResult replay_result = OverrideCreateImage(GetDeviceTable(in_device->handle)->CreateImage, returnValue, in_device, pCreateInfo, pAllocator, pImage); CheckResult("vkCreateImage", returnValue, replay_result, call_info); @@ -808,6 +869,7 @@ void VulkanReplayConsumer::Process_vkDestroyImage( format::HandleId image, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_image = GetObjectInfoTable().GetImageInfo(image); @@ -822,6 +884,7 @@ void VulkanReplayConsumer::Process_vkGetImageSubresourceLayout( StructPointerDecoder* pSubresource, StructPointerDecoder* pLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_image = GetObjectInfoTable().GetImageInfo(image); pLayout->IsNull() ? nullptr : pLayout->AllocateOutputData(1); @@ -837,12 +900,14 @@ void VulkanReplayConsumer::Process_vkCreateImageView( StructPointerDecoder* pAllocator, HandlePointerDecoder* pView) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pView->IsNull()) { pView->SetHandleLength(1); } ImageViewInfo handle_info; pView->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pView->GetPointer(), VK_OBJECT_TYPE_IMAGE_VIEW); VkResult replay_result = OverrideCreateImageView(GetDeviceTable(in_device->handle)->CreateImageView, returnValue, in_device, pCreateInfo, pAllocator, pView); CheckResult("vkCreateImageView", returnValue, replay_result, call_info); @@ -856,6 +921,7 @@ void VulkanReplayConsumer::Process_vkDestroyImageView( format::HandleId imageView, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkImageView in_imageView = MapHandle(imageView, &VulkanObjectInfoTable::GetImageViewInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -872,12 +938,14 @@ void VulkanReplayConsumer::Process_vkCreateShaderModule( StructPointerDecoder* pAllocator, HandlePointerDecoder* pShaderModule) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pShaderModule->IsNull()) { pShaderModule->SetHandleLength(1); } ShaderModuleInfo handle_info; pShaderModule->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pShaderModule->GetPointer(), VK_OBJECT_TYPE_SHADER_MODULE); VkResult replay_result = OverrideCreateShaderModule(GetDeviceTable(in_device->handle)->CreateShaderModule, returnValue, in_device, pCreateInfo, pAllocator, pShaderModule); CheckResult("vkCreateShaderModule", returnValue, replay_result, call_info); @@ -891,6 +959,7 @@ void VulkanReplayConsumer::Process_vkDestroyShaderModule( format::HandleId shaderModule, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_shaderModule = GetObjectInfoTable().GetShaderModuleInfo(shaderModule); @@ -906,10 +975,12 @@ void VulkanReplayConsumer::Process_vkCreatePipelineCache( StructPointerDecoder* pAllocator, HandlePointerDecoder* pPipelineCache) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pPipelineCache->IsNull()) { pPipelineCache->SetHandleLength(1); } PipelineCacheInfo handle_info; pPipelineCache->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pPipelineCache->GetPointer(), VK_OBJECT_TYPE_PIPELINE_CACHE); VkResult replay_result = OverrideCreatePipelineCache(GetDeviceTable(in_device->handle)->CreatePipelineCache, returnValue, in_device, pCreateInfo, pAllocator, pPipelineCache); CheckResult("vkCreatePipelineCache", returnValue, replay_result, call_info); @@ -923,6 +994,7 @@ void VulkanReplayConsumer::Process_vkDestroyPipelineCache( format::HandleId pipelineCache, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipelineCache in_pipelineCache = MapHandle(pipelineCache, &VulkanObjectInfoTable::GetPipelineCacheInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -939,6 +1011,7 @@ void VulkanReplayConsumer::Process_vkGetPipelineCacheData( PointerDecoder* pDataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_pipelineCache = GetObjectInfoTable().GetPipelineCacheInfo(pipelineCache); pDataSize->IsNull() ? nullptr : pDataSize->AllocateOutputData(1, GetOutputArrayCount("vkGetPipelineCacheData", returnValue, pipelineCache, kPipelineCacheArrayGetPipelineCacheData, pDataSize, pData, &VulkanObjectInfoTable::GetPipelineCacheInfo)); @@ -958,6 +1031,7 @@ void VulkanReplayConsumer::Process_vkMergePipelineCaches( uint32_t srcCacheCount, HandlePointerDecoder* pSrcCaches) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipelineCache in_dstCache = MapHandle(dstCache, &VulkanObjectInfoTable::GetPipelineCacheInfo); const VkPipelineCache* in_pSrcCaches = MapHandles(pSrcCaches, srcCacheCount, &VulkanObjectInfoTable::GetPipelineCacheInfo); @@ -976,6 +1050,7 @@ void VulkanReplayConsumer::Process_vkCreateGraphicsPipelines( StructPointerDecoder* pAllocator, HandlePointerDecoder* pPipelines) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_pipelineCache = GetObjectInfoTable().GetPipelineCacheInfo(pipelineCache); @@ -987,6 +1062,7 @@ void VulkanReplayConsumer::Process_vkCreateGraphicsPipelines( if (UseAsyncOperations()) { + ForwardIdsToCaptureLayer(pPipelines->GetPointer(), pPipelines->GetLength(), VK_OBJECT_TYPE_PIPELINE); auto task = AsyncCreateGraphicsPipelines(call_info, returnValue, in_device, in_pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); if(task) { @@ -994,6 +1070,8 @@ void VulkanReplayConsumer::Process_vkCreateGraphicsPipelines( return; } } + +ForwardIdsToCaptureLayer(pPipelines->GetPointer(), pPipelines->GetLength(), pPipelines->GetHandlePointer(), createInfoCount, VK_OBJECT_TYPE_PIPELINE); VkResult replay_result = OverrideCreateGraphicsPipelines(GetDeviceTable(in_device->handle)->CreateGraphicsPipelines, returnValue, in_device, in_pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); CheckResult("vkCreateGraphicsPipelines", returnValue, replay_result, call_info); @@ -1010,6 +1088,7 @@ void VulkanReplayConsumer::Process_vkCreateComputePipelines( StructPointerDecoder* pAllocator, HandlePointerDecoder* pPipelines) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_pipelineCache = GetObjectInfoTable().GetPipelineCacheInfo(pipelineCache); @@ -1021,6 +1100,7 @@ void VulkanReplayConsumer::Process_vkCreateComputePipelines( if (UseAsyncOperations()) { + ForwardIdsToCaptureLayer(pPipelines->GetPointer(), pPipelines->GetLength(), VK_OBJECT_TYPE_PIPELINE); auto task = AsyncCreateComputePipelines(call_info, returnValue, in_device, in_pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); if(task) { @@ -1028,6 +1108,8 @@ void VulkanReplayConsumer::Process_vkCreateComputePipelines( return; } } + +ForwardIdsToCaptureLayer(pPipelines->GetPointer(), pPipelines->GetLength(), pPipelines->GetHandlePointer(), createInfoCount, VK_OBJECT_TYPE_PIPELINE); VkResult replay_result = OverrideCreateComputePipelines(GetDeviceTable(in_device->handle)->CreateComputePipelines, returnValue, in_device, in_pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); CheckResult("vkCreateComputePipelines", returnValue, replay_result, call_info); @@ -1040,6 +1122,7 @@ void VulkanReplayConsumer::Process_vkDestroyPipeline( format::HandleId pipeline, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_pipeline = GetObjectInfoTable().GetPipelineInfo(pipeline); @@ -1055,12 +1138,14 @@ void VulkanReplayConsumer::Process_vkCreatePipelineLayout( StructPointerDecoder* pAllocator, HandlePointerDecoder* pPipelineLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPipelineLayoutCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pPipelineLayout->IsNull()) { pPipelineLayout->SetHandleLength(1); } VkPipelineLayout* out_pPipelineLayout = pPipelineLayout->GetHandlePointer(); +ForwardIdToCaptureLayer(pPipelineLayout->GetPointer(), VK_OBJECT_TYPE_PIPELINE_LAYOUT); VkResult replay_result = GetDeviceTable(in_device)->CreatePipelineLayout(in_device, in_pCreateInfo, in_pAllocator, out_pPipelineLayout); CheckResult("vkCreatePipelineLayout", returnValue, replay_result, call_info); @@ -1074,6 +1159,7 @@ void VulkanReplayConsumer::Process_vkDestroyPipelineLayout( format::HandleId pipelineLayout, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipelineLayout in_pipelineLayout = MapHandle(pipelineLayout, &VulkanObjectInfoTable::GetPipelineLayoutInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -1090,12 +1176,14 @@ void VulkanReplayConsumer::Process_vkCreateSampler( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSampler) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSamplerCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSampler->IsNull()) { pSampler->SetHandleLength(1); } VkSampler* out_pSampler = pSampler->GetHandlePointer(); +ForwardIdToCaptureLayer(pSampler->GetPointer(), VK_OBJECT_TYPE_SAMPLER); VkResult replay_result = GetDeviceTable(in_device)->CreateSampler(in_device, in_pCreateInfo, in_pAllocator, out_pSampler); CheckResult("vkCreateSampler", returnValue, replay_result, call_info); @@ -1109,6 +1197,7 @@ void VulkanReplayConsumer::Process_vkDestroySampler( format::HandleId sampler, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSampler in_sampler = MapHandle(sampler, &VulkanObjectInfoTable::GetSamplerInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -1125,12 +1214,14 @@ void VulkanReplayConsumer::Process_vkCreateDescriptorSetLayout( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSetLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pSetLayout->IsNull()) { pSetLayout->SetHandleLength(1); } DescriptorSetLayoutInfo handle_info; pSetLayout->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSetLayout->GetPointer(), VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT); VkResult replay_result = OverrideCreateDescriptorSetLayout(GetDeviceTable(in_device->handle)->CreateDescriptorSetLayout, returnValue, in_device, pCreateInfo, pAllocator, pSetLayout); CheckResult("vkCreateDescriptorSetLayout", returnValue, replay_result, call_info); @@ -1144,6 +1235,7 @@ void VulkanReplayConsumer::Process_vkDestroyDescriptorSetLayout( format::HandleId descriptorSetLayout, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDescriptorSetLayout in_descriptorSetLayout = MapHandle(descriptorSetLayout, &VulkanObjectInfoTable::GetDescriptorSetLayoutInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -1160,10 +1252,12 @@ void VulkanReplayConsumer::Process_vkCreateDescriptorPool( StructPointerDecoder* pAllocator, HandlePointerDecoder* pDescriptorPool) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pDescriptorPool->IsNull()) { pDescriptorPool->SetHandleLength(1); } DescriptorPoolInfo handle_info; pDescriptorPool->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pDescriptorPool->GetPointer(), VK_OBJECT_TYPE_DESCRIPTOR_POOL); VkResult replay_result = OverrideCreateDescriptorPool(GetDeviceTable(in_device->handle)->CreateDescriptorPool, returnValue, in_device, pCreateInfo, pAllocator, pDescriptorPool); CheckResult("vkCreateDescriptorPool", returnValue, replay_result, call_info); @@ -1177,6 +1271,7 @@ void VulkanReplayConsumer::Process_vkDestroyDescriptorPool( format::HandleId descriptorPool, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_descriptorPool = GetObjectInfoTable().GetDescriptorPoolInfo(descriptorPool); @@ -1191,6 +1286,7 @@ void VulkanReplayConsumer::Process_vkResetDescriptorPool( format::HandleId descriptorPool, VkDescriptorPoolResetFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_descriptorPool = GetObjectInfoTable().GetDescriptorPoolInfo(descriptorPool); @@ -1205,12 +1301,14 @@ void VulkanReplayConsumer::Process_vkAllocateDescriptorSets( StructPointerDecoder* pAllocateInfo, HandlePointerDecoder* pDescriptorSets) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pAllocateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pDescriptorSets->IsNull()) { pDescriptorSets->SetHandleLength(pAllocateInfo->GetPointer()->descriptorSetCount); } std::vector handle_info(pAllocateInfo->GetPointer()->descriptorSetCount); for (size_t i = 0; i < pAllocateInfo->GetPointer()->descriptorSetCount; ++i) { pDescriptorSets->SetConsumerData(i, &handle_info[i]); } +ForwardIdsToCaptureLayer(pDescriptorSets->GetPointer(), pDescriptorSets->GetLength(), pDescriptorSets->GetHandlePointer(), pAllocateInfo->GetPointer()->descriptorSetCount, VK_OBJECT_TYPE_DESCRIPTOR_SET); VkResult replay_result = OverrideAllocateDescriptorSets(GetDeviceTable(in_device->handle)->AllocateDescriptorSets, returnValue, in_device, pAllocateInfo, pDescriptorSets); CheckResult("vkAllocateDescriptorSets", returnValue, replay_result, call_info); @@ -1226,6 +1324,7 @@ void VulkanReplayConsumer::Process_vkFreeDescriptorSets( uint32_t descriptorSetCount, HandlePointerDecoder* pDescriptorSets) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDescriptorPool in_descriptorPool = MapHandle(descriptorPool, &VulkanObjectInfoTable::GetDescriptorPoolInfo); const VkDescriptorSet* in_pDescriptorSets = MapHandles(pDescriptorSets, descriptorSetCount, &VulkanObjectInfoTable::GetDescriptorSetInfo); @@ -1243,6 +1342,7 @@ void VulkanReplayConsumer::Process_vkUpdateDescriptorSets( uint32_t descriptorCopyCount, StructPointerDecoder* pDescriptorCopies) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pDescriptorWrites->GetMetaStructPointer(), pDescriptorWrites->GetLength(), GetObjectInfoTable()); @@ -1260,12 +1360,14 @@ void VulkanReplayConsumer::Process_vkCreateFramebuffer( StructPointerDecoder* pAllocator, HandlePointerDecoder* pFramebuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pFramebuffer->IsNull()) { pFramebuffer->SetHandleLength(1); } FramebufferInfo handle_info; pFramebuffer->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pFramebuffer->GetPointer(), VK_OBJECT_TYPE_FRAMEBUFFER); VkResult replay_result = OverrideCreateFramebuffer(GetDeviceTable(in_device->handle)->CreateFramebuffer, returnValue, in_device, pCreateInfo, pAllocator, pFramebuffer); CheckResult("vkCreateFramebuffer", returnValue, replay_result, call_info); @@ -1279,6 +1381,7 @@ void VulkanReplayConsumer::Process_vkDestroyFramebuffer( format::HandleId framebuffer, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkFramebuffer in_framebuffer = MapHandle(framebuffer, &VulkanObjectInfoTable::GetFramebufferInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -1295,10 +1398,12 @@ void VulkanReplayConsumer::Process_vkCreateRenderPass( StructPointerDecoder* pAllocator, HandlePointerDecoder* pRenderPass) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pRenderPass->IsNull()) { pRenderPass->SetHandleLength(1); } RenderPassInfo handle_info; pRenderPass->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pRenderPass->GetPointer(), VK_OBJECT_TYPE_RENDER_PASS); VkResult replay_result = OverrideCreateRenderPass(GetDeviceTable(in_device->handle)->CreateRenderPass, returnValue, in_device, pCreateInfo, pAllocator, pRenderPass); CheckResult("vkCreateRenderPass", returnValue, replay_result, call_info); @@ -1312,6 +1417,7 @@ void VulkanReplayConsumer::Process_vkDestroyRenderPass( format::HandleId renderPass, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_renderPass = GetObjectInfoTable().GetRenderPassInfo(renderPass); @@ -1325,6 +1431,7 @@ void VulkanReplayConsumer::Process_vkGetRenderAreaGranularity( format::HandleId renderPass, StructPointerDecoder* pGranularity) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkRenderPass in_renderPass = MapHandle(renderPass, &VulkanObjectInfoTable::GetRenderPassInfo); VkExtent2D* out_pGranularity = pGranularity->IsNull() ? nullptr : pGranularity->AllocateOutputData(1); @@ -1340,11 +1447,13 @@ void VulkanReplayConsumer::Process_vkCreateCommandPool( StructPointerDecoder* pAllocator, HandlePointerDecoder* pCommandPool) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkCommandPoolCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pCommandPool->IsNull()) { pCommandPool->SetHandleLength(1); } VkCommandPool* out_pCommandPool = pCommandPool->GetHandlePointer(); +ForwardIdToCaptureLayer(pCommandPool->GetPointer(), VK_OBJECT_TYPE_COMMAND_POOL); VkResult replay_result = GetDeviceTable(in_device)->CreateCommandPool(in_device, in_pCreateInfo, in_pAllocator, out_pCommandPool); CheckResult("vkCreateCommandPool", returnValue, replay_result, call_info); @@ -1358,6 +1467,7 @@ void VulkanReplayConsumer::Process_vkDestroyCommandPool( format::HandleId commandPool, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_commandPool = GetObjectInfoTable().GetCommandPoolInfo(commandPool); @@ -1372,6 +1482,7 @@ void VulkanReplayConsumer::Process_vkResetCommandPool( format::HandleId commandPool, VkCommandPoolResetFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_commandPool = GetObjectInfoTable().GetCommandPoolInfo(commandPool); @@ -1386,12 +1497,14 @@ void VulkanReplayConsumer::Process_vkAllocateCommandBuffers( StructPointerDecoder* pAllocateInfo, HandlePointerDecoder* pCommandBuffers) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pAllocateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pCommandBuffers->IsNull()) { pCommandBuffers->SetHandleLength(pAllocateInfo->GetPointer()->commandBufferCount); } std::vector handle_info(pAllocateInfo->GetPointer()->commandBufferCount); for (size_t i = 0; i < pAllocateInfo->GetPointer()->commandBufferCount; ++i) { pCommandBuffers->SetConsumerData(i, &handle_info[i]); } +ForwardIdsToCaptureLayer(pCommandBuffers->GetPointer(), pCommandBuffers->GetLength(), pCommandBuffers->GetHandlePointer(), pAllocateInfo->GetPointer()->commandBufferCount, VK_OBJECT_TYPE_COMMAND_BUFFER); VkResult replay_result = OverrideAllocateCommandBuffers(GetDeviceTable(in_device->handle)->AllocateCommandBuffers, returnValue, in_device, pAllocateInfo, pCommandBuffers); CheckResult("vkAllocateCommandBuffers", returnValue, replay_result, call_info); @@ -1406,6 +1519,7 @@ void VulkanReplayConsumer::Process_vkFreeCommandBuffers( uint32_t commandBufferCount, HandlePointerDecoder* pCommandBuffers) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_commandPool = GetObjectInfoTable().GetCommandPoolInfo(commandPool); MapHandles(pCommandBuffers, commandBufferCount, &VulkanObjectInfoTable::GetCommandBufferInfo); @@ -1420,6 +1534,7 @@ void VulkanReplayConsumer::Process_vkBeginCommandBuffer( format::HandleId commandBuffer, StructPointerDecoder* pBeginInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); MapStructHandles(pBeginInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -1433,6 +1548,7 @@ void VulkanReplayConsumer::Process_vkEndCommandBuffer( VkResult returnValue, format::HandleId commandBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkResult replay_result = GetDeviceTable(in_commandBuffer)->EndCommandBuffer(in_commandBuffer); @@ -1445,6 +1561,7 @@ void VulkanReplayConsumer::Process_vkResetCommandBuffer( format::HandleId commandBuffer, VkCommandBufferResetFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); VkResult replay_result = OverrideResetCommandBuffer(GetDeviceTable(in_commandBuffer->handle)->ResetCommandBuffer, returnValue, in_commandBuffer, flags); @@ -1457,6 +1574,7 @@ void VulkanReplayConsumer::Process_vkCmdBindPipeline( VkPipelineBindPoint pipelineBindPoint, format::HandleId pipeline) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); @@ -1475,6 +1593,7 @@ void VulkanReplayConsumer::Process_vkCmdSetViewport( uint32_t viewportCount, StructPointerDecoder* pViewports) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkViewport* in_pViewports = pViewports->GetPointer(); @@ -1493,6 +1612,7 @@ void VulkanReplayConsumer::Process_vkCmdSetScissor( uint32_t scissorCount, StructPointerDecoder* pScissors) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRect2D* in_pScissors = pScissors->GetPointer(); @@ -1509,6 +1629,7 @@ void VulkanReplayConsumer::Process_vkCmdSetLineWidth( format::HandleId commandBuffer, float lineWidth) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetLineWidth(in_commandBuffer, lineWidth); @@ -1526,6 +1647,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthBias( float depthBiasClamp, float depthBiasSlopeFactor) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthBias(in_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); @@ -1541,6 +1663,7 @@ void VulkanReplayConsumer::Process_vkCmdSetBlendConstants( format::HandleId commandBuffer, PointerDecoder* blendConstants) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const float* in_blendConstants = blendConstants->GetPointer(); @@ -1558,6 +1681,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthBounds( float minDepthBounds, float maxDepthBounds) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthBounds(in_commandBuffer, minDepthBounds, maxDepthBounds); @@ -1574,6 +1698,7 @@ void VulkanReplayConsumer::Process_vkCmdSetStencilCompareMask( VkStencilFaceFlags faceMask, uint32_t compareMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetStencilCompareMask(in_commandBuffer, faceMask, compareMask); @@ -1590,6 +1715,7 @@ void VulkanReplayConsumer::Process_vkCmdSetStencilWriteMask( VkStencilFaceFlags faceMask, uint32_t writeMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetStencilWriteMask(in_commandBuffer, faceMask, writeMask); @@ -1606,6 +1732,7 @@ void VulkanReplayConsumer::Process_vkCmdSetStencilReference( VkStencilFaceFlags faceMask, uint32_t reference) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetStencilReference(in_commandBuffer, faceMask, reference); @@ -1627,6 +1754,7 @@ void VulkanReplayConsumer::Process_vkCmdBindDescriptorSets( uint32_t dynamicOffsetCount, PointerDecoder* pDynamicOffsets) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkPipelineLayout in_layout = MapHandle(layout, &VulkanObjectInfoTable::GetPipelineLayoutInfo); const VkDescriptorSet* in_pDescriptorSets = MapHandles(pDescriptorSets, descriptorSetCount, &VulkanObjectInfoTable::GetDescriptorSetInfo); @@ -1647,6 +1775,7 @@ void VulkanReplayConsumer::Process_vkCmdBindIndexBuffer( VkDeviceSize offset, VkIndexType indexType) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -1666,6 +1795,7 @@ void VulkanReplayConsumer::Process_vkCmdBindVertexBuffers( HandlePointerDecoder* pBuffers, PointerDecoder* pOffsets) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBuffer* in_pBuffers = MapHandles(pBuffers, bindingCount, &VulkanObjectInfoTable::GetBufferInfo); const VkDeviceSize* in_pOffsets = pOffsets->GetPointer(); @@ -1686,6 +1816,7 @@ void VulkanReplayConsumer::Process_vkCmdDraw( uint32_t firstVertex, uint32_t firstInstance) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDraw(in_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); @@ -1705,6 +1836,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndexed( int32_t vertexOffset, uint32_t firstInstance) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDrawIndexed(in_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); @@ -1723,6 +1855,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndirect( uint32_t drawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -1742,6 +1875,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndexedIndirect( uint32_t drawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -1760,6 +1894,7 @@ void VulkanReplayConsumer::Process_vkCmdDispatch( uint32_t groupCountY, uint32_t groupCountZ) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDispatch(in_commandBuffer, groupCountX, groupCountY, groupCountZ); @@ -1776,6 +1911,7 @@ void VulkanReplayConsumer::Process_vkCmdDispatchIndirect( format::HandleId buffer, VkDeviceSize offset) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -1795,6 +1931,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyBuffer( uint32_t regionCount, StructPointerDecoder* pRegions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_srcBuffer = MapHandle(srcBuffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_dstBuffer = MapHandle(dstBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -1818,6 +1955,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyImage( uint32_t regionCount, StructPointerDecoder* pRegions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImage in_srcImage = MapHandle(srcImage, &VulkanObjectInfoTable::GetImageInfo); VkImage in_dstImage = MapHandle(dstImage, &VulkanObjectInfoTable::GetImageInfo); @@ -1842,6 +1980,7 @@ void VulkanReplayConsumer::Process_vkCmdBlitImage( StructPointerDecoder* pRegions, VkFilter filter) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImage in_srcImage = MapHandle(srcImage, &VulkanObjectInfoTable::GetImageInfo); VkImage in_dstImage = MapHandle(dstImage, &VulkanObjectInfoTable::GetImageInfo); @@ -1864,6 +2003,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyBufferToImage( uint32_t regionCount, StructPointerDecoder* pRegions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_srcBuffer = MapHandle(srcBuffer, &VulkanObjectInfoTable::GetBufferInfo); VkImage in_dstImage = MapHandle(dstImage, &VulkanObjectInfoTable::GetImageInfo); @@ -1886,6 +2026,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyImageToBuffer( uint32_t regionCount, StructPointerDecoder* pRegions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImage in_srcImage = MapHandle(srcImage, &VulkanObjectInfoTable::GetImageInfo); VkBuffer in_dstBuffer = MapHandle(dstBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -1907,6 +2048,7 @@ void VulkanReplayConsumer::Process_vkCmdUpdateBuffer( VkDeviceSize dataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_dstBuffer = MapHandle(dstBuffer, &VulkanObjectInfoTable::GetBufferInfo); const void* in_pData = pData->GetPointer(); @@ -1927,6 +2069,7 @@ void VulkanReplayConsumer::Process_vkCmdFillBuffer( VkDeviceSize size, uint32_t data) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_dstBuffer = MapHandle(dstBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -1947,6 +2090,7 @@ void VulkanReplayConsumer::Process_vkCmdClearColorImage( uint32_t rangeCount, StructPointerDecoder* pRanges) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImage in_image = MapHandle(image, &VulkanObjectInfoTable::GetImageInfo); const VkClearColorValue* in_pColor = pColor->GetPointer(); @@ -1969,6 +2113,7 @@ void VulkanReplayConsumer::Process_vkCmdClearDepthStencilImage( uint32_t rangeCount, StructPointerDecoder* pRanges) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImage in_image = MapHandle(image, &VulkanObjectInfoTable::GetImageInfo); const VkClearDepthStencilValue* in_pDepthStencil = pDepthStencil->GetPointer(); @@ -1990,6 +2135,7 @@ void VulkanReplayConsumer::Process_vkCmdClearAttachments( uint32_t rectCount, StructPointerDecoder* pRects) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkClearAttachment* in_pAttachments = pAttachments->GetPointer(); const VkClearRect* in_pRects = pRects->GetPointer(); @@ -2012,6 +2158,7 @@ void VulkanReplayConsumer::Process_vkCmdResolveImage( uint32_t regionCount, StructPointerDecoder* pRegions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImage in_srcImage = MapHandle(srcImage, &VulkanObjectInfoTable::GetImageInfo); VkImage in_dstImage = MapHandle(dstImage, &VulkanObjectInfoTable::GetImageInfo); @@ -2031,6 +2178,7 @@ void VulkanReplayConsumer::Process_vkCmdSetEvent( format::HandleId event, VkPipelineStageFlags stageMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); @@ -2048,6 +2196,7 @@ void VulkanReplayConsumer::Process_vkCmdResetEvent( format::HandleId event, VkPipelineStageFlags stageMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); @@ -2073,6 +2222,7 @@ void VulkanReplayConsumer::Process_vkCmdWaitEvents( uint32_t imageMemoryBarrierCount, StructPointerDecoder* pImageMemoryBarriers) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkEvent* in_pEvents = MapHandles(pEvents, eventCount, &VulkanObjectInfoTable::GetEventInfo); const VkMemoryBarrier* in_pMemoryBarriers = pMemoryBarriers->GetPointer(); @@ -2102,6 +2252,7 @@ void VulkanReplayConsumer::Process_vkCmdPipelineBarrier( uint32_t imageMemoryBarrierCount, StructPointerDecoder* pImageMemoryBarriers) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); MapStructArrayHandles(pBufferMemoryBarriers->GetMetaStructPointer(), pBufferMemoryBarriers->GetLength(), GetObjectInfoTable()); @@ -2123,6 +2274,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginQuery( uint32_t query, VkQueryControlFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -2140,6 +2292,7 @@ void VulkanReplayConsumer::Process_vkCmdEndQuery( format::HandleId queryPool, uint32_t query) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -2158,6 +2311,7 @@ void VulkanReplayConsumer::Process_vkCmdResetQueryPool( uint32_t firstQuery, uint32_t queryCount) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -2176,6 +2330,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteTimestamp( format::HandleId queryPool, uint32_t query) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -2198,6 +2353,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyQueryPoolResults( VkDeviceSize stride, VkQueryResultFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); VkBuffer in_dstBuffer = MapHandle(dstBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -2219,6 +2375,7 @@ void VulkanReplayConsumer::Process_vkCmdPushConstants( uint32_t size, PointerDecoder* pValues) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkPipelineLayout in_layout = MapHandle(layout, &VulkanObjectInfoTable::GetPipelineLayoutInfo); const void* in_pValues = pValues->GetPointer(); @@ -2237,6 +2394,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginRenderPass( StructPointerDecoder* pRenderPassBegin, VkSubpassContents contents) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); MapStructHandles(pRenderPassBegin->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2254,6 +2412,7 @@ void VulkanReplayConsumer::Process_vkCmdNextSubpass( format::HandleId commandBuffer, VkSubpassContents contents) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdNextSubpass(in_commandBuffer, contents); @@ -2268,6 +2427,7 @@ void VulkanReplayConsumer::Process_vkCmdEndRenderPass( const ApiCallInfo& call_info, format::HandleId commandBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdEndRenderPass(in_commandBuffer); @@ -2284,6 +2444,7 @@ void VulkanReplayConsumer::Process_vkCmdExecuteCommands( uint32_t commandBufferCount, HandlePointerDecoder* pCommandBuffers) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCommandBuffer* in_pCommandBuffers = MapHandles(pCommandBuffers, commandBufferCount, &VulkanObjectInfoTable::GetCommandBufferInfo); @@ -2302,6 +2463,7 @@ void VulkanReplayConsumer::Process_vkBindBufferMemory2( uint32_t bindInfoCount, StructPointerDecoder* pBindInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pBindInfos->GetMetaStructPointer(), pBindInfos->GetLength(), GetObjectInfoTable()); @@ -2317,6 +2479,7 @@ void VulkanReplayConsumer::Process_vkBindImageMemory2( uint32_t bindInfoCount, StructPointerDecoder* pBindInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pBindInfos->GetMetaStructPointer(), pBindInfos->GetLength(), GetObjectInfoTable()); @@ -2333,6 +2496,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceGroupPeerMemoryFeatures( uint32_t remoteDeviceIndex, PointerDecoder* pPeerMemoryFeatures) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPeerMemoryFeatureFlags* out_pPeerMemoryFeatures = pPeerMemoryFeatures->IsNull() ? nullptr : pPeerMemoryFeatures->AllocateOutputData(1, static_cast(0)); @@ -2344,6 +2508,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDeviceMask( format::HandleId commandBuffer, uint32_t deviceMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDeviceMask(in_commandBuffer, deviceMask); @@ -2364,6 +2529,7 @@ void VulkanReplayConsumer::Process_vkCmdDispatchBase( uint32_t groupCountY, uint32_t groupCountZ) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDispatchBase(in_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); @@ -2381,6 +2547,7 @@ void VulkanReplayConsumer::Process_vkEnumeratePhysicalDeviceGroups( PointerDecoder* pPhysicalDeviceGroupCount, StructPointerDecoder* pPhysicalDeviceGroupProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); pPhysicalDeviceGroupCount->IsNull() ? nullptr : pPhysicalDeviceGroupCount->AllocateOutputData(1, GetOutputArrayCount("vkEnumeratePhysicalDeviceGroups", returnValue, instance, kInstanceArrayEnumeratePhysicalDeviceGroups, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, &VulkanObjectInfoTable::GetInstanceInfo)); SetStructArrayHandleLengths(pPhysicalDeviceGroupProperties->GetMetaStructPointer(), pPhysicalDeviceGroupProperties->GetLength()); @@ -2399,6 +2566,7 @@ void VulkanReplayConsumer::Process_vkGetImageMemoryRequirements2( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImageMemoryRequirementsInfo2* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2414,6 +2582,7 @@ void VulkanReplayConsumer::Process_vkGetBufferMemoryRequirements2( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkBufferMemoryRequirementsInfo2* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2430,6 +2599,7 @@ void VulkanReplayConsumer::Process_vkGetImageSparseMemoryRequirements2( PointerDecoder* pSparseMemoryRequirementCount, StructPointerDecoder* pSparseMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImageSparseMemoryRequirementsInfo2* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2446,6 +2616,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceFeatures2( format::HandleId physicalDevice, StructPointerDecoder* pFeatures) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkPhysicalDeviceFeatures2* out_pFeatures = pFeatures->IsNull() ? nullptr : pFeatures->AllocateOutputData(1, { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, nullptr }); InitializeOutputStructPNext(pFeatures); @@ -2458,6 +2629,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceProperties2( format::HandleId physicalDevice, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, nullptr }); InitializeOutputStructPNext(pProperties); @@ -2471,6 +2643,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceFormatProperties2( VkFormat format, StructPointerDecoder* pFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkFormatProperties2* out_pFormatProperties = pFormatProperties->IsNull() ? nullptr : pFormatProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, nullptr }); InitializeOutputStructPNext(pFormatProperties); @@ -2485,6 +2658,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceImageFormatProperties2( StructPointerDecoder* pImageFormatInfo, StructPointerDecoder* pImageFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceImageFormatInfo2* in_pImageFormatInfo = pImageFormatInfo->GetPointer(); VkImageFormatProperties2* out_pImageFormatProperties = pImageFormatProperties->IsNull() ? nullptr : pImageFormatProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, nullptr }); @@ -2500,6 +2674,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceQueueFamilyProperties2( PointerDecoder* pQueueFamilyPropertyCount, StructPointerDecoder* pQueueFamilyProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pQueueFamilyPropertyCount = pQueueFamilyPropertyCount->IsNull() ? nullptr : pQueueFamilyPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceQueueFamilyProperties2", VK_SUCCESS, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceQueueFamilyProperties2, pQueueFamilyPropertyCount, pQueueFamilyProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkQueueFamilyProperties2* out_pQueueFamilyProperties = pQueueFamilyProperties->IsNull() ? nullptr : pQueueFamilyProperties->AllocateOutputData(*out_pQueueFamilyPropertyCount, VkQueueFamilyProperties2{ VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, nullptr }); @@ -2514,6 +2689,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceMemoryProperties2( format::HandleId physicalDevice, StructPointerDecoder* pMemoryProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pMemoryProperties->IsNull() ? nullptr : pMemoryProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, nullptr }); InitializeOutputStructPNext(pMemoryProperties); @@ -2528,6 +2704,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSparseImageFormatPropertie PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceSparseImageFormatInfo2* in_pFormatInfo = pFormatInfo->GetPointer(); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceSparseImageFormatProperties2", VK_SUCCESS, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceSparseImageFormatProperties2, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); @@ -2544,6 +2721,7 @@ void VulkanReplayConsumer::Process_vkTrimCommandPool( format::HandleId commandPool, VkCommandPoolTrimFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkCommandPool in_commandPool = MapHandle(commandPool, &VulkanObjectInfoTable::GetCommandPoolInfo); @@ -2556,10 +2734,12 @@ void VulkanReplayConsumer::Process_vkGetDeviceQueue2( StructPointerDecoder* pQueueInfo, HandlePointerDecoder* pQueue) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pQueue->IsNull()) { pQueue->SetHandleLength(1); } QueueInfo handle_info; pQueue->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pQueue->GetPointer(), VK_OBJECT_TYPE_QUEUE); OverrideGetDeviceQueue2(GetDeviceTable(in_device->handle)->GetDeviceQueue2, in_device, pQueueInfo, pQueue); @@ -2574,11 +2754,13 @@ void VulkanReplayConsumer::Process_vkCreateSamplerYcbcrConversion( StructPointerDecoder* pAllocator, HandlePointerDecoder* pYcbcrConversion) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSamplerYcbcrConversionCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pYcbcrConversion->IsNull()) { pYcbcrConversion->SetHandleLength(1); } VkSamplerYcbcrConversion* out_pYcbcrConversion = pYcbcrConversion->GetHandlePointer(); +ForwardIdToCaptureLayer(pYcbcrConversion->GetPointer(), VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION); VkResult replay_result = GetDeviceTable(in_device)->CreateSamplerYcbcrConversion(in_device, in_pCreateInfo, in_pAllocator, out_pYcbcrConversion); CheckResult("vkCreateSamplerYcbcrConversion", returnValue, replay_result, call_info); @@ -2592,6 +2774,7 @@ void VulkanReplayConsumer::Process_vkDestroySamplerYcbcrConversion( format::HandleId ycbcrConversion, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSamplerYcbcrConversion in_ycbcrConversion = MapHandle(ycbcrConversion, &VulkanObjectInfoTable::GetSamplerYcbcrConversionInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -2608,12 +2791,14 @@ void VulkanReplayConsumer::Process_vkCreateDescriptorUpdateTemplate( StructPointerDecoder* pAllocator, HandlePointerDecoder* pDescriptorUpdateTemplate) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pDescriptorUpdateTemplate->IsNull()) { pDescriptorUpdateTemplate->SetHandleLength(1); } DescriptorUpdateTemplateInfo handle_info; pDescriptorUpdateTemplate->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pDescriptorUpdateTemplate->GetPointer(), VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE); VkResult replay_result = OverrideCreateDescriptorUpdateTemplate(GetDeviceTable(in_device->handle)->CreateDescriptorUpdateTemplate, returnValue, in_device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); CheckResult("vkCreateDescriptorUpdateTemplate", returnValue, replay_result, call_info); @@ -2627,6 +2812,7 @@ void VulkanReplayConsumer::Process_vkDestroyDescriptorUpdateTemplate( format::HandleId descriptorUpdateTemplate, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_descriptorUpdateTemplate = GetObjectInfoTable().GetDescriptorUpdateTemplateInfo(descriptorUpdateTemplate); @@ -2640,6 +2826,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceExternalBufferProperties( StructPointerDecoder* pExternalBufferInfo, StructPointerDecoder* pExternalBufferProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceExternalBufferInfo* in_pExternalBufferInfo = pExternalBufferInfo->GetPointer(); VkExternalBufferProperties* out_pExternalBufferProperties = pExternalBufferProperties->IsNull() ? nullptr : pExternalBufferProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, nullptr }); @@ -2654,6 +2841,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceExternalFenceProperties( StructPointerDecoder* pExternalFenceInfo, StructPointerDecoder* pExternalFenceProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceExternalFenceInfo* in_pExternalFenceInfo = pExternalFenceInfo->GetPointer(); VkExternalFenceProperties* out_pExternalFenceProperties = pExternalFenceProperties->IsNull() ? nullptr : pExternalFenceProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, nullptr }); @@ -2668,6 +2856,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceExternalSemaphorePropertie StructPointerDecoder* pExternalSemaphoreInfo, StructPointerDecoder* pExternalSemaphoreProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceExternalSemaphoreInfo* in_pExternalSemaphoreInfo = pExternalSemaphoreInfo->GetPointer(); VkExternalSemaphoreProperties* out_pExternalSemaphoreProperties = pExternalSemaphoreProperties->IsNull() ? nullptr : pExternalSemaphoreProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, nullptr }); @@ -2682,6 +2871,7 @@ void VulkanReplayConsumer::Process_vkGetDescriptorSetLayoutSupport( StructPointerDecoder* pCreateInfo, StructPointerDecoder* pSupport) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDescriptorSetLayoutCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2701,6 +2891,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndirectCount( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -2723,6 +2914,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndexedIndirectCount( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -2743,10 +2935,12 @@ void VulkanReplayConsumer::Process_vkCreateRenderPass2( StructPointerDecoder* pAllocator, HandlePointerDecoder* pRenderPass) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pRenderPass->IsNull()) { pRenderPass->SetHandleLength(1); } RenderPassInfo handle_info; pRenderPass->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pRenderPass->GetPointer(), VK_OBJECT_TYPE_RENDER_PASS); VkResult replay_result = OverrideCreateRenderPass2(GetDeviceTable(in_device->handle)->CreateRenderPass2, returnValue, in_device, pCreateInfo, pAllocator, pRenderPass); CheckResult("vkCreateRenderPass2", returnValue, replay_result, call_info); @@ -2760,6 +2954,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginRenderPass2( StructPointerDecoder* pRenderPassBegin, StructPointerDecoder* pSubpassBeginInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); MapStructHandles(pRenderPassBegin->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2778,6 +2973,7 @@ void VulkanReplayConsumer::Process_vkCmdNextSubpass2( StructPointerDecoder* pSubpassBeginInfo, StructPointerDecoder* pSubpassEndInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkSubpassBeginInfo* in_pSubpassBeginInfo = pSubpassBeginInfo->GetPointer(); const VkSubpassEndInfo* in_pSubpassEndInfo = pSubpassEndInfo->GetPointer(); @@ -2795,6 +2991,7 @@ void VulkanReplayConsumer::Process_vkCmdEndRenderPass2( format::HandleId commandBuffer, StructPointerDecoder* pSubpassEndInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkSubpassEndInfo* in_pSubpassEndInfo = pSubpassEndInfo->GetPointer(); @@ -2813,6 +3010,7 @@ void VulkanReplayConsumer::Process_vkResetQueryPool( uint32_t firstQuery, uint32_t queryCount) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -2826,6 +3024,7 @@ void VulkanReplayConsumer::Process_vkGetSemaphoreCounterValue( format::HandleId semaphore, PointerDecoder* pValue) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSemaphore in_semaphore = MapHandle(semaphore, &VulkanObjectInfoTable::GetSemaphoreInfo); uint64_t* out_pValue = pValue->IsNull() ? nullptr : pValue->AllocateOutputData(1, static_cast(0)); @@ -2841,6 +3040,7 @@ void VulkanReplayConsumer::Process_vkWaitSemaphores( StructPointerDecoder* pWaitInfo, uint64_t timeout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pWaitInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2855,6 +3055,7 @@ void VulkanReplayConsumer::Process_vkSignalSemaphore( format::HandleId device, StructPointerDecoder* pSignalInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSemaphoreSignalInfo* in_pSignalInfo = pSignalInfo->GetPointer(); MapStructHandles(pSignalInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2869,6 +3070,7 @@ void VulkanReplayConsumer::Process_vkGetBufferDeviceAddress( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2882,6 +3084,7 @@ void VulkanReplayConsumer::Process_vkGetBufferOpaqueCaptureAddress( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkBufferDeviceAddressInfo* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2895,6 +3098,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceMemoryOpaqueCaptureAddress( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceMemoryOpaqueCaptureAddressInfo* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -2909,6 +3113,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceToolProperties( PointerDecoder* pToolCount, StructPointerDecoder* pToolProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pToolCount->IsNull() ? nullptr : pToolCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceToolProperties", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceToolProperties, pToolCount, pToolProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); if (!pToolProperties->IsNull()) { pToolProperties->AllocateOutputData(*pToolCount->GetOutputPointer(), VkPhysicalDeviceToolProperties{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, nullptr }); } @@ -2927,11 +3132,13 @@ void VulkanReplayConsumer::Process_vkCreatePrivateDataSlot( StructPointerDecoder* pAllocator, HandlePointerDecoder* pPrivateDataSlot) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPrivateDataSlotCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pPrivateDataSlot->IsNull()) { pPrivateDataSlot->SetHandleLength(1); } VkPrivateDataSlot* out_pPrivateDataSlot = pPrivateDataSlot->GetHandlePointer(); +ForwardIdToCaptureLayer(pPrivateDataSlot->GetPointer(), VK_OBJECT_TYPE_PRIVATE_DATA_SLOT); VkResult replay_result = GetDeviceTable(in_device)->CreatePrivateDataSlot(in_device, in_pCreateInfo, in_pAllocator, out_pPrivateDataSlot); CheckResult("vkCreatePrivateDataSlot", returnValue, replay_result, call_info); @@ -2945,6 +3152,7 @@ void VulkanReplayConsumer::Process_vkDestroyPrivateDataSlot( format::HandleId privateDataSlot, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPrivateDataSlot in_privateDataSlot = MapHandle(privateDataSlot, &VulkanObjectInfoTable::GetPrivateDataSlotInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -2962,6 +3170,7 @@ void VulkanReplayConsumer::Process_vkSetPrivateData( format::HandleId privateDataSlot, uint64_t data) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); uint64_t in_objectHandle = MapHandle(objectHandle, objectType); VkPrivateDataSlot in_privateDataSlot = MapHandle(privateDataSlot, &VulkanObjectInfoTable::GetPrivateDataSlotInfo); @@ -2978,6 +3187,7 @@ void VulkanReplayConsumer::Process_vkGetPrivateData( format::HandleId privateDataSlot, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); uint64_t in_objectHandle = MapHandle(objectHandle, objectType); VkPrivateDataSlot in_privateDataSlot = MapHandle(privateDataSlot, &VulkanObjectInfoTable::GetPrivateDataSlotInfo); @@ -2992,6 +3202,7 @@ void VulkanReplayConsumer::Process_vkCmdSetEvent2( format::HandleId event, StructPointerDecoder* pDependencyInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); const VkDependencyInfo* in_pDependencyInfo = pDependencyInfo->GetPointer(); @@ -3011,6 +3222,7 @@ void VulkanReplayConsumer::Process_vkCmdResetEvent2( format::HandleId event, VkPipelineStageFlags2 stageMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); @@ -3029,6 +3241,7 @@ void VulkanReplayConsumer::Process_vkCmdWaitEvents2( HandlePointerDecoder* pEvents, StructPointerDecoder* pDependencyInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkEvent* in_pEvents = MapHandles(pEvents, eventCount, &VulkanObjectInfoTable::GetEventInfo); const VkDependencyInfo* in_pDependencyInfos = pDependencyInfos->GetPointer(); @@ -3047,6 +3260,7 @@ void VulkanReplayConsumer::Process_vkCmdPipelineBarrier2( format::HandleId commandBuffer, StructPointerDecoder* pDependencyInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); MapStructHandles(pDependencyInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3066,6 +3280,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteTimestamp2( format::HandleId queryPool, uint32_t query) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -3085,6 +3300,7 @@ void VulkanReplayConsumer::Process_vkQueueSubmit2( StructPointerDecoder* pSubmits, format::HandleId fence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_queue = GetObjectInfoTable().GetQueueInfo(queue); MapStructArrayHandles(pSubmits->GetMetaStructPointer(), pSubmits->GetLength(), GetObjectInfoTable()); @@ -3099,6 +3315,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyBuffer2( format::HandleId commandBuffer, StructPointerDecoder* pCopyBufferInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyBufferInfo2* in_pCopyBufferInfo = pCopyBufferInfo->GetPointer(); MapStructHandles(pCopyBufferInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3116,6 +3333,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyImage2( format::HandleId commandBuffer, StructPointerDecoder* pCopyImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyImageInfo2* in_pCopyImageInfo = pCopyImageInfo->GetPointer(); MapStructHandles(pCopyImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3133,6 +3351,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyBufferToImage2( format::HandleId commandBuffer, StructPointerDecoder* pCopyBufferToImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyBufferToImageInfo2* in_pCopyBufferToImageInfo = pCopyBufferToImageInfo->GetPointer(); MapStructHandles(pCopyBufferToImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3150,6 +3369,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyImageToBuffer2( format::HandleId commandBuffer, StructPointerDecoder* pCopyImageToBufferInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyImageToBufferInfo2* in_pCopyImageToBufferInfo = pCopyImageToBufferInfo->GetPointer(); MapStructHandles(pCopyImageToBufferInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3167,6 +3387,7 @@ void VulkanReplayConsumer::Process_vkCmdBlitImage2( format::HandleId commandBuffer, StructPointerDecoder* pBlitImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBlitImageInfo2* in_pBlitImageInfo = pBlitImageInfo->GetPointer(); MapStructHandles(pBlitImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3184,6 +3405,7 @@ void VulkanReplayConsumer::Process_vkCmdResolveImage2( format::HandleId commandBuffer, StructPointerDecoder* pResolveImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkResolveImageInfo2* in_pResolveImageInfo = pResolveImageInfo->GetPointer(); MapStructHandles(pResolveImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3201,6 +3423,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginRendering( format::HandleId commandBuffer, StructPointerDecoder* pRenderingInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRenderingInfo* in_pRenderingInfo = pRenderingInfo->GetPointer(); MapStructHandles(pRenderingInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3217,6 +3440,7 @@ void VulkanReplayConsumer::Process_vkCmdEndRendering( const ApiCallInfo& call_info, format::HandleId commandBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdEndRendering(in_commandBuffer); @@ -3232,6 +3456,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCullMode( format::HandleId commandBuffer, VkCullModeFlags cullMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetCullMode(in_commandBuffer, cullMode); @@ -3247,6 +3472,7 @@ void VulkanReplayConsumer::Process_vkCmdSetFrontFace( format::HandleId commandBuffer, VkFrontFace frontFace) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetFrontFace(in_commandBuffer, frontFace); @@ -3262,6 +3488,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPrimitiveTopology( format::HandleId commandBuffer, VkPrimitiveTopology primitiveTopology) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetPrimitiveTopology(in_commandBuffer, primitiveTopology); @@ -3278,6 +3505,7 @@ void VulkanReplayConsumer::Process_vkCmdSetViewportWithCount( uint32_t viewportCount, StructPointerDecoder* pViewports) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkViewport* in_pViewports = pViewports->GetPointer(); @@ -3295,6 +3523,7 @@ void VulkanReplayConsumer::Process_vkCmdSetScissorWithCount( uint32_t scissorCount, StructPointerDecoder* pScissors) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRect2D* in_pScissors = pScissors->GetPointer(); @@ -3316,6 +3545,7 @@ void VulkanReplayConsumer::Process_vkCmdBindVertexBuffers2( PointerDecoder* pSizes, PointerDecoder* pStrides) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBuffer* in_pBuffers = MapHandles(pBuffers, bindingCount, &VulkanObjectInfoTable::GetBufferInfo); const VkDeviceSize* in_pOffsets = pOffsets->GetPointer(); @@ -3335,6 +3565,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthTestEnable( format::HandleId commandBuffer, VkBool32 depthTestEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthTestEnable(in_commandBuffer, depthTestEnable); @@ -3350,6 +3581,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthWriteEnable( format::HandleId commandBuffer, VkBool32 depthWriteEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthWriteEnable(in_commandBuffer, depthWriteEnable); @@ -3365,6 +3597,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthCompareOp( format::HandleId commandBuffer, VkCompareOp depthCompareOp) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthCompareOp(in_commandBuffer, depthCompareOp); @@ -3380,6 +3613,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthBoundsTestEnable( format::HandleId commandBuffer, VkBool32 depthBoundsTestEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthBoundsTestEnable(in_commandBuffer, depthBoundsTestEnable); @@ -3395,6 +3629,7 @@ void VulkanReplayConsumer::Process_vkCmdSetStencilTestEnable( format::HandleId commandBuffer, VkBool32 stencilTestEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetStencilTestEnable(in_commandBuffer, stencilTestEnable); @@ -3414,6 +3649,7 @@ void VulkanReplayConsumer::Process_vkCmdSetStencilOp( VkStencilOp depthFailOp, VkCompareOp compareOp) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetStencilOp(in_commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp); @@ -3429,6 +3665,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRasterizerDiscardEnable( format::HandleId commandBuffer, VkBool32 rasterizerDiscardEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetRasterizerDiscardEnable(in_commandBuffer, rasterizerDiscardEnable); @@ -3444,6 +3681,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthBiasEnable( format::HandleId commandBuffer, VkBool32 depthBiasEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthBiasEnable(in_commandBuffer, depthBiasEnable); @@ -3459,6 +3697,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPrimitiveRestartEnable( format::HandleId commandBuffer, VkBool32 primitiveRestartEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetPrimitiveRestartEnable(in_commandBuffer, primitiveRestartEnable); @@ -3475,6 +3714,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceBufferMemoryRequirements( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceBufferMemoryRequirements* in_pInfo = pInfo->GetPointer(); VkMemoryRequirements2* out_pMemoryRequirements = pMemoryRequirements->IsNull() ? nullptr : pMemoryRequirements->AllocateOutputData(1, { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, nullptr }); @@ -3489,6 +3729,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceImageMemoryRequirements( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceImageMemoryRequirements* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3505,6 +3746,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceImageSparseMemoryRequirements( PointerDecoder* pSparseMemoryRequirementCount, StructPointerDecoder* pSparseMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceImageMemoryRequirements* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3522,6 +3764,7 @@ void VulkanReplayConsumer::Process_vkDestroySurfaceKHR( format::HandleId surface, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); auto in_surface = GetObjectInfoTable().GetSurfaceKHRInfo(surface); if (in_surface == nullptr || in_surface->surface_creation_skipped) { return; } @@ -3543,6 +3786,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceSupportKHR( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfaceSupportKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkSurfaceKHR in_surface = MapHandle(surface, &VulkanObjectInfoTable::GetSurfaceKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(surface) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(surface)->surface_creation_skipped) { return; } @@ -3564,6 +3808,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceCapabilitiesKHR( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfaceCapabilitiesKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); auto in_surface = GetObjectInfoTable().GetSurfaceKHRInfo(surface); if (in_surface == nullptr || in_surface->surface_creation_skipped) { return; } @@ -3586,6 +3831,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceFormatsKHR( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfaceFormatsKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkSurfaceKHR in_surface = MapHandle(surface, &VulkanObjectInfoTable::GetSurfaceKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(surface) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(surface)->surface_creation_skipped) { return; } @@ -3611,6 +3857,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfacePresentModesKHR( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfacePresentModesKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkSurfaceKHR in_surface = MapHandle(surface, &VulkanObjectInfoTable::GetSurfaceKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(surface) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(surface)->surface_creation_skipped) { return; } @@ -3631,12 +3878,14 @@ void VulkanReplayConsumer::Process_vkCreateSwapchainKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSwapchain) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pSwapchain->IsNull()) { pSwapchain->SetHandleLength(1); } SwapchainKHRInfo handle_info; pSwapchain->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSwapchain->GetPointer(), VK_OBJECT_TYPE_SWAPCHAIN_KHR); VkResult replay_result = OverrideCreateSwapchainKHR(GetDeviceTable(in_device->handle)->CreateSwapchainKHR, returnValue, in_device, pCreateInfo, pAllocator, pSwapchain); CheckResult("vkCreateSwapchainKHR", returnValue, replay_result, call_info); @@ -3650,6 +3899,7 @@ void VulkanReplayConsumer::Process_vkDestroySwapchainKHR( format::HandleId swapchain, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_swapchain = GetObjectInfoTable().GetSwapchainKHRInfo(swapchain); @@ -3665,11 +3915,13 @@ void VulkanReplayConsumer::Process_vkGetSwapchainImagesKHR( PointerDecoder* pSwapchainImageCount, HandlePointerDecoder* pSwapchainImages) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_swapchain = GetObjectInfoTable().GetSwapchainKHRInfo(swapchain); pSwapchainImageCount->IsNull() ? nullptr : pSwapchainImageCount->AllocateOutputData(1, GetOutputArrayCount("vkGetSwapchainImagesKHR", returnValue, swapchain, kSwapchainKHRArrayGetSwapchainImagesKHR, pSwapchainImageCount, pSwapchainImages, &VulkanObjectInfoTable::GetSwapchainKHRInfo)); if (!pSwapchainImages->IsNull()) { pSwapchainImages->SetHandleLength(*pSwapchainImageCount->GetOutputPointer()); } std::vector handle_info(*pSwapchainImageCount->GetOutputPointer()); + ForwardIdsToCaptureLayer(pSwapchainImages->GetPointer(), pSwapchainImages->GetLength(), pSwapchainImages->GetHandlePointer(), *pSwapchainImageCount->GetOutputPointer(), VK_OBJECT_TYPE_IMAGE); for (size_t i = 0; i < *pSwapchainImageCount->GetOutputPointer(); ++i) { pSwapchainImages->SetConsumerData(i, &handle_info[i]); } VkResult replay_result = OverrideGetSwapchainImagesKHR(GetDeviceTable(in_device->handle)->GetSwapchainImagesKHR, returnValue, in_device, in_swapchain, pSwapchainImageCount, pSwapchainImages); @@ -3689,6 +3941,7 @@ void VulkanReplayConsumer::Process_vkAcquireNextImageKHR( format::HandleId fence, PointerDecoder* pImageIndex) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_swapchain = GetObjectInfoTable().GetSwapchainKHRInfo(swapchain); auto in_semaphore = GetObjectInfoTable().GetSemaphoreInfo(semaphore); @@ -3705,6 +3958,7 @@ void VulkanReplayConsumer::Process_vkQueuePresentKHR( format::HandleId queue, StructPointerDecoder* pPresentInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_queue = GetObjectInfoTable().GetQueueInfo(queue); MapStructHandles(pPresentInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3724,6 +3978,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceGroupPresentCapabilitiesKHR( GFXRECON_LOG_DEBUG("Skip vkGetDeviceGroupPresentCapabilitiesKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeviceGroupPresentCapabilitiesKHR* out_pDeviceGroupPresentCapabilities = pDeviceGroupPresentCapabilities->IsNull() ? nullptr : pDeviceGroupPresentCapabilities->AllocateOutputData(1, { VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR, nullptr }); InitializeOutputStructPNext(pDeviceGroupPresentCapabilities); @@ -3744,6 +3999,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceGroupSurfacePresentModesKHR( GFXRECON_LOG_DEBUG("Skip vkGetDeviceGroupSurfacePresentModesKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSurfaceKHR in_surface = MapHandle(surface, &VulkanObjectInfoTable::GetSurfaceKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(surface) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(surface)->surface_creation_skipped) { return; } @@ -3766,6 +4022,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDevicePresentRectanglesKHR( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDevicePresentRectanglesKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkSurfaceKHR in_surface = MapHandle(surface, &VulkanObjectInfoTable::GetSurfaceKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(surface) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(surface)->surface_creation_skipped) { return; } @@ -3785,6 +4042,7 @@ void VulkanReplayConsumer::Process_vkAcquireNextImage2KHR( StructPointerDecoder* pAcquireInfo, PointerDecoder* pImageIndex) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pAcquireInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -3801,6 +4059,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceDisplayPropertiesKHR( PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceDisplayPropertiesKHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceDisplayPropertiesKHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkDisplayPropertiesKHR* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(*out_pPropertyCount); @@ -3819,6 +4078,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceDisplayPlanePropertiesKHR( PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceDisplayPlanePropertiesKHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceDisplayPlanePropertiesKHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkDisplayPlanePropertiesKHR* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(*out_pPropertyCount); @@ -3838,10 +4098,12 @@ void VulkanReplayConsumer::Process_vkGetDisplayPlaneSupportedDisplaysKHR( PointerDecoder* pDisplayCount, HandlePointerDecoder* pDisplays) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pDisplayCount = pDisplayCount->IsNull() ? nullptr : pDisplayCount->AllocateOutputData(1, GetOutputArrayCount("vkGetDisplayPlaneSupportedDisplaysKHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetDisplayPlaneSupportedDisplaysKHR, pDisplayCount, pDisplays, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); if (!pDisplays->IsNull()) { pDisplays->SetHandleLength(*out_pDisplayCount); } VkDisplayKHR* out_pDisplays = pDisplays->GetHandlePointer(); +ForwardIdsToCaptureLayer(pDisplays->GetPointer(), pDisplays->GetLength(), pDisplays->GetHandlePointer(), *out_pDisplayCount, VK_OBJECT_TYPE_DISPLAY_KHR); VkResult replay_result = GetInstanceTable(in_physicalDevice)->GetDisplayPlaneSupportedDisplaysKHR(in_physicalDevice, planeIndex, out_pDisplayCount, out_pDisplays); CheckResult("vkGetDisplayPlaneSupportedDisplaysKHR", returnValue, replay_result, call_info); @@ -3858,6 +4120,7 @@ void VulkanReplayConsumer::Process_vkGetDisplayModePropertiesKHR( PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetDisplayModePropertiesKHR", returnValue, display, kDisplayKHRArrayGetDisplayModePropertiesKHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetDisplayKHRInfo)); @@ -3879,12 +4142,14 @@ void VulkanReplayConsumer::Process_vkCreateDisplayModeKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); const VkDisplayModeCreateInfoKHR* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pMode->IsNull()) { pMode->SetHandleLength(1); } VkDisplayModeKHR* out_pMode = pMode->GetHandlePointer(); +ForwardIdToCaptureLayer(pMode->GetPointer(), VK_OBJECT_TYPE_DISPLAY_MODE_KHR); VkResult replay_result = GetInstanceTable(in_physicalDevice)->CreateDisplayModeKHR(in_physicalDevice, in_display, in_pCreateInfo, in_pAllocator, out_pMode); CheckResult("vkCreateDisplayModeKHR", returnValue, replay_result, call_info); @@ -3900,6 +4165,7 @@ void VulkanReplayConsumer::Process_vkGetDisplayPlaneCapabilitiesKHR( uint32_t planeIndex, StructPointerDecoder* pCapabilities) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkDisplayModeKHR in_mode = MapHandle(mode, &VulkanObjectInfoTable::GetDisplayModeKHRInfo); VkDisplayPlaneCapabilitiesKHR* out_pCapabilities = pCapabilities->IsNull() ? nullptr : pCapabilities->AllocateOutputData(1); @@ -3916,12 +4182,14 @@ void VulkanReplayConsumer::Process_vkCreateDisplayPlaneSurfaceKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateDisplayPlaneSurfaceKHR(GetInstanceTable(in_instance->handle)->CreateDisplayPlaneSurfaceKHR, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateDisplayPlaneSurfaceKHR", returnValue, replay_result, call_info); @@ -3938,11 +4206,13 @@ void VulkanReplayConsumer::Process_vkCreateSharedSwapchainsKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSwapchains) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pCreateInfos->GetMetaStructPointer(), pCreateInfos->GetLength(), GetObjectInfoTable()); if (!pSwapchains->IsNull()) { pSwapchains->SetHandleLength(swapchainCount); } std::vector handle_info(swapchainCount); + ForwardIdsToCaptureLayer(pSwapchains->GetPointer(), pSwapchains->GetLength(), pSwapchains->GetHandlePointer(), swapchainCount, VK_OBJECT_TYPE_SWAPCHAIN_KHR); for (size_t i = 0; i < swapchainCount; ++i) { pSwapchains->SetConsumerData(i, &handle_info[i]); } VkResult replay_result = OverrideCreateSharedSwapchainsKHR(GetDeviceTable(in_device->handle)->CreateSharedSwapchainsKHR, returnValue, in_device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); @@ -3959,10 +4229,12 @@ void VulkanReplayConsumer::Process_vkCreateXlibSurfaceKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateXlibSurfaceKHR(GetInstanceTable(in_instance->handle)->CreateXlibSurfaceKHR, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateXlibSurfaceKHR", returnValue, replay_result, call_info); @@ -3978,6 +4250,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceXlibPresentationSupportKHR uint64_t dpy, size_t visualID) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); Display* in_dpy = static_cast(PreProcessExternalObject(dpy, format::ApiCallId::ApiCall_vkGetPhysicalDeviceXlibPresentationSupportKHR, "vkGetPhysicalDeviceXlibPresentationSupportKHR")); @@ -3992,10 +4265,12 @@ void VulkanReplayConsumer::Process_vkCreateXcbSurfaceKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateXcbSurfaceKHR(GetInstanceTable(in_instance->handle)->CreateXcbSurfaceKHR, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateXcbSurfaceKHR", returnValue, replay_result, call_info); @@ -4011,6 +4286,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceXcbPresentationSupportKHR( uint64_t connection, uint32_t visual_id) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); xcb_connection_t* in_connection = static_cast(PreProcessExternalObject(connection, format::ApiCallId::ApiCall_vkGetPhysicalDeviceXcbPresentationSupportKHR, "vkGetPhysicalDeviceXcbPresentationSupportKHR")); @@ -4025,10 +4301,12 @@ void VulkanReplayConsumer::Process_vkCreateWaylandSurfaceKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateWaylandSurfaceKHR(GetInstanceTable(in_instance->handle)->CreateWaylandSurfaceKHR, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateWaylandSurfaceKHR", returnValue, replay_result, call_info); @@ -4043,6 +4321,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceWaylandPresentationSupport uint32_t queueFamilyIndex, uint64_t display) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); struct wl_display* in_display = static_cast(PreProcessExternalObject(display, format::ApiCallId::ApiCall_vkGetPhysicalDeviceWaylandPresentationSupportKHR, "vkGetPhysicalDeviceWaylandPresentationSupportKHR")); @@ -4057,10 +4336,12 @@ void VulkanReplayConsumer::Process_vkCreateAndroidSurfaceKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateAndroidSurfaceKHR(GetInstanceTable(in_instance->handle)->CreateAndroidSurfaceKHR, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateAndroidSurfaceKHR", returnValue, replay_result, call_info); @@ -4076,10 +4357,12 @@ void VulkanReplayConsumer::Process_vkCreateWin32SurfaceKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateWin32SurfaceKHR(GetInstanceTable(in_instance->handle)->CreateWin32SurfaceKHR, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateWin32SurfaceKHR", returnValue, replay_result, call_info); @@ -4093,6 +4376,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceWin32PresentationSupportKH format::HandleId physicalDevice, uint32_t queueFamilyIndex) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); OverrideGetPhysicalDeviceWin32PresentationSupportKHR(GetInstanceTable(in_physicalDevice->handle)->GetPhysicalDeviceWin32PresentationSupportKHR, in_physicalDevice, queueFamilyIndex); @@ -4105,6 +4389,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceVideoCapabilitiesKHR( StructPointerDecoder* pVideoProfile, StructPointerDecoder* pCapabilities) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkVideoProfileInfoKHR* in_pVideoProfile = pVideoProfile->GetPointer(); VkVideoCapabilitiesKHR* out_pCapabilities = pCapabilities->IsNull() ? nullptr : pCapabilities->AllocateOutputData(1, { VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR, nullptr }); @@ -4122,6 +4407,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceVideoFormatPropertiesKHR( PointerDecoder* pVideoFormatPropertyCount, StructPointerDecoder* pVideoFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceVideoFormatInfoKHR* in_pVideoFormatInfo = pVideoFormatInfo->GetPointer(); uint32_t* out_pVideoFormatPropertyCount = pVideoFormatPropertyCount->IsNull() ? nullptr : pVideoFormatPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceVideoFormatPropertiesKHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceVideoFormatPropertiesKHR, pVideoFormatPropertyCount, pVideoFormatProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); @@ -4141,10 +4427,12 @@ void VulkanReplayConsumer::Process_vkCreateVideoSessionKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pVideoSession) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pVideoSession->IsNull()) { pVideoSession->SetHandleLength(1); } VideoSessionKHRInfo handle_info; pVideoSession->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pVideoSession->GetPointer(), VK_OBJECT_TYPE_VIDEO_SESSION_KHR); VkResult replay_result = OverrideCreateVideoSessionKHR(GetDeviceTable(in_device->handle)->CreateVideoSessionKHR, returnValue, in_device, pCreateInfo, pAllocator, pVideoSession); CheckResult("vkCreateVideoSessionKHR", returnValue, replay_result, call_info); @@ -4158,6 +4446,7 @@ void VulkanReplayConsumer::Process_vkDestroyVideoSessionKHR( format::HandleId videoSession, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_videoSession = GetObjectInfoTable().GetVideoSessionKHRInfo(videoSession); @@ -4173,6 +4462,7 @@ void VulkanReplayConsumer::Process_vkGetVideoSessionMemoryRequirementsKHR( PointerDecoder* pMemoryRequirementsCount, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkVideoSessionKHR in_videoSession = MapHandle(videoSession, &VulkanObjectInfoTable::GetVideoSessionKHRInfo); uint32_t* out_pMemoryRequirementsCount = pMemoryRequirementsCount->IsNull() ? nullptr : pMemoryRequirementsCount->AllocateOutputData(1, GetOutputArrayCount("vkGetVideoSessionMemoryRequirementsKHR", returnValue, videoSession, kVideoSessionKHRArrayGetVideoSessionMemoryRequirementsKHR, pMemoryRequirementsCount, pMemoryRequirements, &VulkanObjectInfoTable::GetVideoSessionKHRInfo)); @@ -4192,6 +4482,7 @@ void VulkanReplayConsumer::Process_vkBindVideoSessionMemoryKHR( uint32_t bindSessionMemoryInfoCount, StructPointerDecoder* pBindSessionMemoryInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_videoSession = GetObjectInfoTable().GetVideoSessionKHRInfo(videoSession); @@ -4209,12 +4500,14 @@ void VulkanReplayConsumer::Process_vkCreateVideoSessionParametersKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pVideoSessionParameters) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkVideoSessionParametersCreateInfoKHR* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pVideoSessionParameters->IsNull()) { pVideoSessionParameters->SetHandleLength(1); } VkVideoSessionParametersKHR* out_pVideoSessionParameters = pVideoSessionParameters->GetHandlePointer(); +ForwardIdToCaptureLayer(pVideoSessionParameters->GetPointer(), VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR); VkResult replay_result = GetDeviceTable(in_device)->CreateVideoSessionParametersKHR(in_device, in_pCreateInfo, in_pAllocator, out_pVideoSessionParameters); CheckResult("vkCreateVideoSessionParametersKHR", returnValue, replay_result, call_info); @@ -4229,6 +4522,7 @@ void VulkanReplayConsumer::Process_vkUpdateVideoSessionParametersKHR( format::HandleId videoSessionParameters, StructPointerDecoder* pUpdateInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkVideoSessionParametersKHR in_videoSessionParameters = MapHandle(videoSessionParameters, &VulkanObjectInfoTable::GetVideoSessionParametersKHRInfo); const VkVideoSessionParametersUpdateInfoKHR* in_pUpdateInfo = pUpdateInfo->GetPointer(); @@ -4243,6 +4537,7 @@ void VulkanReplayConsumer::Process_vkDestroyVideoSessionParametersKHR( format::HandleId videoSessionParameters, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkVideoSessionParametersKHR in_videoSessionParameters = MapHandle(videoSessionParameters, &VulkanObjectInfoTable::GetVideoSessionParametersKHRInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -4256,6 +4551,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginVideoCodingKHR( format::HandleId commandBuffer, StructPointerDecoder* pBeginInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkVideoBeginCodingInfoKHR* in_pBeginInfo = pBeginInfo->GetPointer(); MapStructHandles(pBeginInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4273,6 +4569,7 @@ void VulkanReplayConsumer::Process_vkCmdEndVideoCodingKHR( format::HandleId commandBuffer, StructPointerDecoder* pEndCodingInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkVideoEndCodingInfoKHR* in_pEndCodingInfo = pEndCodingInfo->GetPointer(); @@ -4289,6 +4586,7 @@ void VulkanReplayConsumer::Process_vkCmdControlVideoCodingKHR( format::HandleId commandBuffer, StructPointerDecoder* pCodingControlInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkVideoCodingControlInfoKHR* in_pCodingControlInfo = pCodingControlInfo->GetPointer(); @@ -4305,6 +4603,7 @@ void VulkanReplayConsumer::Process_vkCmdDecodeVideoKHR( format::HandleId commandBuffer, StructPointerDecoder* pDecodeInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkVideoDecodeInfoKHR* in_pDecodeInfo = pDecodeInfo->GetPointer(); MapStructHandles(pDecodeInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4322,6 +4621,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginRenderingKHR( format::HandleId commandBuffer, StructPointerDecoder* pRenderingInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRenderingInfo* in_pRenderingInfo = pRenderingInfo->GetPointer(); MapStructHandles(pRenderingInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4338,6 +4638,7 @@ void VulkanReplayConsumer::Process_vkCmdEndRenderingKHR( const ApiCallInfo& call_info, format::HandleId commandBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdEndRenderingKHR(in_commandBuffer); @@ -4353,6 +4654,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceFeatures2KHR( format::HandleId physicalDevice, StructPointerDecoder* pFeatures) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkPhysicalDeviceFeatures2* out_pFeatures = pFeatures->IsNull() ? nullptr : pFeatures->AllocateOutputData(1, { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, nullptr }); InitializeOutputStructPNext(pFeatures); @@ -4365,6 +4667,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceProperties2KHR( format::HandleId physicalDevice, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, nullptr }); InitializeOutputStructPNext(pProperties); @@ -4378,6 +4681,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceFormatProperties2KHR( VkFormat format, StructPointerDecoder* pFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkFormatProperties2* out_pFormatProperties = pFormatProperties->IsNull() ? nullptr : pFormatProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, nullptr }); InitializeOutputStructPNext(pFormatProperties); @@ -4392,6 +4696,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceImageFormatProperties2KHR( StructPointerDecoder* pImageFormatInfo, StructPointerDecoder* pImageFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceImageFormatInfo2* in_pImageFormatInfo = pImageFormatInfo->GetPointer(); VkImageFormatProperties2* out_pImageFormatProperties = pImageFormatProperties->IsNull() ? nullptr : pImageFormatProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, nullptr }); @@ -4407,6 +4712,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceQueueFamilyProperties2KHR( PointerDecoder* pQueueFamilyPropertyCount, StructPointerDecoder* pQueueFamilyProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pQueueFamilyPropertyCount = pQueueFamilyPropertyCount->IsNull() ? nullptr : pQueueFamilyPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceQueueFamilyProperties2KHR", VK_SUCCESS, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceQueueFamilyProperties2KHR, pQueueFamilyPropertyCount, pQueueFamilyProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkQueueFamilyProperties2* out_pQueueFamilyProperties = pQueueFamilyProperties->IsNull() ? nullptr : pQueueFamilyProperties->AllocateOutputData(*out_pQueueFamilyPropertyCount, VkQueueFamilyProperties2{ VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, nullptr }); @@ -4421,6 +4727,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceMemoryProperties2KHR( format::HandleId physicalDevice, StructPointerDecoder* pMemoryProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pMemoryProperties->IsNull() ? nullptr : pMemoryProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, nullptr }); InitializeOutputStructPNext(pMemoryProperties); @@ -4435,6 +4742,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSparseImageFormatPropertie PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceSparseImageFormatInfo2* in_pFormatInfo = pFormatInfo->GetPointer(); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceSparseImageFormatProperties2KHR", VK_SUCCESS, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceSparseImageFormatProperties2KHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); @@ -4453,6 +4761,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceGroupPeerMemoryFeaturesKHR( uint32_t remoteDeviceIndex, PointerDecoder* pPeerMemoryFeatures) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPeerMemoryFeatureFlags* out_pPeerMemoryFeatures = pPeerMemoryFeatures->IsNull() ? nullptr : pPeerMemoryFeatures->AllocateOutputData(1, static_cast(0)); @@ -4464,6 +4773,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDeviceMaskKHR( format::HandleId commandBuffer, uint32_t deviceMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDeviceMaskKHR(in_commandBuffer, deviceMask); @@ -4484,6 +4794,7 @@ void VulkanReplayConsumer::Process_vkCmdDispatchBaseKHR( uint32_t groupCountY, uint32_t groupCountZ) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDispatchBaseKHR(in_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ); @@ -4500,6 +4811,7 @@ void VulkanReplayConsumer::Process_vkTrimCommandPoolKHR( format::HandleId commandPool, VkCommandPoolTrimFlags flags) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkCommandPool in_commandPool = MapHandle(commandPool, &VulkanObjectInfoTable::GetCommandPoolInfo); @@ -4513,6 +4825,7 @@ void VulkanReplayConsumer::Process_vkEnumeratePhysicalDeviceGroupsKHR( PointerDecoder* pPhysicalDeviceGroupCount, StructPointerDecoder* pPhysicalDeviceGroupProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); pPhysicalDeviceGroupCount->IsNull() ? nullptr : pPhysicalDeviceGroupCount->AllocateOutputData(1, GetOutputArrayCount("vkEnumeratePhysicalDeviceGroupsKHR", returnValue, instance, kInstanceArrayEnumeratePhysicalDeviceGroupsKHR, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, &VulkanObjectInfoTable::GetInstanceInfo)); SetStructArrayHandleLengths(pPhysicalDeviceGroupProperties->GetMetaStructPointer(), pPhysicalDeviceGroupProperties->GetLength()); @@ -4531,6 +4844,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceExternalBufferPropertiesKH StructPointerDecoder* pExternalBufferInfo, StructPointerDecoder* pExternalBufferProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceExternalBufferInfo* in_pExternalBufferInfo = pExternalBufferInfo->GetPointer(); VkExternalBufferProperties* out_pExternalBufferProperties = pExternalBufferProperties->IsNull() ? nullptr : pExternalBufferProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, nullptr }); @@ -4546,6 +4860,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryWin32HandleKHR( StructPointerDecoder* pGetWin32HandleInfo, PointerDecoder* pHandle) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMemoryGetWin32HandleInfoKHR* in_pGetWin32HandleInfo = pGetWin32HandleInfo->GetPointer(); MapStructHandles(pGetWin32HandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4565,6 +4880,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryWin32HandlePropertiesKHR( uint64_t handle, StructPointerDecoder* pMemoryWin32HandleProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); HANDLE in_handle = static_cast(PreProcessExternalObject(handle, format::ApiCallId::ApiCall_vkGetMemoryWin32HandlePropertiesKHR, "vkGetMemoryWin32HandlePropertiesKHR")); VkMemoryWin32HandlePropertiesKHR* out_pMemoryWin32HandleProperties = pMemoryWin32HandleProperties->IsNull() ? nullptr : pMemoryWin32HandleProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR, nullptr }); @@ -4581,6 +4897,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryFdKHR( StructPointerDecoder* pGetFdInfo, PointerDecoder* pFd) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMemoryGetFdInfoKHR* in_pGetFdInfo = pGetFdInfo->GetPointer(); MapStructHandles(pGetFdInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4598,6 +4915,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryFdPropertiesKHR( int fd, StructPointerDecoder* pMemoryFdProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkMemoryFdPropertiesKHR* out_pMemoryFdProperties = pMemoryFdProperties->IsNull() ? nullptr : pMemoryFdProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR, nullptr }); InitializeOutputStructPNext(pMemoryFdProperties); @@ -4612,6 +4930,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceExternalSemaphorePropertie StructPointerDecoder* pExternalSemaphoreInfo, StructPointerDecoder* pExternalSemaphoreProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceExternalSemaphoreInfo* in_pExternalSemaphoreInfo = pExternalSemaphoreInfo->GetPointer(); VkExternalSemaphoreProperties* out_pExternalSemaphoreProperties = pExternalSemaphoreProperties->IsNull() ? nullptr : pExternalSemaphoreProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, nullptr }); @@ -4626,6 +4945,7 @@ void VulkanReplayConsumer::Process_vkImportSemaphoreWin32HandleKHR( format::HandleId device, StructPointerDecoder* pImportSemaphoreWin32HandleInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pImportSemaphoreWin32HandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4641,6 +4961,7 @@ void VulkanReplayConsumer::Process_vkGetSemaphoreWin32HandleKHR( StructPointerDecoder* pGetWin32HandleInfo, PointerDecoder* pHandle) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSemaphoreGetWin32HandleInfoKHR* in_pGetWin32HandleInfo = pGetWin32HandleInfo->GetPointer(); MapStructHandles(pGetWin32HandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4658,6 +4979,7 @@ void VulkanReplayConsumer::Process_vkImportSemaphoreFdKHR( format::HandleId device, StructPointerDecoder* pImportSemaphoreFdInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pImportSemaphoreFdInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4673,6 +4995,7 @@ void VulkanReplayConsumer::Process_vkGetSemaphoreFdKHR( StructPointerDecoder* pGetFdInfo, PointerDecoder* pFd) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pGetFdInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4691,6 +5014,7 @@ void VulkanReplayConsumer::Process_vkCmdPushDescriptorSetKHR( uint32_t descriptorWriteCount, StructPointerDecoder* pDescriptorWrites) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkPipelineLayout in_layout = MapHandle(layout, &VulkanObjectInfoTable::GetPipelineLayoutInfo); const VkWriteDescriptorSet* in_pDescriptorWrites = pDescriptorWrites->GetPointer(); @@ -4712,12 +5036,14 @@ void VulkanReplayConsumer::Process_vkCreateDescriptorUpdateTemplateKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pDescriptorUpdateTemplate) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pDescriptorUpdateTemplate->IsNull()) { pDescriptorUpdateTemplate->SetHandleLength(1); } DescriptorUpdateTemplateInfo handle_info; pDescriptorUpdateTemplate->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pDescriptorUpdateTemplate->GetPointer(), VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE); VkResult replay_result = OverrideCreateDescriptorUpdateTemplate(GetDeviceTable(in_device->handle)->CreateDescriptorUpdateTemplateKHR, returnValue, in_device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); CheckResult("vkCreateDescriptorUpdateTemplateKHR", returnValue, replay_result, call_info); @@ -4731,6 +5057,7 @@ void VulkanReplayConsumer::Process_vkDestroyDescriptorUpdateTemplateKHR( format::HandleId descriptorUpdateTemplate, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_descriptorUpdateTemplate = GetObjectInfoTable().GetDescriptorUpdateTemplateInfo(descriptorUpdateTemplate); @@ -4746,10 +5073,12 @@ void VulkanReplayConsumer::Process_vkCreateRenderPass2KHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pRenderPass) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); if (!pRenderPass->IsNull()) { pRenderPass->SetHandleLength(1); } RenderPassInfo handle_info; pRenderPass->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pRenderPass->GetPointer(), VK_OBJECT_TYPE_RENDER_PASS); VkResult replay_result = OverrideCreateRenderPass2(GetDeviceTable(in_device->handle)->CreateRenderPass2KHR, returnValue, in_device, pCreateInfo, pAllocator, pRenderPass); CheckResult("vkCreateRenderPass2KHR", returnValue, replay_result, call_info); @@ -4763,6 +5092,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginRenderPass2KHR( StructPointerDecoder* pRenderPassBegin, StructPointerDecoder* pSubpassBeginInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); MapStructHandles(pRenderPassBegin->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4781,6 +5111,7 @@ void VulkanReplayConsumer::Process_vkCmdNextSubpass2KHR( StructPointerDecoder* pSubpassBeginInfo, StructPointerDecoder* pSubpassEndInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkSubpassBeginInfo* in_pSubpassBeginInfo = pSubpassBeginInfo->GetPointer(); const VkSubpassEndInfo* in_pSubpassEndInfo = pSubpassEndInfo->GetPointer(); @@ -4798,6 +5129,7 @@ void VulkanReplayConsumer::Process_vkCmdEndRenderPass2KHR( format::HandleId commandBuffer, StructPointerDecoder* pSubpassEndInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkSubpassEndInfo* in_pSubpassEndInfo = pSubpassEndInfo->GetPointer(); @@ -4820,6 +5152,7 @@ void VulkanReplayConsumer::Process_vkGetSwapchainStatusKHR( GFXRECON_LOG_DEBUG("Skip vkGetSwapchainStatusKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -4834,6 +5167,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceExternalFencePropertiesKHR StructPointerDecoder* pExternalFenceInfo, StructPointerDecoder* pExternalFenceProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceExternalFenceInfo* in_pExternalFenceInfo = pExternalFenceInfo->GetPointer(); VkExternalFenceProperties* out_pExternalFenceProperties = pExternalFenceProperties->IsNull() ? nullptr : pExternalFenceProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, nullptr }); @@ -4848,6 +5182,7 @@ void VulkanReplayConsumer::Process_vkImportFenceWin32HandleKHR( format::HandleId device, StructPointerDecoder* pImportFenceWin32HandleInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImportFenceWin32HandleInfoKHR* in_pImportFenceWin32HandleInfo = pImportFenceWin32HandleInfo->GetPointer(); MapStructHandles(pImportFenceWin32HandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4863,6 +5198,7 @@ void VulkanReplayConsumer::Process_vkGetFenceWin32HandleKHR( StructPointerDecoder* pGetWin32HandleInfo, PointerDecoder* pHandle) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkFenceGetWin32HandleInfoKHR* in_pGetWin32HandleInfo = pGetWin32HandleInfo->GetPointer(); MapStructHandles(pGetWin32HandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4880,6 +5216,7 @@ void VulkanReplayConsumer::Process_vkImportFenceFdKHR( format::HandleId device, StructPointerDecoder* pImportFenceFdInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImportFenceFdInfoKHR* in_pImportFenceFdInfo = pImportFenceFdInfo->GetPointer(); MapStructHandles(pImportFenceFdInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4895,6 +5232,7 @@ void VulkanReplayConsumer::Process_vkGetFenceFdKHR( StructPointerDecoder* pGetFdInfo, PointerDecoder* pFd) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkFenceGetFdInfoKHR* in_pGetFdInfo = pGetFdInfo->GetPointer(); MapStructHandles(pGetFdInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -4913,6 +5251,7 @@ void VulkanReplayConsumer::Process_vkEnumeratePhysicalDeviceQueueFamilyPerforman StructPointerDecoder* pCounters, StructPointerDecoder* pCounterDescriptions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pCounterCount = pCounterCount->IsNull() ? nullptr : pCounterCount->AllocateOutputData(1, GetOutputArrayCount("vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR", returnValue, physicalDevice, kPhysicalDeviceArrayEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, pCounterCount, pCounterDescriptions, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkPerformanceCounterKHR* out_pCounters = pCounters->IsNull() ? nullptr : pCounters->AllocateOutputData(*out_pCounterCount, VkPerformanceCounterKHR{ VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR, nullptr }); @@ -4931,6 +5270,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceQueueFamilyPerformanceQuer StructPointerDecoder* pPerformanceQueryCreateInfo, PointerDecoder* pNumPasses) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkQueryPoolPerformanceCreateInfoKHR* in_pPerformanceQueryCreateInfo = pPerformanceQueryCreateInfo->GetPointer(); uint32_t* out_pNumPasses = pNumPasses->IsNull() ? nullptr : pNumPasses->AllocateOutputData(1, static_cast(0)); @@ -4944,6 +5284,7 @@ void VulkanReplayConsumer::Process_vkAcquireProfilingLockKHR( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); VkResult replay_result = OverrideAcquireProfilingLockKHR(GetDeviceTable(in_device->handle)->AcquireProfilingLockKHR, returnValue, in_device, pInfo); @@ -4954,6 +5295,7 @@ void VulkanReplayConsumer::Process_vkReleaseProfilingLockKHR( const ApiCallInfo& call_info, format::HandleId device) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); GetDeviceTable(in_device)->ReleaseProfilingLockKHR(in_device); @@ -4971,6 +5313,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceCapabilities2KHR( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfaceCapabilities2KHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; } @@ -4997,6 +5340,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceFormats2KHR( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfaceFormats2KHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceSurfaceInfo2KHR* in_pSurfaceInfo = pSurfaceInfo->GetPointer(); if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; } @@ -5019,6 +5363,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceDisplayProperties2KHR( PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceDisplayProperties2KHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceDisplayProperties2KHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkDisplayProperties2KHR* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(*out_pPropertyCount, VkDisplayProperties2KHR{ VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR, nullptr }); @@ -5037,6 +5382,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceDisplayPlaneProperties2KHR PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceDisplayPlaneProperties2KHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceDisplayPlaneProperties2KHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkDisplayPlaneProperties2KHR* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(*out_pPropertyCount, VkDisplayPlaneProperties2KHR{ VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR, nullptr }); @@ -5056,6 +5402,7 @@ void VulkanReplayConsumer::Process_vkGetDisplayModeProperties2KHR( PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetDisplayModeProperties2KHR", returnValue, display, kDisplayKHRArrayGetDisplayModeProperties2KHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetDisplayKHRInfo)); @@ -5075,6 +5422,7 @@ void VulkanReplayConsumer::Process_vkGetDisplayPlaneCapabilities2KHR( StructPointerDecoder* pDisplayPlaneInfo, StructPointerDecoder* pCapabilities) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkDisplayPlaneInfo2KHR* in_pDisplayPlaneInfo = pDisplayPlaneInfo->GetPointer(); MapStructHandles(pDisplayPlaneInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5091,6 +5439,7 @@ void VulkanReplayConsumer::Process_vkGetImageMemoryRequirements2KHR( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImageMemoryRequirementsInfo2* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5106,6 +5455,7 @@ void VulkanReplayConsumer::Process_vkGetBufferMemoryRequirements2KHR( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkBufferMemoryRequirementsInfo2* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5122,6 +5472,7 @@ void VulkanReplayConsumer::Process_vkGetImageSparseMemoryRequirements2KHR( PointerDecoder* pSparseMemoryRequirementCount, StructPointerDecoder* pSparseMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImageSparseMemoryRequirementsInfo2* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5141,11 +5492,13 @@ void VulkanReplayConsumer::Process_vkCreateSamplerYcbcrConversionKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pYcbcrConversion) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSamplerYcbcrConversionCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pYcbcrConversion->IsNull()) { pYcbcrConversion->SetHandleLength(1); } VkSamplerYcbcrConversion* out_pYcbcrConversion = pYcbcrConversion->GetHandlePointer(); +ForwardIdToCaptureLayer(pYcbcrConversion->GetPointer(), VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION); VkResult replay_result = GetDeviceTable(in_device)->CreateSamplerYcbcrConversionKHR(in_device, in_pCreateInfo, in_pAllocator, out_pYcbcrConversion); CheckResult("vkCreateSamplerYcbcrConversionKHR", returnValue, replay_result, call_info); @@ -5159,6 +5512,7 @@ void VulkanReplayConsumer::Process_vkDestroySamplerYcbcrConversionKHR( format::HandleId ycbcrConversion, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSamplerYcbcrConversion in_ycbcrConversion = MapHandle(ycbcrConversion, &VulkanObjectInfoTable::GetSamplerYcbcrConversionInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -5174,6 +5528,7 @@ void VulkanReplayConsumer::Process_vkBindBufferMemory2KHR( uint32_t bindInfoCount, StructPointerDecoder* pBindInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pBindInfos->GetMetaStructPointer(), pBindInfos->GetLength(), GetObjectInfoTable()); @@ -5189,6 +5544,7 @@ void VulkanReplayConsumer::Process_vkBindImageMemory2KHR( uint32_t bindInfoCount, StructPointerDecoder* pBindInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pBindInfos->GetMetaStructPointer(), pBindInfos->GetLength(), GetObjectInfoTable()); @@ -5203,6 +5559,7 @@ void VulkanReplayConsumer::Process_vkGetDescriptorSetLayoutSupportKHR( StructPointerDecoder* pCreateInfo, StructPointerDecoder* pSupport) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDescriptorSetLayoutCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5222,6 +5579,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndirectCountKHR( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -5244,6 +5602,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndexedIndirectCountKHR( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -5263,6 +5622,7 @@ void VulkanReplayConsumer::Process_vkGetSemaphoreCounterValueKHR( format::HandleId semaphore, PointerDecoder* pValue) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSemaphore in_semaphore = MapHandle(semaphore, &VulkanObjectInfoTable::GetSemaphoreInfo); uint64_t* out_pValue = pValue->IsNull() ? nullptr : pValue->AllocateOutputData(1, static_cast(0)); @@ -5278,6 +5638,7 @@ void VulkanReplayConsumer::Process_vkWaitSemaphoresKHR( StructPointerDecoder* pWaitInfo, uint64_t timeout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSemaphoreWaitInfo* in_pWaitInfo = pWaitInfo->GetPointer(); MapStructHandles(pWaitInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5292,6 +5653,7 @@ void VulkanReplayConsumer::Process_vkSignalSemaphoreKHR( format::HandleId device, StructPointerDecoder* pSignalInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSemaphoreSignalInfo* in_pSignalInfo = pSignalInfo->GetPointer(); MapStructHandles(pSignalInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5307,6 +5669,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceFragmentShadingRatesKHR( PointerDecoder* pFragmentShadingRateCount, StructPointerDecoder* pFragmentShadingRates) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pFragmentShadingRateCount = pFragmentShadingRateCount->IsNull() ? nullptr : pFragmentShadingRateCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceFragmentShadingRatesKHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceFragmentShadingRatesKHR, pFragmentShadingRateCount, pFragmentShadingRates, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkPhysicalDeviceFragmentShadingRateKHR* out_pFragmentShadingRates = pFragmentShadingRates->IsNull() ? nullptr : pFragmentShadingRates->AllocateOutputData(*out_pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR, nullptr }); @@ -5323,6 +5686,7 @@ void VulkanReplayConsumer::Process_vkCmdSetFragmentShadingRateKHR( StructPointerDecoder* pFragmentSize, PointerDecoder* combinerOps) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkExtent2D* in_pFragmentSize = pFragmentSize->GetPointer(); const VkFragmentShadingRateCombinerOpKHR* in_combinerOps = combinerOps->GetPointer(); @@ -5340,6 +5704,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRenderingAttachmentLocationsKHR( format::HandleId commandBuffer, StructPointerDecoder* pLocationInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRenderingAttachmentLocationInfoKHR* in_pLocationInfo = pLocationInfo->GetPointer(); @@ -5356,6 +5721,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRenderingInputAttachmentIndicesKHR( format::HandleId commandBuffer, StructPointerDecoder* pInputAttachmentIndexInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRenderingInputAttachmentIndexInfoKHR* in_pInputAttachmentIndexInfo = pInputAttachmentIndexInfo->GetPointer(); @@ -5380,6 +5746,7 @@ void VulkanReplayConsumer::Process_vkWaitForPresentKHR( GFXRECON_LOG_DEBUG("Skip vkWaitForPresentKHR for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_swapchain = GetObjectInfoTable().GetSwapchainKHRInfo(swapchain); @@ -5393,6 +5760,7 @@ void VulkanReplayConsumer::Process_vkGetBufferDeviceAddressKHR( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5406,6 +5774,7 @@ void VulkanReplayConsumer::Process_vkGetBufferOpaqueCaptureAddressKHR( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkBufferDeviceAddressInfo* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5419,6 +5788,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceMemoryOpaqueCaptureAddressKHR( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceMemoryOpaqueCaptureAddressInfo* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5433,10 +5803,12 @@ void VulkanReplayConsumer::Process_vkCreateDeferredOperationKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pDeferredOperation) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pDeferredOperation->IsNull()) { pDeferredOperation->SetHandleLength(1); } VkDeferredOperationKHR* out_pDeferredOperation = pDeferredOperation->GetHandlePointer(); +ForwardIdToCaptureLayer(pDeferredOperation->GetPointer(), VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR); VkResult replay_result = GetDeviceTable(in_device)->CreateDeferredOperationKHR(in_device, in_pAllocator, out_pDeferredOperation); CheckResult("vkCreateDeferredOperationKHR", returnValue, replay_result, call_info); @@ -5450,6 +5822,7 @@ void VulkanReplayConsumer::Process_vkDestroyDeferredOperationKHR( format::HandleId operation, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_operation = MapHandle(operation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -5464,6 +5837,7 @@ void VulkanReplayConsumer::Process_vkGetDeferredOperationMaxConcurrencyKHR( format::HandleId device, format::HandleId operation) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_operation = MapHandle(operation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); @@ -5476,6 +5850,7 @@ void VulkanReplayConsumer::Process_vkGetDeferredOperationResultKHR( format::HandleId device, format::HandleId operation) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_operation = MapHandle(operation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); @@ -5489,6 +5864,7 @@ void VulkanReplayConsumer::Process_vkDeferredOperationJoinKHR( format::HandleId device, format::HandleId operation) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_operation = GetObjectInfoTable().GetDeferredOperationKHRInfo(operation); @@ -5504,6 +5880,7 @@ void VulkanReplayConsumer::Process_vkGetPipelineExecutablePropertiesKHR( PointerDecoder* pExecutableCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPipelineInfoKHR* in_pPipelineInfo = pPipelineInfo->GetPointer(); MapStructHandles(pPipelineInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5524,6 +5901,7 @@ void VulkanReplayConsumer::Process_vkGetPipelineExecutableStatisticsKHR( PointerDecoder* pStatisticCount, StructPointerDecoder* pStatistics) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPipelineExecutableInfoKHR* in_pExecutableInfo = pExecutableInfo->GetPointer(); MapStructHandles(pExecutableInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5544,6 +5922,7 @@ void VulkanReplayConsumer::Process_vkGetPipelineExecutableInternalRepresentation PointerDecoder* pInternalRepresentationCount, StructPointerDecoder* pInternalRepresentations) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPipelineExecutableInfoKHR* in_pExecutableInfo = pExecutableInfo->GetPointer(); MapStructHandles(pExecutableInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5563,6 +5942,7 @@ void VulkanReplayConsumer::Process_vkMapMemory2KHR( StructPointerDecoder* pMemoryMapInfo, PointerDecoder* ppData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMemoryMapInfoKHR* in_pMemoryMapInfo = pMemoryMapInfo->GetPointer(); MapStructHandles(pMemoryMapInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5580,6 +5960,7 @@ void VulkanReplayConsumer::Process_vkUnmapMemory2KHR( format::HandleId device, StructPointerDecoder* pMemoryUnmapInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMemoryUnmapInfoKHR* in_pMemoryUnmapInfo = pMemoryUnmapInfo->GetPointer(); MapStructHandles(pMemoryUnmapInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5595,6 +5976,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceVideoEncodeQualityLevelPro StructPointerDecoder* pQualityLevelInfo, StructPointerDecoder* pQualityLevelProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* in_pQualityLevelInfo = pQualityLevelInfo->GetPointer(); VkVideoEncodeQualityLevelPropertiesKHR* out_pQualityLevelProperties = pQualityLevelProperties->IsNull() ? nullptr : pQualityLevelProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_PROPERTIES_KHR, nullptr }); @@ -5613,6 +5995,7 @@ void VulkanReplayConsumer::Process_vkGetEncodedVideoSessionParametersKHR( PointerDecoder* pDataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkVideoEncodeSessionParametersGetInfoKHR* in_pVideoSessionParametersInfo = pVideoSessionParametersInfo->GetPointer(); MapStructHandles(pVideoSessionParametersInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5632,6 +6015,7 @@ void VulkanReplayConsumer::Process_vkCmdEncodeVideoKHR( format::HandleId commandBuffer, StructPointerDecoder* pEncodeInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkVideoEncodeInfoKHR* in_pEncodeInfo = pEncodeInfo->GetPointer(); MapStructHandles(pEncodeInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5650,6 +6034,7 @@ void VulkanReplayConsumer::Process_vkCmdSetEvent2KHR( format::HandleId event, StructPointerDecoder* pDependencyInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); const VkDependencyInfo* in_pDependencyInfo = pDependencyInfo->GetPointer(); @@ -5669,6 +6054,7 @@ void VulkanReplayConsumer::Process_vkCmdResetEvent2KHR( format::HandleId event, VkPipelineStageFlags2 stageMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkEvent in_event = MapHandle(event, &VulkanObjectInfoTable::GetEventInfo); @@ -5687,6 +6073,7 @@ void VulkanReplayConsumer::Process_vkCmdWaitEvents2KHR( HandlePointerDecoder* pEvents, StructPointerDecoder* pDependencyInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkEvent* in_pEvents = MapHandles(pEvents, eventCount, &VulkanObjectInfoTable::GetEventInfo); const VkDependencyInfo* in_pDependencyInfos = pDependencyInfos->GetPointer(); @@ -5705,6 +6092,7 @@ void VulkanReplayConsumer::Process_vkCmdPipelineBarrier2KHR( format::HandleId commandBuffer, StructPointerDecoder* pDependencyInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); MapStructHandles(pDependencyInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5724,6 +6112,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteTimestamp2KHR( format::HandleId queryPool, uint32_t query) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -5743,6 +6132,7 @@ void VulkanReplayConsumer::Process_vkQueueSubmit2KHR( StructPointerDecoder* pSubmits, format::HandleId fence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_queue = GetObjectInfoTable().GetQueueInfo(queue); MapStructArrayHandles(pSubmits->GetMetaStructPointer(), pSubmits->GetLength(), GetObjectInfoTable()); @@ -5760,6 +6150,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteBufferMarker2AMD( VkDeviceSize dstOffset, uint32_t marker) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_dstBuffer = MapHandle(dstBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -5777,6 +6168,7 @@ void VulkanReplayConsumer::Process_vkGetQueueCheckpointData2NV( PointerDecoder* pCheckpointDataCount, StructPointerDecoder* pCheckpointData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); uint32_t* out_pCheckpointDataCount = pCheckpointDataCount->IsNull() ? nullptr : pCheckpointDataCount->AllocateOutputData(1, GetOutputArrayCount("vkGetQueueCheckpointData2NV", VK_SUCCESS, queue, kQueueArrayGetQueueCheckpointData2NV, pCheckpointDataCount, pCheckpointData, &VulkanObjectInfoTable::GetQueueInfo)); VkCheckpointData2NV* out_pCheckpointData = pCheckpointData->IsNull() ? nullptr : pCheckpointData->AllocateOutputData(*out_pCheckpointDataCount, VkCheckpointData2NV{ VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV, nullptr }); @@ -5791,6 +6183,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyBuffer2KHR( format::HandleId commandBuffer, StructPointerDecoder* pCopyBufferInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyBufferInfo2* in_pCopyBufferInfo = pCopyBufferInfo->GetPointer(); MapStructHandles(pCopyBufferInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5808,6 +6201,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyImage2KHR( format::HandleId commandBuffer, StructPointerDecoder* pCopyImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyImageInfo2* in_pCopyImageInfo = pCopyImageInfo->GetPointer(); MapStructHandles(pCopyImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5825,6 +6219,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyBufferToImage2KHR( format::HandleId commandBuffer, StructPointerDecoder* pCopyBufferToImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyBufferToImageInfo2* in_pCopyBufferToImageInfo = pCopyBufferToImageInfo->GetPointer(); MapStructHandles(pCopyBufferToImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5842,6 +6237,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyImageToBuffer2KHR( format::HandleId commandBuffer, StructPointerDecoder* pCopyImageToBufferInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyImageToBufferInfo2* in_pCopyImageToBufferInfo = pCopyImageToBufferInfo->GetPointer(); MapStructHandles(pCopyImageToBufferInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5859,6 +6255,7 @@ void VulkanReplayConsumer::Process_vkCmdBlitImage2KHR( format::HandleId commandBuffer, StructPointerDecoder* pBlitImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBlitImageInfo2* in_pBlitImageInfo = pBlitImageInfo->GetPointer(); MapStructHandles(pBlitImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5876,6 +6273,7 @@ void VulkanReplayConsumer::Process_vkCmdResolveImage2KHR( format::HandleId commandBuffer, StructPointerDecoder* pResolveImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkResolveImageInfo2* in_pResolveImageInfo = pResolveImageInfo->GetPointer(); MapStructHandles(pResolveImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5893,6 +6291,7 @@ void VulkanReplayConsumer::Process_vkCmdTraceRaysIndirect2KHR( format::HandleId commandBuffer, VkDeviceAddress indirectDeviceAddress) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdTraceRaysIndirect2KHR(in_commandBuffer, indirectDeviceAddress); @@ -5909,6 +6308,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceBufferMemoryRequirementsKHR( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceBufferMemoryRequirements* in_pInfo = pInfo->GetPointer(); VkMemoryRequirements2* out_pMemoryRequirements = pMemoryRequirements->IsNull() ? nullptr : pMemoryRequirements->AllocateOutputData(1, { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, nullptr }); @@ -5923,6 +6323,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceImageMemoryRequirementsKHR( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceImageMemoryRequirements* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5939,6 +6340,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceImageSparseMemoryRequirementsKHR( PointerDecoder* pSparseMemoryRequirementCount, StructPointerDecoder* pSparseMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceImageMemoryRequirements* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -5958,6 +6360,7 @@ void VulkanReplayConsumer::Process_vkCmdBindIndexBuffer2KHR( VkDeviceSize size, VkIndexType indexType) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -5975,6 +6378,7 @@ void VulkanReplayConsumer::Process_vkGetRenderingAreaGranularityKHR( StructPointerDecoder* pRenderingAreaInfo, StructPointerDecoder* pGranularity) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkRenderingAreaInfoKHR* in_pRenderingAreaInfo = pRenderingAreaInfo->GetPointer(); VkExtent2D* out_pGranularity = pGranularity->IsNull() ? nullptr : pGranularity->AllocateOutputData(1); @@ -5988,6 +6392,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceImageSubresourceLayoutKHR( StructPointerDecoder* pInfo, StructPointerDecoder* pLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceImageSubresourceInfoKHR* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6004,6 +6409,7 @@ void VulkanReplayConsumer::Process_vkGetImageSubresourceLayout2KHR( StructPointerDecoder* pSubresource, StructPointerDecoder* pLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkImage in_image = MapHandle(image, &VulkanObjectInfoTable::GetImageInfo); const VkImageSubresource2KHR* in_pSubresource = pSubresource->GetPointer(); @@ -6020,6 +6426,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceCooperativeMatrixPropertie PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceCooperativeMatrixPropertiesKHR, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkCooperativeMatrixPropertiesKHR* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(*out_pPropertyCount, VkCooperativeMatrixPropertiesKHR{ VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR, nullptr }); @@ -6036,6 +6443,7 @@ void VulkanReplayConsumer::Process_vkCmdSetLineStippleKHR( uint32_t lineStippleFactor, uint16_t lineStipplePattern) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetLineStippleKHR(in_commandBuffer, lineStippleFactor, lineStipplePattern); @@ -6053,6 +6461,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceCalibrateableTimeDomainsKH PointerDecoder* pTimeDomainCount, PointerDecoder* pTimeDomains) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pTimeDomainCount = pTimeDomainCount->IsNull() ? nullptr : pTimeDomainCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceCalibrateableTimeDomainsKHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceCalibrateableTimeDomainsKHR, pTimeDomainCount, pTimeDomains, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkTimeDomainKHR* out_pTimeDomains = pTimeDomains->IsNull() ? nullptr : pTimeDomains->AllocateOutputData(*out_pTimeDomainCount); @@ -6072,6 +6481,7 @@ void VulkanReplayConsumer::Process_vkGetCalibratedTimestampsKHR( PointerDecoder* pTimestamps, PointerDecoder* pMaxDeviation) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkCalibratedTimestampInfoKHR* in_pTimestampInfos = pTimestampInfos->GetPointer(); uint64_t* out_pTimestamps = pTimestamps->IsNull() ? nullptr : pTimestamps->AllocateOutputData(timestampCount); @@ -6086,6 +6496,7 @@ void VulkanReplayConsumer::Process_vkCmdBindDescriptorSets2KHR( format::HandleId commandBuffer, StructPointerDecoder* pBindDescriptorSetsInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBindDescriptorSetsInfoKHR* in_pBindDescriptorSetsInfo = pBindDescriptorSetsInfo->GetPointer(); MapStructHandles(pBindDescriptorSetsInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6103,6 +6514,7 @@ void VulkanReplayConsumer::Process_vkCmdPushConstants2KHR( format::HandleId commandBuffer, StructPointerDecoder* pPushConstantsInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkPushConstantsInfoKHR* in_pPushConstantsInfo = pPushConstantsInfo->GetPointer(); MapStructHandles(pPushConstantsInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6120,6 +6532,7 @@ void VulkanReplayConsumer::Process_vkCmdPushDescriptorSet2KHR( format::HandleId commandBuffer, StructPointerDecoder* pPushDescriptorSetInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkPushDescriptorSetInfoKHR* in_pPushDescriptorSetInfo = pPushDescriptorSetInfo->GetPointer(); MapStructHandles(pPushDescriptorSetInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6137,6 +6550,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDescriptorBufferOffsets2EXT( format::HandleId commandBuffer, StructPointerDecoder* pSetDescriptorBufferOffsetsInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkSetDescriptorBufferOffsetsInfoEXT* in_pSetDescriptorBufferOffsetsInfo = pSetDescriptorBufferOffsetsInfo->GetPointer(); MapStructHandles(pSetDescriptorBufferOffsetsInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6154,6 +6568,7 @@ void VulkanReplayConsumer::Process_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT format::HandleId commandBuffer, StructPointerDecoder* pBindDescriptorBufferEmbeddedSamplersInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* in_pBindDescriptorBufferEmbeddedSamplersInfo = pBindDescriptorBufferEmbeddedSamplersInfo->GetPointer(); MapStructHandles(pBindDescriptorBufferEmbeddedSamplersInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6172,6 +6587,7 @@ void VulkanReplayConsumer::Process_vkFrameBoundaryANDROID( format::HandleId semaphore, format::HandleId image) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_semaphore = GetObjectInfoTable().GetSemaphoreInfo(semaphore); auto in_image = GetObjectInfoTable().GetImageInfo(image); @@ -6187,10 +6603,12 @@ void VulkanReplayConsumer::Process_vkCreateDebugReportCallbackEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pCallback) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pCallback->IsNull()) { pCallback->SetHandleLength(1); } DebugReportCallbackEXTInfo handle_info; pCallback->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pCallback->GetPointer(), VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT); VkResult replay_result = OverrideCreateDebugReportCallbackEXT(GetInstanceTable(in_instance->handle)->CreateDebugReportCallbackEXT, returnValue, in_instance, pCreateInfo, pAllocator, pCallback); CheckResult("vkCreateDebugReportCallbackEXT", returnValue, replay_result, call_info); @@ -6204,6 +6622,7 @@ void VulkanReplayConsumer::Process_vkDestroyDebugReportCallbackEXT( format::HandleId callback, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); VkDebugReportCallbackEXT in_callback = MapHandle(callback, &VulkanObjectInfoTable::GetDebugReportCallbackEXTInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -6223,6 +6642,7 @@ void VulkanReplayConsumer::Process_vkDebugReportMessageEXT( StringDecoder* pLayerPrefix, StringDecoder* pMessage) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); uint64_t in_object = MapHandle(object, objectType); const char* in_pLayerPrefix = pLayerPrefix->GetPointer(); @@ -6237,6 +6657,7 @@ void VulkanReplayConsumer::Process_vkDebugMarkerSetObjectTagEXT( format::HandleId device, StructPointerDecoder* pTagInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDebugMarkerObjectTagInfoEXT* in_pTagInfo = pTagInfo->GetPointer(); MapStructHandles(pTagInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6251,6 +6672,7 @@ void VulkanReplayConsumer::Process_vkDebugMarkerSetObjectNameEXT( format::HandleId device, StructPointerDecoder* pNameInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDebugMarkerObjectNameInfoEXT* in_pNameInfo = pNameInfo->GetPointer(); MapStructHandles(pNameInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6264,6 +6686,7 @@ void VulkanReplayConsumer::Process_vkCmdDebugMarkerBeginEXT( format::HandleId commandBuffer, StructPointerDecoder* pMarkerInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkDebugMarkerMarkerInfoEXT* in_pMarkerInfo = pMarkerInfo->GetPointer(); @@ -6279,6 +6702,7 @@ void VulkanReplayConsumer::Process_vkCmdDebugMarkerEndEXT( const ApiCallInfo& call_info, format::HandleId commandBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDebugMarkerEndEXT(in_commandBuffer); @@ -6294,6 +6718,7 @@ void VulkanReplayConsumer::Process_vkCmdDebugMarkerInsertEXT( format::HandleId commandBuffer, StructPointerDecoder* pMarkerInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); OverrideCmdDebugMarkerInsertEXT(GetDeviceTable(in_commandBuffer->handle)->CmdDebugMarkerInsertEXT, in_commandBuffer, pMarkerInfo); @@ -6313,6 +6738,7 @@ void VulkanReplayConsumer::Process_vkCmdBindTransformFeedbackBuffersEXT( PointerDecoder* pOffsets, PointerDecoder* pSizes) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBuffer* in_pBuffers = MapHandles(pBuffers, bindingCount, &VulkanObjectInfoTable::GetBufferInfo); const VkDeviceSize* in_pOffsets = pOffsets->GetPointer(); @@ -6334,6 +6760,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginTransformFeedbackEXT( HandlePointerDecoder* pCounterBuffers, PointerDecoder* pCounterBufferOffsets) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBuffer* in_pCounterBuffers = MapHandles(pCounterBuffers, counterBufferCount, &VulkanObjectInfoTable::GetBufferInfo); const VkDeviceSize* in_pCounterBufferOffsets = pCounterBufferOffsets->GetPointer(); @@ -6354,6 +6781,7 @@ void VulkanReplayConsumer::Process_vkCmdEndTransformFeedbackEXT( HandlePointerDecoder* pCounterBuffers, PointerDecoder* pCounterBufferOffsets) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBuffer* in_pCounterBuffers = MapHandles(pCounterBuffers, counterBufferCount, &VulkanObjectInfoTable::GetBufferInfo); const VkDeviceSize* in_pCounterBufferOffsets = pCounterBufferOffsets->GetPointer(); @@ -6374,6 +6802,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginQueryIndexedEXT( VkQueryControlFlags flags, uint32_t index) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -6392,6 +6821,7 @@ void VulkanReplayConsumer::Process_vkCmdEndQueryIndexedEXT( uint32_t query, uint32_t index) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -6413,6 +6843,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndirectByteCountEXT( uint32_t counterOffset, uint32_t vertexStride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_counterBuffer = MapHandle(counterBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -6430,6 +6861,7 @@ void VulkanReplayConsumer::Process_vkGetImageViewHandleNVX( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImageViewHandleInfoNVX* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6444,6 +6876,7 @@ void VulkanReplayConsumer::Process_vkGetImageViewAddressNVX( format::HandleId imageView, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkImageView in_imageView = MapHandle(imageView, &VulkanObjectInfoTable::GetImageViewInfo); VkImageViewAddressPropertiesNVX* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX, nullptr }); @@ -6463,6 +6896,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndirectCountAMD( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -6485,6 +6919,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawIndexedIndirectCountAMD( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -6507,6 +6942,7 @@ void VulkanReplayConsumer::Process_vkGetShaderInfoAMD( PointerDecoder* pInfoSize, PointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); size_t* out_pInfoSize = pInfoSize->IsNull() ? nullptr : pInfoSize->AllocateOutputData(1, GetOutputArrayCount("vkGetShaderInfoAMD", returnValue, pipeline, kPipelineArrayGetShaderInfoAMD, pInfoSize, pInfo, &VulkanObjectInfoTable::GetPipelineInfo)); @@ -6526,11 +6962,13 @@ void VulkanReplayConsumer::Process_vkCreateStreamDescriptorSurfaceGGP( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkStreamDescriptorSurfaceCreateInfoGGP* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } VkSurfaceKHR* out_pSurface = pSurface->GetHandlePointer(); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = GetInstanceTable(in_instance)->CreateStreamDescriptorSurfaceGGP(in_instance, in_pCreateInfo, in_pAllocator, out_pSurface); CheckResult("vkCreateStreamDescriptorSurfaceGGP", returnValue, replay_result, call_info); @@ -6550,6 +6988,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceExternalImageFormatPropert VkExternalMemoryHandleTypeFlagsNV externalHandleType, StructPointerDecoder* pExternalImageFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkExternalImageFormatPropertiesNV* out_pExternalImageFormatProperties = pExternalImageFormatProperties->IsNull() ? nullptr : pExternalImageFormatProperties->AllocateOutputData(1); @@ -6565,6 +7004,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryWin32HandleNV( VkExternalMemoryHandleTypeFlagsNV handleType, PointerDecoder* pHandle) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeviceMemory in_memory = MapHandle(memory, &VulkanObjectInfoTable::GetDeviceMemoryInfo); HANDLE* out_pHandle = pHandle->IsNull() ? nullptr : reinterpret_cast(pHandle->AllocateOutputData(1)); @@ -6583,11 +7023,13 @@ void VulkanReplayConsumer::Process_vkCreateViSurfaceNN( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkViSurfaceCreateInfoNN* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } VkSurfaceKHR* out_pSurface = pSurface->GetHandlePointer(); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = GetInstanceTable(in_instance)->CreateViSurfaceNN(in_instance, in_pCreateInfo, in_pAllocator, out_pSurface); CheckResult("vkCreateViSurfaceNN", returnValue, replay_result, call_info); @@ -6600,6 +7042,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginConditionalRenderingEXT( format::HandleId commandBuffer, StructPointerDecoder* pConditionalRenderingBegin) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkConditionalRenderingBeginInfoEXT* in_pConditionalRenderingBegin = pConditionalRenderingBegin->GetPointer(); MapStructHandles(pConditionalRenderingBegin->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6616,6 +7059,7 @@ void VulkanReplayConsumer::Process_vkCmdEndConditionalRenderingEXT( const ApiCallInfo& call_info, format::HandleId commandBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdEndConditionalRenderingEXT(in_commandBuffer); @@ -6633,6 +7077,7 @@ void VulkanReplayConsumer::Process_vkCmdSetViewportWScalingNV( uint32_t viewportCount, StructPointerDecoder* pViewportWScalings) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkViewportWScalingNV* in_pViewportWScalings = pViewportWScalings->GetPointer(); @@ -6650,6 +7095,7 @@ void VulkanReplayConsumer::Process_vkReleaseDisplayEXT( format::HandleId physicalDevice, format::HandleId display) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); @@ -6664,6 +7110,7 @@ void VulkanReplayConsumer::Process_vkAcquireXlibDisplayEXT( uint64_t dpy, format::HandleId display) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); Display* in_dpy = static_cast(PreProcessExternalObject(dpy, format::ApiCallId::ApiCall_vkAcquireXlibDisplayEXT, "vkAcquireXlibDisplayEXT")); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); @@ -6680,11 +7127,13 @@ void VulkanReplayConsumer::Process_vkGetRandROutputDisplayEXT( size_t rrOutput, HandlePointerDecoder* pDisplay) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); Display* in_dpy = static_cast(PreProcessExternalObject(dpy, format::ApiCallId::ApiCall_vkGetRandROutputDisplayEXT, "vkGetRandROutputDisplayEXT")); if (!pDisplay->IsNull()) { pDisplay->SetHandleLength(1); } DisplayKHRInfo handle_info; pDisplay->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pDisplay->GetPointer(), VK_OBJECT_TYPE_DISPLAY_KHR); VkResult replay_result = OverrideGetRandROutputDisplayEXT(GetInstanceTable(in_physicalDevice->handle)->GetRandROutputDisplayEXT, returnValue, in_physicalDevice, in_dpy, rrOutput, pDisplay); CheckResult("vkGetRandROutputDisplayEXT", returnValue, replay_result, call_info); @@ -6704,6 +7153,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceCapabilities2EXT( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfaceCapabilities2EXT for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkSurfaceKHR in_surface = MapHandle(surface, &VulkanObjectInfoTable::GetSurfaceKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(surface) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(surface)->surface_creation_skipped) { return; } @@ -6721,6 +7171,7 @@ void VulkanReplayConsumer::Process_vkDisplayPowerControlEXT( format::HandleId display, StructPointerDecoder* pDisplayPowerInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); const VkDisplayPowerInfoEXT* in_pDisplayPowerInfo = pDisplayPowerInfo->GetPointer(); @@ -6737,11 +7188,13 @@ void VulkanReplayConsumer::Process_vkRegisterDeviceEventEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pFence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDeviceEventInfoEXT* in_pDeviceEventInfo = pDeviceEventInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pFence->IsNull()) { pFence->SetHandleLength(1); } VkFence* out_pFence = pFence->GetHandlePointer(); +ForwardIdToCaptureLayer(pFence->GetPointer(), VK_OBJECT_TYPE_FENCE); VkResult replay_result = GetDeviceTable(in_device)->RegisterDeviceEventEXT(in_device, in_pDeviceEventInfo, in_pAllocator, out_pFence); CheckResult("vkRegisterDeviceEventEXT", returnValue, replay_result, call_info); @@ -6758,12 +7211,14 @@ void VulkanReplayConsumer::Process_vkRegisterDisplayEventEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pFence) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); const VkDisplayEventInfoEXT* in_pDisplayEventInfo = pDisplayEventInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pFence->IsNull()) { pFence->SetHandleLength(1); } VkFence* out_pFence = pFence->GetHandlePointer(); +ForwardIdToCaptureLayer(pFence->GetPointer(), VK_OBJECT_TYPE_FENCE); VkResult replay_result = GetDeviceTable(in_device)->RegisterDisplayEventEXT(in_device, in_display, in_pDisplayEventInfo, in_pAllocator, out_pFence); CheckResult("vkRegisterDisplayEventEXT", returnValue, replay_result, call_info); @@ -6784,6 +7239,7 @@ void VulkanReplayConsumer::Process_vkGetSwapchainCounterEXT( GFXRECON_LOG_DEBUG("Skip vkGetSwapchainCounterEXT for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -6805,6 +7261,7 @@ void VulkanReplayConsumer::Process_vkGetRefreshCycleDurationGOOGLE( GFXRECON_LOG_DEBUG("Skip vkGetRefreshCycleDurationGOOGLE for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -6827,6 +7284,7 @@ void VulkanReplayConsumer::Process_vkGetPastPresentationTimingGOOGLE( GFXRECON_LOG_DEBUG("Skip vkGetPastPresentationTimingGOOGLE for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -6846,6 +7304,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDiscardRectangleEXT( uint32_t discardRectangleCount, StructPointerDecoder* pDiscardRectangles) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRect2D* in_pDiscardRectangles = pDiscardRectangles->GetPointer(); @@ -6862,6 +7321,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDiscardRectangleEnableEXT( format::HandleId commandBuffer, VkBool32 discardRectangleEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDiscardRectangleEnableEXT(in_commandBuffer, discardRectangleEnable); @@ -6877,6 +7337,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDiscardRectangleModeEXT( format::HandleId commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDiscardRectangleModeEXT(in_commandBuffer, discardRectangleMode); @@ -6899,6 +7360,7 @@ void VulkanReplayConsumer::Process_vkSetHdrMetadataEXT( GFXRECON_LOG_DEBUG("Skip vkSetHdrMetadataEXT for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSwapchainKHR* in_pSwapchains = MapHandles(pSwapchains, swapchainCount, &VulkanObjectInfoTable::GetSwapchainKHRInfo); const VkHdrMetadataEXT* in_pMetadata = pMetadata->GetPointer(); @@ -6914,11 +7376,13 @@ void VulkanReplayConsumer::Process_vkCreateIOSSurfaceMVK( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkIOSSurfaceCreateInfoMVK* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } VkSurfaceKHR* out_pSurface = pSurface->GetHandlePointer(); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = GetInstanceTable(in_instance)->CreateIOSSurfaceMVK(in_instance, in_pCreateInfo, in_pAllocator, out_pSurface); CheckResult("vkCreateIOSSurfaceMVK", returnValue, replay_result, call_info); @@ -6934,11 +7398,13 @@ void VulkanReplayConsumer::Process_vkCreateMacOSSurfaceMVK( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkMacOSSurfaceCreateInfoMVK* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } VkSurfaceKHR* out_pSurface = pSurface->GetHandlePointer(); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = GetInstanceTable(in_instance)->CreateMacOSSurfaceMVK(in_instance, in_pCreateInfo, in_pAllocator, out_pSurface); CheckResult("vkCreateMacOSSurfaceMVK", returnValue, replay_result, call_info); @@ -6952,6 +7418,7 @@ void VulkanReplayConsumer::Process_vkSetDebugUtilsObjectNameEXT( format::HandleId device, StructPointerDecoder* pNameInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDebugUtilsObjectNameInfoEXT* in_pNameInfo = pNameInfo->GetPointer(); MapStructHandles(pNameInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6968,6 +7435,7 @@ void VulkanReplayConsumer::Process_vkSetDebugUtilsObjectTagEXT( format::HandleId device, StructPointerDecoder* pTagInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDebugUtilsObjectTagInfoEXT* in_pTagInfo = pTagInfo->GetPointer(); MapStructHandles(pTagInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -6983,6 +7451,7 @@ void VulkanReplayConsumer::Process_vkQueueBeginDebugUtilsLabelEXT( format::HandleId queue, StructPointerDecoder* pLabelInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); const VkDebugUtilsLabelEXT* in_pLabelInfo = pLabelInfo->GetPointer(); @@ -6993,6 +7462,7 @@ void VulkanReplayConsumer::Process_vkQueueEndDebugUtilsLabelEXT( const ApiCallInfo& call_info, format::HandleId queue) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); GetDeviceTable(in_queue)->QueueEndDebugUtilsLabelEXT(in_queue); @@ -7003,6 +7473,7 @@ void VulkanReplayConsumer::Process_vkQueueInsertDebugUtilsLabelEXT( format::HandleId queue, StructPointerDecoder* pLabelInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); const VkDebugUtilsLabelEXT* in_pLabelInfo = pLabelInfo->GetPointer(); @@ -7014,6 +7485,7 @@ void VulkanReplayConsumer::Process_vkCmdBeginDebugUtilsLabelEXT( format::HandleId commandBuffer, StructPointerDecoder* pLabelInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkDebugUtilsLabelEXT* in_pLabelInfo = pLabelInfo->GetPointer(); @@ -7029,6 +7501,7 @@ void VulkanReplayConsumer::Process_vkCmdEndDebugUtilsLabelEXT( const ApiCallInfo& call_info, format::HandleId commandBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdEndDebugUtilsLabelEXT(in_commandBuffer); @@ -7044,6 +7517,7 @@ void VulkanReplayConsumer::Process_vkCmdInsertDebugUtilsLabelEXT( format::HandleId commandBuffer, StructPointerDecoder* pLabelInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_commandBuffer = GetObjectInfoTable().GetCommandBufferInfo(commandBuffer); OverrideCmdInsertDebugUtilsLabelEXT(GetDeviceTable(in_commandBuffer->handle)->CmdInsertDebugUtilsLabelEXT, in_commandBuffer, pLabelInfo); @@ -7062,10 +7536,12 @@ void VulkanReplayConsumer::Process_vkCreateDebugUtilsMessengerEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pMessenger) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pMessenger->IsNull()) { pMessenger->SetHandleLength(1); } DebugUtilsMessengerEXTInfo handle_info; pMessenger->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pMessenger->GetPointer(), VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT); VkResult replay_result = OverrideCreateDebugUtilsMessengerEXT(GetInstanceTable(in_instance->handle)->CreateDebugUtilsMessengerEXT, returnValue, in_instance, pCreateInfo, pAllocator, pMessenger); CheckResult("vkCreateDebugUtilsMessengerEXT", returnValue, replay_result, call_info); @@ -7079,6 +7555,7 @@ void VulkanReplayConsumer::Process_vkDestroyDebugUtilsMessengerEXT( format::HandleId messenger, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); VkDebugUtilsMessengerEXT in_messenger = MapHandle(messenger, &VulkanObjectInfoTable::GetDebugUtilsMessengerEXTInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -7094,6 +7571,7 @@ void VulkanReplayConsumer::Process_vkSubmitDebugUtilsMessageEXT( VkDebugUtilsMessageTypeFlagsEXT messageTypes, StructPointerDecoder* pCallbackData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkDebugUtilsMessengerCallbackDataEXT* in_pCallbackData = pCallbackData->GetPointer(); @@ -7107,6 +7585,7 @@ void VulkanReplayConsumer::Process_vkGetAndroidHardwareBufferPropertiesANDROID( uint64_t buffer, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); const struct AHardwareBuffer* in_buffer = static_cast(PreProcessExternalObject(buffer, format::ApiCallId::ApiCall_vkGetAndroidHardwareBufferPropertiesANDROID, "vkGetAndroidHardwareBufferPropertiesANDROID")); pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, nullptr }); @@ -7123,6 +7602,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryAndroidHardwareBufferANDROID( StructPointerDecoder* pInfo, PointerDecoder* pBuffer) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMemoryGetAndroidHardwareBufferInfoANDROID* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -7139,6 +7619,7 @@ void VulkanReplayConsumer::Process_vkCmdSetSampleLocationsEXT( format::HandleId commandBuffer, StructPointerDecoder* pSampleLocationsInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkSampleLocationsInfoEXT* in_pSampleLocationsInfo = pSampleLocationsInfo->GetPointer(); @@ -7156,6 +7637,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceMultisamplePropertiesEXT( VkSampleCountFlagBits samples, StructPointerDecoder* pMultisampleProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkMultisamplePropertiesEXT* out_pMultisampleProperties = pMultisampleProperties->IsNull() ? nullptr : pMultisampleProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT, nullptr }); InitializeOutputStructPNext(pMultisampleProperties); @@ -7170,6 +7652,7 @@ void VulkanReplayConsumer::Process_vkGetImageDrmFormatModifierPropertiesEXT( format::HandleId image, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkImage in_image = MapHandle(image, &VulkanObjectInfoTable::GetImageInfo); VkImageDrmFormatModifierPropertiesEXT* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT, nullptr }); @@ -7187,11 +7670,13 @@ void VulkanReplayConsumer::Process_vkCreateValidationCacheEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pValidationCache) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkValidationCacheCreateInfoEXT* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pValidationCache->IsNull()) { pValidationCache->SetHandleLength(1); } VkValidationCacheEXT* out_pValidationCache = pValidationCache->GetHandlePointer(); +ForwardIdToCaptureLayer(pValidationCache->GetPointer(), VK_OBJECT_TYPE_VALIDATION_CACHE_EXT); VkResult replay_result = GetDeviceTable(in_device)->CreateValidationCacheEXT(in_device, in_pCreateInfo, in_pAllocator, out_pValidationCache); CheckResult("vkCreateValidationCacheEXT", returnValue, replay_result, call_info); @@ -7205,6 +7690,7 @@ void VulkanReplayConsumer::Process_vkDestroyValidationCacheEXT( format::HandleId validationCache, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkValidationCacheEXT in_validationCache = MapHandle(validationCache, &VulkanObjectInfoTable::GetValidationCacheEXTInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -7221,6 +7707,7 @@ void VulkanReplayConsumer::Process_vkMergeValidationCachesEXT( uint32_t srcCacheCount, HandlePointerDecoder* pSrcCaches) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkValidationCacheEXT in_dstCache = MapHandle(dstCache, &VulkanObjectInfoTable::GetValidationCacheEXTInfo); const VkValidationCacheEXT* in_pSrcCaches = MapHandles(pSrcCaches, srcCacheCount, &VulkanObjectInfoTable::GetValidationCacheEXTInfo); @@ -7237,6 +7724,7 @@ void VulkanReplayConsumer::Process_vkGetValidationCacheDataEXT( PointerDecoder* pDataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkValidationCacheEXT in_validationCache = MapHandle(validationCache, &VulkanObjectInfoTable::GetValidationCacheEXTInfo); size_t* out_pDataSize = pDataSize->IsNull() ? nullptr : pDataSize->AllocateOutputData(1, GetOutputArrayCount("vkGetValidationCacheDataEXT", returnValue, validationCache, kValidationCacheEXTArrayGetValidationCacheDataEXT, pDataSize, pData, &VulkanObjectInfoTable::GetValidationCacheEXTInfo)); @@ -7254,6 +7742,7 @@ void VulkanReplayConsumer::Process_vkCmdBindShadingRateImageNV( format::HandleId imageView, VkImageLayout imageLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImageView in_imageView = MapHandle(imageView, &VulkanObjectInfoTable::GetImageViewInfo); @@ -7272,6 +7761,7 @@ void VulkanReplayConsumer::Process_vkCmdSetViewportShadingRatePaletteNV( uint32_t viewportCount, StructPointerDecoder* pShadingRatePalettes) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkShadingRatePaletteNV* in_pShadingRatePalettes = pShadingRatePalettes->GetPointer(); @@ -7290,6 +7780,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCoarseSampleOrderNV( uint32_t customSampleOrderCount, StructPointerDecoder* pCustomSampleOrders) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCoarseSampleOrderCustomNV* in_pCustomSampleOrders = pCustomSampleOrders->GetPointer(); @@ -7309,12 +7800,14 @@ void VulkanReplayConsumer::Process_vkCreateAccelerationStructureNV( StructPointerDecoder* pAllocator, HandlePointerDecoder* pAccelerationStructure) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkAccelerationStructureCreateInfoNV* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pAccelerationStructure->IsNull()) { pAccelerationStructure->SetHandleLength(1); } VkAccelerationStructureNV* out_pAccelerationStructure = pAccelerationStructure->GetHandlePointer(); +ForwardIdToCaptureLayer(pAccelerationStructure->GetPointer(), VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV); VkResult replay_result = GetDeviceTable(in_device)->CreateAccelerationStructureNV(in_device, in_pCreateInfo, in_pAllocator, out_pAccelerationStructure); CheckResult("vkCreateAccelerationStructureNV", returnValue, replay_result, call_info); @@ -7328,6 +7821,7 @@ void VulkanReplayConsumer::Process_vkDestroyAccelerationStructureNV( format::HandleId accelerationStructure, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkAccelerationStructureNV in_accelerationStructure = MapHandle(accelerationStructure, &VulkanObjectInfoTable::GetAccelerationStructureNVInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -7342,6 +7836,7 @@ void VulkanReplayConsumer::Process_vkGetAccelerationStructureMemoryRequirementsN StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkAccelerationStructureMemoryRequirementsInfoNV* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -7357,6 +7852,7 @@ void VulkanReplayConsumer::Process_vkBindAccelerationStructureMemoryNV( uint32_t bindInfoCount, StructPointerDecoder* pBindInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkBindAccelerationStructureMemoryInfoNV* in_pBindInfos = pBindInfos->GetPointer(); MapStructArrayHandles(pBindInfos->GetMetaStructPointer(), pBindInfos->GetLength(), GetObjectInfoTable()); @@ -7377,6 +7873,7 @@ void VulkanReplayConsumer::Process_vkCmdBuildAccelerationStructureNV( format::HandleId scratch, VkDeviceSize scratchOffset) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkAccelerationStructureInfoNV* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -7400,6 +7897,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyAccelerationStructureNV( format::HandleId src, VkCopyAccelerationStructureModeKHR mode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkAccelerationStructureNV in_dst = MapHandle(dst, &VulkanObjectInfoTable::GetAccelerationStructureNVInfo); VkAccelerationStructureNV in_src = MapHandle(src, &VulkanObjectInfoTable::GetAccelerationStructureNVInfo); @@ -7430,6 +7928,7 @@ void VulkanReplayConsumer::Process_vkCmdTraceRaysNV( uint32_t height, uint32_t depth) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_raygenShaderBindingTableBuffer = MapHandle(raygenShaderBindingTableBuffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_missShaderBindingTableBuffer = MapHandle(missShaderBindingTableBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -7454,6 +7953,7 @@ void VulkanReplayConsumer::Process_vkCreateRayTracingPipelinesNV( StructPointerDecoder* pAllocator, HandlePointerDecoder* pPipelines) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipelineCache in_pipelineCache = MapHandle(pipelineCache, &VulkanObjectInfoTable::GetPipelineCacheInfo); const VkRayTracingPipelineCreateInfoNV* in_pCreateInfos = pCreateInfos->GetPointer(); @@ -7462,6 +7962,7 @@ void VulkanReplayConsumer::Process_vkCreateRayTracingPipelinesNV( if (!pPipelines->IsNull()) { pPipelines->SetHandleLength(createInfoCount); } if (omitted_pipeline_cache_data_) {AllowCompileDuringPipelineCreation(createInfoCount, pCreateInfos->GetPointer());} VkPipeline* out_pPipelines = pPipelines->GetHandlePointer(); +ForwardIdsToCaptureLayer(pPipelines->GetPointer(), pPipelines->GetLength(), pPipelines->GetHandlePointer(), createInfoCount, VK_OBJECT_TYPE_PIPELINE); VkResult replay_result = GetDeviceTable(in_device)->CreateRayTracingPipelinesNV(in_device, in_pipelineCache, createInfoCount, in_pCreateInfos, in_pAllocator, out_pPipelines); CheckResult("vkCreateRayTracingPipelinesNV", returnValue, replay_result, call_info); @@ -7479,6 +7980,7 @@ void VulkanReplayConsumer::Process_vkGetRayTracingShaderGroupHandlesKHR( size_t dataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); auto in_pipeline = GetObjectInfoTable().GetPipelineInfo(pipeline); if (!pData->IsNull()) { pData->AllocateOutputData(dataSize); } @@ -7497,6 +7999,7 @@ void VulkanReplayConsumer::Process_vkGetRayTracingShaderGroupHandlesNV( size_t dataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); void* out_pData = pData->IsNull() ? nullptr : pData->AllocateOutputData(dataSize); @@ -7513,6 +8016,7 @@ void VulkanReplayConsumer::Process_vkGetAccelerationStructureHandleNV( size_t dataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkAccelerationStructureNV in_accelerationStructure = MapHandle(accelerationStructure, &VulkanObjectInfoTable::GetAccelerationStructureNVInfo); void* out_pData = pData->IsNull() ? nullptr : pData->AllocateOutputData(dataSize); @@ -7530,6 +8034,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteAccelerationStructuresPropertiesNV( format::HandleId queryPool, uint32_t firstQuery) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkAccelerationStructureNV* in_pAccelerationStructures = MapHandles(pAccelerationStructures, accelerationStructureCount, &VulkanObjectInfoTable::GetAccelerationStructureNVInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -7549,6 +8054,7 @@ void VulkanReplayConsumer::Process_vkCompileDeferredNV( format::HandleId pipeline, uint32_t shader) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); @@ -7564,6 +8070,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryHostPointerPropertiesEXT( uint64_t pHostPointer, StructPointerDecoder* pMemoryHostPointerProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const void* in_pHostPointer = PreProcessExternalObject(pHostPointer, format::ApiCallId::ApiCall_vkGetMemoryHostPointerPropertiesEXT, "vkGetMemoryHostPointerPropertiesEXT"); VkMemoryHostPointerPropertiesEXT* out_pMemoryHostPointerProperties = pMemoryHostPointerProperties->IsNull() ? nullptr : pMemoryHostPointerProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT, nullptr }); @@ -7581,6 +8088,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteBufferMarkerAMD( VkDeviceSize dstOffset, uint32_t marker) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_dstBuffer = MapHandle(dstBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -7599,6 +8107,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceCalibrateableTimeDomainsEX PointerDecoder* pTimeDomainCount, PointerDecoder* pTimeDomains) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pTimeDomainCount = pTimeDomainCount->IsNull() ? nullptr : pTimeDomainCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceCalibrateableTimeDomainsEXT, pTimeDomainCount, pTimeDomains, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkTimeDomainKHR* out_pTimeDomains = pTimeDomains->IsNull() ? nullptr : pTimeDomains->AllocateOutputData(*out_pTimeDomainCount); @@ -7618,6 +8127,7 @@ void VulkanReplayConsumer::Process_vkGetCalibratedTimestampsEXT( PointerDecoder* pTimestamps, PointerDecoder* pMaxDeviation) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkCalibratedTimestampInfoKHR* in_pTimestampInfos = pTimestampInfos->GetPointer(); uint64_t* out_pTimestamps = pTimestamps->IsNull() ? nullptr : pTimestamps->AllocateOutputData(timestampCount); @@ -7633,6 +8143,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMeshTasksNV( uint32_t taskCount, uint32_t firstTask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDrawMeshTasksNV(in_commandBuffer, taskCount, firstTask); @@ -7651,6 +8162,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMeshTasksIndirectNV( uint32_t drawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -7672,6 +8184,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMeshTasksIndirectCountNV( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -7691,6 +8204,7 @@ void VulkanReplayConsumer::Process_vkCmdSetExclusiveScissorEnableNV( uint32_t exclusiveScissorCount, PointerDecoder* pExclusiveScissorEnables) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBool32* in_pExclusiveScissorEnables = pExclusiveScissorEnables->GetPointer(); @@ -7709,6 +8223,7 @@ void VulkanReplayConsumer::Process_vkCmdSetExclusiveScissorNV( uint32_t exclusiveScissorCount, StructPointerDecoder* pExclusiveScissors) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRect2D* in_pExclusiveScissors = pExclusiveScissors->GetPointer(); @@ -7725,6 +8240,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCheckpointNV( format::HandleId commandBuffer, uint64_t pCheckpointMarker) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const void* in_pCheckpointMarker = PreProcessExternalObject(pCheckpointMarker, format::ApiCallId::ApiCall_vkCmdSetCheckpointNV, "vkCmdSetCheckpointNV"); @@ -7742,6 +8258,7 @@ void VulkanReplayConsumer::Process_vkGetQueueCheckpointDataNV( PointerDecoder* pCheckpointDataCount, StructPointerDecoder* pCheckpointData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); uint32_t* out_pCheckpointDataCount = pCheckpointDataCount->IsNull() ? nullptr : pCheckpointDataCount->AllocateOutputData(1, GetOutputArrayCount("vkGetQueueCheckpointDataNV", VK_SUCCESS, queue, kQueueArrayGetQueueCheckpointDataNV, pCheckpointDataCount, pCheckpointData, &VulkanObjectInfoTable::GetQueueInfo)); VkCheckpointDataNV* out_pCheckpointData = pCheckpointData->IsNull() ? nullptr : pCheckpointData->AllocateOutputData(*out_pCheckpointDataCount, VkCheckpointDataNV{ VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV, nullptr }); @@ -7757,6 +8274,7 @@ void VulkanReplayConsumer::Process_vkInitializePerformanceApiINTEL( format::HandleId device, StructPointerDecoder* pInitializeInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkInitializePerformanceApiInfoINTEL* in_pInitializeInfo = pInitializeInfo->GetPointer(); @@ -7768,6 +8286,7 @@ void VulkanReplayConsumer::Process_vkUninitializePerformanceApiINTEL( const ApiCallInfo& call_info, format::HandleId device) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); GetDeviceTable(in_device)->UninitializePerformanceApiINTEL(in_device); @@ -7779,6 +8298,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPerformanceMarkerINTEL( format::HandleId commandBuffer, StructPointerDecoder* pMarkerInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkPerformanceMarkerInfoINTEL* in_pMarkerInfo = pMarkerInfo->GetPointer(); @@ -7797,6 +8317,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPerformanceStreamMarkerINTEL( format::HandleId commandBuffer, StructPointerDecoder* pMarkerInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkPerformanceStreamMarkerInfoINTEL* in_pMarkerInfo = pMarkerInfo->GetPointer(); @@ -7815,6 +8336,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPerformanceOverrideINTEL( format::HandleId commandBuffer, StructPointerDecoder* pOverrideInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkPerformanceOverrideInfoINTEL* in_pOverrideInfo = pOverrideInfo->GetPointer(); @@ -7834,10 +8356,12 @@ void VulkanReplayConsumer::Process_vkAcquirePerformanceConfigurationINTEL( StructPointerDecoder* pAcquireInfo, HandlePointerDecoder* pConfiguration) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPerformanceConfigurationAcquireInfoINTEL* in_pAcquireInfo = pAcquireInfo->GetPointer(); if (!pConfiguration->IsNull()) { pConfiguration->SetHandleLength(1); } VkPerformanceConfigurationINTEL* out_pConfiguration = pConfiguration->GetHandlePointer(); +ForwardIdToCaptureLayer(pConfiguration->GetPointer(), VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL); VkResult replay_result = GetDeviceTable(in_device)->AcquirePerformanceConfigurationINTEL(in_device, in_pAcquireInfo, out_pConfiguration); CheckResult("vkAcquirePerformanceConfigurationINTEL", returnValue, replay_result, call_info); @@ -7851,6 +8375,7 @@ void VulkanReplayConsumer::Process_vkReleasePerformanceConfigurationINTEL( format::HandleId device, format::HandleId configuration) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPerformanceConfigurationINTEL in_configuration = MapHandle(configuration, &VulkanObjectInfoTable::GetPerformanceConfigurationINTELInfo); @@ -7864,6 +8389,7 @@ void VulkanReplayConsumer::Process_vkQueueSetPerformanceConfigurationINTEL( format::HandleId queue, format::HandleId configuration) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); VkPerformanceConfigurationINTEL in_configuration = MapHandle(configuration, &VulkanObjectInfoTable::GetPerformanceConfigurationINTELInfo); @@ -7878,6 +8404,7 @@ void VulkanReplayConsumer::Process_vkGetPerformanceParameterINTEL( VkPerformanceParameterTypeINTEL parameter, StructPointerDecoder* pValue) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPerformanceValueINTEL* out_pValue = pValue->IsNull() ? nullptr : pValue->AllocateOutputData(1); @@ -7896,6 +8423,7 @@ void VulkanReplayConsumer::Process_vkSetLocalDimmingAMD( GFXRECON_LOG_DEBUG("Skip vkSetLocalDimmingAMD for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapChain = MapHandle(swapChain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); @@ -7910,11 +8438,13 @@ void VulkanReplayConsumer::Process_vkCreateImagePipeSurfaceFUCHSIA( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkImagePipeSurfaceCreateInfoFUCHSIA* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } VkSurfaceKHR* out_pSurface = pSurface->GetHandlePointer(); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = GetInstanceTable(in_instance)->CreateImagePipeSurfaceFUCHSIA(in_instance, in_pCreateInfo, in_pAllocator, out_pSurface); CheckResult("vkCreateImagePipeSurfaceFUCHSIA", returnValue, replay_result, call_info); @@ -7930,10 +8460,12 @@ void VulkanReplayConsumer::Process_vkCreateMetalSurfaceEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateMetalSurfaceEXT(GetInstanceTable(in_instance->handle)->CreateMetalSurfaceEXT, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateMetalSurfaceEXT", returnValue, replay_result, call_info); @@ -7947,6 +8479,7 @@ void VulkanReplayConsumer::Process_vkGetBufferDeviceAddressEXT( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkBufferDeviceAddressInfo* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -7961,6 +8494,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceToolPropertiesEXT( PointerDecoder* pToolCount, StructPointerDecoder* pToolProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_physicalDevice = GetObjectInfoTable().GetPhysicalDeviceInfo(physicalDevice); pToolCount->IsNull() ? nullptr : pToolCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceToolPropertiesEXT", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceToolPropertiesEXT, pToolCount, pToolProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); if (!pToolProperties->IsNull()) { pToolProperties->AllocateOutputData(*pToolCount->GetOutputPointer(), VkPhysicalDeviceToolProperties{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, nullptr }); } @@ -7978,6 +8512,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceCooperativeMatrixPropertie PointerDecoder* pPropertyCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pPropertyCount = pPropertyCount->IsNull() ? nullptr : pPropertyCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceCooperativeMatrixPropertiesNV", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceCooperativeMatrixPropertiesNV, pPropertyCount, pProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkCooperativeMatrixPropertiesNV* out_pProperties = pProperties->IsNull() ? nullptr : pProperties->AllocateOutputData(*out_pPropertyCount, VkCooperativeMatrixPropertiesNV{ VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV, nullptr }); @@ -7995,6 +8530,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSupportedFramebufferMixedS PointerDecoder* pCombinationCount, StructPointerDecoder* pCombinations) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); uint32_t* out_pCombinationCount = pCombinationCount->IsNull() ? nullptr : pCombinationCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV, pCombinationCount, pCombinations, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); VkFramebufferMixedSamplesCombinationNV* out_pCombinations = pCombinations->IsNull() ? nullptr : pCombinations->AllocateOutputData(*out_pCombinationCount, VkFramebufferMixedSamplesCombinationNV{ VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV, nullptr }); @@ -8018,6 +8554,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfacePresentModes2EXT( GFXRECON_LOG_DEBUG("Skip vkGetPhysicalDeviceSurfacePresentModes2EXT for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkPhysicalDeviceSurfaceInfo2KHR* in_pSurfaceInfo = pSurfaceInfo->GetPointer(); if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; } @@ -8044,6 +8581,7 @@ void VulkanReplayConsumer::Process_vkAcquireFullScreenExclusiveModeEXT( GFXRECON_LOG_DEBUG("Skip vkAcquireFullScreenExclusiveModeEXT for offscreen or force windowed mode."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -8063,6 +8601,7 @@ void VulkanReplayConsumer::Process_vkReleaseFullScreenExclusiveModeEXT( GFXRECON_LOG_DEBUG("Skip vkReleaseFullScreenExclusiveModeEXT for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -8083,6 +8622,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceGroupSurfacePresentModes2EXT( GFXRECON_LOG_DEBUG("Skip vkGetDeviceGroupSurfacePresentModes2EXT for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPhysicalDeviceSurfaceInfo2KHR* in_pSurfaceInfo = pSurfaceInfo->GetPointer(); if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; } @@ -8103,10 +8643,12 @@ void VulkanReplayConsumer::Process_vkCreateHeadlessSurfaceEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_instance = GetObjectInfoTable().GetInstanceInfo(instance); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } SurfaceKHRInfo handle_info; pSurface->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = OverrideCreateHeadlessSurfaceEXT(GetInstanceTable(in_instance->handle)->CreateHeadlessSurfaceEXT, returnValue, in_instance, pCreateInfo, pAllocator, pSurface); CheckResult("vkCreateHeadlessSurfaceEXT", returnValue, replay_result, call_info); @@ -8120,6 +8662,7 @@ void VulkanReplayConsumer::Process_vkCmdSetLineStippleEXT( uint32_t lineStippleFactor, uint16_t lineStipplePattern) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetLineStippleEXT(in_commandBuffer, lineStippleFactor, lineStipplePattern); @@ -8137,6 +8680,7 @@ void VulkanReplayConsumer::Process_vkResetQueryPoolEXT( uint32_t firstQuery, uint32_t queryCount) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -8148,6 +8692,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCullModeEXT( format::HandleId commandBuffer, VkCullModeFlags cullMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetCullModeEXT(in_commandBuffer, cullMode); @@ -8163,6 +8708,7 @@ void VulkanReplayConsumer::Process_vkCmdSetFrontFaceEXT( format::HandleId commandBuffer, VkFrontFace frontFace) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetFrontFaceEXT(in_commandBuffer, frontFace); @@ -8178,6 +8724,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPrimitiveTopologyEXT( format::HandleId commandBuffer, VkPrimitiveTopology primitiveTopology) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetPrimitiveTopologyEXT(in_commandBuffer, primitiveTopology); @@ -8194,6 +8741,7 @@ void VulkanReplayConsumer::Process_vkCmdSetViewportWithCountEXT( uint32_t viewportCount, StructPointerDecoder* pViewports) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkViewport* in_pViewports = pViewports->GetPointer(); @@ -8211,6 +8759,7 @@ void VulkanReplayConsumer::Process_vkCmdSetScissorWithCountEXT( uint32_t scissorCount, StructPointerDecoder* pScissors) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkRect2D* in_pScissors = pScissors->GetPointer(); @@ -8232,6 +8781,7 @@ void VulkanReplayConsumer::Process_vkCmdBindVertexBuffers2EXT( PointerDecoder* pSizes, PointerDecoder* pStrides) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBuffer* in_pBuffers = MapHandles(pBuffers, bindingCount, &VulkanObjectInfoTable::GetBufferInfo); const VkDeviceSize* in_pOffsets = pOffsets->GetPointer(); @@ -8251,6 +8801,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthTestEnableEXT( format::HandleId commandBuffer, VkBool32 depthTestEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthTestEnableEXT(in_commandBuffer, depthTestEnable); @@ -8266,6 +8817,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthWriteEnableEXT( format::HandleId commandBuffer, VkBool32 depthWriteEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthWriteEnableEXT(in_commandBuffer, depthWriteEnable); @@ -8281,6 +8833,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthCompareOpEXT( format::HandleId commandBuffer, VkCompareOp depthCompareOp) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthCompareOpEXT(in_commandBuffer, depthCompareOp); @@ -8296,6 +8849,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthBoundsTestEnableEXT( format::HandleId commandBuffer, VkBool32 depthBoundsTestEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthBoundsTestEnableEXT(in_commandBuffer, depthBoundsTestEnable); @@ -8311,6 +8865,7 @@ void VulkanReplayConsumer::Process_vkCmdSetStencilTestEnableEXT( format::HandleId commandBuffer, VkBool32 stencilTestEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetStencilTestEnableEXT(in_commandBuffer, stencilTestEnable); @@ -8330,6 +8885,7 @@ void VulkanReplayConsumer::Process_vkCmdSetStencilOpEXT( VkStencilOp depthFailOp, VkCompareOp compareOp) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetStencilOpEXT(in_commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp); @@ -8346,6 +8902,7 @@ void VulkanReplayConsumer::Process_vkCopyMemoryToImageEXT( format::HandleId device, StructPointerDecoder* pCopyMemoryToImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkCopyMemoryToImageInfoEXT* in_pCopyMemoryToImageInfo = pCopyMemoryToImageInfo->GetPointer(); MapStructHandles(pCopyMemoryToImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8360,6 +8917,7 @@ void VulkanReplayConsumer::Process_vkCopyImageToMemoryEXT( format::HandleId device, StructPointerDecoder* pCopyImageToMemoryInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkCopyImageToMemoryInfoEXT* in_pCopyImageToMemoryInfo = pCopyImageToMemoryInfo->GetPointer(); MapStructHandles(pCopyImageToMemoryInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8374,6 +8932,7 @@ void VulkanReplayConsumer::Process_vkCopyImageToImageEXT( format::HandleId device, StructPointerDecoder* pCopyImageToImageInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkCopyImageToImageInfoEXT* in_pCopyImageToImageInfo = pCopyImageToImageInfo->GetPointer(); MapStructHandles(pCopyImageToImageInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8389,6 +8948,7 @@ void VulkanReplayConsumer::Process_vkTransitionImageLayoutEXT( uint32_t transitionCount, StructPointerDecoder* pTransitions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkHostImageLayoutTransitionInfoEXT* in_pTransitions = pTransitions->GetPointer(); MapStructArrayHandles(pTransitions->GetMetaStructPointer(), pTransitions->GetLength(), GetObjectInfoTable()); @@ -8404,6 +8964,7 @@ void VulkanReplayConsumer::Process_vkGetImageSubresourceLayout2EXT( StructPointerDecoder* pSubresource, StructPointerDecoder* pLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkImage in_image = MapHandle(image, &VulkanObjectInfoTable::GetImageInfo); const VkImageSubresource2KHR* in_pSubresource = pSubresource->GetPointer(); @@ -8424,6 +8985,7 @@ void VulkanReplayConsumer::Process_vkReleaseSwapchainImagesEXT( GFXRECON_LOG_DEBUG("Skip vkReleaseSwapchainImagesEXT for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkReleaseSwapchainImagesInfoEXT* in_pReleaseInfo = pReleaseInfo->GetPointer(); MapStructHandles(pReleaseInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8438,6 +9000,7 @@ void VulkanReplayConsumer::Process_vkGetGeneratedCommandsMemoryRequirementsNV( StructPointerDecoder* pInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkGeneratedCommandsMemoryRequirementsInfoNV* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8452,6 +9015,7 @@ void VulkanReplayConsumer::Process_vkCmdPreprocessGeneratedCommandsNV( format::HandleId commandBuffer, StructPointerDecoder* pGeneratedCommandsInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkGeneratedCommandsInfoNV* in_pGeneratedCommandsInfo = pGeneratedCommandsInfo->GetPointer(); MapStructHandles(pGeneratedCommandsInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8470,6 +9034,7 @@ void VulkanReplayConsumer::Process_vkCmdExecuteGeneratedCommandsNV( VkBool32 isPreprocessed, StructPointerDecoder* pGeneratedCommandsInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkGeneratedCommandsInfoNV* in_pGeneratedCommandsInfo = pGeneratedCommandsInfo->GetPointer(); MapStructHandles(pGeneratedCommandsInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8489,6 +9054,7 @@ void VulkanReplayConsumer::Process_vkCmdBindPipelineShaderGroupNV( format::HandleId pipeline, uint32_t groupIndex) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); @@ -8508,12 +9074,14 @@ void VulkanReplayConsumer::Process_vkCreateIndirectCommandsLayoutNV( StructPointerDecoder* pAllocator, HandlePointerDecoder* pIndirectCommandsLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkIndirectCommandsLayoutCreateInfoNV* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pIndirectCommandsLayout->IsNull()) { pIndirectCommandsLayout->SetHandleLength(1); } VkIndirectCommandsLayoutNV* out_pIndirectCommandsLayout = pIndirectCommandsLayout->GetHandlePointer(); +ForwardIdToCaptureLayer(pIndirectCommandsLayout->GetPointer(), VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV); VkResult replay_result = GetDeviceTable(in_device)->CreateIndirectCommandsLayoutNV(in_device, in_pCreateInfo, in_pAllocator, out_pIndirectCommandsLayout); CheckResult("vkCreateIndirectCommandsLayoutNV", returnValue, replay_result, call_info); @@ -8527,6 +9095,7 @@ void VulkanReplayConsumer::Process_vkDestroyIndirectCommandsLayoutNV( format::HandleId indirectCommandsLayout, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkIndirectCommandsLayoutNV in_indirectCommandsLayout = MapHandle(indirectCommandsLayout, &VulkanObjectInfoTable::GetIndirectCommandsLayoutNVInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -8540,6 +9109,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthBias2EXT( format::HandleId commandBuffer, StructPointerDecoder* pDepthBiasInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkDepthBiasInfoEXT* in_pDepthBiasInfo = pDepthBiasInfo->GetPointer(); @@ -8558,6 +9128,7 @@ void VulkanReplayConsumer::Process_vkAcquireDrmDisplayEXT( int32_t drmFd, format::HandleId display) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); @@ -8573,9 +9144,11 @@ void VulkanReplayConsumer::Process_vkGetDrmDisplayEXT( uint32_t connectorId, HandlePointerDecoder* display) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); if (!display->IsNull()) { display->SetHandleLength(1); } VkDisplayKHR* out_display = display->GetHandlePointer(); +ForwardIdToCaptureLayer(display->GetPointer(), VK_OBJECT_TYPE_DISPLAY_KHR); VkResult replay_result = GetInstanceTable(in_physicalDevice)->GetDrmDisplayEXT(in_physicalDevice, drmFd, connectorId, out_display); CheckResult("vkGetDrmDisplayEXT", returnValue, replay_result, call_info); @@ -8591,11 +9164,13 @@ void VulkanReplayConsumer::Process_vkCreatePrivateDataSlotEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pPrivateDataSlot) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPrivateDataSlotCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pPrivateDataSlot->IsNull()) { pPrivateDataSlot->SetHandleLength(1); } VkPrivateDataSlot* out_pPrivateDataSlot = pPrivateDataSlot->GetHandlePointer(); +ForwardIdToCaptureLayer(pPrivateDataSlot->GetPointer(), VK_OBJECT_TYPE_PRIVATE_DATA_SLOT); VkResult replay_result = GetDeviceTable(in_device)->CreatePrivateDataSlotEXT(in_device, in_pCreateInfo, in_pAllocator, out_pPrivateDataSlot); CheckResult("vkCreatePrivateDataSlotEXT", returnValue, replay_result, call_info); @@ -8609,6 +9184,7 @@ void VulkanReplayConsumer::Process_vkDestroyPrivateDataSlotEXT( format::HandleId privateDataSlot, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPrivateDataSlot in_privateDataSlot = MapHandle(privateDataSlot, &VulkanObjectInfoTable::GetPrivateDataSlotInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -8626,6 +9202,7 @@ void VulkanReplayConsumer::Process_vkSetPrivateDataEXT( format::HandleId privateDataSlot, uint64_t data) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); uint64_t in_objectHandle = MapHandle(objectHandle, objectType); VkPrivateDataSlot in_privateDataSlot = MapHandle(privateDataSlot, &VulkanObjectInfoTable::GetPrivateDataSlotInfo); @@ -8642,6 +9219,7 @@ void VulkanReplayConsumer::Process_vkGetPrivateDataEXT( format::HandleId privateDataSlot, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); uint64_t in_objectHandle = MapHandle(objectHandle, objectType); VkPrivateDataSlot in_privateDataSlot = MapHandle(privateDataSlot, &VulkanObjectInfoTable::GetPrivateDataSlotInfo); @@ -8656,6 +9234,7 @@ void VulkanReplayConsumer::Process_vkCmdSetFragmentShadingRateEnumNV( VkFragmentShadingRateNV shadingRate, PointerDecoder* combinerOps) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkFragmentShadingRateCombinerOpKHR* in_combinerOps = combinerOps->GetPointer(); @@ -8674,6 +9253,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceFaultInfoEXT( StructPointerDecoder* pFaultCounts, StructPointerDecoder* pFaultInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeviceFaultCountsEXT* out_pFaultCounts = pFaultCounts->IsNull() ? nullptr : pFaultCounts->AllocateOutputData(1, { VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT, nullptr }); InitializeOutputStructPNext(pFaultCounts); @@ -8690,6 +9270,7 @@ void VulkanReplayConsumer::Process_vkAcquireWinrtDisplayNV( format::HandleId physicalDevice, format::HandleId display) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); VkDisplayKHR in_display = MapHandle(display, &VulkanObjectInfoTable::GetDisplayKHRInfo); @@ -8704,9 +9285,11 @@ void VulkanReplayConsumer::Process_vkGetWinrtDisplayNV( uint32_t deviceRelativeId, HandlePointerDecoder* pDisplay) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); if (!pDisplay->IsNull()) { pDisplay->SetHandleLength(1); } VkDisplayKHR* out_pDisplay = pDisplay->GetHandlePointer(); +ForwardIdToCaptureLayer(pDisplay->GetPointer(), VK_OBJECT_TYPE_DISPLAY_KHR); VkResult replay_result = GetInstanceTable(in_physicalDevice)->GetWinrtDisplayNV(in_physicalDevice, deviceRelativeId, out_pDisplay); CheckResult("vkGetWinrtDisplayNV", returnValue, replay_result, call_info); @@ -8722,11 +9305,13 @@ void VulkanReplayConsumer::Process_vkCreateDirectFBSurfaceEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkDirectFBSurfaceCreateInfoEXT* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } VkSurfaceKHR* out_pSurface = pSurface->GetHandlePointer(); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = GetInstanceTable(in_instance)->CreateDirectFBSurfaceEXT(in_instance, in_pCreateInfo, in_pAllocator, out_pSurface); CheckResult("vkCreateDirectFBSurfaceEXT", returnValue, replay_result, call_info); @@ -8741,6 +9326,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceDirectFBPresentationSuppor uint32_t queueFamilyIndex, uint64_t dfb) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); IDirectFB* in_dfb = static_cast(PreProcessExternalObject(dfb, format::ApiCallId::ApiCall_vkGetPhysicalDeviceDirectFBPresentationSupportEXT, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT")); @@ -8755,6 +9341,7 @@ void VulkanReplayConsumer::Process_vkCmdSetVertexInputEXT( uint32_t vertexAttributeDescriptionCount, StructPointerDecoder* pVertexAttributeDescriptions) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkVertexInputBindingDescription2EXT* in_pVertexBindingDescriptions = pVertexBindingDescriptions->GetPointer(); const VkVertexInputAttributeDescription2EXT* in_pVertexAttributeDescriptions = pVertexAttributeDescriptions->GetPointer(); @@ -8774,6 +9361,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryZirconHandleFUCHSIA( StructPointerDecoder* pGetZirconHandleInfo, PointerDecoder* pZirconHandle) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMemoryGetZirconHandleInfoFUCHSIA* in_pGetZirconHandleInfo = pGetZirconHandleInfo->GetPointer(); MapStructHandles(pGetZirconHandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8791,6 +9379,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryZirconHandlePropertiesFUCHSIA( uint32_t zirconHandle, StructPointerDecoder* pMemoryZirconHandleProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkMemoryZirconHandlePropertiesFUCHSIA* out_pMemoryZirconHandleProperties = pMemoryZirconHandleProperties->IsNull() ? nullptr : pMemoryZirconHandleProperties->AllocateOutputData(1, { VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA, nullptr }); InitializeOutputStructPNext(pMemoryZirconHandleProperties); @@ -8805,6 +9394,7 @@ void VulkanReplayConsumer::Process_vkImportSemaphoreZirconHandleFUCHSIA( format::HandleId device, StructPointerDecoder* pImportSemaphoreZirconHandleInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkImportSemaphoreZirconHandleInfoFUCHSIA* in_pImportSemaphoreZirconHandleInfo = pImportSemaphoreZirconHandleInfo->GetPointer(); MapStructHandles(pImportSemaphoreZirconHandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8820,6 +9410,7 @@ void VulkanReplayConsumer::Process_vkGetSemaphoreZirconHandleFUCHSIA( StructPointerDecoder* pGetZirconHandleInfo, PointerDecoder* pZirconHandle) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkSemaphoreGetZirconHandleInfoFUCHSIA* in_pGetZirconHandleInfo = pGetZirconHandleInfo->GetPointer(); MapStructHandles(pGetZirconHandleInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8835,6 +9426,7 @@ void VulkanReplayConsumer::Process_vkCmdBindInvocationMaskHUAWEI( format::HandleId imageView, VkImageLayout imageLayout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkImageView in_imageView = MapHandle(imageView, &VulkanObjectInfoTable::GetImageViewInfo); @@ -8853,6 +9445,7 @@ void VulkanReplayConsumer::Process_vkGetMemoryRemoteAddressNV( StructPointerDecoder* pMemoryGetRemoteAddressInfo, PointerDecoder* pAddress) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMemoryGetRemoteAddressInfoNV* in_pMemoryGetRemoteAddressInfo = pMemoryGetRemoteAddressInfo->GetPointer(); MapStructHandles(pMemoryGetRemoteAddressInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -8869,6 +9462,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPatchControlPointsEXT( format::HandleId commandBuffer, uint32_t patchControlPoints) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetPatchControlPointsEXT(in_commandBuffer, patchControlPoints); @@ -8884,6 +9478,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRasterizerDiscardEnableEXT( format::HandleId commandBuffer, VkBool32 rasterizerDiscardEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetRasterizerDiscardEnableEXT(in_commandBuffer, rasterizerDiscardEnable); @@ -8899,6 +9494,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthBiasEnableEXT( format::HandleId commandBuffer, VkBool32 depthBiasEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthBiasEnableEXT(in_commandBuffer, depthBiasEnable); @@ -8914,6 +9510,7 @@ void VulkanReplayConsumer::Process_vkCmdSetLogicOpEXT( format::HandleId commandBuffer, VkLogicOp logicOp) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetLogicOpEXT(in_commandBuffer, logicOp); @@ -8929,6 +9526,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPrimitiveRestartEnableEXT( format::HandleId commandBuffer, VkBool32 primitiveRestartEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetPrimitiveRestartEnableEXT(in_commandBuffer, primitiveRestartEnable); @@ -8947,11 +9545,13 @@ void VulkanReplayConsumer::Process_vkCreateScreenSurfaceQNX( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSurface) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkInstance in_instance = MapHandle(instance, &VulkanObjectInfoTable::GetInstanceInfo); const VkScreenSurfaceCreateInfoQNX* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSurface->IsNull()) { pSurface->SetHandleLength(1); } VkSurfaceKHR* out_pSurface = pSurface->GetHandlePointer(); +ForwardIdToCaptureLayer(pSurface->GetPointer(), VK_OBJECT_TYPE_SURFACE_KHR); VkResult replay_result = GetInstanceTable(in_instance)->CreateScreenSurfaceQNX(in_instance, in_pCreateInfo, in_pAllocator, out_pSurface); CheckResult("vkCreateScreenSurfaceQNX", returnValue, replay_result, call_info); @@ -8966,6 +9566,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceScreenPresentationSupportQ uint32_t queueFamilyIndex, uint64_t window) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); struct _screen_window* in_window = static_cast(PreProcessExternalObject(window, format::ApiCallId::ApiCall_vkGetPhysicalDeviceScreenPresentationSupportQNX, "vkGetPhysicalDeviceScreenPresentationSupportQNX")); @@ -8978,6 +9579,7 @@ void VulkanReplayConsumer::Process_vkCmdSetColorWriteEnableEXT( uint32_t attachmentCount, PointerDecoder* pColorWriteEnables) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBool32* in_pColorWriteEnables = pColorWriteEnables->GetPointer(); @@ -8998,6 +9600,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMultiEXT( uint32_t firstInstance, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkMultiDrawInfoEXT* in_pVertexInfo = pVertexInfo->GetPointer(); @@ -9019,6 +9622,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMultiIndexedEXT( uint32_t stride, PointerDecoder* pVertexOffset) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkMultiDrawIndexedInfoEXT* in_pIndexInfo = pIndexInfo->GetPointer(); const int32_t* in_pVertexOffset = pVertexOffset->GetPointer(); @@ -9039,12 +9643,14 @@ void VulkanReplayConsumer::Process_vkCreateMicromapEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pMicromap) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMicromapCreateInfoEXT* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pMicromap->IsNull()) { pMicromap->SetHandleLength(1); } VkMicromapEXT* out_pMicromap = pMicromap->GetHandlePointer(); +ForwardIdToCaptureLayer(pMicromap->GetPointer(), VK_OBJECT_TYPE_MICROMAP_EXT); VkResult replay_result = GetDeviceTable(in_device)->CreateMicromapEXT(in_device, in_pCreateInfo, in_pAllocator, out_pMicromap); CheckResult("vkCreateMicromapEXT", returnValue, replay_result, call_info); @@ -9058,6 +9664,7 @@ void VulkanReplayConsumer::Process_vkDestroyMicromapEXT( format::HandleId micromap, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkMicromapEXT in_micromap = MapHandle(micromap, &VulkanObjectInfoTable::GetMicromapEXTInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -9072,6 +9679,7 @@ void VulkanReplayConsumer::Process_vkCmdBuildMicromapsEXT( uint32_t infoCount, StructPointerDecoder* pInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkMicromapBuildInfoEXT* in_pInfos = pInfos->GetPointer(); MapStructArrayHandles(pInfos->GetMetaStructPointer(), pInfos->GetLength(), GetObjectInfoTable()); @@ -9092,6 +9700,7 @@ void VulkanReplayConsumer::Process_vkBuildMicromapsEXT( uint32_t infoCount, StructPointerDecoder* pInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_deferredOperation = MapHandle(deferredOperation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); const VkMicromapBuildInfoEXT* in_pInfos = pInfos->GetPointer(); @@ -9108,6 +9717,7 @@ void VulkanReplayConsumer::Process_vkCopyMicromapEXT( format::HandleId deferredOperation, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_deferredOperation = MapHandle(deferredOperation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); const VkCopyMicromapInfoEXT* in_pInfo = pInfo->GetPointer(); @@ -9124,6 +9734,7 @@ void VulkanReplayConsumer::Process_vkCopyMicromapToMemoryEXT( format::HandleId deferredOperation, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_deferredOperation = MapHandle(deferredOperation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); const VkCopyMicromapToMemoryInfoEXT* in_pInfo = pInfo->GetPointer(); @@ -9140,6 +9751,7 @@ void VulkanReplayConsumer::Process_vkCopyMemoryToMicromapEXT( format::HandleId deferredOperation, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_deferredOperation = MapHandle(deferredOperation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); const VkCopyMemoryToMicromapInfoEXT* in_pInfo = pInfo->GetPointer(); @@ -9160,6 +9772,7 @@ void VulkanReplayConsumer::Process_vkWriteMicromapsPropertiesEXT( PointerDecoder* pData, size_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMicromapEXT* in_pMicromaps = MapHandles(pMicromaps, micromapCount, &VulkanObjectInfoTable::GetMicromapEXTInfo); void* out_pData = pData->IsNull() ? nullptr : pData->AllocateOutputData(dataSize); @@ -9173,6 +9786,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyMicromapEXT( format::HandleId commandBuffer, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyMicromapInfoEXT* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9190,6 +9804,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyMicromapToMemoryEXT( format::HandleId commandBuffer, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyMicromapToMemoryInfoEXT* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9207,6 +9822,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyMemoryToMicromapEXT( format::HandleId commandBuffer, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyMemoryToMicromapInfoEXT* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9228,6 +9844,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteMicromapsPropertiesEXT( format::HandleId queryPool, uint32_t firstQuery) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkMicromapEXT* in_pMicromaps = MapHandles(pMicromaps, micromapCount, &VulkanObjectInfoTable::GetMicromapEXTInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -9246,6 +9863,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceMicromapCompatibilityEXT( StructPointerDecoder* pVersionInfo, PointerDecoder* pCompatibility) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMicromapVersionInfoEXT* in_pVersionInfo = pVersionInfo->GetPointer(); VkAccelerationStructureCompatibilityKHR* out_pCompatibility = pCompatibility->IsNull() ? nullptr : pCompatibility->AllocateOutputData(1, static_cast(0)); @@ -9260,6 +9878,7 @@ void VulkanReplayConsumer::Process_vkGetMicromapBuildSizesEXT( StructPointerDecoder* pBuildInfo, StructPointerDecoder* pSizeInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkMicromapBuildInfoEXT* in_pBuildInfo = pBuildInfo->GetPointer(); MapStructHandles(pBuildInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9276,6 +9895,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawClusterHUAWEI( uint32_t groupCountY, uint32_t groupCountZ) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDrawClusterHUAWEI(in_commandBuffer, groupCountX, groupCountY, groupCountZ); @@ -9292,6 +9912,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawClusterIndirectHUAWEI( format::HandleId buffer, VkDeviceSize offset) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -9309,6 +9930,7 @@ void VulkanReplayConsumer::Process_vkSetDeviceMemoryPriorityEXT( format::HandleId memory, float priority) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeviceMemory in_memory = MapHandle(memory, &VulkanObjectInfoTable::GetDeviceMemoryInfo); @@ -9321,6 +9943,7 @@ void VulkanReplayConsumer::Process_vkGetDescriptorSetLayoutHostMappingInfoVALVE( StructPointerDecoder* pBindingReference, StructPointerDecoder* pHostMapping) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkDescriptorSetBindingReferenceVALVE* in_pBindingReference = pBindingReference->GetPointer(); MapStructHandles(pBindingReference->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9336,6 +9959,7 @@ void VulkanReplayConsumer::Process_vkGetDescriptorSetHostMappingVALVE( format::HandleId descriptorSet, PointerDecoder* ppData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDescriptorSet in_descriptorSet = MapHandle(descriptorSet, &VulkanObjectInfoTable::GetDescriptorSetInfo); void** out_ppData = ppData->IsNull() ? nullptr : ppData->AllocateOutputData(1); @@ -9351,6 +9975,7 @@ void VulkanReplayConsumer::Process_vkGetPipelineIndirectMemoryRequirementsNV( StructPointerDecoder* pCreateInfo, StructPointerDecoder* pMemoryRequirements) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkComputePipelineCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9366,6 +9991,7 @@ void VulkanReplayConsumer::Process_vkCmdUpdatePipelineIndirectBufferNV( VkPipelineBindPoint pipelineBindPoint, format::HandleId pipeline) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); @@ -9383,6 +10009,7 @@ void VulkanReplayConsumer::Process_vkGetPipelineIndirectDeviceAddressNV( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkPipelineIndirectDeviceAddressInfoNV* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9395,6 +10022,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthClampEnableEXT( format::HandleId commandBuffer, VkBool32 depthClampEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthClampEnableEXT(in_commandBuffer, depthClampEnable); @@ -9410,6 +10038,7 @@ void VulkanReplayConsumer::Process_vkCmdSetPolygonModeEXT( format::HandleId commandBuffer, VkPolygonMode polygonMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetPolygonModeEXT(in_commandBuffer, polygonMode); @@ -9425,6 +10054,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRasterizationSamplesEXT( format::HandleId commandBuffer, VkSampleCountFlagBits rasterizationSamples) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetRasterizationSamplesEXT(in_commandBuffer, rasterizationSamples); @@ -9441,6 +10071,7 @@ void VulkanReplayConsumer::Process_vkCmdSetSampleMaskEXT( VkSampleCountFlagBits samples, PointerDecoder* pSampleMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkSampleMask* in_pSampleMask = pSampleMask->GetPointer(); @@ -9457,6 +10088,7 @@ void VulkanReplayConsumer::Process_vkCmdSetAlphaToCoverageEnableEXT( format::HandleId commandBuffer, VkBool32 alphaToCoverageEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetAlphaToCoverageEnableEXT(in_commandBuffer, alphaToCoverageEnable); @@ -9472,6 +10104,7 @@ void VulkanReplayConsumer::Process_vkCmdSetAlphaToOneEnableEXT( format::HandleId commandBuffer, VkBool32 alphaToOneEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetAlphaToOneEnableEXT(in_commandBuffer, alphaToOneEnable); @@ -9487,6 +10120,7 @@ void VulkanReplayConsumer::Process_vkCmdSetLogicOpEnableEXT( format::HandleId commandBuffer, VkBool32 logicOpEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetLogicOpEnableEXT(in_commandBuffer, logicOpEnable); @@ -9504,6 +10138,7 @@ void VulkanReplayConsumer::Process_vkCmdSetColorBlendEnableEXT( uint32_t attachmentCount, PointerDecoder* pColorBlendEnables) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkBool32* in_pColorBlendEnables = pColorBlendEnables->GetPointer(); @@ -9522,6 +10157,7 @@ void VulkanReplayConsumer::Process_vkCmdSetColorBlendEquationEXT( uint32_t attachmentCount, StructPointerDecoder* pColorBlendEquations) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkColorBlendEquationEXT* in_pColorBlendEquations = pColorBlendEquations->GetPointer(); @@ -9540,6 +10176,7 @@ void VulkanReplayConsumer::Process_vkCmdSetColorWriteMaskEXT( uint32_t attachmentCount, PointerDecoder* pColorWriteMasks) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkColorComponentFlags* in_pColorWriteMasks = pColorWriteMasks->GetPointer(); @@ -9556,6 +10193,7 @@ void VulkanReplayConsumer::Process_vkCmdSetTessellationDomainOriginEXT( format::HandleId commandBuffer, VkTessellationDomainOrigin domainOrigin) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetTessellationDomainOriginEXT(in_commandBuffer, domainOrigin); @@ -9571,6 +10209,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRasterizationStreamEXT( format::HandleId commandBuffer, uint32_t rasterizationStream) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetRasterizationStreamEXT(in_commandBuffer, rasterizationStream); @@ -9586,6 +10225,7 @@ void VulkanReplayConsumer::Process_vkCmdSetConservativeRasterizationModeEXT( format::HandleId commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetConservativeRasterizationModeEXT(in_commandBuffer, conservativeRasterizationMode); @@ -9601,6 +10241,7 @@ void VulkanReplayConsumer::Process_vkCmdSetExtraPrimitiveOverestimationSizeEXT( format::HandleId commandBuffer, float extraPrimitiveOverestimationSize) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetExtraPrimitiveOverestimationSizeEXT(in_commandBuffer, extraPrimitiveOverestimationSize); @@ -9616,6 +10257,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthClipEnableEXT( format::HandleId commandBuffer, VkBool32 depthClipEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthClipEnableEXT(in_commandBuffer, depthClipEnable); @@ -9631,6 +10273,7 @@ void VulkanReplayConsumer::Process_vkCmdSetSampleLocationsEnableEXT( format::HandleId commandBuffer, VkBool32 sampleLocationsEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetSampleLocationsEnableEXT(in_commandBuffer, sampleLocationsEnable); @@ -9648,6 +10291,7 @@ void VulkanReplayConsumer::Process_vkCmdSetColorBlendAdvancedEXT( uint32_t attachmentCount, StructPointerDecoder* pColorBlendAdvanced) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkColorBlendAdvancedEXT* in_pColorBlendAdvanced = pColorBlendAdvanced->GetPointer(); @@ -9664,6 +10308,7 @@ void VulkanReplayConsumer::Process_vkCmdSetProvokingVertexModeEXT( format::HandleId commandBuffer, VkProvokingVertexModeEXT provokingVertexMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetProvokingVertexModeEXT(in_commandBuffer, provokingVertexMode); @@ -9679,6 +10324,7 @@ void VulkanReplayConsumer::Process_vkCmdSetLineRasterizationModeEXT( format::HandleId commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetLineRasterizationModeEXT(in_commandBuffer, lineRasterizationMode); @@ -9694,6 +10340,7 @@ void VulkanReplayConsumer::Process_vkCmdSetLineStippleEnableEXT( format::HandleId commandBuffer, VkBool32 stippledLineEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetLineStippleEnableEXT(in_commandBuffer, stippledLineEnable); @@ -9709,6 +10356,7 @@ void VulkanReplayConsumer::Process_vkCmdSetDepthClipNegativeOneToOneEXT( format::HandleId commandBuffer, VkBool32 negativeOneToOne) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetDepthClipNegativeOneToOneEXT(in_commandBuffer, negativeOneToOne); @@ -9724,6 +10372,7 @@ void VulkanReplayConsumer::Process_vkCmdSetViewportWScalingEnableNV( format::HandleId commandBuffer, VkBool32 viewportWScalingEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetViewportWScalingEnableNV(in_commandBuffer, viewportWScalingEnable); @@ -9741,6 +10390,7 @@ void VulkanReplayConsumer::Process_vkCmdSetViewportSwizzleNV( uint32_t viewportCount, StructPointerDecoder* pViewportSwizzles) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkViewportSwizzleNV* in_pViewportSwizzles = pViewportSwizzles->GetPointer(); @@ -9757,6 +10407,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCoverageToColorEnableNV( format::HandleId commandBuffer, VkBool32 coverageToColorEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetCoverageToColorEnableNV(in_commandBuffer, coverageToColorEnable); @@ -9772,6 +10423,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCoverageToColorLocationNV( format::HandleId commandBuffer, uint32_t coverageToColorLocation) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetCoverageToColorLocationNV(in_commandBuffer, coverageToColorLocation); @@ -9787,6 +10439,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCoverageModulationModeNV( format::HandleId commandBuffer, VkCoverageModulationModeNV coverageModulationMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetCoverageModulationModeNV(in_commandBuffer, coverageModulationMode); @@ -9802,6 +10455,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCoverageModulationTableEnableNV( format::HandleId commandBuffer, VkBool32 coverageModulationTableEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetCoverageModulationTableEnableNV(in_commandBuffer, coverageModulationTableEnable); @@ -9818,6 +10472,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCoverageModulationTableNV( uint32_t coverageModulationTableCount, PointerDecoder* pCoverageModulationTable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const float* in_pCoverageModulationTable = pCoverageModulationTable->GetPointer(); @@ -9834,6 +10489,7 @@ void VulkanReplayConsumer::Process_vkCmdSetShadingRateImageEnableNV( format::HandleId commandBuffer, VkBool32 shadingRateImageEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetShadingRateImageEnableNV(in_commandBuffer, shadingRateImageEnable); @@ -9849,6 +10505,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRepresentativeFragmentTestEnableNV( format::HandleId commandBuffer, VkBool32 representativeFragmentTestEnable) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetRepresentativeFragmentTestEnableNV(in_commandBuffer, representativeFragmentTestEnable); @@ -9864,6 +10521,7 @@ void VulkanReplayConsumer::Process_vkCmdSetCoverageReductionModeNV( format::HandleId commandBuffer, VkCoverageReductionModeNV coverageReductionMode) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetCoverageReductionModeNV(in_commandBuffer, coverageReductionMode); @@ -9880,6 +10538,7 @@ void VulkanReplayConsumer::Process_vkGetShaderModuleIdentifierEXT( format::HandleId shaderModule, StructPointerDecoder* pIdentifier) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkShaderModule in_shaderModule = MapHandle(shaderModule, &VulkanObjectInfoTable::GetShaderModuleInfo); VkShaderModuleIdentifierEXT* out_pIdentifier = pIdentifier->IsNull() ? nullptr : pIdentifier->AllocateOutputData(1, { VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT, nullptr }); @@ -9894,6 +10553,7 @@ void VulkanReplayConsumer::Process_vkGetShaderModuleCreateInfoIdentifierEXT( StructPointerDecoder* pCreateInfo, StructPointerDecoder* pIdentifier) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkShaderModuleCreateInfo* in_pCreateInfo = pCreateInfo->GetPointer(); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -9911,6 +10571,7 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceOpticalFlowImageFormatsNV( PointerDecoder* pFormatCount, StructPointerDecoder* pImageFormatProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkPhysicalDevice in_physicalDevice = MapHandle(physicalDevice, &VulkanObjectInfoTable::GetPhysicalDeviceInfo); const VkOpticalFlowImageFormatInfoNV* in_pOpticalFlowImageFormatInfo = pOpticalFlowImageFormatInfo->GetPointer(); uint32_t* out_pFormatCount = pFormatCount->IsNull() ? nullptr : pFormatCount->AllocateOutputData(1, GetOutputArrayCount("vkGetPhysicalDeviceOpticalFlowImageFormatsNV", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceOpticalFlowImageFormatsNV, pFormatCount, pImageFormatProperties, &VulkanObjectInfoTable::GetPhysicalDeviceInfo)); @@ -9930,11 +10591,13 @@ void VulkanReplayConsumer::Process_vkCreateOpticalFlowSessionNV( StructPointerDecoder* pAllocator, HandlePointerDecoder* pSession) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkOpticalFlowSessionCreateInfoNV* in_pCreateInfo = pCreateInfo->GetPointer(); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); if (!pSession->IsNull()) { pSession->SetHandleLength(1); } VkOpticalFlowSessionNV* out_pSession = pSession->GetHandlePointer(); +ForwardIdToCaptureLayer(pSession->GetPointer(), VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV); VkResult replay_result = GetDeviceTable(in_device)->CreateOpticalFlowSessionNV(in_device, in_pCreateInfo, in_pAllocator, out_pSession); CheckResult("vkCreateOpticalFlowSessionNV", returnValue, replay_result, call_info); @@ -9948,6 +10611,7 @@ void VulkanReplayConsumer::Process_vkDestroyOpticalFlowSessionNV( format::HandleId session, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkOpticalFlowSessionNV in_session = MapHandle(session, &VulkanObjectInfoTable::GetOpticalFlowSessionNVInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -9965,6 +10629,7 @@ void VulkanReplayConsumer::Process_vkBindOpticalFlowSessionImageNV( format::HandleId view, VkImageLayout layout) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkOpticalFlowSessionNV in_session = MapHandle(session, &VulkanObjectInfoTable::GetOpticalFlowSessionNVInfo); VkImageView in_view = MapHandle(view, &VulkanObjectInfoTable::GetImageViewInfo); @@ -9979,6 +10644,7 @@ void VulkanReplayConsumer::Process_vkCmdOpticalFlowExecuteNV( format::HandleId session, StructPointerDecoder* pExecuteInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkOpticalFlowSessionNV in_session = MapHandle(session, &VulkanObjectInfoTable::GetOpticalFlowSessionNVInfo); const VkOpticalFlowExecuteInfoNV* in_pExecuteInfo = pExecuteInfo->GetPointer(); @@ -10000,6 +10666,7 @@ void VulkanReplayConsumer::Process_vkCreateShadersEXT( StructPointerDecoder* pAllocator, HandlePointerDecoder* pShaders) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructArrayHandles(pCreateInfos->GetMetaStructPointer(), pCreateInfos->GetLength(), GetObjectInfoTable()); @@ -10009,6 +10676,7 @@ void VulkanReplayConsumer::Process_vkCreateShadersEXT( if (UseAsyncOperations()) { + ForwardIdsToCaptureLayer(pShaders->GetPointer(), pShaders->GetLength(), VK_OBJECT_TYPE_SHADER_EXT); auto task = AsyncCreateShadersEXT(call_info, returnValue, in_device, createInfoCount, pCreateInfos, pAllocator, pShaders); if(task) { @@ -10016,6 +10684,8 @@ void VulkanReplayConsumer::Process_vkCreateShadersEXT( return; } } + +ForwardIdsToCaptureLayer(pShaders->GetPointer(), pShaders->GetLength(), pShaders->GetHandlePointer(), createInfoCount, VK_OBJECT_TYPE_SHADER_EXT); VkResult replay_result = OverrideCreateShadersEXT(GetDeviceTable(in_device->handle)->CreateShadersEXT, returnValue, in_device, createInfoCount, pCreateInfos, pAllocator, pShaders); CheckResult("vkCreateShadersEXT", returnValue, replay_result, call_info); @@ -10028,6 +10698,7 @@ void VulkanReplayConsumer::Process_vkDestroyShaderEXT( format::HandleId shader, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkShaderEXT in_shader = MapHandle(shader, &VulkanObjectInfoTable::GetShaderEXTInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -10044,6 +10715,7 @@ void VulkanReplayConsumer::Process_vkGetShaderBinaryDataEXT( PointerDecoder* pDataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkShaderEXT in_shader = MapHandle(shader, &VulkanObjectInfoTable::GetShaderEXTInfo); size_t* out_pDataSize = pDataSize->IsNull() ? nullptr : pDataSize->AllocateOutputData(1, GetOutputArrayCount("vkGetShaderBinaryDataEXT", returnValue, shader, kShaderEXTArrayGetShaderBinaryDataEXT, pDataSize, pData, &VulkanObjectInfoTable::GetShaderEXTInfo)); @@ -10062,6 +10734,7 @@ void VulkanReplayConsumer::Process_vkCmdBindShadersEXT( PointerDecoder* pStages, HandlePointerDecoder* pShaders) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkShaderStageFlagBits* in_pStages = pStages->GetPointer(); const VkShaderEXT* in_pShaders = MapHandles(pShaders, stageCount, &VulkanObjectInfoTable::GetShaderEXTInfo); @@ -10082,6 +10755,7 @@ void VulkanReplayConsumer::Process_vkGetFramebufferTilePropertiesQCOM( PointerDecoder* pPropertiesCount, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkFramebuffer in_framebuffer = MapHandle(framebuffer, &VulkanObjectInfoTable::GetFramebufferInfo); uint32_t* out_pPropertiesCount = pPropertiesCount->IsNull() ? nullptr : pPropertiesCount->AllocateOutputData(1, GetOutputArrayCount("vkGetFramebufferTilePropertiesQCOM", returnValue, framebuffer, kFramebufferArrayGetFramebufferTilePropertiesQCOM, pPropertiesCount, pProperties, &VulkanObjectInfoTable::GetFramebufferInfo)); @@ -10100,6 +10774,7 @@ void VulkanReplayConsumer::Process_vkGetDynamicRenderingTilePropertiesQCOM( StructPointerDecoder* pRenderingInfo, StructPointerDecoder* pProperties) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkRenderingInfo* in_pRenderingInfo = pRenderingInfo->GetPointer(); MapStructHandles(pRenderingInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -10122,6 +10797,7 @@ void VulkanReplayConsumer::Process_vkSetLatencySleepModeNV( GFXRECON_LOG_DEBUG("Skip vkSetLatencySleepModeNV for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -10143,6 +10819,7 @@ void VulkanReplayConsumer::Process_vkLatencySleepNV( GFXRECON_LOG_DEBUG("Skip vkLatencySleepNV for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -10164,6 +10841,7 @@ void VulkanReplayConsumer::Process_vkSetLatencyMarkerNV( GFXRECON_LOG_DEBUG("Skip vkSetLatencyMarkerNV for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -10183,6 +10861,7 @@ void VulkanReplayConsumer::Process_vkGetLatencyTimingsNV( GFXRECON_LOG_DEBUG("Skip vkGetLatencyTimingsNV for offscreen."); return; } + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkSwapchainKHR in_swapchain = MapHandle(swapchain, &VulkanObjectInfoTable::GetSwapchainKHRInfo); if (GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id) == nullptr || GetObjectInfoTable().GetSurfaceKHRInfo(GetObjectInfoTable().GetSwapchainKHRInfo(swapchain)->surface_id)->surface_creation_skipped) { return; } @@ -10197,6 +10876,7 @@ void VulkanReplayConsumer::Process_vkQueueNotifyOutOfBandNV( format::HandleId queue, StructPointerDecoder* pQueueTypeInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkQueue in_queue = MapHandle(queue, &VulkanObjectInfoTable::GetQueueInfo); const VkOutOfBandQueueTypeInfoNV* in_pQueueTypeInfo = pQueueTypeInfo->GetPointer(); @@ -10208,6 +10888,7 @@ void VulkanReplayConsumer::Process_vkCmdSetAttachmentFeedbackLoopEnableEXT( format::HandleId commandBuffer, VkImageAspectFlags aspectMask) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetAttachmentFeedbackLoopEnableEXT(in_commandBuffer, aspectMask); @@ -10226,12 +10907,14 @@ void VulkanReplayConsumer::Process_vkCreateAccelerationStructureKHR( StructPointerDecoder* pAllocator, HandlePointerDecoder* pAccelerationStructure) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pCreateInfo->GetMetaStructPointer(), GetObjectInfoTable()); if (!pAccelerationStructure->IsNull()) { pAccelerationStructure->SetHandleLength(1); } AccelerationStructureKHRInfo handle_info; pAccelerationStructure->SetConsumerData(0, &handle_info); +ForwardIdToCaptureLayer(pAccelerationStructure->GetPointer(), VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR); VkResult replay_result = OverrideCreateAccelerationStructureKHR(GetDeviceTable(in_device->handle)->CreateAccelerationStructureKHR, returnValue, in_device, pCreateInfo, pAllocator, pAccelerationStructure); CheckResult("vkCreateAccelerationStructureKHR", returnValue, replay_result, call_info); @@ -10245,6 +10928,7 @@ void VulkanReplayConsumer::Process_vkDestroyAccelerationStructureKHR( format::HandleId accelerationStructure, StructPointerDecoder* pAllocator) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkAccelerationStructureKHR in_accelerationStructure = MapHandle(accelerationStructure, &VulkanObjectInfoTable::GetAccelerationStructureKHRInfo); const VkAllocationCallbacks* in_pAllocator = GetAllocationCallbacks(pAllocator); @@ -10260,6 +10944,7 @@ void VulkanReplayConsumer::Process_vkCmdBuildAccelerationStructuresKHR( StructPointerDecoder* pInfos, StructPointerDecoder* ppBuildRangeInfos) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkAccelerationStructureBuildGeometryInfoKHR* in_pInfos = pInfos->GetPointer(); MapStructArrayHandles(pInfos->GetMetaStructPointer(), pInfos->GetLength(), GetObjectInfoTable()); @@ -10282,6 +10967,7 @@ void VulkanReplayConsumer::Process_vkCmdBuildAccelerationStructuresIndirectKHR( PointerDecoder* pIndirectStrides, PointerDecoder* ppMaxPrimitiveCounts) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkAccelerationStructureBuildGeometryInfoKHR* in_pInfos = pInfos->GetPointer(); MapStructArrayHandles(pInfos->GetMetaStructPointer(), pInfos->GetLength(), GetObjectInfoTable()); @@ -10304,6 +10990,7 @@ void VulkanReplayConsumer::Process_vkCopyAccelerationStructureToMemoryKHR( format::HandleId deferredOperation, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_deferredOperation = MapHandle(deferredOperation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); const VkCopyAccelerationStructureToMemoryInfoKHR* in_pInfo = pInfo->GetPointer(); @@ -10320,6 +11007,7 @@ void VulkanReplayConsumer::Process_vkCopyMemoryToAccelerationStructureKHR( format::HandleId deferredOperation, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkDeferredOperationKHR in_deferredOperation = MapHandle(deferredOperation, &VulkanObjectInfoTable::GetDeferredOperationKHRInfo); const VkCopyMemoryToAccelerationStructureInfoKHR* in_pInfo = pInfo->GetPointer(); @@ -10340,6 +11028,7 @@ void VulkanReplayConsumer::Process_vkWriteAccelerationStructuresPropertiesKHR( PointerDecoder* pData, size_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkAccelerationStructureKHR* in_pAccelerationStructures = MapHandles(pAccelerationStructures, accelerationStructureCount, &VulkanObjectInfoTable::GetAccelerationStructureKHRInfo); void* out_pData = pData->IsNull() ? nullptr : pData->AllocateOutputData(dataSize); @@ -10353,6 +11042,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyAccelerationStructureKHR( format::HandleId commandBuffer, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyAccelerationStructureInfoKHR* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -10370,6 +11060,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyAccelerationStructureToMemoryKHR( format::HandleId commandBuffer, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyAccelerationStructureToMemoryInfoKHR* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -10387,6 +11078,7 @@ void VulkanReplayConsumer::Process_vkCmdCopyMemoryToAccelerationStructureKHR( format::HandleId commandBuffer, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkCopyMemoryToAccelerationStructureInfoKHR* in_pInfo = pInfo->GetPointer(); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -10405,6 +11097,7 @@ void VulkanReplayConsumer::Process_vkGetAccelerationStructureDeviceAddressKHR( format::HandleId device, StructPointerDecoder* pInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) auto in_device = GetObjectInfoTable().GetDeviceInfo(device); MapStructHandles(pInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -10421,6 +11114,7 @@ void VulkanReplayConsumer::Process_vkCmdWriteAccelerationStructuresPropertiesKHR format::HandleId queryPool, uint32_t firstQuery) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkAccelerationStructureKHR* in_pAccelerationStructures = MapHandles(pAccelerationStructures, accelerationStructureCount, &VulkanObjectInfoTable::GetAccelerationStructureKHRInfo); VkQueryPool in_queryPool = MapHandle(queryPool, &VulkanObjectInfoTable::GetQueryPoolInfo); @@ -10439,6 +11133,7 @@ void VulkanReplayConsumer::Process_vkGetDeviceAccelerationStructureCompatibility StructPointerDecoder* pVersionInfo, PointerDecoder* pCompatibility) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkAccelerationStructureVersionInfoKHR* in_pVersionInfo = pVersionInfo->GetPointer(); VkAccelerationStructureCompatibilityKHR* out_pCompatibility = pCompatibility->IsNull() ? nullptr : pCompatibility->AllocateOutputData(1, static_cast(0)); @@ -10454,6 +11149,7 @@ void VulkanReplayConsumer::Process_vkGetAccelerationStructureBuildSizesKHR( PointerDecoder* pMaxPrimitiveCounts, StructPointerDecoder* pSizeInfo) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); const VkAccelerationStructureBuildGeometryInfoKHR* in_pBuildInfo = pBuildInfo->GetPointer(); MapStructHandles(pBuildInfo->GetMetaStructPointer(), GetObjectInfoTable()); @@ -10475,6 +11171,7 @@ void VulkanReplayConsumer::Process_vkCmdTraceRaysKHR( uint32_t height, uint32_t depth) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkStridedDeviceAddressRegionKHR* in_pRaygenShaderBindingTable = pRaygenShaderBindingTable->GetPointer(); const VkStridedDeviceAddressRegionKHR* in_pMissShaderBindingTable = pMissShaderBindingTable->GetPointer(); @@ -10499,6 +11196,7 @@ void VulkanReplayConsumer::Process_vkGetRayTracingCaptureReplayShaderGroupHandle size_t dataSize, PointerDecoder* pData) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); void* out_pData = pData->IsNull() ? nullptr : pData->AllocateOutputData(dataSize); @@ -10516,6 +11214,7 @@ void VulkanReplayConsumer::Process_vkCmdTraceRaysIndirectKHR( StructPointerDecoder* pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); const VkStridedDeviceAddressRegionKHR* in_pRaygenShaderBindingTable = pRaygenShaderBindingTable->GetPointer(); const VkStridedDeviceAddressRegionKHR* in_pMissShaderBindingTable = pMissShaderBindingTable->GetPointer(); @@ -10538,6 +11237,7 @@ void VulkanReplayConsumer::Process_vkGetRayTracingShaderGroupStackSizeKHR( uint32_t group, VkShaderGroupShaderKHR groupShader) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkDevice in_device = MapHandle(device, &VulkanObjectInfoTable::GetDeviceInfo); VkPipeline in_pipeline = MapHandle(pipeline, &VulkanObjectInfoTable::GetPipelineInfo); @@ -10549,6 +11249,7 @@ void VulkanReplayConsumer::Process_vkCmdSetRayTracingPipelineStackSizeKHR( format::HandleId commandBuffer, uint32_t pipelineStackSize) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdSetRayTracingPipelineStackSizeKHR(in_commandBuffer, pipelineStackSize); @@ -10566,6 +11267,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMeshTasksEXT( uint32_t groupCountY, uint32_t groupCountZ) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); GetDeviceTable(in_commandBuffer)->CmdDrawMeshTasksEXT(in_commandBuffer, groupCountX, groupCountY, groupCountZ); @@ -10584,6 +11286,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMeshTasksIndirectEXT( uint32_t drawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); @@ -10605,6 +11308,7 @@ void VulkanReplayConsumer::Process_vkCmdDrawMeshTasksIndirectCountEXT( uint32_t maxDrawCount, uint32_t stride) { + // GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__) VkCommandBuffer in_commandBuffer = MapHandle(commandBuffer, &VulkanObjectInfoTable::GetCommandBufferInfo); VkBuffer in_buffer = MapHandle(buffer, &VulkanObjectInfoTable::GetBufferInfo); VkBuffer in_countBuffer = MapHandle(countBuffer, &VulkanObjectInfoTable::GetBufferInfo); diff --git a/framework/generated/generated_vulkan_replay_consumer.h b/framework/generated/generated_vulkan_replay_consumer.h index 9948d52d2b..87c6bfb3c1 100644 --- a/framework/generated/generated_vulkan_replay_consumer.h +++ b/framework/generated/generated_vulkan_replay_consumer.h @@ -48,7 +48,7 @@ GFXRECON_BEGIN_NAMESPACE(decode) class VulkanReplayConsumer : public VulkanReplayConsumerBase { public: - VulkanReplayConsumer(std::shared_ptr application, const VulkanReplayOptions& options) : VulkanReplayConsumerBase(application, options) { } + VulkanReplayConsumer(std::shared_ptr application, const VulkanReplayOptions& options, const gfxrecon::format::AssetFileOffsets* offsets) : VulkanReplayConsumerBase(application, options, offsets) { } virtual ~VulkanReplayConsumer() override { } diff --git a/framework/generated/vulkan_generators/gencode.py b/framework/generated/vulkan_generators/gencode.py index 27fb03e157..7937f9bba3 100644 --- a/framework/generated/vulkan_generators/gencode.py +++ b/framework/generated/vulkan_generators/gencode.py @@ -376,7 +376,7 @@ def make_gen_opts(args): base_class_header='vulkan_replay_consumer_base.h', is_override=True, constructor_args= - 'std::shared_ptr application, const VulkanReplayOptions& options', + 'std::shared_ptr application, const VulkanReplayOptions& options, const gfxrecon::format::AssetFileOffsets* offsets', filename='generated_vulkan_replay_consumer.h', directory=directory, blacklists=blacklists, diff --git a/framework/generated/vulkan_generators/vulkan_api_call_encoders_body_generator.py b/framework/generated/vulkan_generators/vulkan_api_call_encoders_body_generator.py index 7d006837b9..99e0c57a26 100644 --- a/framework/generated/vulkan_generators/vulkan_api_call_encoders_body_generator.py +++ b/framework/generated/vulkan_generators/vulkan_api_call_encoders_body_generator.py @@ -233,7 +233,7 @@ def make_cmd_body(self, return_type, name, values): capture_manager = 'manager' if name == "vkCreateInstance": capture_manager = 'VulkanCaptureManager::Get()' - body = '' + body = 'GFXRECON_WRITE_CONSOLE("[CAPTURE] %s()", __func__)\n' if name != "vkCreateInstance": body += indent + 'VulkanCaptureManager* manager = VulkanCaptureManager::Get();\n' body += indent + 'GFXRECON_ASSERT(manager != nullptr);\n' @@ -702,7 +702,7 @@ def make_handle_unwrapping(self, name, values, indent): if value.is_array: expr += indent + '{} {name}_unwrapped = {}::UnwrapStructArrayHandles({name}, {}, handle_unwrap_memory);\n'.format( value.full_type, - wrapper_prefix, + wrapper_prefix, value.array_length, name=value.name ) diff --git a/framework/generated/vulkan_generators/vulkan_replay_consumer_body_generator.py b/framework/generated/vulkan_generators/vulkan_replay_consumer_body_generator.py index a53200d39e..011f8f3cb7 100644 --- a/framework/generated/vulkan_generators/vulkan_replay_consumer_body_generator.py +++ b/framework/generated/vulkan_generators/vulkan_replay_consumer_body_generator.py @@ -341,14 +341,17 @@ def make_consumer_func_body(self, return_type, name, values): if is_async: body += ' if (UseAsyncOperations())\n' body += ' {\n' + body += ' {}\n'.format(postexpr[0]) body += ' auto task = {}(call_info, returnValue, {});\n'.format(self.REPLAY_ASYNC_OVERRIDES[name], arglist) body += ' if(task)\n' body += ' {\n' - body += ' {}\n'.format(postexpr[0]) + body += ' {}\n'.format(postexpr[1]) body += ' return;\n' body += ' }\n' body += ' }\n' - postexpr = postexpr[1:] # drop async post-expression, don't repeat later + body += '\n' + body += '{}\n'.format(postexpr[2]) + postexpr = postexpr[3:] # drop async post-expression, don't repeat later body += ' VkResult replay_result = {};\n'.format(call_expr) body += ' CheckResult("{}", returnValue, replay_result, call_info);\n'.format(name) @@ -482,6 +485,61 @@ def make_body_expressions(self, return_type, name, values, is_override): postexpr = [ ] # Expressions to add new handles to the handle map and delete temporary allocations. +# "" : "VK_OBJECT_TYPE_UNKNOWN", + vulkan_types_to_object_types = { + "VkInstance" : "VK_OBJECT_TYPE_INSTANCE", + "VkPhysicalDevice" : "VK_OBJECT_TYPE_PHYSICAL_DEVICE", + "VkDevice" : "VK_OBJECT_TYPE_DEVICE", + "VkQueue" : "VK_OBJECT_TYPE_QUEUE", + "VkSemaphore" : "VK_OBJECT_TYPE_SEMAPHORE", + "VkCommandBuffer" : "VK_OBJECT_TYPE_COMMAND_BUFFER", + "VkFence" : "VK_OBJECT_TYPE_FENCE", + "VkDeviceMemory" : "VK_OBJECT_TYPE_DEVICE_MEMORY", + "VkBuffer" : "VK_OBJECT_TYPE_BUFFER", + "VkImage" : "VK_OBJECT_TYPE_IMAGE", + "VkEvent" : "VK_OBJECT_TYPE_EVENT", + "VkQueryPool" : "VK_OBJECT_TYPE_QUERY_POOL", + "VkBufferView" : "VK_OBJECT_TYPE_BUFFER_VIEW", + "VkImageView" : "VK_OBJECT_TYPE_IMAGE_VIEW", + "VkShaderModule" : "VK_OBJECT_TYPE_SHADER_MODULE", + "VkPipelineCache" : "VK_OBJECT_TYPE_PIPELINE_CACHE", + "VkPipelineLayout" : "VK_OBJECT_TYPE_PIPELINE_LAYOUT", + "VkRenderPass" : "VK_OBJECT_TYPE_RENDER_PASS", + "VkPipeline" : "VK_OBJECT_TYPE_PIPELINE", + "VkDescriptorSetLayout" : "VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT", + "VkSampler" : "VK_OBJECT_TYPE_SAMPLER", + "VkDescriptorPool" : "VK_OBJECT_TYPE_DESCRIPTOR_POOL", + "VkDescriptorSet" : "VK_OBJECT_TYPE_DESCRIPTOR_SET", + "VkFramebuffer" : "VK_OBJECT_TYPE_FRAMEBUFFER", + "VkCommandPool" : "VK_OBJECT_TYPE_COMMAND_POOL", + "VkSamplerYcbcrConversion" : "VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION", + "VkDescriptorUpdateTemplate" : "VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE", + "VkPrivateDataSlot" : "VK_OBJECT_TYPE_PRIVATE_DATA_SLOT", + "VkSurfaceKHR" : "VK_OBJECT_TYPE_SURFACE_KHR", + "VkSwapchainKHR" : "VK_OBJECT_TYPE_SWAPCHAIN_KHR", + "VkDisplayKHR" : "VK_OBJECT_TYPE_DISPLAY_KHR", + "VkDisplayModeKHR" : "VK_OBJECT_TYPE_DISPLAY_MODE_KHR", + "VkDebugReportCallbackEXT" : "VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT", + "VkVideoSessionKHR" : "VK_OBJECT_TYPE_VIDEO_SESSION_KHR", + "VkVideoSessionParametersKHR" : "VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR", + "VkCuModuleNVX" : "VK_OBJECT_TYPE_CU_MODULE_NVX", + "VkCuFunctionNVX" : "VK_OBJECT_TYPE_CU_FUNCTION_NVX", + "VkDebugUtilsMessengerEXT" : "VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT", + "VkAccelerationStructureKHR" : "VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR", + "VkValidationCacheEXT" : "VK_OBJECT_TYPE_VALIDATION_CACHE_EXT", + "VkAccelerationStructureNV" : "VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV", + "VkPerformanceConfigurationINTEL" : "VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL", + "VkDeferredOperationKHR" : "VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR", + "VkIndirectCommandsLayoutNV" : "VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV", + "VkCudaModuleNV" : "VK_OBJECT_TYPE_CUDA_MODULE_NV", + "VkCudaFunctionNV" : "VK_OBJECT_TYPE_CUDA_FUNCTION_NV", + # "" : "VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA", + "VkMicromapEXT" : "VK_OBJECT_TYPE_MICROMAP_EXT", + "VkOpticalFlowSessionNV" : "VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV", + "VkShaderEXT" : "VK_OBJECT_TYPE_SHADER_EXT" + } + + preexpr.append('GFXRECON_WRITE_CONSOLE("[REPLAY] %s()", __func__)') for value in values: need_initialize_output_pnext_struct = '' if value.is_pointer or value.is_array: @@ -489,6 +547,8 @@ def make_body_expressions(self, return_type, name, values, is_override): is_input = self.is_input_pointer(value) is_extenal_object = False need_temp_value = True + vk_obj_type = vulkan_types_to_object_types[value.base_type] if value.base_type in vulkan_types_to_object_types else "VK_OBJECT_TYPE_UNKNOWN" + expr = '' if ( @@ -644,10 +704,11 @@ def make_body_expressions(self, return_type, name, values, is_override): if name == 'vkCreateGraphicsPipelines' or name == 'vkCreateComputePipelines' or name == 'vkCreateRayTracingPipelinesNV': preexpr.append('if (omitted_pipeline_cache_data_) {{AllowCompileDuringPipelineCreation({}, pCreateInfos->GetPointer());}}'.format(length_name)) if need_temp_value: - expr += '{}->GetHandlePointer();'.format( + expr += '{}->GetHandlePointer();\n'.format( value.name ) if self.is_pool_allocation(name): + expr += 'ForwardIdsToCaptureLayer<{basetype}Info>({paramname}->GetPointer(), {paramname}->GetLength(), {paramname}->GetHandlePointer(), {}, {});'.format(length_name, vk_obj_type, basetype=value.base_type[2:], paramname=value.name) postexpr.append( 'AddPoolHandles<{pooltype}Info, {basetype}Info>({}, handle_mapping::GetPoolId({}->GetMetaStructPointer()), {paramname}->GetPointer(), {paramname}->GetLength(), {}, {}, &VulkanObjectInfoTable::Get{pooltype}Info, &VulkanObjectInfoTable::Add{basetype}Info);' .format( @@ -657,12 +718,11 @@ def make_body_expressions(self, return_type, name, values, is_override): length_name, paramname=value.name, basetype=value.base_type[2:], - pooltype=self. - POOL_OBJECT_ASSOCIATIONS[ - value.base_type][2:] + pooltype=self.POOL_OBJECT_ASSOCIATIONS[value.base_type][2:] ) ) else: + expr += 'ForwardIdsToCaptureLayer<{basetype}Info>({paramname}->GetPointer(), {paramname}->GetLength(), {paramname}->GetHandlePointer(), {}, {});'.format(length_name, vk_obj_type, basetype=value.base_type[2:], paramname=value.name) postexpr.append( 'AddHandles<{basetype}Info>({}, {paramname}->GetPointer(), {paramname}->GetLength(), {}, {}, &VulkanObjectInfoTable::Add{basetype}Info);' .format( @@ -682,6 +742,7 @@ def make_body_expressions(self, return_type, name, values, is_override): length_name, value.name ) if self.is_pool_allocation(name): + expr += '\nForwardIdsToCaptureLayer<{basetype}Info>({paramname}->GetPointer(), {paramname}->GetLength(), {paramname}->GetHandlePointer(), {}, {});'.format(length_name, vk_obj_type, basetype=value.base_type[2:], paramname=value.name) postexpr.append( 'AddPoolHandles<{pooltype}Info, {basetype}Info>({}, handle_mapping::GetPoolId({}->GetMetaStructPointer()), {paramname}->GetPointer(), {paramname}->GetLength(), {paramname}->GetHandlePointer(), {}, std::move(handle_info), &VulkanObjectInfoTable::Get{pooltype}Info, &VulkanObjectInfoTable::Add{basetype}Info);' .format( @@ -698,6 +759,7 @@ def make_body_expressions(self, return_type, name, values, is_override): else: # additionally add an asynchronous flavour to postexpr, so both are available later if name in self.REPLAY_ASYNC_OVERRIDES: + postexpr.append('ForwardIdsToCaptureLayer({paramname}->GetPointer(), {paramname}->GetLength(), {});'.format(vk_obj_type, paramname=value.name)) postexpr.append( 'AddHandlesAsync<{basetype}Info>({}, {paramname}->GetPointer(), {paramname}->GetLength(), std::move(handle_info), &VulkanObjectInfoTable::Add{basetype}Info, std::move(task));' .format( @@ -708,6 +770,9 @@ def make_body_expressions(self, return_type, name, values, is_override): basetype=value.base_type[2:] ) ) + postexpr.append('ForwardIdsToCaptureLayer<{basetype}Info>({paramname}->GetPointer(), {paramname}->GetLength(), {paramname}->GetHandlePointer(), {}, {});'.format(length_name, vk_obj_type, basetype=value.base_type[2:], paramname=value.name)) + else: + preexpr.append('ForwardIdsToCaptureLayer<{basetype}Info>({paramname}->GetPointer(), {paramname}->GetLength(), {paramname}->GetHandlePointer(), {}, {});'.format(length_name, vk_obj_type, basetype=value.base_type[2:], paramname=value.name)) postexpr.append( 'AddHandles<{basetype}Info>({}, {paramname}->GetPointer(), {paramname}->GetLength(), {paramname}->GetHandlePointer(), {}, std::move(handle_info), &VulkanObjectInfoTable::Add{basetype}Info);' .format( @@ -747,6 +812,7 @@ def make_body_expressions(self, return_type, name, values, is_override): paramname=value.name ) ) + # expr += '\nForwardIdsToCaptureLayer({paramname}->GetMetaStructPointer(), {paramname}->GetLength(), {paramname}->GetOutputPointer(), {}, {});'.format(length_name, vk_obj_type, basetype=value.base_type, paramname=value.name) postexpr.append( 'AddStructArrayHandles({}, {paramname}->GetMetaStructPointer(), {paramname}->GetLength(), {}, {}, &GetObjectInfoTable());' .format( @@ -771,6 +837,7 @@ def make_body_expressions(self, return_type, name, values, is_override): paramname=value.name ) ) + # expr += '\nForwardIdsToCaptureLayer({paramname}->GetMetaStructPointer(), {paramname}->GetLength(), {paramname}->GetOutputPointer(), {}, {});'.format(length_name, vk_obj_type, basetype=value.base_type, paramname=value.name) postexpr.append( 'AddStructArrayHandles({}, {paramname}->GetMetaStructPointer(), {paramname}->GetLength(), {paramname}->GetOutputPointer(), {}, &GetObjectInfoTable());' .format( @@ -830,6 +897,7 @@ def make_body_expressions(self, return_type, name, values, is_override): expr += '{}->GetHandlePointer();'.format( value.name ) + expr += '\nForwardIdToCaptureLayer({paramname}->GetPointer(), {});'.format(vk_obj_type, paramname=value.name) postexpr.append( 'AddHandle<{basetype}Info>({}, {}->GetPointer(), {}, &VulkanObjectInfoTable::Add{basetype}Info);' .format( @@ -848,6 +916,7 @@ def make_body_expressions(self, return_type, name, values, is_override): expr = '{}->SetConsumerData(0, &handle_info);'.format( value.name ) + expr += '\nForwardIdToCaptureLayer({paramname}->GetPointer(), {});'.format(vk_obj_type, paramname=value.name) postexpr.append( 'AddHandle<{basetype}Info>({}, {paramname}->GetPointer(), {paramname}->GetHandlePointer(), std::move(handle_info), &VulkanObjectInfoTable::Add{basetype}Info);' .format( diff --git a/framework/util/defines.h b/framework/util/defines.h index 19a6cfc837..ae34e2a7ea 100644 --- a/framework/util/defines.h +++ b/framework/util/defines.h @@ -67,6 +67,8 @@ static constexpr uint64_t GFXRECON_PTR_TO_UINT64(T ptr) return static_cast(reinterpret_cast(ptr)); } +#define GFXRECON_ARRAY_ELEMENTS(_array_) sizeof((_array_)) / sizeof((_array_)[0]) + #ifdef NDEBUG #define GFXRECON_RELEASE_BUILD 1 #else diff --git a/framework/util/file_output_stream.cpp b/framework/util/file_output_stream.cpp index 608301dbe4..bc26988b31 100644 --- a/framework/util/file_output_stream.cpp +++ b/framework/util/file_output_stream.cpp @@ -25,12 +25,13 @@ #include "util/logging.h" #include "util/platform.h" +#include GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(util) FileOutputStream::FileOutputStream(const std::string& filename, size_t buffer_size, bool append) : - file_(nullptr), own_file_(true) + file_(nullptr), own_file_(true), filename(filename) { const char* mode = append ? "ab" : "wb"; int32_t result = platform::FileOpen(&file_, filename.c_str(), mode); @@ -45,7 +46,7 @@ FileOutputStream::FileOutputStream(const std::string& filename, size_t buffer_si } else { - GFXRECON_LOG_ERROR("fopen(%s, %s) failed (errno = %d)", filename.c_str(), mode, result); + GFXRECON_LOG_ERROR("fopen(%s, %s) failed (errno = %d: %s)", filename.c_str(), mode, result, strerror(result)); } } diff --git a/framework/util/file_output_stream.h b/framework/util/file_output_stream.h index e8c65f1792..d209440298 100644 --- a/framework/util/file_output_stream.h +++ b/framework/util/file_output_stream.h @@ -29,6 +29,7 @@ #include "util/output_stream.h" #include "util/platform.h" +#include #include #include @@ -58,11 +59,16 @@ class FileOutputStream : public OutputStream virtual void Flush() override { platform::FileFlush(file_); } + virtual int64_t GetOffset() const { return platform::FileTell(file_); } + + virtual const std::string& GetFilename() const { return filename; } + protected: FileOutputStream(const FileOutputStream&) = delete; FileOutputStream& operator=(const FileOutputStream&) = delete; FILE* file_; bool own_file_; + const std::string filename; }; class FileNoLockOutputStream : public FileOutputStream diff --git a/framework/util/file_path.cpp b/framework/util/file_path.cpp index b4f77220d3..494d7dfa9c 100644 --- a/framework/util/file_path.cpp +++ b/framework/util/file_path.cpp @@ -254,7 +254,10 @@ std::string GenerateTimestampedFilename(const std::string& filename, bool use_gm { std::string timestamp = "_"; timestamp += util::datetime::GetDateTimeString(use_gmt); - return InsertFilenamePostfix(filename, timestamp); + + std::string result_filename = InsertFilenamePostfix(filename, timestamp); + + return result_filename; } bool GetWindowsSystemLibrariesPath(std::string& base_path) diff --git a/framework/util/page_guard_manager.cpp b/framework/util/page_guard_manager.cpp index c65a158660..78dec14e6e 100644 --- a/framework/util/page_guard_manager.cpp +++ b/framework/util/page_guard_manager.cpp @@ -25,6 +25,7 @@ #include "util/page_guard_manager.h" #include "util/logging.h" +#include "util/page_status_tracker.h" #include "util/platform.h" #include @@ -1369,5 +1370,19 @@ const void* PageGuardManager::GetMappedMemory(uint64_t memory_id) const return nullptr; } +void PageGuardManager::GetDirtyMemoryRegions( + std::unordered_map& memories_page_status) +{ + std::lock_guard lock(tracked_memory_lock_); + + for (auto& entry : memory_info_) + { + if (entry.second.is_modified) + { + auto new_entry = memories_page_status.emplace(entry.first, entry.second.status_tracker.GetActiveWrites()); + } + } +} + GFXRECON_END_NAMESPACE(util) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/util/page_guard_manager.h b/framework/util/page_guard_manager.h index 3c543416fb..775475d729 100644 --- a/framework/util/page_guard_manager.h +++ b/framework/util/page_guard_manager.h @@ -145,6 +145,9 @@ class PageGuardManager void UffdUnblockRtSignal(); + void + GetDirtyMemoryRegions(std::unordered_map& memories_page_status); + protected: PageGuardManager(); diff --git a/framework/util/page_status_tracker.h b/framework/util/page_status_tracker.h index 2db47b2bce..b6cb7c4b45 100644 --- a/framework/util/page_status_tracker.h +++ b/framework/util/page_status_tracker.h @@ -37,6 +37,9 @@ GFXRECON_BEGIN_NAMESPACE(util) class PageStatusTracker { + public: + typedef std::vector PageStatus; + public: PageStatusTracker(size_t page_count) : active_writes_(page_count, 0), active_reads_(page_count, 0) {} @@ -50,8 +53,7 @@ class PageStatusTracker void SetAllBlocksActiveWrite() { std::fill(active_writes_.begin(), active_writes_.end(), 1); } - private: - typedef std::vector PageStatus; + const PageStatus& GetActiveWrites() { return active_writes_; } private: PageStatus active_writes_; //< Track blocks that have been written. diff --git a/framework/util/spirv_parsing_util.cpp b/framework/util/spirv_parsing_util.cpp index 5e150e4804..991d14da8d 100644 --- a/framework/util/spirv_parsing_util.cpp +++ b/framework/util/spirv_parsing_util.cpp @@ -498,5 +498,108 @@ std::vector SpirVParsingUtil::GetBufferRe return ret; } +static VkDescriptorType SpvReflectToVkDescriptorType(SpvReflectDescriptorType type) +{ + switch (type) + { + case SPV_REFLECT_DESCRIPTOR_TYPE_SAMPLER: + return VK_DESCRIPTOR_TYPE_SAMPLER; + + case SPV_REFLECT_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: + return VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + + case SPV_REFLECT_DESCRIPTOR_TYPE_SAMPLED_IMAGE: + return VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; + + case SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_IMAGE: + return VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + + case SPV_REFLECT_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: + return VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER; + + case SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: + return VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; + + case SPV_REFLECT_DESCRIPTOR_TYPE_UNIFORM_BUFFER: + return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + + case SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_BUFFER: + return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + + case SPV_REFLECT_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: + return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + + case SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC; + + case SPV_REFLECT_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: + return VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; + + case SPV_REFLECT_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: + return VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR; + + default: + GFXRECON_LOG_WARNING("%s(): Unrecognised SPIRV-Reflect descriptor type"); + assert(0); + return VK_DESCRIPTOR_TYPE_MAX_ENUM; + } +} + +bool SpirVParsingUtil::SPIRVReflectPerformReflectionOnShaderModule( + size_t spirv_size, + const uint32_t* spirv_code, + encode::vulkan_state_info::ShaderReflectionDescriptorSetsInfos& shader_reflection) +{ + assert(spirv_size); + assert(spirv_code != nullptr); + + shader_reflection.clear(); + + spv_reflect::ShaderModule reflection(spirv_size, spirv_code); + if (reflection.GetResult() != SPV_REFLECT_RESULT_SUCCESS) + { + GFXRECON_LOG_WARNING("Could not generate reflection data about shader module") + assert(0); + return false; + } + + // Scan shader descriptor bindings + uint32_t count = 0; + SpvReflectResult result = reflection.EnumerateDescriptorBindings(&count, nullptr); + if (result != SPV_REFLECT_RESULT_SUCCESS) + { + // GFXRECON_LOG_ERROR("Shader reflection on shader %" PRIu64 " failed", shader_info->capture_id); + assert(0); + return false; + } + + if (count) + { + std::vector bindings(count, nullptr); + result = reflection.EnumerateDescriptorBindings(&count, bindings.data()); + if (result != SPV_REFLECT_RESULT_SUCCESS) + { + // GFXRECON_LOG_ERROR("Shader reflection on shader %" PRIu64 " failed", shader_info->capture_id); + assert(0); + return false; + } + + for (const auto binding : bindings) + { + VkDescriptorType type = SpvReflectToVkDescriptorType(binding->descriptor_type); + bool readonly = ((binding->decoration_flags & SPV_REFLECT_DECORATION_NON_WRITABLE) == + SPV_REFLECT_DECORATION_NON_WRITABLE); + const uint32_t count = binding->count; + const bool is_array = binding->array.dims_count > 0; + + shader_reflection[binding->set].emplace(binding->binding, + encode::vulkan_state_info::ShaderReflectionDescriptorInfo( + type, readonly, binding->accessed, count, is_array)); + } + } + + return true; +} + GFXRECON_END_NAMESPACE(util) GFXRECON_END_NAMESPACE(gfxrecon) diff --git a/framework/util/spirv_parsing_util.h b/framework/util/spirv_parsing_util.h index 2229497229..d60d92d8f6 100644 --- a/framework/util/spirv_parsing_util.h +++ b/framework/util/spirv_parsing_util.h @@ -29,6 +29,7 @@ #include #include "util/defines.h" +#include "encode/vulkan_state_info.h" GFXRECON_BEGIN_NAMESPACE(gfxrecon) GFXRECON_BEGIN_NAMESPACE(util) @@ -51,6 +52,11 @@ class SpirVParsingUtil [[nodiscard]] std::vector GetBufferReferenceInfos() const; + bool SPIRVReflectPerformReflectionOnShaderModule( + size_t spirv_size, + const uint32_t* spirv_code, + encode::vulkan_state_info::ShaderReflectionDescriptorSetsInfos& reflection); + private: class Instruction; diff --git a/layer/trace_layer.cpp b/layer/trace_layer.cpp index 1364aa14c4..2ccc0455ba 100644 --- a/layer/trace_layer.cpp +++ b/layer/trace_layer.cpp @@ -21,6 +21,7 @@ ** DEALINGS IN THE SOFTWARE. */ +#include "util/logging.h" #include PROJECT_VERSION_HEADER_FILE #include "layer/trace_layer.h" diff --git a/tools/convert/main.cpp b/tools/convert/main.cpp index b7528d0836..b30f593f54 100644 --- a/tools/convert/main.cpp +++ b/tools/convert/main.cpp @@ -21,6 +21,7 @@ ** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ** DEALINGS IN THE SOFTWARE. */ +#include #include PROJECT_VERSION_HEADER_FILE #include "tool_settings.h" #include "decode/json_writer.h" /// @todo move to util? @@ -30,6 +31,8 @@ #include "util/file_path.h" #include "util/platform.h" +#include "decode/asset_file_consumer.h" + #include "generated/generated_vulkan_json_consumer.h" #include "decode/marker_json_consumer.h" #include "decode/metadata_json_consumer.h" @@ -173,6 +176,16 @@ int main(int argc, const char** argv) bool file_per_frame = arg_parser.IsOptionSet(kFilePerFrameOption); bool output_to_stdout = output_filename == "stdout"; + bool is_asset_file = false; + size_t last_dot_pos = input_filename.find_last_of("."); + if (last_dot_pos != std::string::npos) + { + if (!input_filename.compare(last_dot_pos, 5, ".gfxa")) + { + is_asset_file = true; + } + } + gfxrecon::decode::FileProcessor file_processor; #ifndef D3D12_SUPPORT @@ -180,7 +193,7 @@ int main(int argc, const char** argv) bool detected_vulkan = false; gfxrecon::decode::DetectAPIs(input_filename, detected_d3d12, detected_vulkan); - if (!detected_vulkan) + if (!detected_vulkan && !is_asset_file) { GFXRECON_LOG_INFO("Capture file does not contain Vulkan content. D3D12 content may be present but " "gfxrecon-convert is not compiled with D3D12 support."); @@ -229,72 +242,17 @@ int main(int argc, const char** argv) else { gfxrecon::util::FileNoLockOutputStream out_stream{ out_file_handle, false }; - VulkanJsonConsumer json_consumer; - gfxrecon::util::JsonOptions json_options; + gfxrecon::decode::AssetFileConsumer asset_file_consumer; gfxrecon::decode::VulkanDecoder decoder; - decoder.AddConsumer(&json_consumer); + decoder.AddConsumer(&asset_file_consumer); file_processor.AddDecoder(&decoder); - json_options.root_dir = output_dir; - json_options.data_sub_dir = filename_stem; - json_options.format = output_format; - json_options.dump_binaries = dump_binaries; - json_options.expand_flags = expand_flags; - - gfxrecon::decode::JsonWriter json_writer{ json_options, GFXRECON_PROJECT_VERSION_STRING, input_filename }; - file_processor.SetAnnotationProcessor(&json_writer); - - bool success = true; - const std::string vulkan_version{ std::to_string(VK_VERSION_MAJOR(VK_HEADER_VERSION_COMPLETE)) + "." + - std::to_string(VK_VERSION_MINOR(VK_HEADER_VERSION_COMPLETE)) + "." + - std::to_string(VK_VERSION_PATCH(VK_HEADER_VERSION_COMPLETE)) }; - json_consumer.Initialize(&json_writer, vulkan_version); - json_writer.StartStream(&out_stream); - - // If CONVERT_EXPERIMENTAL_D3D12 was set, then add DX12 consumer/decoder -#ifdef D3D12_SUPPORT - Dx12JsonConsumer dx12_json_consumer; - gfxrecon::decode::Dx12Decoder dx12_decoder; - - dx12_decoder.AddConsumer(&dx12_json_consumer); - file_processor.AddDecoder(&dx12_decoder); - auto dx12_json_flags = output_format == JsonFormat::JSON ? gfxrecon::util::kToString_Formatted - : gfxrecon::util::kToString_Unformatted; - dx12_json_consumer.Initialize(&json_writer); -#endif - + bool success = true; while (success) { success = file_processor.ProcessNextFrame(); - if (success && file_per_frame) - { - json_writer.EndStream(); - gfxrecon::util::platform::FileClose(out_file_handle); - json_filename = gfxrecon::util::filepath::InsertFilenamePostfix( - output_filename, +"_" + FormatFrameNumber(file_processor.GetCurrentFrameNumber())); - gfxrecon::util::platform::FileOpen(&out_file_handle, json_filename.c_str(), "w"); - success = out_file_handle != nullptr; - if (success) - { - out_stream.Reset(out_file_handle); - json_writer.StartStream(&out_stream); - } - else - { - GFXRECON_LOG_ERROR("Failed to create file: '%s'.", json_filename.c_str()); - ret_code = 1; - } - } - } - json_consumer.Destroy(); - // If CONVERT_EXPERIMENTAL_D3D12 was set, then cleanup DX12 consumer -#ifdef D3D12_SUPPORT - dx12_json_consumer.Destroy(); -#endif - if (!output_to_stdout) - { - gfxrecon::util::platform::FileClose(out_file_handle); } + if (file_processor.GetErrorState() != gfxrecon::decode::FileProcessor::kErrorNone) { GFXRECON_LOG_ERROR("Failed to process trace."); diff --git a/tools/info/main.cpp b/tools/info/main.cpp index 0110c80be3..b10a748049 100644 --- a/tools/info/main.cpp +++ b/tools/info/main.cpp @@ -203,14 +203,15 @@ static std::string GetVersionString(uint32_t api_version) void GatherApiAgnosticStats(ApiAgnosticStats& api_agnostic_stats, gfxrecon::decode::FileProcessor& file_processor, - gfxrecon::decode::StatConsumer& stat_consumer) + gfxrecon::decode::StatConsumer& stat_consumer, + const std::string& input_filename) { api_agnostic_stats.error_state = file_processor.GetErrorState(); // File options. gfxrecon::format::CompressionType compression_type = gfxrecon::format::CompressionType::kNone; - auto file_options = file_processor.GetFileOptions(); + auto file_options = file_processor.GetFileOptions(input_filename); for (const auto& option : file_options) { if (option.key == gfxrecon::format::FileOption::kCompressionType) @@ -360,7 +361,8 @@ void GatherAndPrintExeInfo(const std::string& input_filename) void PrintVulkanStats(const gfxrecon::decode::VulkanStatsConsumer& vulkan_stats_consumer, const gfxrecon::decode::FileProcessor& file_processor, const ApiAgnosticStats& api_agnostic_stats, - const AnnotationRecorder& annotation_recoder) + const AnnotationRecorder& annotation_recoder, + const std::string& input_filename) { if (api_agnostic_stats.error_state == gfxrecon::decode::FileProcessor::kErrorNone) { @@ -368,7 +370,7 @@ void PrintVulkanStats(const gfxrecon::decode::VulkanStatsConsumer& vulkan_stats_ GFXRECON_WRITE_CONSOLE("File info:"); gfxrecon::format::CompressionType compression_type = gfxrecon::format::CompressionType::kNone; - auto file_options = file_processor.GetFileOptions(); + auto file_options = file_processor.GetFileOptions(input_filename); for (const auto& option : file_options) { if (option.key == gfxrecon::format::FileOption::kCompressionType) @@ -792,7 +794,7 @@ void GatherAndPrintAllInfo(const std::string& input_filename) if (file_processor.GetErrorState() == gfxrecon::decode::FileProcessor::kErrorNone) { ApiAgnosticStats api_agnostic_stats = {}; - GatherApiAgnosticStats(api_agnostic_stats, file_processor, stat_consumer); + GatherApiAgnosticStats(api_agnostic_stats, file_processor, stat_consumer, input_filename); std::vector target_annotations = { { "GFXR version", gfxrecon::format::kOperationAnnotationGfxreconstructVersion }, @@ -815,7 +817,8 @@ void GatherAndPrintAllInfo(const std::string& input_filename) if (vulkan_detection_consumer.WasVulkanAPIDetected() || print_all_apis) { - PrintVulkanStats(vulkan_stats_consumer, file_processor, api_agnostic_stats, annotation_recorder); + PrintVulkanStats( + vulkan_stats_consumer, file_processor, api_agnostic_stats, annotation_recorder, input_filename); // Add annotations relevant to Vulkan target_annotations.push_back({ "Vulkan version", gfxrecon::format::kOperationAnnotationVulkanVersion }); diff --git a/tools/optimize/block_skipping_file_processor.cpp b/tools/optimize/block_skipping_file_processor.cpp index 88e786009b..8f76c50ee4 100644 --- a/tools/optimize/block_skipping_file_processor.cpp +++ b/tools/optimize/block_skipping_file_processor.cpp @@ -203,7 +203,7 @@ bool BlockSkippingFileProcessor::ProcessBlocks() } else { - if (!feof(file_descriptor_)) + if (!feof(GetFileDescriptor())) { // No data has been read for the current block, so we don't use 'HandleBlockReadError' here, as it // assumes that the block header has been successfully read and will print an incomplete block at diff --git a/tools/replay/android_main.cpp b/tools/replay/android_main.cpp index e692515d53..e2888cace9 100644 --- a/tools/replay/android_main.cpp +++ b/tools/replay/android_main.cpp @@ -32,11 +32,14 @@ #include "format/format.h" #include "generated/generated_vulkan_decoder.h" #include "generated/generated_vulkan_replay_consumer.h" +#include "decode/asset_file_consumer.h" #include "util/argument_parser.h" #include "util/logging.h" #include "util/platform.h" #include "parse_dump_resources_cli.h" +#include "format/format.h" + #include #include #include @@ -100,6 +103,40 @@ void android_main(struct android_app* app) filename = positional_arguments[0]; } + gfxrecon::format::AssetFileOffsets asset_file_offsets; + const std::string reuse_asset_file = arg_parser.GetArgumentValue(kReuseAssetFileArgument); + GFXRECON_WRITE_CONSOLE("%s()", __func__) + GFXRECON_WRITE_CONSOLE(" reuse_asset_file: %s", reuse_asset_file.c_str()) + + if (!reuse_asset_file.empty()) + { + gfxrecon::decode::FileProcessor file_processor; + if (file_processor.Initialize(reuse_asset_file)) + { + gfxrecon::decode::AssetFileConsumer asset_file_consumer; + gfxrecon::decode::VulkanDecoder decoder; + + decoder.AddConsumer(&asset_file_consumer); + file_processor.AddDecoder(&decoder); + + bool success = true; + while (success) + { + success = file_processor.ProcessNextFrame(); + } + + if (file_processor.GetErrorState() != gfxrecon::decode::FileProcessor::kErrorNone) + { + GFXRECON_LOG_ERROR("Failed to process asset file %s.", reuse_asset_file.c_str()); + } + else + { + asset_file_offsets = asset_file_consumer.GetFrameAssetFileOffsets(); + const gfxrecon::format::HandleId greatest_id = asset_file_consumer.GetGreatestId(); + } + } + } + try { std::unique_ptr file_processor = @@ -129,11 +166,12 @@ void android_main(struct android_app* app) return; } - gfxrecon::decode::VulkanReplayConsumer replay_consumer(application, replay_options); - gfxrecon::decode::VulkanDecoder decoder; - uint32_t start_frame, end_frame; - bool has_mfr = GetMeasurementFrameRange(arg_parser, start_frame, end_frame); - std::string measurement_file_name; + gfxrecon::decode::VulkanReplayConsumer replay_consumer( + application, replay_options, &asset_file_offsets); + gfxrecon::decode::VulkanDecoder decoder; + uint32_t start_frame, end_frame; + bool has_mfr = GetMeasurementFrameRange(arg_parser, start_frame, end_frame); + std::string measurement_file_name; if (has_mfr) { @@ -153,7 +191,9 @@ void android_main(struct android_app* app) replay_consumer.SetFpsInfo(&fps_info); decoder.AddConsumer(&replay_consumer); + file_processor->AddDecoder(&decoder); + application->SetPauseFrame(GetPauseFrame(arg_parser)); // Warn if the capture layer is active. diff --git a/tools/replay/desktop_main.cpp b/tools/replay/desktop_main.cpp index 958382026c..7503584411 100644 --- a/tools/replay/desktop_main.cpp +++ b/tools/replay/desktop_main.cpp @@ -216,7 +216,7 @@ int main(int argc, const char** argv) preload_measurement_frame_range, measurement_file_name); - gfxrecon::decode::VulkanReplayConsumer vulkan_replay_consumer(application, vulkan_replay_options); + gfxrecon::decode::VulkanReplayConsumer vulkan_replay_consumer(application, vulkan_replay_options, nullptr); gfxrecon::decode::VulkanDecoder vulkan_decoder; if (vulkan_replay_options.enable_vulkan) diff --git a/tools/replay/replay_settings.h b/tools/replay/replay_settings.h index aa40615c48..6f0e6cdc35 100644 --- a/tools/replay/replay_settings.h +++ b/tools/replay/replay_settings.h @@ -43,7 +43,7 @@ const char kArguments[] = "force-windowed,--fwo|--force-windowed-origin,--batching-memory-usage,--measurement-file,--swapchain,--sgfs|--skip-" "get-fence-status,--sgfr|--" "skip-get-fence-ranges,--dump-resources,--dump-resources-scale,--dump-resources-image-format,--dump-resources-dir," - "--dump-resources-dump-color-attachment-index,--pbis,--pcj|--pipeline-creation-jobs"; + "--dump-resources-dump-color-attachment-index,--pbis,--pcj|--pipeline-creation-jobs,--reuse-asset-file"; static void PrintUsage(const char* exe_name) { diff --git a/tools/tool_settings.h b/tools/tool_settings.h index 4a4a51612e..4ed07e5520 100644 --- a/tools/tool_settings.h +++ b/tools/tool_settings.h @@ -141,6 +141,7 @@ const char kDumpResourcesDumpVertexIndexBuffers[] = "--dump-resources-dump-verte const char kDumpResourcesJsonPerCommand[] = "--dump-resources-json-output-per-command"; const char kDumpResourcesDumpImmutableResources[] = "--dump-resources-dump-immutable-resources"; const char kDumpResourcesDumpImageSubresources[] = "--dump-resources-dump-all-image-subresources"; +const char kReuseAssetFileArgument[] = "--reuse-asset-file"; enum class WsiPlatform { @@ -1095,6 +1096,9 @@ GetVulkanReplayOptions(const gfxrecon::util::ArgumentParser& arg_parse replay_options.dump_resources_color_attachment_index = std::stoi(dr_color_att_idx); } + replay_options.reuse_asset_file = arg_parser.GetArgumentValue(kReuseAssetFileArgument); + GFXRECON_WRITE_CONSOLE("%s() reuse_asset_file: %s", __func__, replay_options.reuse_asset_file.c_str()); + return replay_options; }