Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2018-2021 The Khronos Group Inc. |
| 2 | * Copyright (c) 2018-2021 Valve Corporation |
| 3 | * Copyright (c) 2018-2021 LunarG, Inc. |
Karl Schultz | 7b024b4 | 2018-08-30 16:18:18 -0600 | [diff] [blame] | 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | * |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 17 | * Author: Karl Schultz <karl@lunarg.com> |
| 18 | * Author: Tony Barbour <tony@lunarg.com> |
Karl Schultz | 7b024b4 | 2018-08-30 16:18:18 -0600 | [diff] [blame] | 19 | */ |
| 20 | |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 21 | #pragma once |
| 22 | |
| 23 | #include "chassis.h" |
| 24 | #include "state_tracker.h" |
Tony-LunarG | 0e56472 | 2019-03-19 16:09:14 -0600 | [diff] [blame] | 25 | #include "vk_mem_alloc.h" |
Tony-LunarG | b5fae46 | 2020-03-05 12:43:25 -0700 | [diff] [blame] | 26 | #include "gpu_utils.h" |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 27 | class GpuAssisted; |
Tony-LunarG | 0e56472 | 2019-03-19 16:09:14 -0600 | [diff] [blame] | 28 | |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 29 | struct GpuAssistedDeviceMemoryBlock { |
Mark Lobodzinski | 2a3ee4a | 2019-03-13 13:11:39 -0600 | [diff] [blame] | 30 | VkBuffer buffer; |
Tony-LunarG | 0e56472 | 2019-03-19 16:09:14 -0600 | [diff] [blame] | 31 | VmaAllocation allocation; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 32 | std::unordered_map<uint32_t, const cvdescriptorset::Descriptor*> update_at_submit; |
Mark Lobodzinski | 2a3ee4a | 2019-03-13 13:11:39 -0600 | [diff] [blame] | 33 | }; |
| 34 | |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 35 | struct GpuAssistedBufferInfo { |
| 36 | GpuAssistedDeviceMemoryBlock output_mem_block; |
| 37 | GpuAssistedDeviceMemoryBlock di_input_mem_block; // Descriptor Indexing input |
| 38 | GpuAssistedDeviceMemoryBlock bda_input_mem_block; // Buffer Device Address input |
Mark Lobodzinski | 2a3ee4a | 2019-03-13 13:11:39 -0600 | [diff] [blame] | 39 | VkDescriptorSet desc_set; |
| 40 | VkDescriptorPool desc_pool; |
Jason Macnak | 67407e7 | 2019-07-11 11:05:09 -0700 | [diff] [blame] | 41 | VkPipelineBindPoint pipeline_bind_point; |
Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 42 | CMD_TYPE cmd_type; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 43 | GpuAssistedBufferInfo(GpuAssistedDeviceMemoryBlock output_mem_block, GpuAssistedDeviceMemoryBlock di_input_mem_block, |
| 44 | GpuAssistedDeviceMemoryBlock bda_input_mem_block, VkDescriptorSet desc_set, VkDescriptorPool desc_pool, |
Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 45 | VkPipelineBindPoint pipeline_bind_point, CMD_TYPE cmd_type) |
Jason Macnak | 67407e7 | 2019-07-11 11:05:09 -0700 | [diff] [blame] | 46 | : output_mem_block(output_mem_block), |
Tony-LunarG | 8eb5a00 | 2019-07-25 16:49:00 -0600 | [diff] [blame] | 47 | di_input_mem_block(di_input_mem_block), |
| 48 | bda_input_mem_block(bda_input_mem_block), |
Jason Macnak | 67407e7 | 2019-07-11 11:05:09 -0700 | [diff] [blame] | 49 | desc_set(desc_set), |
| 50 | desc_pool(desc_pool), |
Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 51 | pipeline_bind_point(pipeline_bind_point), |
| 52 | cmd_type(cmd_type){}; |
Mark Lobodzinski | 2a3ee4a | 2019-03-13 13:11:39 -0600 | [diff] [blame] | 53 | }; |
| 54 | |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 55 | struct GpuAssistedShaderTracker { |
| 56 | VkPipeline pipeline; |
| 57 | VkShaderModule shader_module; |
| 58 | std::vector<unsigned int> pgm; |
| 59 | }; |
| 60 | |
Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 61 | struct GpuVuid { |
| 62 | const char* uniform_access_oob = kVUIDUndefined; |
| 63 | const char* storage_access_oob = kVUIDUndefined; |
| 64 | }; |
| 65 | |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 66 | struct GpuAssistedAccelerationStructureBuildValidationBufferInfo { |
Jason Macnak | 83cfd58 | 2019-07-31 10:14:24 -0700 | [diff] [blame] | 67 | // The acceleration structure that is being built. |
| 68 | VkAccelerationStructureNV acceleration_structure = VK_NULL_HANDLE; |
| 69 | |
| 70 | // The descriptor pool and descriptor set being used to validate a given build. |
| 71 | VkDescriptorPool descriptor_pool = VK_NULL_HANDLE; |
| 72 | VkDescriptorSet descriptor_set = VK_NULL_HANDLE; |
| 73 | |
| 74 | // The storage buffer used by the validating compute shader whichcontains info about |
| 75 | // the valid handles and which is written to communicate found invalid handles. |
| 76 | VkBuffer validation_buffer = VK_NULL_HANDLE; |
| 77 | VmaAllocation validation_buffer_allocation = VK_NULL_HANDLE; |
| 78 | }; |
| 79 | |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 80 | struct GpuAssistedAccelerationStructureBuildValidationState { |
Jason Macnak | 83cfd58 | 2019-07-31 10:14:24 -0700 | [diff] [blame] | 81 | bool initialized = false; |
| 82 | |
| 83 | VkPipeline pipeline = VK_NULL_HANDLE; |
| 84 | VkPipelineLayout pipeline_layout = VK_NULL_HANDLE; |
| 85 | |
| 86 | VkAccelerationStructureNV replacement_as = VK_NULL_HANDLE; |
| 87 | VmaAllocation replacement_as_allocation = VK_NULL_HANDLE; |
| 88 | uint64_t replacement_as_handle = 0; |
| 89 | |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 90 | std::unordered_map<VkCommandBuffer, std::vector<GpuAssistedAccelerationStructureBuildValidationBufferInfo>> validation_buffers; |
Jason Macnak | 83cfd58 | 2019-07-31 10:14:24 -0700 | [diff] [blame] | 91 | }; |
| 92 | |
Tony-LunarG | 99b880b | 2019-09-26 11:19:52 -0600 | [diff] [blame] | 93 | class GpuAssisted : public ValidationStateTracker { |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 94 | VkPhysicalDeviceFeatures supported_features; |
Tony-LunarG | 8eb5a00 | 2019-07-25 16:49:00 -0600 | [diff] [blame] | 95 | VkBool32 shaderInt64; |
Tony-LunarG | 99b880b | 2019-09-26 11:19:52 -0600 | [diff] [blame] | 96 | uint32_t unique_shader_module_id = 0; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 97 | std::unordered_map<VkCommandBuffer, std::vector<GpuAssistedBufferInfo>> command_buffer_map; // gpu_buffer_list; |
Tony-LunarG | 0e56472 | 2019-03-19 16:09:14 -0600 | [diff] [blame] | 98 | uint32_t output_buffer_size; |
Tony-LunarG | c28e28a | 2020-08-14 10:37:48 -0600 | [diff] [blame] | 99 | bool buffer_oob_enabled; |
Tony-LunarG | 8eb5a00 | 2019-07-25 16:49:00 -0600 | [diff] [blame] | 100 | std::map<VkDeviceAddress, VkDeviceSize> buffer_map; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 101 | GpuAssistedAccelerationStructureBuildValidationState acceleration_structure_validation_state; |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 102 | |
Jeremy Gebben | a3705f4 | 2021-01-19 16:47:43 -0700 | [diff] [blame^] | 103 | void PreRecordCommandBuffer(VkCommandBuffer command_buffer); |
| 104 | bool CommandBufferNeedsProcessing(VkCommandBuffer command_buffer); |
| 105 | void ProcessCommandBuffer(VkQueue queue, VkCommandBuffer command_buffer); |
| 106 | |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 107 | public: |
Mark Lobodzinski | 0dcb87d | 2020-03-30 16:09:24 -0600 | [diff] [blame] | 108 | GpuAssisted() { container_type = LayerObjectTypeGpuAssisted; } |
| 109 | |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 110 | bool aborted = false; |
Tony-LunarG | 5c38b18 | 2020-06-10 16:15:32 -0600 | [diff] [blame] | 111 | bool descriptor_indexing = false; |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 112 | VkDevice device; |
| 113 | VkPhysicalDevice physicalDevice; |
| 114 | uint32_t adjusted_max_desc_sets; |
| 115 | uint32_t desc_set_bind_index; |
Tony-LunarG | 57ada96 | 2020-05-01 16:21:00 -0600 | [diff] [blame] | 116 | VkDescriptorSetLayout debug_desc_layout = VK_NULL_HANDLE; |
| 117 | VkDescriptorSetLayout dummy_desc_layout = VK_NULL_HANDLE; |
Tony-LunarG | b5fae46 | 2020-03-05 12:43:25 -0700 | [diff] [blame] | 118 | std::unique_ptr<UtilDescriptorSetManager> desc_set_manager; |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 119 | std::unordered_map<uint32_t, GpuAssistedShaderTracker> shader_map; |
| 120 | PFN_vkSetDeviceLoaderData vkSetDeviceLoaderData; |
| 121 | VmaAllocator vmaAllocator = {}; |
Tony-LunarG | b5fae46 | 2020-03-05 12:43:25 -0700 | [diff] [blame] | 122 | std::map<VkQueue, UtilQueueBarrierCommandInfo> queue_barrier_command_infos; |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 123 | std::vector<GpuAssistedBufferInfo>& GetBufferInfo(const VkCommandBuffer command_buffer) { |
Mark Lobodzinski | 2a3ee4a | 2019-03-13 13:11:39 -0600 | [diff] [blame] | 124 | auto buffer_list = command_buffer_map.find(command_buffer); |
| 125 | if (buffer_list == command_buffer_map.end()) { |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 126 | std::vector<GpuAssistedBufferInfo> new_list{}; |
Mark Lobodzinski | 2a3ee4a | 2019-03-13 13:11:39 -0600 | [diff] [blame] | 127 | command_buffer_map[command_buffer] = new_list; |
| 128 | return command_buffer_map[command_buffer]; |
| 129 | } |
| 130 | return buffer_list->second; |
| 131 | } |
Mark Lobodzinski | a8151b0 | 2020-02-27 13:38:08 -0700 | [diff] [blame] | 132 | |
Tony-LunarG | 1dce239 | 2019-10-23 16:49:29 -0600 | [diff] [blame] | 133 | public: |
Mark Lobodzinski | a8151b0 | 2020-02-27 13:38:08 -0700 | [diff] [blame] | 134 | template <typename T> |
| 135 | void ReportSetupProblem(T object, const char* const specific_message) const; |
Tony-LunarG | 5c38b18 | 2020-06-10 16:15:32 -0600 | [diff] [blame] | 136 | bool CheckForDescriptorIndexing(DeviceFeatures enabled_features) const; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 137 | void PreCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 138 | const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, void* modified_create_info) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 139 | void PostCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 140 | const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, VkResult result) override; |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 141 | void PostCallRecordGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 142 | VkDeviceAddress address) override; |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 143 | void PostCallRecordGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 144 | VkDeviceAddress address) override; |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 145 | void PostCallRecordGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 146 | VkDeviceAddress address) override; |
| 147 | void PreCallRecordDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) override; |
| 148 | void PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 149 | void PostCallRecordBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, |
| 150 | const VkBindAccelerationStructureMemoryInfoNV* pBindInfos, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 151 | VkResult result) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 152 | void PreCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 153 | const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 154 | void* cpl_state_data) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 155 | void PostCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 156 | const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 157 | VkResult result) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 158 | void ResetCommandBuffer(VkCommandBuffer commandBuffer); |
| 159 | bool PreCallValidateCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, |
| 160 | VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, |
| 161 | uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, |
| 162 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 163 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) const override; |
Jeremy Gebben | a3705f4 | 2021-01-19 16:47:43 -0700 | [diff] [blame^] | 164 | bool PreCallValidateCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, |
| 165 | const VkDependencyInfoKHR* pDependencyInfos) const override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 166 | void PreCallRecordCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 167 | VkBuffer* pBuffer, void* cb_state_data) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 168 | void CreateAccelerationStructureBuildValidationState(GpuAssisted* device_GpuAssisted); |
| 169 | void DestroyAccelerationStructureBuildValidationState(); |
| 170 | void PreCallRecordCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, |
| 171 | VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, |
| 172 | VkAccelerationStructureNV dst, VkAccelerationStructureNV src, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 173 | VkBuffer scratch, VkDeviceSize scratchOffset) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 174 | void ProcessAccelerationStructureBuildValidationBuffer(VkQueue queue, CMD_BUFFER_STATE* cb_node); |
| 175 | void PreCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, |
| 176 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 177 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 178 | void* cgpl_state_data) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 179 | void PreCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, |
| 180 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 181 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 182 | void* ccpl_state_data) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 183 | void PreCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, |
| 184 | const VkRayTracingPipelineCreateInfoNV* pCreateInfos, |
| 185 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 186 | void* crtpl_state_data) override; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 187 | void PreCallRecordCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, |
| 188 | VkPipelineCache pipelineCache, uint32_t count, |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 189 | const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, |
| 190 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 191 | void* crtpl_state_data) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 192 | void PostCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, |
| 193 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 194 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 195 | void* cgpl_state_data) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 196 | void PostCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, |
| 197 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 198 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 199 | void* ccpl_state_data) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 200 | void PostCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, |
| 201 | const VkRayTracingPipelineCreateInfoNV* pCreateInfos, |
| 202 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 203 | void* crtpl_state_data) override; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 204 | void PostCallRecordCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, |
| 205 | VkPipelineCache pipelineCache, uint32_t count, |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 206 | const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, |
| 207 | const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 208 | VkResult result, void* crtpl_state_data) override; |
| 209 | void PreCallRecordDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 210 | bool InstrumentShader(const VkShaderModuleCreateInfo* pCreateInfo, std::vector<unsigned int>& new_pgm, |
| 211 | uint32_t* unique_shader_id); |
| 212 | void PreCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, |
| 213 | const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 214 | void* csm_state_data) override; |
Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 215 | void AnalyzeAndGenerateMessages(VkCommandBuffer command_buffer, VkQueue queue, GpuAssistedBufferInfo &buffer_info, |
| 216 | uint32_t operation_index, uint32_t* const debug_output_buffer); |
| 217 | |
Tony-LunarG | c28e28a | 2020-08-14 10:37:48 -0600 | [diff] [blame] | 218 | void SetDescriptorInitialized(uint32_t* pData, uint32_t index, const cvdescriptorset::Descriptor* descriptor); |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 219 | void UpdateInstrumentationBuffer(CMD_BUFFER_STATE* cb_node); |
Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 220 | const GpuVuid& GetGpuVuid(CMD_TYPE cmd_type) const; |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 221 | void PreCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 222 | void PostCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 223 | VkResult result) override; |
Jeremy Gebben | a3705f4 | 2021-01-19 16:47:43 -0700 | [diff] [blame^] | 224 | void PreCallRecordQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2KHR* pSubmits, |
| 225 | VkFence fence) override; |
| 226 | void PostCallRecordQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2KHR* pSubmits, VkFence fence, |
| 227 | VkResult result) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 228 | void PreCallRecordCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 229 | uint32_t firstInstance) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 230 | void PreCallRecordCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 231 | uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 232 | void PreCallRecordCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 233 | uint32_t stride) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 234 | void PreCallRecordCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 235 | uint32_t stride) override; |
Tony-LunarG | 2fb8ff0 | 2020-06-11 12:45:07 -0600 | [diff] [blame] | 236 | void PreCallRecordCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 237 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 238 | uint32_t stride) override; |
Tony-LunarG | 2fb8ff0 | 2020-06-11 12:45:07 -0600 | [diff] [blame] | 239 | void PreCallRecordCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 240 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 241 | uint32_t stride) override; |
Tony-LunarG | 54176fb | 2020-12-02 10:47:22 -0700 | [diff] [blame] | 242 | void PreCallRecordCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, |
| 243 | VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 244 | uint32_t vertexStride) override; |
Tony-LunarG | 2fb8ff0 | 2020-06-11 12:45:07 -0600 | [diff] [blame] | 245 | void PreCallRecordCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 246 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 247 | uint32_t stride) override; |
Tony-LunarG | 2fb8ff0 | 2020-06-11 12:45:07 -0600 | [diff] [blame] | 248 | void PreCallRecordCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 249 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 250 | uint32_t stride) override; |
| 251 | void PreCallRecordCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) override; |
Tony-LunarG | 2fb8ff0 | 2020-06-11 12:45:07 -0600 | [diff] [blame] | 252 | void PreCallRecordCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 253 | uint32_t drawCount, uint32_t stride) override; |
Tony-LunarG | 2fb8ff0 | 2020-06-11 12:45:07 -0600 | [diff] [blame] | 254 | void PreCallRecordCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 255 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 256 | uint32_t stride) override; |
| 257 | void PreCallRecordCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) override; |
| 258 | void PreCallRecordCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) override; |
Tony-LunarG | d13f9b5 | 2020-09-08 15:45:45 -0600 | [diff] [blame] | 259 | void PreCallRecordCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 260 | uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) override; |
Tony-LunarG | 52c8c60 | 2020-09-10 16:29:56 -0600 | [diff] [blame] | 261 | void PreCallRecordCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 262 | uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, |
| 263 | uint32_t groupCountZ) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 264 | void PreCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, |
| 265 | VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, |
| 266 | VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, |
| 267 | VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, |
| 268 | VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, |
| 269 | VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 270 | uint32_t width, uint32_t height, uint32_t depth) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 271 | void PostCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, |
| 272 | VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, |
| 273 | VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, |
| 274 | VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, |
| 275 | VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, |
| 276 | VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 277 | uint32_t width, uint32_t height, uint32_t depth) override; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 278 | void PreCallRecordCmdTraceRaysKHR(VkCommandBuffer commandBuffer, |
| 279 | const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, |
| 280 | const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, |
| 281 | const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, |
| 282 | const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 283 | uint32_t height, uint32_t depth) override; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 284 | void PostCallRecordCmdTraceRaysKHR(VkCommandBuffer commandBuffer, |
| 285 | const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, |
| 286 | const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, |
| 287 | const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, |
| 288 | const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 289 | uint32_t height, uint32_t depth) override; |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 290 | void PreCallRecordCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 291 | const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, |
| 292 | const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, |
| 293 | const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, |
Shannon McPherson | 54e1f89 | 2020-11-27 11:04:19 -0700 | [diff] [blame] | 294 | const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 295 | VkDeviceAddress indirectDeviceAddress) override; |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 296 | void PostCallRecordCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 297 | const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, |
| 298 | const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, |
| 299 | const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, |
Shannon McPherson | 54e1f89 | 2020-11-27 11:04:19 -0700 | [diff] [blame] | 300 | const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 301 | VkDeviceAddress indirectDeviceAddress) override; |
Tony-LunarG | 7de10e8 | 2020-11-24 11:31:55 -0700 | [diff] [blame] | 302 | void AllocateValidationResources(const VkCommandBuffer cmd_buffer, const VkPipelineBindPoint bind_point, CMD_TYPE cmd); |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 303 | void PostCallRecordGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 304 | VkPhysicalDeviceProperties* pPhysicalDeviceProperties) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 305 | void PostCallRecordGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, |
Mark Lobodzinski | b8e22b5 | 2020-12-03 15:22:35 -0700 | [diff] [blame] | 306 | VkPhysicalDeviceProperties2* pPhysicalDeviceProperties2) override; |
Tony-LunarG | 2ba1cb3 | 2019-09-25 15:16:11 -0600 | [diff] [blame] | 307 | }; |