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