John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1 | /* |
John Zulauf | ab7756b | 2020-12-29 16:10:16 -0700 | [diff] [blame] | 2 | * Copyright (c) 2019-2021 Valve Corporation |
| 3 | * Copyright (c) 2019-2021 LunarG, Inc. |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -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 | * |
| 17 | * Author: John Zulauf <jzulauf@lunarg.com> |
John Zulauf | ab7756b | 2020-12-29 16:10:16 -0700 | [diff] [blame] | 18 | * Author: Locke Lin <locke@lunarg.com> |
| 19 | * Author: Jeremy Gebben <jeremyg@lunarg.com> |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #pragma once |
| 23 | |
John Zulauf | 7635de3 | 2020-05-29 17:14:15 -0600 | [diff] [blame] | 24 | #include <limits> |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 25 | #include <memory> |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 26 | #include <vulkan/vulkan.h> |
| 27 | |
| 28 | #include "synchronization_validation_types.h" |
| 29 | #include "state_tracker.h" |
Jeremy Gebben | 159b3cc | 2021-06-03 09:09:03 -0600 | [diff] [blame] | 30 | #include "cmd_buffer_state.h" |
| 31 | #include "render_pass_state.h" |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 32 | |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 33 | class AccessContext; |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 34 | class CommandBufferAccessContext; |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 35 | using CommandBufferAccessContextShared = std::shared_ptr<CommandBufferAccessContext>; |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 36 | class CommandExecutionContext; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 37 | class ResourceAccessState; |
| 38 | class SyncValidator; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 39 | |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 40 | using ImageRangeEncoder = subresource_adapter::ImageRangeEncoder; |
| 41 | using ImageRangeGen = subresource_adapter::ImageRangeGenerator; |
| 42 | |
John Zulauf | 2f952d2 | 2020-02-10 11:34:51 -0700 | [diff] [blame] | 43 | enum SyncHazard { |
| 44 | NONE = 0, |
| 45 | READ_AFTER_WRITE, |
| 46 | WRITE_AFTER_READ, |
| 47 | WRITE_AFTER_WRITE, |
| 48 | READ_RACING_WRITE, |
| 49 | WRITE_RACING_WRITE, |
| 50 | WRITE_RACING_READ, |
| 51 | }; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 52 | |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 53 | enum class SyncOrdering : uint8_t { |
| 54 | kNonAttachment = 0, |
| 55 | kColorAttachment = 1, |
| 56 | kDepthStencilAttachment = 2, |
| 57 | kRaster = 3, |
| 58 | kNumOrderings = 4, |
| 59 | }; |
| 60 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 61 | // Useful Utilites for manipulating StageAccess parameters, suitable as base class to save typing |
| 62 | struct SyncStageAccess { |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 63 | static inline SyncStageAccessFlags FlagBit(SyncStageAccessIndex stage_access) { |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 64 | return syncStageAccessInfoByStageAccessIndex[stage_access].stage_access_bit; |
| 65 | } |
John Zulauf | 1507ee4 | 2020-05-18 11:33:09 -0600 | [diff] [blame] | 66 | static inline SyncStageAccessFlags Flags(SyncStageAccessIndex stage_access) { |
| 67 | return static_cast<SyncStageAccessFlags>(FlagBit(stage_access)); |
| 68 | } |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 69 | |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 70 | static bool IsRead(const SyncStageAccessFlags &stage_access_bit) { return (stage_access_bit & syncStageAccessReadMask).any(); } |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 71 | static bool IsRead(SyncStageAccessIndex stage_access_index) { return IsRead(FlagBit(stage_access_index)); } |
| 72 | |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 73 | static bool IsWrite(const SyncStageAccessFlags &stage_access_bit) { |
| 74 | return (stage_access_bit & syncStageAccessWriteMask).any(); |
| 75 | } |
| 76 | static bool HasWrite(const SyncStageAccessFlags &stage_access_mask) { |
| 77 | return (stage_access_mask & syncStageAccessWriteMask).any(); |
| 78 | } |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 79 | static bool IsWrite(SyncStageAccessIndex stage_access_index) { return IsWrite(FlagBit(stage_access_index)); } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 80 | static VkPipelineStageFlags2KHR PipelineStageBit(SyncStageAccessIndex stage_access_index) { |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 81 | return syncStageAccessInfoByStageAccessIndex[stage_access_index].stage_mask; |
| 82 | } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 83 | static SyncStageAccessFlags AccessScopeByStage(VkPipelineStageFlags2KHR stages); |
| 84 | static SyncStageAccessFlags AccessScopeByAccess(VkAccessFlags2KHR access); |
| 85 | static SyncStageAccessFlags AccessScope(VkPipelineStageFlags2KHR stages, VkAccessFlags2KHR access); |
| 86 | static SyncStageAccessFlags AccessScope(const SyncStageAccessFlags &stage_scope, VkAccessFlags2KHR accesses) { |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 87 | return stage_scope & AccessScopeByAccess(accesses); |
| 88 | } |
| 89 | }; |
| 90 | |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 91 | // The resource tag is relative to the command buffer or queue in which it's found |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 92 | struct ResourceUsageRecord { |
| 93 | using TagIndex = size_t; |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 94 | using Count = uint32_t; |
John Zulauf | f4aecca | 2021-01-05 16:21:58 -0700 | [diff] [blame] | 95 | constexpr static TagIndex kMaxIndex = std::numeric_limits<TagIndex>::max(); |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 96 | constexpr static uint32_t kMaxCount = std::numeric_limits<Count>::max(); |
Jeremy Gebben | 4bb7350 | 2020-12-14 11:17:50 -0700 | [diff] [blame] | 97 | |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 98 | TagIndex index = 0U; // the index of the command within the command buffer itself (primary or secondary) |
| 99 | CMD_TYPE command = CMD_NONE; |
| 100 | Count seq_num = 0U; |
| 101 | Count sub_command = 0U; |
Jeremy Gebben | 4bb7350 | 2020-12-14 11:17:50 -0700 | [diff] [blame] | 102 | |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 103 | ResourceUsageRecord() = default; |
| 104 | ResourceUsageRecord(TagIndex index_, Count seq_num_, Count sub_command_, CMD_TYPE command_) |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 105 | : index(index_), command(command_), seq_num(seq_num_), sub_command(sub_command_) {} |
John Zulauf | 5f13a79 | 2020-03-10 07:31:21 -0600 | [diff] [blame] | 106 | }; |
| 107 | |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 108 | using ResourceUsageTag = ResourceUsageRecord::TagIndex; |
| 109 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 110 | struct HazardResult { |
John Zulauf | 59e2507 | 2020-07-17 10:55:21 -0600 | [diff] [blame] | 111 | std::unique_ptr<const ResourceAccessState> access_state; |
| 112 | SyncStageAccessIndex usage_index = std::numeric_limits<SyncStageAccessIndex>::max(); |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 113 | SyncHazard hazard = NONE; |
John Zulauf | 37ceaed | 2020-07-03 16:18:15 -0600 | [diff] [blame] | 114 | SyncStageAccessFlags prior_access = 0U; // TODO -- change to a NONE enum in ...Bits |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 115 | ResourceUsageTag tag = ResourceUsageTag(); |
John Zulauf | 59e2507 | 2020-07-17 10:55:21 -0600 | [diff] [blame] | 116 | void Set(const ResourceAccessState *access_state_, SyncStageAccessIndex usage_index_, SyncHazard hazard_, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 117 | const SyncStageAccessFlags &prior_, ResourceUsageTag tag_); |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 118 | }; |
| 119 | |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 120 | struct SyncExecScope { |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 121 | VkPipelineStageFlags2KHR mask_param; // the xxxStageMask parameter passed by the caller |
| 122 | VkPipelineStageFlags2KHR |
| 123 | expanded_mask; // all stage bits covered by any 'catch all bits' in the parameter (eg. ALL_GRAPHICS_BIT). |
| 124 | VkPipelineStageFlags2KHR exec_scope; // all earlier or later stages that would be affected by a barrier using this scope. |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 125 | SyncStageAccessFlags valid_accesses; // all valid accesses that can be used with this scope. |
| 126 | |
| 127 | SyncExecScope() : mask_param(0), expanded_mask(0), exec_scope(0), valid_accesses(0) {} |
| 128 | |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 129 | static SyncExecScope MakeSrc(VkQueueFlags queue_flags, VkPipelineStageFlags2KHR src_stage_mask); |
| 130 | static SyncExecScope MakeDst(VkQueueFlags queue_flags, VkPipelineStageFlags2KHR src_stage_mask); |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 131 | }; |
| 132 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 133 | struct SyncBarrier { |
John Zulauf | c523bf6 | 2021-02-16 08:20:34 -0700 | [diff] [blame] | 134 | SyncExecScope src_exec_scope; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 135 | SyncStageAccessFlags src_access_scope; |
John Zulauf | c523bf6 | 2021-02-16 08:20:34 -0700 | [diff] [blame] | 136 | SyncExecScope dst_exec_scope; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 137 | SyncStageAccessFlags dst_access_scope; |
| 138 | SyncBarrier() = default; |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 139 | SyncBarrier(const SyncBarrier &other) = default; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 140 | SyncBarrier &operator=(const SyncBarrier &) = default; |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 141 | |
| 142 | SyncBarrier(const SyncExecScope &src, const SyncExecScope &dst); |
| 143 | |
| 144 | template <typename Barrier> |
| 145 | SyncBarrier(const Barrier &barrier, const SyncExecScope &src, const SyncExecScope &dst); |
| 146 | |
| 147 | SyncBarrier(VkQueueFlags queue_flags, const VkSubpassDependency2 &barrier); |
Jeremy Gebben | df3fcc3 | 2021-02-15 08:53:17 -0700 | [diff] [blame] | 148 | // template constructor for sync2 barriers |
| 149 | template <typename Barrier> |
| 150 | SyncBarrier(VkQueueFlags queue_flags, const Barrier &barrier); |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 151 | |
John Zulauf | a0a9829 | 2020-09-18 09:30:10 -0600 | [diff] [blame] | 152 | void Merge(const SyncBarrier &other) { |
John Zulauf | c523bf6 | 2021-02-16 08:20:34 -0700 | [diff] [blame] | 153 | // Note that after merge, only the exec_scope and access_scope fields are fully valid |
| 154 | // TODO: Do we need to update any of the other fields? Merging has limited application. |
| 155 | src_exec_scope.exec_scope |= other.src_exec_scope.exec_scope; |
John Zulauf | a0a9829 | 2020-09-18 09:30:10 -0600 | [diff] [blame] | 156 | src_access_scope |= other.src_access_scope; |
John Zulauf | c523bf6 | 2021-02-16 08:20:34 -0700 | [diff] [blame] | 157 | dst_exec_scope.exec_scope |= other.dst_exec_scope.exec_scope; |
John Zulauf | a0a9829 | 2020-09-18 09:30:10 -0600 | [diff] [blame] | 158 | dst_access_scope |= other.dst_access_scope; |
| 159 | } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 160 | }; |
John Zulauf | 6913342 | 2020-05-20 14:55:53 -0600 | [diff] [blame] | 161 | |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 162 | enum class AccessAddressType : uint32_t { kLinear = 0, kIdealized = 1, kMaxType = 1, kTypeCount = kMaxType + 1 }; |
| 163 | |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 164 | struct SyncEventState { |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 165 | enum IgnoreReason { NotIgnored = 0, ResetWaitRace, Reset2WaitRace, SetRace, MissingStageBits, SetVsWait2 }; |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 166 | using EventPointer = std::shared_ptr<const EVENT_STATE>; |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 167 | using ScopeMap = sparse_container::range_map<VkDeviceSize, bool>; |
| 168 | EventPointer event; |
| 169 | CMD_TYPE last_command; // Only Event commands are valid here. |
| 170 | CMD_TYPE unsynchronized_set; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 171 | VkPipelineStageFlags2KHR barriers; |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 172 | SyncExecScope scope; |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 173 | ResourceUsageTag first_scope_tag; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 174 | bool destroyed; |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 175 | std::array<ScopeMap, static_cast<size_t>(AccessAddressType::kTypeCount)> first_scope; |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 176 | template <typename EventPointerType> |
| 177 | SyncEventState(EventPointerType &&event_state) |
| 178 | : event(std::forward<EventPointerType>(event_state)), |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 179 | last_command(CMD_NONE), |
| 180 | unsynchronized_set(CMD_NONE), |
| 181 | barriers(0U), |
| 182 | scope(), |
| 183 | first_scope_tag(), |
Jeremy Gebben | 9efe1cf | 2021-05-15 20:05:09 -0600 | [diff] [blame] | 184 | destroyed((event_state.get() == nullptr) || event_state->Destroyed()) {} |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 185 | SyncEventState() : SyncEventState(EventPointer()) {} |
| 186 | void ResetFirstScope(); |
| 187 | const ScopeMap &FirstScope(AccessAddressType address_type) const { return first_scope[static_cast<size_t>(address_type)]; } |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 188 | IgnoreReason IsIgnoredByWait(CMD_TYPE cmd, VkPipelineStageFlags2KHR srcStageMask) const; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 189 | bool HasBarrier(VkPipelineStageFlags2KHR stageMask, VkPipelineStageFlags2KHR exec_scope) const; |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 190 | }; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 191 | using SyncEventStateShared = std::shared_ptr<SyncEventState>; |
| 192 | using SyncEventStateConstShared = std::shared_ptr<const SyncEventState>; |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 193 | class SyncEventsContext { |
| 194 | public: |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 195 | using Map = layer_data::unordered_map<const EVENT_STATE *, SyncEventStateShared>; |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 196 | using iterator = Map::iterator; |
| 197 | using const_iterator = Map::const_iterator; |
| 198 | |
| 199 | SyncEventState *GetFromShared(const SyncEventState::EventPointer &event_state) { |
| 200 | const auto find_it = map_.find(event_state.get()); |
| 201 | if (find_it == map_.end()) { |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 202 | if (!event_state.get()) return nullptr; |
| 203 | |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 204 | const auto *event_plain_ptr = event_state.get(); |
| 205 | auto sync_state = SyncEventStateShared(new SyncEventState(event_state)); |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 206 | auto insert_pair = map_.emplace(event_plain_ptr, sync_state); |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 207 | return insert_pair.first->second.get(); |
| 208 | } |
| 209 | return find_it->second.get(); |
| 210 | } |
| 211 | |
| 212 | const SyncEventState *Get(const EVENT_STATE *event_state) const { |
| 213 | const auto find_it = map_.find(event_state); |
| 214 | if (find_it == map_.end()) { |
| 215 | return nullptr; |
| 216 | } |
| 217 | return find_it->second.get(); |
| 218 | } |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 219 | const SyncEventState *Get(const SyncEventState::EventPointer &event_state) const { return Get(event_state.get()); } |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 220 | |
| 221 | // stl style naming for range-for support |
| 222 | inline iterator begin() { return map_.begin(); } |
| 223 | inline const_iterator begin() const { return map_.begin(); } |
| 224 | inline iterator end() { return map_.end(); } |
| 225 | inline const_iterator end() const { return map_.end(); } |
| 226 | |
| 227 | void Destroy(const EVENT_STATE *event_state) { |
| 228 | auto sync_it = map_.find(event_state); |
| 229 | if (sync_it != map_.end()) { |
| 230 | sync_it->second->destroyed = true; |
| 231 | map_.erase(sync_it); |
| 232 | } |
| 233 | } |
| 234 | void Clear() { map_.clear(); } |
| 235 | |
| 236 | private: |
| 237 | Map map_; |
| 238 | }; |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 239 | |
John Zulauf | 6913342 | 2020-05-20 14:55:53 -0600 | [diff] [blame] | 240 | // To represent ordering guarantees such as rasterization and store |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 241 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 242 | class ResourceAccessState : public SyncStageAccess { |
| 243 | protected: |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 244 | struct OrderingBarrier { |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 245 | VkPipelineStageFlags2KHR exec_scope; |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 246 | SyncStageAccessFlags access_scope; |
| 247 | OrderingBarrier() = default; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 248 | OrderingBarrier(VkPipelineStageFlags2KHR es, SyncStageAccessFlags as) : exec_scope(es), access_scope(as) {} |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 249 | OrderingBarrier &operator=(const OrderingBarrier &) = default; |
| 250 | }; |
| 251 | using OrderingBarriers = std::array<OrderingBarrier, static_cast<size_t>(SyncOrdering::kNumOrderings)>; |
| 252 | |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 253 | struct FirstAccess { |
| 254 | ResourceUsageTag tag; |
| 255 | SyncStageAccessIndex usage_index; |
| 256 | SyncOrdering ordering_rule; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 257 | FirstAccess(ResourceUsageTag tag_, SyncStageAccessIndex usage_index_, SyncOrdering ordering_rule_) |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 258 | : tag(tag_), usage_index(usage_index_), ordering_rule(ordering_rule_){}; |
| 259 | FirstAccess(const FirstAccess &other) = default; |
| 260 | FirstAccess(FirstAccess &&other) = default; |
| 261 | FirstAccess &operator=(const FirstAccess &rhs) = default; |
| 262 | FirstAccess &operator=(FirstAccess &&rhs) = default; |
| 263 | |
| 264 | bool operator==(const FirstAccess &rhs) const { |
| 265 | return (tag == rhs.tag) && (usage_index == rhs.usage_index) && (ordering_rule == rhs.ordering_rule); |
| 266 | } |
| 267 | }; |
| 268 | using FirstAccesses = small_vector<FirstAccess, 3>; |
| 269 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 270 | // Mutliple read operations can be simlutaneously (and independently) synchronized, |
| 271 | // given the only the second execution scope creates a dependency chain, we have to track each, |
| 272 | // but only up to one per pipeline stage (as another read from the *same* stage become more recent, |
| 273 | // and applicable one for hazard detection |
| 274 | struct ReadState { |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 275 | VkPipelineStageFlags2KHR stage; // The stage of this read |
John Zulauf | 37ceaed | 2020-07-03 16:18:15 -0600 | [diff] [blame] | 276 | SyncStageAccessFlags access; // TODO: Change to FlagBits when we have a None bit enum |
John Zulauf | f51fbb6 | 2020-10-02 14:43:24 -0600 | [diff] [blame] | 277 | // TODO: Revisit whether this needs to support multiple reads per stage |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 278 | VkPipelineStageFlags2KHR barriers; // all applicable barriered stages |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 279 | ResourceUsageTag tag; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 280 | VkPipelineStageFlags2KHR pending_dep_chain; // Should be zero except during barrier application |
| 281 | // Excluded from comparison |
John Zulauf | 89311b4 | 2020-09-29 16:28:47 -0600 | [diff] [blame] | 282 | ReadState() = default; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 283 | ReadState(VkPipelineStageFlags2KHR stage_, SyncStageAccessFlags access_, VkPipelineStageFlags2KHR barriers_, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 284 | ResourceUsageTag tag_) |
John Zulauf | ab7756b | 2020-12-29 16:10:16 -0700 | [diff] [blame] | 285 | : stage(stage_), access(access_), barriers(barriers_), tag(tag_), pending_dep_chain(0) {} |
John Zulauf | e5da6e5 | 2020-03-18 15:32:18 -0600 | [diff] [blame] | 286 | bool operator==(const ReadState &rhs) const { |
John Zulauf | 37ceaed | 2020-07-03 16:18:15 -0600 | [diff] [blame] | 287 | bool same = (stage == rhs.stage) && (access == rhs.access) && (barriers == rhs.barriers) && (tag == rhs.tag); |
John Zulauf | e5da6e5 | 2020-03-18 15:32:18 -0600 | [diff] [blame] | 288 | return same; |
| 289 | } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 290 | bool IsReadBarrierHazard(VkPipelineStageFlags2KHR src_exec_scope) const { |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 291 | // If the read stage is not in the src sync scope |
| 292 | // *AND* not execution chained with an existing sync barrier (that's the or) |
| 293 | // then the barrier access is unsafe (R/W after R) |
| 294 | return (src_exec_scope & (stage | barriers)) == 0; |
| 295 | } |
| 296 | |
John Zulauf | e5da6e5 | 2020-03-18 15:32:18 -0600 | [diff] [blame] | 297 | bool operator!=(const ReadState &rhs) const { return !(*this == rhs); } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 298 | inline void Set(VkPipelineStageFlags2KHR stage_, const SyncStageAccessFlags &access_, VkPipelineStageFlags2KHR barriers_, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 299 | ResourceUsageTag tag_) { |
John Zulauf | 4285ee9 | 2020-09-23 10:20:52 -0600 | [diff] [blame] | 300 | stage = stage_; |
| 301 | access = access_; |
| 302 | barriers = barriers_; |
| 303 | tag = tag_; |
John Zulauf | 89311b4 | 2020-09-29 16:28:47 -0600 | [diff] [blame] | 304 | pending_dep_chain = 0; // If this is a new read, we aren't applying a barrier set. |
John Zulauf | 4285ee9 | 2020-09-23 10:20:52 -0600 | [diff] [blame] | 305 | } |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 306 | }; |
| 307 | |
| 308 | public: |
| 309 | HazardResult DetectHazard(SyncStageAccessIndex usage_index) const; |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 310 | HazardResult DetectHazard(SyncStageAccessIndex usage_index, const SyncOrdering &ordering_rule) const; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 311 | |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 312 | HazardResult DetectBarrierHazard(SyncStageAccessIndex usage_index, VkPipelineStageFlags2KHR source_exec_scope, |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 313 | const SyncStageAccessFlags &source_access_scope) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 314 | HazardResult DetectAsyncHazard(SyncStageAccessIndex usage_index, ResourceUsageTag start_tag) const; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 315 | HazardResult DetectBarrierHazard(SyncStageAccessIndex usage_index, VkPipelineStageFlags2KHR source_exec_scope, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 316 | const SyncStageAccessFlags &source_access_scope, ResourceUsageTag event_tag) const; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 317 | |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 318 | void Update(SyncStageAccessIndex usage_index, SyncOrdering ordering_rule, ResourceUsageTag tag); |
| 319 | void SetWrite(const SyncStageAccessFlags &usage_bit, ResourceUsageTag tag); |
John Zulauf | 5f13a79 | 2020-03-10 07:31:21 -0600 | [diff] [blame] | 320 | void Resolve(const ResourceAccessState &other); |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 321 | void ApplyBarriers(const std::vector<SyncBarrier> &barriers, bool layout_transition); |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 322 | void ApplyBarriers(const std::vector<SyncBarrier> &barriers, ResourceUsageTag tag); |
John Zulauf | 89311b4 | 2020-09-29 16:28:47 -0600 | [diff] [blame] | 323 | void ApplyBarrier(const SyncBarrier &barrier, bool layout_transition); |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 324 | void ApplyBarrier(ResourceUsageTag scope_tag, const SyncBarrier &barrier, bool layout_transition); |
| 325 | void ApplyPendingBarriers(ResourceUsageTag tag); |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 326 | |
| 327 | ResourceAccessState() |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 328 | : write_barriers(~SyncStageAccessFlags(0)), |
| 329 | write_dependency_chain(0), |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 330 | write_tag(), |
John Zulauf | d14743a | 2020-07-03 09:42:39 -0600 | [diff] [blame] | 331 | last_write(0), |
John Zulauf | f51fbb6 | 2020-10-02 14:43:24 -0600 | [diff] [blame] | 332 | input_attachment_read(false), |
John Zulauf | 361fb53 | 2020-07-22 10:45:39 -0600 | [diff] [blame] | 333 | last_read_stages(0), |
John Zulauf | 89311b4 | 2020-09-29 16:28:47 -0600 | [diff] [blame] | 334 | read_execution_barriers(0), |
| 335 | pending_write_dep_chain(0), |
| 336 | pending_layout_transition(false), |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 337 | pending_write_barriers(0), |
| 338 | first_accesses_(), |
| 339 | first_read_stages_(0U) {} |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 340 | |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 341 | bool HasPendingState() const { |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 342 | return (0 != pending_layout_transition) || pending_write_barriers.any() || (0 != pending_write_dep_chain); |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 343 | } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 344 | bool HasWriteOp() const { return last_write != 0; } |
John Zulauf | e5da6e5 | 2020-03-18 15:32:18 -0600 | [diff] [blame] | 345 | bool operator==(const ResourceAccessState &rhs) const { |
| 346 | bool same = (write_barriers == rhs.write_barriers) && (write_dependency_chain == rhs.write_dependency_chain) && |
John Zulauf | ab7756b | 2020-12-29 16:10:16 -0700 | [diff] [blame] | 347 | (last_reads == rhs.last_reads) && (last_read_stages == rhs.last_read_stages) && (write_tag == rhs.write_tag) && |
| 348 | (input_attachment_read == rhs.input_attachment_read) && |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 349 | (read_execution_barriers == rhs.read_execution_barriers) && (first_accesses_ == rhs.first_accesses_); |
John Zulauf | e5da6e5 | 2020-03-18 15:32:18 -0600 | [diff] [blame] | 350 | return same; |
| 351 | } |
| 352 | bool operator!=(const ResourceAccessState &rhs) const { return !(*this == rhs); } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 353 | VkPipelineStageFlags2KHR GetReadBarriers(const SyncStageAccessFlags &usage) const; |
John Zulauf | 59e2507 | 2020-07-17 10:55:21 -0600 | [diff] [blame] | 354 | SyncStageAccessFlags GetWriteBarriers() const { return write_barriers; } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 355 | bool InSourceScopeOrChain(VkPipelineStageFlags2KHR src_exec_scope, SyncStageAccessFlags src_access_scope) const { |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 356 | return ReadInSourceScopeOrChain(src_exec_scope) || WriteInSourceScopeOrChain(src_exec_scope, src_access_scope); |
| 357 | } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 358 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 359 | private: |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 360 | static constexpr VkPipelineStageFlags2KHR kInvalidAttachmentStage = ~VkPipelineStageFlags2KHR(0); |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 361 | bool IsWriteHazard(SyncStageAccessFlags usage) const { return (usage & ~write_barriers).any(); } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 362 | bool IsRAWHazard(VkPipelineStageFlags2KHR usage_stage, const SyncStageAccessFlags &usage) const; |
| 363 | bool IsWriteBarrierHazard(VkPipelineStageFlags2KHR src_exec_scope, const SyncStageAccessFlags &src_access_scope) const { |
John Zulauf | 6b58364 | 2021-10-05 17:25:31 -0600 | [diff] [blame] | 364 | // If the previous write is *not* a layout transition |
| 365 | // *AND* is *not* in the 1st access scope |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 366 | // *AND* the current barrier is not in the dependency chain |
| 367 | // *AND* the there is no prior memory barrier for the previous write in the dependency chain |
| 368 | // then the barrier access is unsafe (R/W after W) |
John Zulauf | 6b58364 | 2021-10-05 17:25:31 -0600 | [diff] [blame] | 369 | return (last_write != SYNC_IMAGE_LAYOUT_TRANSITION_BIT) && (last_write & src_access_scope).none() && |
| 370 | (((src_exec_scope & write_dependency_chain) == 0) || (write_barriers & src_access_scope).none()); |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 371 | } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 372 | bool ReadInSourceScopeOrChain(VkPipelineStageFlags2KHR src_exec_scope) const { |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 373 | return (0 != (src_exec_scope & (last_read_stages | read_execution_barriers))); |
| 374 | } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 375 | bool WriteInSourceScopeOrChain(VkPipelineStageFlags2KHR src_exec_scope, SyncStageAccessFlags src_access_scope) const { |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 376 | return (src_access_scope & last_write).any() || (write_dependency_chain & src_exec_scope); |
John Zulauf | a0a9829 | 2020-09-18 09:30:10 -0600 | [diff] [blame] | 377 | } |
John Zulauf | d14743a | 2020-07-03 09:42:39 -0600 | [diff] [blame] | 378 | |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 379 | static bool IsReadHazard(VkPipelineStageFlags2KHR stage_mask, const VkPipelineStageFlags2KHR barriers) { |
John Zulauf | d14743a | 2020-07-03 09:42:39 -0600 | [diff] [blame] | 380 | return stage_mask != (stage_mask & barriers); |
| 381 | } |
| 382 | |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 383 | bool IsReadHazard(VkPipelineStageFlags2KHR stage_mask, const ReadState &read_access) const { |
John Zulauf | d14743a | 2020-07-03 09:42:39 -0600 | [diff] [blame] | 384 | return IsReadHazard(stage_mask, read_access.barriers); |
John Zulauf | 0cb5be2 | 2020-01-23 12:18:22 -0700 | [diff] [blame] | 385 | } |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 386 | VkPipelineStageFlags2KHR GetOrderedStages(const OrderingBarrier &ordering) const; |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 387 | |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 388 | void UpdateFirst(ResourceUsageTag tag, SyncStageAccessIndex usage_index, SyncOrdering ordering_rule); |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 389 | |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 390 | static const OrderingBarrier &GetOrderingRules(SyncOrdering ordering_enum) { |
| 391 | return kOrderingRules[static_cast<size_t>(ordering_enum)]; |
| 392 | } |
John Zulauf | d14743a | 2020-07-03 09:42:39 -0600 | [diff] [blame] | 393 | |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 394 | // TODO: Add a NONE (zero) enum to SyncStageAccessFlags for input_attachment_read and last_write |
John Zulauf | d14743a | 2020-07-03 09:42:39 -0600 | [diff] [blame] | 395 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 396 | // With reads, each must be "safe" relative to it's prior write, so we need only |
| 397 | // save the most recent write operation (as anything *transitively* unsafe would arleady |
| 398 | // be included |
| 399 | SyncStageAccessFlags write_barriers; // union of applicable barrier masks since last write |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 400 | VkPipelineStageFlags2KHR write_dependency_chain; // intiially zero, but accumulating the dstStages of barriers if they chain. |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 401 | ResourceUsageTag write_tag; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 402 | SyncStageAccessFlags last_write; // only the most recent write |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 403 | |
John Zulauf | f51fbb6 | 2020-10-02 14:43:24 -0600 | [diff] [blame] | 404 | // TODO Input Attachment cleanup for multiple reads in a given stage |
| 405 | // Tracks whether the fragment shader read is input attachment read |
| 406 | bool input_attachment_read; |
John Zulauf | d14743a | 2020-07-03 09:42:39 -0600 | [diff] [blame] | 407 | |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 408 | VkPipelineStageFlags2KHR last_read_stages; |
| 409 | VkPipelineStageFlags2KHR read_execution_barriers; |
Artem Bolgar | 09b0154 | 2021-06-01 23:49:14 -0700 | [diff] [blame] | 410 | small_vector<ReadState, 3, uint32_t> last_reads; |
John Zulauf | 89311b4 | 2020-09-29 16:28:47 -0600 | [diff] [blame] | 411 | |
| 412 | // Pending execution state to support independent parallel barriers |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 413 | VkPipelineStageFlags2KHR pending_write_dep_chain; |
John Zulauf | 89311b4 | 2020-09-29 16:28:47 -0600 | [diff] [blame] | 414 | bool pending_layout_transition; |
| 415 | SyncStageAccessFlags pending_write_barriers; |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 416 | FirstAccesses first_accesses_; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 417 | VkPipelineStageFlags2KHR first_read_stages_; |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 418 | |
| 419 | static OrderingBarriers kOrderingRules; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 420 | }; |
John Zulauf | 22aefed | 2021-03-11 18:14:35 -0700 | [diff] [blame] | 421 | using ResourceAccessStateFunction = std::function<void(ResourceAccessState *)>; |
| 422 | using ResourceAccessStateConstFunction = std::function<void(const ResourceAccessState &)>; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 423 | |
John Zulauf | 16adfc9 | 2020-04-08 10:28:33 -0600 | [diff] [blame] | 424 | using ResourceAccessRangeMap = sparse_container::range_map<VkDeviceSize, ResourceAccessState>; |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 425 | using ResourceAccessRange = typename ResourceAccessRangeMap::key_type; |
John Zulauf | 22aefed | 2021-03-11 18:14:35 -0700 | [diff] [blame] | 426 | using ResourceAccessRangeIndex = typename ResourceAccessRange::index_type; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 427 | using ResourceRangeMergeIterator = sparse_container::parallel_iterator<ResourceAccessRangeMap, const ResourceAccessRangeMap>; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 428 | |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 429 | class AttachmentViewGen { |
| 430 | public: |
| 431 | enum Gen { kViewSubresource = 0, kRenderArea = 1, kDepthOnlyRenderArea = 2, kStencilOnlyRenderArea = 3, kGenSize = 4 }; |
| 432 | AttachmentViewGen(const IMAGE_VIEW_STATE *view_, const VkOffset3D &offset, const VkExtent3D &extent); |
| 433 | AttachmentViewGen(const AttachmentViewGen &other) = default; |
| 434 | AttachmentViewGen(AttachmentViewGen &&other) = default; |
| 435 | AccessAddressType GetAddressType() const; |
| 436 | const IMAGE_VIEW_STATE *GetViewState() const { return view_; } |
| 437 | const ImageRangeGen *GetRangeGen(Gen type) const; |
| 438 | bool IsValid() const { return gen_store_[Gen::kViewSubresource]; } |
| 439 | Gen GetDepthStencilRenderAreaGenType(bool depth_op, bool stencil_op) const; |
| 440 | |
| 441 | private: |
| 442 | using RangeGenStore = layer_data::optional<ImageRangeGen>; |
| 443 | const IMAGE_VIEW_STATE *view_ = nullptr; |
| 444 | VkImageAspectFlags view_mask_ = 0U; |
| 445 | std::array<RangeGenStore, Gen::kGenSize> gen_store_; |
| 446 | }; |
| 447 | |
| 448 | using AttachmentViewGenVector = std::vector<AttachmentViewGen>; |
| 449 | |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 450 | using SyncMemoryBarrier = SyncBarrier; |
| 451 | struct SyncBufferMemoryBarrier { |
| 452 | using Buffer = std::shared_ptr<const BUFFER_STATE>; |
| 453 | Buffer buffer; |
| 454 | SyncBarrier barrier; |
| 455 | ResourceAccessRange range; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 456 | bool IsLayoutTransition() const { return false; } |
| 457 | const ResourceAccessRange &Range() const { return range; }; |
| 458 | const BUFFER_STATE *GetState() const { return buffer.get(); } |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 459 | SyncBufferMemoryBarrier(const Buffer &buffer_, const SyncBarrier &barrier_, const ResourceAccessRange &range_) |
| 460 | : buffer(buffer_), barrier(barrier_), range(range_) {} |
| 461 | SyncBufferMemoryBarrier() = default; |
| 462 | }; |
| 463 | |
| 464 | struct SyncImageMemoryBarrier { |
| 465 | using Image = std::shared_ptr<const IMAGE_STATE>; |
John Zulauf | 110413c | 2021-03-20 05:38:38 -0600 | [diff] [blame] | 466 | |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 467 | Image image; |
| 468 | uint32_t index; |
| 469 | SyncBarrier barrier; |
| 470 | VkImageLayout old_layout; |
| 471 | VkImageLayout new_layout; |
John Zulauf | 110413c | 2021-03-20 05:38:38 -0600 | [diff] [blame] | 472 | VkImageSubresourceRange range; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 473 | |
| 474 | bool IsLayoutTransition() const { return old_layout != new_layout; } |
John Zulauf | 110413c | 2021-03-20 05:38:38 -0600 | [diff] [blame] | 475 | const VkImageSubresourceRange &Range() const { return range; }; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 476 | const IMAGE_STATE *GetState() const { return image.get(); } |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 477 | SyncImageMemoryBarrier(const Image &image_, uint32_t index_, const SyncBarrier &barrier_, VkImageLayout old_layout_, |
| 478 | VkImageLayout new_layout_, const VkImageSubresourceRange &subresource_range_) |
| 479 | : image(image_), |
| 480 | index(index_), |
| 481 | barrier(barrier_), |
| 482 | old_layout(old_layout_), |
| 483 | new_layout(new_layout_), |
John Zulauf | 110413c | 2021-03-20 05:38:38 -0600 | [diff] [blame] | 484 | range(subresource_range_) {} |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 485 | SyncImageMemoryBarrier() = default; |
| 486 | }; |
| 487 | |
| 488 | class SyncOpBase { |
| 489 | public: |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 490 | SyncOpBase() : cmd_(CMD_NONE) {} |
| 491 | SyncOpBase(CMD_TYPE cmd) : cmd_(cmd) {} |
| 492 | const char *CmdName() const { return CommandTypeString(cmd_); } |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 493 | virtual bool Validate(const CommandBufferAccessContext &cb_context) const = 0; |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 494 | virtual void Record(CommandBufferAccessContext *cb_context) const = 0; |
| 495 | |
| 496 | protected: |
| 497 | CMD_TYPE cmd_; |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 498 | }; |
| 499 | |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 500 | class SyncOpBarriers : public SyncOpBase { |
| 501 | protected: |
| 502 | template <typename Barriers, typename FunctorFactory> |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 503 | static void ApplyBarriers(const Barriers &barriers, const FunctorFactory &factory, ResourceUsageTag tag, |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 504 | AccessContext *context); |
| 505 | template <typename Barriers, typename FunctorFactory> |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 506 | static void ApplyGlobalBarriers(const Barriers &barriers, const FunctorFactory &factory, ResourceUsageTag tag, |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 507 | AccessContext *access_context); |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 508 | |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 509 | SyncOpBarriers(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, VkPipelineStageFlags srcStageMask, |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 510 | VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, |
| 511 | const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, |
| 512 | const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, |
| 513 | const VkImageMemoryBarrier *pImageMemoryBarriers); |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 514 | SyncOpBarriers(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, uint32_t event_count, |
| 515 | const VkDependencyInfoKHR *pDependencyInfo); |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 516 | |
| 517 | protected: |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 518 | struct BarrierSet { |
| 519 | VkDependencyFlags dependency_flags; |
| 520 | SyncExecScope src_exec_scope; |
| 521 | SyncExecScope dst_exec_scope; |
| 522 | std::vector<SyncMemoryBarrier> memory_barriers; |
| 523 | std::vector<SyncBufferMemoryBarrier> buffer_memory_barriers; |
| 524 | std::vector<SyncImageMemoryBarrier> image_memory_barriers; |
| 525 | bool single_exec_scope; |
| 526 | void MakeMemoryBarriers(const SyncExecScope &src, const SyncExecScope &dst, VkDependencyFlags dependencyFlags, |
| 527 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers); |
| 528 | void MakeBufferMemoryBarriers(const SyncValidator &sync_state, const SyncExecScope &src, const SyncExecScope &dst, |
| 529 | VkDependencyFlags dependencyFlags, uint32_t bufferMemoryBarrierCount, |
| 530 | const VkBufferMemoryBarrier *pBufferMemoryBarriers); |
| 531 | void MakeImageMemoryBarriers(const SyncValidator &sync_state, const SyncExecScope &src, const SyncExecScope &dst, |
| 532 | VkDependencyFlags dependencyFlags, uint32_t imageMemoryBarrierCount, |
| 533 | const VkImageMemoryBarrier *pImageMemoryBarriers); |
| 534 | void MakeMemoryBarriers(VkQueueFlags queue_flags, VkDependencyFlags dependency_flags, uint32_t barrier_count, |
| 535 | const VkMemoryBarrier2KHR *barriers); |
| 536 | void MakeBufferMemoryBarriers(const SyncValidator &sync_state, VkQueueFlags queue_flags, VkDependencyFlags dependency_flags, |
| 537 | uint32_t barrier_count, const VkBufferMemoryBarrier2KHR *barriers); |
| 538 | void MakeImageMemoryBarriers(const SyncValidator &sync_state, VkQueueFlags queue_flags, VkDependencyFlags dependency_flags, |
| 539 | uint32_t barrier_count, const VkImageMemoryBarrier2KHR *barriers); |
| 540 | }; |
| 541 | std::vector<BarrierSet> barriers_; |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 542 | }; |
| 543 | |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 544 | class SyncOpPipelineBarrier : public SyncOpBarriers { |
| 545 | public: |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 546 | SyncOpPipelineBarrier(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, |
| 547 | VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, |
| 548 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 549 | const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, |
| 550 | const VkImageMemoryBarrier *pImageMemoryBarriers); |
Jeremy Gebben | df3fcc3 | 2021-02-15 08:53:17 -0700 | [diff] [blame] | 551 | SyncOpPipelineBarrier(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, |
| 552 | const VkDependencyInfoKHR &pDependencyInfo); |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 553 | bool Validate(const CommandBufferAccessContext &cb_context) const override; |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 554 | void Record(CommandBufferAccessContext *cb_context) const override; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 555 | }; |
| 556 | |
| 557 | class SyncOpWaitEvents : public SyncOpBarriers { |
| 558 | public: |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 559 | SyncOpWaitEvents(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, uint32_t eventCount, |
| 560 | const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, |
| 561 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 562 | const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, |
| 563 | const VkImageMemoryBarrier *pImageMemoryBarriers); |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 564 | |
| 565 | SyncOpWaitEvents(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, uint32_t eventCount, |
| 566 | const VkEvent *pEvents, const VkDependencyInfoKHR *pDependencyInfo); |
| 567 | |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 568 | bool Validate(const CommandBufferAccessContext &cb_context) const override; |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 569 | void Record(CommandBufferAccessContext *cb_context) const override; |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 570 | |
| 571 | protected: |
| 572 | // TODO PHASE2 This is the wrong thing to use for "replay".. as the event state will have moved on since the record |
| 573 | // TODO PHASE2 May need to capture by value w.r.t. "first use" or build up in calling/enqueue context through replay. |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 574 | std::vector<std::shared_ptr<const EVENT_STATE>> events_; |
| 575 | void MakeEventsList(const SyncValidator &sync_state, uint32_t event_count, const VkEvent *events); |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 576 | }; |
| 577 | |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 578 | class SyncOpResetEvent : public SyncOpBase { |
| 579 | public: |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 580 | SyncOpResetEvent(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, VkEvent event, |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 581 | VkPipelineStageFlags2KHR stageMask); |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 582 | bool Validate(const CommandBufferAccessContext &cb_context) const override; |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 583 | void Record(CommandBufferAccessContext *cb_context) const override; |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 584 | |
| 585 | private: |
| 586 | std::shared_ptr<const EVENT_STATE> event_; |
| 587 | SyncExecScope exec_scope_; |
| 588 | }; |
| 589 | |
| 590 | class SyncOpSetEvent : public SyncOpBase { |
| 591 | public: |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 592 | SyncOpSetEvent(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, VkEvent event, |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 593 | VkPipelineStageFlags2KHR stageMask); |
| 594 | SyncOpSetEvent(CMD_TYPE cmd, const SyncValidator &sync_state, VkQueueFlags queue_flags, VkEvent event, |
| 595 | const VkDependencyInfoKHR &dep_info); |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 596 | bool Validate(const CommandBufferAccessContext &cb_context) const override; |
John Zulauf | 36ef928 | 2021-02-02 11:47:24 -0700 | [diff] [blame] | 597 | void Record(CommandBufferAccessContext *cb_context) const override; |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 598 | |
| 599 | private: |
| 600 | std::shared_ptr<const EVENT_STATE> event_; |
| 601 | SyncExecScope src_exec_scope_; |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 602 | // Note that the dep info is *not* dehandled, but retained for comparison with a future WaitEvents2 |
| 603 | std::shared_ptr<safe_VkDependencyInfoKHR> dep_info_; |
John Zulauf | 6ce2437 | 2021-01-30 05:56:25 -0700 | [diff] [blame] | 604 | }; |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 605 | |
| 606 | class SyncOpBeginRenderPass : public SyncOpBase { |
| 607 | public: |
| 608 | SyncOpBeginRenderPass(CMD_TYPE cmd, const SyncValidator &sync_state, const VkRenderPassBeginInfo *pRenderPassBegin, |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 609 | const VkSubpassBeginInfo *pSubpassBeginInfo); |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 610 | bool Validate(const CommandBufferAccessContext &cb_context) const override; |
| 611 | void Record(CommandBufferAccessContext *cb_context) const override; |
| 612 | |
| 613 | protected: |
| 614 | safe_VkRenderPassBeginInfo renderpass_begin_info_; |
| 615 | safe_VkSubpassBeginInfo subpass_begin_info_; |
| 616 | std::vector<std::shared_ptr<const IMAGE_VIEW_STATE>> shared_attachments_; |
| 617 | std::vector<const IMAGE_VIEW_STATE *> attachments_; |
| 618 | std::shared_ptr<const RENDER_PASS_STATE> rp_state_; |
| 619 | }; |
| 620 | |
| 621 | class SyncOpNextSubpass : public SyncOpBase { |
| 622 | public: |
| 623 | SyncOpNextSubpass(CMD_TYPE cmd, const SyncValidator &sync_state, const VkSubpassBeginInfo *pSubpassBeginInfo, |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 624 | const VkSubpassEndInfo *pSubpassEndInfo); |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 625 | bool Validate(const CommandBufferAccessContext &cb_context) const override; |
| 626 | void Record(CommandBufferAccessContext *cb_context) const override; |
| 627 | |
| 628 | protected: |
| 629 | safe_VkSubpassBeginInfo subpass_begin_info_; |
| 630 | safe_VkSubpassEndInfo subpass_end_info_; |
| 631 | }; |
| 632 | |
| 633 | class SyncOpEndRenderPass : public SyncOpBase { |
| 634 | public: |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 635 | SyncOpEndRenderPass(CMD_TYPE cmd, const SyncValidator &sync_state, const VkSubpassEndInfo *pSubpassEndInfo); |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 636 | bool Validate(const CommandBufferAccessContext &cb_context) const override; |
| 637 | void Record(CommandBufferAccessContext *cb_context) const override; |
| 638 | |
| 639 | protected: |
| 640 | safe_VkSubpassEndInfo subpass_end_info_; |
| 641 | }; |
| 642 | |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 643 | class AccessContext { |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 644 | public: |
John Zulauf | 6913342 | 2020-05-20 14:55:53 -0600 | [diff] [blame] | 645 | enum DetectOptions : uint32_t { |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 646 | kDetectPrevious = 1U << 0, |
| 647 | kDetectAsync = 1U << 1, |
| 648 | kDetectAll = (kDetectPrevious | kDetectAsync) |
John Zulauf | 16adfc9 | 2020-04-08 10:28:33 -0600 | [diff] [blame] | 649 | }; |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 650 | using MapArray = std::array<ResourceAccessRangeMap, static_cast<size_t>(AccessAddressType::kTypeCount)>; |
John Zulauf | 16adfc9 | 2020-04-08 10:28:33 -0600 | [diff] [blame] | 651 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 652 | struct TrackBack { |
John Zulauf | a0a9829 | 2020-09-18 09:30:10 -0600 | [diff] [blame] | 653 | std::vector<SyncBarrier> barriers; |
John Zulauf | 1a22429 | 2020-06-30 14:52:13 -0600 | [diff] [blame] | 654 | const AccessContext *context; |
John Zulauf | baea94f | 2020-09-15 17:55:16 -0600 | [diff] [blame] | 655 | TrackBack(const AccessContext *context_, VkQueueFlags queue_flags_, |
John Zulauf | a0a9829 | 2020-09-18 09:30:10 -0600 | [diff] [blame] | 656 | const std::vector<const VkSubpassDependency2 *> &subpass_dependencies_) |
| 657 | : barriers(), context(context_) { |
| 658 | barriers.reserve(subpass_dependencies_.size()); |
| 659 | for (const VkSubpassDependency2 *dependency : subpass_dependencies_) { |
| 660 | assert(dependency); |
| 661 | barriers.emplace_back(queue_flags_, *dependency); |
| 662 | } |
| 663 | } |
| 664 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 665 | TrackBack &operator=(const TrackBack &) = default; |
| 666 | TrackBack() = default; |
| 667 | }; |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 668 | |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 669 | HazardResult DetectHazard(const BUFFER_STATE &buffer, SyncStageAccessIndex usage_index, const ResourceAccessRange &range) const; |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 670 | HazardResult DetectHazard(const IMAGE_STATE &image, SyncStageAccessIndex current_usage, |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 671 | const VkImageSubresourceLayers &subresource, const VkOffset3D &offset, |
| 672 | const VkExtent3D &extent) const; |
John Zulauf | 6913342 | 2020-05-20 14:55:53 -0600 | [diff] [blame] | 673 | template <typename Detector> |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 674 | HazardResult DetectHazard(Detector &detector, const AttachmentViewGen &view_gen, AttachmentViewGen::Gen gen_type, |
| 675 | DetectOptions options) const; |
| 676 | template <typename Detector> |
John Zulauf | 6913342 | 2020-05-20 14:55:53 -0600 | [diff] [blame] | 677 | HazardResult DetectHazard(Detector &detector, const IMAGE_STATE &image, const VkImageSubresourceRange &subresource_range, |
| 678 | const VkOffset3D &offset, const VkExtent3D &extent, DetectOptions options) const; |
John Zulauf | 110413c | 2021-03-20 05:38:38 -0600 | [diff] [blame] | 679 | template <typename Detector> |
| 680 | HazardResult DetectHazard(Detector &detector, const IMAGE_STATE &image, const VkImageSubresourceRange &subresource_range, |
| 681 | DetectOptions options) const; |
John Zulauf | 1507ee4 | 2020-05-18 11:33:09 -0600 | [diff] [blame] | 682 | HazardResult DetectHazard(const IMAGE_STATE &image, SyncStageAccessIndex current_usage, |
John Zulauf | 110413c | 2021-03-20 05:38:38 -0600 | [diff] [blame] | 683 | const VkImageSubresourceRange &subresource_range) const; |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 684 | HazardResult DetectHazard(const AttachmentViewGen &view_gen, AttachmentViewGen::Gen gen_type, |
| 685 | SyncStageAccessIndex current_usage, SyncOrdering ordering_rule) const; |
| 686 | |
John Zulauf | 6913342 | 2020-05-20 14:55:53 -0600 | [diff] [blame] | 687 | HazardResult DetectHazard(const IMAGE_STATE &image, SyncStageAccessIndex current_usage, |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 688 | const VkImageSubresourceRange &subresource_range, SyncOrdering ordering_rule, |
John Zulauf | 6913342 | 2020-05-20 14:55:53 -0600 | [diff] [blame] | 689 | const VkOffset3D &offset, const VkExtent3D &extent) const; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 690 | HazardResult DetectImageBarrierHazard(const IMAGE_STATE &image, VkPipelineStageFlags2KHR src_exec_scope, |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 691 | const SyncStageAccessFlags &src_access_scope, |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 692 | const VkImageSubresourceRange &subresource_range, const SyncEventState &sync_event, |
| 693 | DetectOptions options) const; |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 694 | HazardResult DetectImageBarrierHazard(const AttachmentViewGen &attachment_view, const SyncBarrier &barrier, |
| 695 | DetectOptions options) const; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 696 | HazardResult DetectImageBarrierHazard(const IMAGE_STATE &image, VkPipelineStageFlags2KHR src_exec_scope, |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 697 | const SyncStageAccessFlags &src_access_scope, |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 698 | const VkImageSubresourceRange &subresource_range, DetectOptions options) const; |
Jeremy Gebben | 40a2294 | 2020-12-22 14:22:06 -0700 | [diff] [blame] | 699 | HazardResult DetectImageBarrierHazard(const IMAGE_STATE &image, VkPipelineStageFlags2KHR src_exec_scope, |
Jeremy Gebben | d0de1f8 | 2020-11-09 08:21:07 -0700 | [diff] [blame] | 700 | const SyncStageAccessFlags &src_stage_accesses, |
| 701 | const VkImageMemoryBarrier &barrier) const; |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 702 | HazardResult DetectImageBarrierHazard(const SyncImageMemoryBarrier &image_barrier) const; |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 703 | HazardResult DetectSubpassTransitionHazard(const TrackBack &track_back, const AttachmentViewGen &attach_view) const; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 704 | |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 705 | void RecordLayoutTransitions(const RENDER_PASS_STATE &rp_state, uint32_t subpass, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 706 | const AttachmentViewGenVector &attachment_views, ResourceUsageTag tag); |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 707 | |
John Zulauf | e5da6e5 | 2020-03-18 15:32:18 -0600 | [diff] [blame] | 708 | const TrackBack &GetDstExternalTrackBack() const { return dst_external_; } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 709 | void Reset() { |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 710 | prev_.clear(); |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 711 | prev_by_subpass_.clear(); |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 712 | async_.clear(); |
John Zulauf | 22aefed | 2021-03-11 18:14:35 -0700 | [diff] [blame] | 713 | src_external_ = nullptr; |
John Zulauf | a0a9829 | 2020-09-18 09:30:10 -0600 | [diff] [blame] | 714 | dst_external_ = TrackBack(); |
Jeremy Gebben | c4b78c5 | 2020-12-11 09:39:47 -0700 | [diff] [blame] | 715 | start_tag_ = ResourceUsageTag(); |
John Zulauf | 16adfc9 | 2020-04-08 10:28:33 -0600 | [diff] [blame] | 716 | for (auto &map : access_state_maps_) { |
| 717 | map.clear(); |
| 718 | } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 719 | } |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 720 | |
| 721 | // Follow the context previous to access the access state, supporting "lazy" import into the context. Not intended for |
| 722 | // subpass layout transition, as the pending state handling is more complex |
John Zulauf | 5f13a79 | 2020-03-10 07:31:21 -0600 | [diff] [blame] | 723 | // TODO: See if returning the lower_bound would be useful from a performance POV -- look at the lower_bound overhead |
| 724 | // Would need to add a "hint" overload to parallel_iterator::invalidate_[AB] call, if so. |
John Zulauf | 22aefed | 2021-03-11 18:14:35 -0700 | [diff] [blame] | 725 | template <typename BarrierAction> |
| 726 | void ResolvePreviousAccessStack(AccessAddressType type, const ResourceAccessRange &range, ResourceAccessRangeMap *descent_map, |
| 727 | const ResourceAccessState *infill_state, const BarrierAction &previous_barrie) const; |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 728 | void ResolvePreviousAccess(AccessAddressType type, const ResourceAccessRange &range, ResourceAccessRangeMap *descent_map, |
John Zulauf | 22aefed | 2021-03-11 18:14:35 -0700 | [diff] [blame] | 729 | const ResourceAccessState *infill_state, |
| 730 | const ResourceAccessStateFunction *previous_barrier = nullptr) const; |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 731 | void ResolvePreviousAccesses(); |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 732 | template <typename BarrierAction> |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 733 | void ResolveAccessRange(const AttachmentViewGen &view_gen, AttachmentViewGen::Gen gen_type, BarrierAction &barrier_action, |
| 734 | ResourceAccessRangeMap *descent_map, const ResourceAccessState *infill_state) const; |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 735 | template <typename BarrierAction> |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 736 | void ResolveAccessRange(AccessAddressType type, const ResourceAccessRange &range, BarrierAction &barrier_action, |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 737 | ResourceAccessRangeMap *resolve_map, const ResourceAccessState *infill_state, |
| 738 | bool recur_to_infill = true) const; |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 739 | |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 740 | void UpdateAccessState(const BUFFER_STATE &buffer, SyncStageAccessIndex current_usage, SyncOrdering ordering_rule, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 741 | const ResourceAccessRange &range, ResourceUsageTag tag); |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 742 | void UpdateAccessState(const IMAGE_STATE &image, SyncStageAccessIndex current_usage, SyncOrdering ordering_rule, |
John Zulauf | 110413c | 2021-03-20 05:38:38 -0600 | [diff] [blame] | 743 | const VkImageSubresourceRange &subresource_range, const ResourceUsageTag &tag); |
| 744 | void UpdateAccessState(const IMAGE_STATE &image, SyncStageAccessIndex current_usage, SyncOrdering ordering_rule, |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 745 | const VkImageSubresourceRange &subresource_range, const VkOffset3D &offset, const VkExtent3D &extent, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 746 | ResourceUsageTag tag); |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 747 | void UpdateAccessState(const AttachmentViewGen &view_gen, AttachmentViewGen::Gen gen_type, SyncStageAccessIndex current_usage, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 748 | SyncOrdering ordering_rule, ResourceUsageTag tag); |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 749 | void UpdateAccessState(const IMAGE_STATE &image, SyncStageAccessIndex current_usage, SyncOrdering ordering_rule, |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 750 | const VkImageSubresourceLayers &subresource, const VkOffset3D &offset, const VkExtent3D &extent, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 751 | ResourceUsageTag tag); |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 752 | void UpdateAttachmentResolveAccess(const RENDER_PASS_STATE &rp_state, const AttachmentViewGenVector &attachment_views, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 753 | uint32_t subpass, ResourceUsageTag tag); |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 754 | void UpdateAttachmentStoreAccess(const RENDER_PASS_STATE &rp_state, const AttachmentViewGenVector &attachment_views, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 755 | uint32_t subpass, ResourceUsageTag tag); |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 756 | |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 757 | void ResolveChildContexts(const std::vector<AccessContext> &contexts); |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 758 | |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 759 | template <typename Action, typename RangeGen> |
| 760 | void ApplyUpdateAction(AccessAddressType address_type, const Action &action, RangeGen *range_gen_arg); |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 761 | template <typename Action> |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 762 | void ApplyUpdateAction(const AttachmentViewGen &view_gen, AttachmentViewGen::Gen gen_type, const Action &action); |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 763 | template <typename Action> |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 764 | void ApplyToContext(const Action &barrier_action); |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 765 | static AccessAddressType ImageAddressType(const IMAGE_STATE &image); |
John Zulauf | 16adfc9 | 2020-04-08 10:28:33 -0600 | [diff] [blame] | 766 | |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 767 | AccessContext(uint32_t subpass, VkQueueFlags queue_flags, const std::vector<SubpassDependencyGraphNode> &dependencies, |
John Zulauf | 1a22429 | 2020-06-30 14:52:13 -0600 | [diff] [blame] | 768 | const std::vector<AccessContext> &contexts, const AccessContext *external_context); |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 769 | |
| 770 | AccessContext() { Reset(); } |
John Zulauf | 7635de3 | 2020-05-29 17:14:15 -0600 | [diff] [blame] | 771 | AccessContext(const AccessContext ©_from) = default; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 772 | |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 773 | ResourceAccessRangeMap &GetAccessStateMap(AccessAddressType type) { return access_state_maps_[static_cast<size_t>(type)]; } |
| 774 | const ResourceAccessRangeMap &GetAccessStateMap(AccessAddressType type) const { |
| 775 | return access_state_maps_[static_cast<size_t>(type)]; |
| 776 | } |
| 777 | ResourceAccessRangeMap &GetLinearMap() { return GetAccessStateMap(AccessAddressType::kLinear); } |
| 778 | const ResourceAccessRangeMap &GetLinearMap() const { return GetAccessStateMap(AccessAddressType::kLinear); } |
| 779 | ResourceAccessRangeMap &GetIdealizedMap() { return GetAccessStateMap(AccessAddressType::kIdealized); } |
| 780 | const ResourceAccessRangeMap &GetIdealizedMap() const { return GetAccessStateMap(AccessAddressType::kIdealized); } |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 781 | const TrackBack *GetTrackBackFromSubpass(uint32_t subpass) const { |
| 782 | if (subpass == VK_SUBPASS_EXTERNAL) { |
John Zulauf | 22aefed | 2021-03-11 18:14:35 -0700 | [diff] [blame] | 783 | return src_external_; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 784 | } else { |
| 785 | assert(subpass < prev_by_subpass_.size()); |
| 786 | return prev_by_subpass_[subpass]; |
| 787 | } |
| 788 | } |
John Zulauf | 16adfc9 | 2020-04-08 10:28:33 -0600 | [diff] [blame] | 789 | |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 790 | bool ValidateLayoutTransitions(const CommandExecutionContext &ex_context, const RENDER_PASS_STATE &rp_state, |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 791 | const VkRect2D &render_area, uint32_t subpass, const AttachmentViewGenVector &attachment_views, |
| 792 | const char *func_name) const; |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 793 | bool ValidateLoadOperation(const CommandExecutionContext &ex_context, const RENDER_PASS_STATE &rp_state, |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 794 | const VkRect2D &render_area, uint32_t subpass, const AttachmentViewGenVector &attachment_views, |
| 795 | const char *func_name) const; |
| 796 | bool ValidateStoreOperation(const CommandExecutionContext &ex_context, |
| 797 | |
| 798 | const RENDER_PASS_STATE &rp_state, |
| 799 | |
| 800 | const VkRect2D &render_area, uint32_t subpass, const AttachmentViewGenVector &attachment_views, |
| 801 | const char *func_name) const; |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 802 | bool ValidateResolveOperations(const CommandExecutionContext &ex_context, const RENDER_PASS_STATE &rp_state, |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 803 | const VkRect2D &render_area, const AttachmentViewGenVector &attachment_views, |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 804 | const char *func_name, uint32_t subpass) const; |
John Zulauf | 1507ee4 | 2020-05-18 11:33:09 -0600 | [diff] [blame] | 805 | |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 806 | void SetStartTag(ResourceUsageTag tag) { start_tag_ = tag; } |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 807 | template <typename Action> |
| 808 | void ForAll(Action &&action); |
Jeremy Gebben | c4b78c5 | 2020-12-11 09:39:47 -0700 | [diff] [blame] | 809 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 810 | private: |
| 811 | template <typename Detector> |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 812 | HazardResult DetectHazard(AccessAddressType type, const Detector &detector, const ResourceAccessRange &range, |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 813 | DetectOptions options) const; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 814 | template <typename Detector> |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 815 | HazardResult DetectAsyncHazard(AccessAddressType type, const Detector &detector, const ResourceAccessRange &range) const; |
John Zulauf | 5f13a79 | 2020-03-10 07:31:21 -0600 | [diff] [blame] | 816 | template <typename Detector> |
John Zulauf | 43cc746 | 2020-12-03 12:33:12 -0700 | [diff] [blame] | 817 | HazardResult DetectPreviousHazard(AccessAddressType type, const Detector &detector, const ResourceAccessRange &range) const; |
John Zulauf | 8e3c3e9 | 2021-01-06 11:19:36 -0700 | [diff] [blame] | 818 | void UpdateAccessState(AccessAddressType type, SyncStageAccessIndex current_usage, SyncOrdering ordering_rule, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 819 | const ResourceAccessRange &range, ResourceUsageTag tag); |
John Zulauf | b02c1eb | 2020-10-06 16:33:36 -0600 | [diff] [blame] | 820 | |
| 821 | MapArray access_state_maps_; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 822 | std::vector<TrackBack> prev_; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 823 | std::vector<TrackBack *> prev_by_subpass_; |
Jeremy Gebben | c4b78c5 | 2020-12-11 09:39:47 -0700 | [diff] [blame] | 824 | std::vector<const AccessContext *> async_; |
John Zulauf | 22aefed | 2021-03-11 18:14:35 -0700 | [diff] [blame] | 825 | TrackBack *src_external_; |
John Zulauf | e5da6e5 | 2020-03-18 15:32:18 -0600 | [diff] [blame] | 826 | TrackBack dst_external_; |
Jeremy Gebben | c4b78c5 | 2020-12-11 09:39:47 -0700 | [diff] [blame] | 827 | ResourceUsageTag start_tag_; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 828 | }; |
| 829 | |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 830 | class RenderPassAccessContext { |
| 831 | public: |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 832 | static AttachmentViewGenVector CreateAttachmentViewGen(const VkRect2D &render_area, |
| 833 | const std::vector<const IMAGE_VIEW_STATE *> &attachment_views); |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 834 | RenderPassAccessContext() : rp_state_(nullptr), render_area_(VkRect2D()), current_subpass_(0) {} |
| 835 | RenderPassAccessContext(const RENDER_PASS_STATE &rp_state, const VkRect2D &render_area, VkQueueFlags queue_flags, |
| 836 | const std::vector<const IMAGE_VIEW_STATE *> &attachment_views, const AccessContext *external_context); |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 837 | |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 838 | bool ValidateDrawSubpassAttachment(const CommandExecutionContext &ex_context, const CMD_BUFFER_STATE &cmd, |
| 839 | const char *func_name) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 840 | void RecordDrawSubpassAttachment(const CMD_BUFFER_STATE &cmd, ResourceUsageTag tag); |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 841 | bool ValidateNextSubpass(const CommandExecutionContext &ex_context, const char *command_name) const; |
| 842 | bool ValidateEndRenderPass(const CommandExecutionContext &ex_context, const char *func_name) const; |
| 843 | bool ValidateFinalSubpassLayoutTransitions(const CommandExecutionContext &ex_context, const char *func_name) const; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 844 | |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 845 | void RecordLayoutTransitions(ResourceUsageTag tag); |
| 846 | void RecordLoadOperations(ResourceUsageTag tag); |
| 847 | void RecordBeginRenderPass(ResourceUsageTag tag); |
| 848 | void RecordNextSubpass(ResourceUsageTag prev_subpass_tag, ResourceUsageTag next_subpass_tag); |
| 849 | void RecordEndRenderPass(AccessContext *external_context, ResourceUsageTag tag); |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 850 | |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 851 | AccessContext &CurrentContext() { return subpass_contexts_[current_subpass_]; } |
| 852 | const AccessContext &CurrentContext() const { return subpass_contexts_[current_subpass_]; } |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 853 | const std::vector<AccessContext> &GetContexts() const { return subpass_contexts_; } |
| 854 | uint32_t GetCurrentSubpass() const { return current_subpass_; } |
| 855 | const RENDER_PASS_STATE *GetRenderPassState() const { return rp_state_; } |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 856 | AccessContext *CreateStoreResolveProxy() const; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 857 | |
| 858 | private: |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 859 | const RENDER_PASS_STATE *rp_state_; |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 860 | const VkRect2D render_area_; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 861 | uint32_t current_subpass_; |
| 862 | std::vector<AccessContext> subpass_contexts_; |
John Zulauf | d0ec59f | 2021-03-13 14:25:08 -0700 | [diff] [blame] | 863 | AttachmentViewGenVector attachment_views_; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 864 | }; |
| 865 | |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 866 | // Command execution context is the base class for command buffer and queue contexts |
| 867 | // Preventing unintented leakage of subclass specific state, storing enough information |
| 868 | // for message logging. |
| 869 | // TODO: determine where to draw the design split for tag tracking (is there anything command to Queues and CB's) |
| 870 | class CommandExecutionContext { |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 871 | public: |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 872 | CommandExecutionContext() : sync_state_(nullptr) {} |
| 873 | CommandExecutionContext(SyncValidator *sync_validator) : sync_state_(sync_validator) {} |
| 874 | virtual ~CommandExecutionContext() = default; |
| 875 | const SyncValidator &GetSyncState() const { |
| 876 | assert(sync_state_); |
| 877 | return *sync_state_; |
| 878 | } |
| 879 | SyncValidator &GetSyncState() { |
| 880 | assert(sync_state_); |
| 881 | return *sync_state_; |
| 882 | } |
| 883 | virtual std::string FormatUsage(const HazardResult &hazard) const = 0; |
| 884 | |
| 885 | protected: |
| 886 | SyncValidator *sync_state_; |
| 887 | }; |
| 888 | |
| 889 | class CommandBufferAccessContext : public CommandExecutionContext { |
| 890 | public: |
| 891 | CommandBufferAccessContext(SyncValidator *sync_validator = nullptr) |
| 892 | : CommandExecutionContext(sync_validator), |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 893 | access_log_(), |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 894 | command_number_(0), |
| 895 | subcommand_number_(0), |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 896 | reset_count_(0), |
| 897 | render_pass_contexts_(), |
| 898 | cb_access_context_(), |
| 899 | current_context_(&cb_access_context_), |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 900 | current_renderpass_context_(), |
| 901 | cb_state_(), |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 902 | queue_flags_(), |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 903 | events_context_(), |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 904 | destroyed_(false) {} |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 905 | CommandBufferAccessContext(SyncValidator &sync_validator, std::shared_ptr<CMD_BUFFER_STATE> &cb_state, VkQueueFlags queue_flags) |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 906 | : CommandBufferAccessContext(&sync_validator) { |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 907 | cb_state_ = cb_state; |
| 908 | queue_flags_ = queue_flags; |
| 909 | } |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 910 | ~CommandBufferAccessContext() override = default; |
| 911 | CommandExecutionContext &GetExecutionContext() { return *this; } |
| 912 | const CommandExecutionContext &GetExecutionContext() const { return *this; } |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 913 | |
| 914 | void Reset() { |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 915 | access_log_.clear(); |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 916 | command_number_ = 0; |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 917 | subcommand_number_ = 0; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 918 | reset_count_++; |
| 919 | cb_access_context_.Reset(); |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 920 | render_pass_contexts_.clear(); |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 921 | current_context_ = &cb_access_context_; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 922 | current_renderpass_context_ = nullptr; |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 923 | events_context_.Clear(); |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 924 | } |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 925 | void MarkDestroyed() { destroyed_ = true; } |
| 926 | bool IsDestroyed() const { return destroyed_; } |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 927 | |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 928 | std::string FormatUsage(const HazardResult &hazard) const override; |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 929 | AccessContext *GetCurrentAccessContext() { return current_context_; } |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 930 | SyncEventsContext *GetCurrentEventsContext() { return &events_context_; } |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 931 | RenderPassAccessContext *GetCurrentRenderPassContext() { return current_renderpass_context_; } |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 932 | const AccessContext *GetCurrentAccessContext() const { return current_context_; } |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 933 | const SyncEventsContext *GetCurrentEventsContext() const { return &events_context_; } |
| 934 | const RenderPassAccessContext *GetCurrentRenderPassContext() const { return current_renderpass_context_; } |
| 935 | void RecordBeginRenderPass(const RENDER_PASS_STATE &rp_state, const VkRect2D &render_area, |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 936 | const std::vector<const IMAGE_VIEW_STATE *> &attachment_views, ResourceUsageTag tag); |
Jeremy Gebben | 9893daf | 2021-01-04 10:40:50 -0700 | [diff] [blame] | 937 | void ApplyGlobalBarriersToEvents(const SyncExecScope &src, const SyncExecScope &dst); |
John Zulauf | d511570 | 2021-01-18 12:34:33 -0700 | [diff] [blame] | 938 | |
locke-lunarg | 61870c2 | 2020-06-09 14:51:50 -0600 | [diff] [blame] | 939 | bool ValidateDispatchDrawDescriptorSet(VkPipelineBindPoint pipelineBindPoint, const char *func_name) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 940 | void RecordDispatchDrawDescriptorSet(VkPipelineBindPoint pipelineBindPoint, ResourceUsageTag tag); |
locke-lunarg | 61870c2 | 2020-06-09 14:51:50 -0600 | [diff] [blame] | 941 | bool ValidateDrawVertex(uint32_t vertexCount, uint32_t firstVertex, const char *func_name) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 942 | void RecordDrawVertex(uint32_t vertexCount, uint32_t firstVertex, ResourceUsageTag tag); |
locke-lunarg | 61870c2 | 2020-06-09 14:51:50 -0600 | [diff] [blame] | 943 | bool ValidateDrawVertexIndex(uint32_t indexCount, uint32_t firstIndex, const char *func_name) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 944 | void RecordDrawVertexIndex(uint32_t indexCount, uint32_t firstIndex, ResourceUsageTag tag); |
locke-lunarg | 61870c2 | 2020-06-09 14:51:50 -0600 | [diff] [blame] | 945 | bool ValidateDrawSubpassAttachment(const char *func_name) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 946 | void RecordDrawSubpassAttachment(ResourceUsageTag tag); |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 947 | void RecordNextSubpass(CMD_TYPE command); |
| 948 | void RecordEndRenderPass(CMD_TYPE command); |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 949 | void RecordDestroyEvent(VkEvent event); |
John Zulauf | 49beb11 | 2020-11-04 16:06:31 -0700 | [diff] [blame] | 950 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 951 | const CMD_BUFFER_STATE *GetCommandBufferState() const { return cb_state_.get(); } |
| 952 | VkQueueFlags GetQueueFlags() const { return queue_flags_; } |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 953 | |
| 954 | inline ResourceUsageTag NextSubcommandTag(CMD_TYPE command) { |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 955 | ResourceUsageTag next = access_log_.size(); |
| 956 | access_log_.emplace_back(next, command_number_, ++subcommand_number_, command); |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 957 | return next; |
| 958 | } |
| 959 | |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 960 | inline ResourceUsageTag NextCommandTag(CMD_TYPE command) { |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 961 | command_number_++; |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 962 | subcommand_number_ = 0; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 963 | ResourceUsageTag next = access_log_.size(); |
Jeremy Gebben | 6ea9d9e | 2020-12-11 09:41:01 -0700 | [diff] [blame] | 964 | // The lowest bit is a sub-command number used to separate operations at the end of the previous renderpass |
| 965 | // from the start of the new one in VkCmdNextRenderpass(). |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 966 | access_log_.emplace_back(next, command_number_, subcommand_number_, command); |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 967 | return next; |
| 968 | } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 969 | |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 970 | const CMD_BUFFER_STATE &GetCBState() const { |
| 971 | assert(cb_state_); |
| 972 | return *(cb_state_.get()); |
| 973 | } |
| 974 | CMD_BUFFER_STATE &GetCBState() { |
| 975 | assert(cb_state_); |
| 976 | return *(cb_state_.get()); |
| 977 | } |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 978 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 979 | private: |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 980 | std::vector<ResourceUsageRecord> access_log_; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 981 | uint32_t command_number_; |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 982 | uint32_t subcommand_number_; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 983 | uint32_t reset_count_; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 984 | std::vector<RenderPassAccessContext> render_pass_contexts_; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 985 | AccessContext cb_access_context_; |
John Zulauf | 540266b | 2020-04-06 18:54:53 -0600 | [diff] [blame] | 986 | AccessContext *current_context_; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 987 | RenderPassAccessContext *current_renderpass_context_; |
| 988 | std::shared_ptr<CMD_BUFFER_STATE> cb_state_; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 989 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 990 | VkQueueFlags queue_flags_; |
John Zulauf | 669dfd5 | 2021-01-27 17:15:28 -0700 | [diff] [blame] | 991 | SyncEventsContext events_context_; |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 992 | bool destroyed_; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 993 | }; |
| 994 | |
| 995 | class SyncValidator : public ValidationStateTracker, public SyncStageAccess { |
| 996 | public: |
| 997 | SyncValidator() { container_type = LayerObjectTypeSyncValidation; } |
| 998 | using StateTracker = ValidationStateTracker; |
| 999 | |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 1000 | layer_data::unordered_map<VkCommandBuffer, CommandBufferAccessContextShared> cb_access_state; |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 1001 | |
| 1002 | CommandBufferAccessContextShared GetAccessContextImpl(VkCommandBuffer command_buffer, bool do_insert) { |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1003 | auto found_it = cb_access_state.find(command_buffer); |
| 1004 | if (found_it == cb_access_state.end()) { |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 1005 | if (!do_insert) return CommandBufferAccessContextShared(); |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1006 | // If we don't have one, make it. |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1007 | auto cb_state = GetShared<CMD_BUFFER_STATE>(command_buffer); |
| 1008 | assert(cb_state.get()); |
Jeremy Gebben | 159b3cc | 2021-06-03 09:09:03 -0600 | [diff] [blame] | 1009 | auto queue_flags = cb_state->GetQueueFlags(); |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 1010 | std::shared_ptr<CommandBufferAccessContext> context(new CommandBufferAccessContext(*this, cb_state, queue_flags)); |
Jeremy Gebben | cbf2286 | 2021-03-03 12:01:22 -0700 | [diff] [blame] | 1011 | auto insert_pair = cb_access_state.emplace(command_buffer, std::move(context)); |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1012 | found_it = insert_pair.first; |
| 1013 | } |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 1014 | return found_it->second; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1015 | } |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 1016 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1017 | CommandBufferAccessContext *GetAccessContext(VkCommandBuffer command_buffer) { |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 1018 | return GetAccessContextImpl(command_buffer, true).get(); // true -> do_insert on not found |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1019 | } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1020 | CommandBufferAccessContext *GetAccessContextNoInsert(VkCommandBuffer command_buffer) { |
John Zulauf | e7f6a5e | 2021-01-16 14:31:18 -0700 | [diff] [blame] | 1021 | return GetAccessContextImpl(command_buffer, false).get(); // false -> don't do_insert on not found |
| 1022 | } |
| 1023 | |
| 1024 | CommandBufferAccessContextShared GetAccessContextShared(VkCommandBuffer command_buffer) { |
| 1025 | return GetAccessContextImpl(command_buffer, true); // true -> do_insert on not found |
| 1026 | } |
| 1027 | CommandBufferAccessContextShared GetAccessContextSharedNoInsert(VkCommandBuffer command_buffer) { |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1028 | return GetAccessContextImpl(command_buffer, false); // false -> don't do_insert on not found |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1029 | } |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1030 | |
| 1031 | const CommandBufferAccessContext *GetAccessContext(VkCommandBuffer command_buffer) const { |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1032 | const auto found_it = cb_access_state.find(command_buffer); |
| 1033 | if (found_it == cb_access_state.end()) { |
| 1034 | return nullptr; |
| 1035 | } |
| 1036 | return found_it->second.get(); |
| 1037 | } |
| 1038 | |
John Zulauf | d1f85d4 | 2020-04-15 12:23:15 -0600 | [diff] [blame] | 1039 | void ResetCommandBufferCallback(VkCommandBuffer command_buffer); |
| 1040 | void FreeCommandBufferCallback(VkCommandBuffer command_buffer); |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1041 | void RecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 1042 | const VkSubpassBeginInfo *pSubpassBeginInfo, CMD_TYPE cmd); |
John Zulauf | 64ffe55 | 2021-02-06 10:25:07 -0700 | [diff] [blame] | 1043 | void RecordCmdNextSubpass(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 1044 | const VkSubpassEndInfo *pSubpassEndInfo, CMD_TYPE command); |
| 1045 | void RecordCmdEndRenderPass(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo, CMD_TYPE cmd); |
John Zulauf | 33fc1d5 | 2020-07-17 11:01:10 -0600 | [diff] [blame] | 1046 | bool SupressedBoundDescriptorWAW(const HazardResult &hazard) const; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1047 | |
| 1048 | void PostCallRecordCreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1049 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, VkResult result) override; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1050 | |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 1051 | bool ValidateBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 1052 | const VkSubpassBeginInfo *pSubpassBeginInfo, CMD_TYPE cmd) const; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 1053 | |
| 1054 | bool PreCallValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1055 | VkSubpassContents contents) const override; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 1056 | |
| 1057 | bool PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 1058 | const VkSubpassBeginInfo *pSubpassBeginInfo) const override; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 1059 | |
| 1060 | bool PreCallValidateCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 1061 | const VkSubpassBeginInfo *pSubpassBeginInfo) const override; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 1062 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1063 | bool PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1064 | const VkBufferCopy *pRegions) const override; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1065 | |
| 1066 | void PreCallRecordCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1067 | const VkBufferCopy *pRegions) override; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1068 | |
John Zulauf | 4a6105a | 2020-11-17 15:11:05 -0700 | [diff] [blame] | 1069 | void PreCallRecordDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) override; |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1070 | bool PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR *pCopyBufferInfos) const override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1071 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1072 | void PreCallRecordCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR *pCopyBufferInfos) override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1073 | |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 1074 | bool PreCallValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 1075 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1076 | const VkImageCopy *pRegions) const override; |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 1077 | |
| 1078 | void PreCallRecordCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1079 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions) override; |
John Zulauf | 5c5e88d | 2019-12-26 11:22:02 -0700 | [diff] [blame] | 1080 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1081 | bool PreCallValidateCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR *pCopyImageInfo) const override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1082 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1083 | void PreCallRecordCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR *pCopyImageInfo) override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1084 | |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1085 | bool PreCallValidateCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, |
| 1086 | VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, |
| 1087 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 1088 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 1089 | uint32_t imageMemoryBarrierCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1090 | const VkImageMemoryBarrier *pImageMemoryBarriers) const override; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1091 | |
| 1092 | void PreCallRecordCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, |
| 1093 | VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, |
| 1094 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 1095 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1096 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1097 | |
Jeremy Gebben | df3fcc3 | 2021-02-15 08:53:17 -0700 | [diff] [blame] | 1098 | bool PreCallValidateCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, |
| 1099 | const VkDependencyInfoKHR *pDependencyInfo) const override; |
| 1100 | void PreCallRecordCmdPipelineBarrier2KHR(VkCommandBuffer commandBuffer, const VkDependencyInfoKHR *pDependencyInfo) override; |
| 1101 | |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1102 | void PostCallRecordBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1103 | VkResult result) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1104 | |
| 1105 | void PostCallRecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1106 | VkSubpassContents contents) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1107 | void PostCallRecordCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1108 | const VkSubpassBeginInfo *pSubpassBeginInfo) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1109 | void PostCallRecordCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1110 | const VkSubpassBeginInfo *pSubpassBeginInfo) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1111 | |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 1112 | bool ValidateCmdNextSubpass(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 1113 | const VkSubpassEndInfo *pSubpassEndInfo, CMD_TYPE cmd) const; |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1114 | bool PreCallValidateCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) const override; |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 1115 | bool PreCallValidateCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, |
| 1116 | const VkSubpassEndInfo *pSubpassEndInfo) const override; |
| 1117 | bool PreCallValidateCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, |
| 1118 | const VkSubpassEndInfo *pSubpassEndInfo) const override; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 1119 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1120 | void PostCallRecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1121 | void PostCallRecordCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1122 | const VkSubpassEndInfo *pSubpassEndInfo) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1123 | void PostCallRecordCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo *pSubpassBeginInfo, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1124 | const VkSubpassEndInfo *pSubpassEndInfo) override; |
John Zulauf | 3d84f1b | 2020-03-09 13:33:25 -0600 | [diff] [blame] | 1125 | |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 1126 | bool ValidateCmdEndRenderPass(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo, CMD_TYPE cmd) const; |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1127 | bool PreCallValidateCmdEndRenderPass(VkCommandBuffer commandBuffer) const override; |
Mike Schuchardt | 2df0891 | 2020-12-15 16:28:09 -0800 | [diff] [blame] | 1128 | bool PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) const override; |
| 1129 | bool PreCallValidateCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) const override; |
John Zulauf | 355e49b | 2020-04-24 15:11:15 -0600 | [diff] [blame] | 1130 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1131 | void PostCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer) override; |
| 1132 | void PostCallRecordCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) override; |
| 1133 | void PostCallRecordCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo *pSubpassEndInfo) override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1134 | |
| 1135 | template <typename BufferImageCopyRegionType> |
| 1136 | bool ValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, |
| 1137 | VkImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopyRegionType *pRegions, |
| 1138 | CopyCommandVersion version) const; |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1139 | bool PreCallValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, |
| 1140 | VkImageLayout dstImageLayout, uint32_t regionCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1141 | const VkBufferImageCopy *pRegions) const override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1142 | bool PreCallValidateCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1143 | const VkCopyBufferToImageInfo2KHR *pCopyBufferToImageInfo) const override; |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1144 | |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1145 | template <typename BufferImageCopyRegionType> |
| 1146 | void RecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, |
| 1147 | VkImageLayout dstImageLayout, uint32_t regionCount, const BufferImageCopyRegionType *pRegions, |
| 1148 | CopyCommandVersion version); |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1149 | void PreCallRecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1150 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions) override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1151 | void PreCallRecordCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1152 | const VkCopyBufferToImageInfo2KHR *pCopyBufferToImageInfo) override; |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1153 | |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1154 | template <typename BufferImageCopyRegionType> |
| 1155 | bool ValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 1156 | VkBuffer dstBuffer, uint32_t regionCount, const BufferImageCopyRegionType *pRegions, |
| 1157 | CopyCommandVersion version) const; |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1158 | bool PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1159 | VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions) const override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1160 | bool PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1161 | const VkCopyImageToBufferInfo2KHR *pCopyImageToBufferInfo) const override; |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1162 | |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1163 | template <typename BufferImageCopyRegionType> |
| 1164 | void RecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 1165 | VkBuffer dstBuffer, uint32_t regionCount, const BufferImageCopyRegionType *pRegions, |
| 1166 | CopyCommandVersion version); |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1167 | void PreCallRecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1168 | VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions) override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1169 | void PreCallRecordCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1170 | const VkCopyImageToBufferInfo2KHR *pCopyImageToBufferInfo) override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1171 | |
| 1172 | template <typename RegionType> |
| 1173 | bool ValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 1174 | VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType *pRegions, VkFilter filter, |
| 1175 | const char *apiName) const; |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1176 | |
| 1177 | bool PreCallValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 1178 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1179 | const VkImageBlit *pRegions, VkFilter filter) const override; |
| 1180 | bool PreCallValidateCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR *pBlitImageInfo) const override; |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1181 | |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1182 | template <typename RegionType> |
| 1183 | void RecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 1184 | VkImageLayout dstImageLayout, uint32_t regionCount, const RegionType *pRegions, VkFilter filter, |
| 1185 | ResourceUsageTag tag); |
locke-lunarg | a19c71d | 2020-03-02 18:17:04 -0700 | [diff] [blame] | 1186 | void PreCallRecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 1187 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1188 | VkFilter filter) override; |
| 1189 | void PreCallRecordCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR *pBlitImageInfo) override; |
locke-lunarg | 36ba259 | 2020-04-03 09:42:04 -0600 | [diff] [blame] | 1190 | |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 1191 | bool ValidateIndirectBuffer(const CommandBufferAccessContext &cb_context, const AccessContext &context, |
| 1192 | VkCommandBuffer commandBuffer, const VkDeviceSize struct_size, const VkBuffer buffer, |
| 1193 | const VkDeviceSize offset, const uint32_t drawCount, const uint32_t stride, |
locke-lunarg | 61870c2 | 2020-06-09 14:51:50 -0600 | [diff] [blame] | 1194 | const char *function) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 1195 | void RecordIndirectBuffer(AccessContext &context, ResourceUsageTag tag, const VkDeviceSize struct_size, const VkBuffer buffer, |
| 1196 | const VkDeviceSize offset, const uint32_t drawCount, uint32_t stride); |
locke-lunarg | 36ba259 | 2020-04-03 09:42:04 -0600 | [diff] [blame] | 1197 | |
John Zulauf | faea0ee | 2021-01-14 14:01:32 -0700 | [diff] [blame] | 1198 | bool ValidateCountBuffer(const CommandBufferAccessContext &cb_context, const AccessContext &context, |
| 1199 | VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, const char *function) const; |
John Zulauf | 1494072 | 2021-04-12 15:19:02 -0600 | [diff] [blame^] | 1200 | void RecordCountBuffer(AccessContext &context, ResourceUsageTag tag, VkBuffer buffer, VkDeviceSize offset); |
locke-lunarg | 93d68af | 2020-05-12 17:18:03 -0600 | [diff] [blame] | 1201 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1202 | bool PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) const override; |
| 1203 | void PreCallRecordCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1204 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1205 | bool PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) const override; |
| 1206 | void PreCallRecordCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1207 | |
| 1208 | bool PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1209 | uint32_t firstInstance) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1210 | void PreCallRecordCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1211 | uint32_t firstInstance) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1212 | |
| 1213 | bool PreCallValidateCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1214 | uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1215 | void PreCallRecordCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1216 | uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1217 | |
| 1218 | bool PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1219 | uint32_t stride) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1220 | void PreCallRecordCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1221 | uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1222 | |
| 1223 | bool PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1224 | uint32_t drawCount, uint32_t stride) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1225 | void PreCallRecordCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1226 | uint32_t drawCount, uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1227 | |
locke-lunarg | ff255f9 | 2020-05-13 18:53:52 -0600 | [diff] [blame] | 1228 | bool ValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, |
| 1229 | VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, |
| 1230 | const char *function) const; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1231 | bool PreCallValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1232 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1233 | uint32_t stride) const override; |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 1234 | void RecordCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, |
| 1235 | VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, CMD_TYPE cmd_type); |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1236 | void PreCallRecordCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1237 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1238 | uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1239 | bool PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1240 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1241 | uint32_t stride) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1242 | void PreCallRecordCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1243 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1244 | uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1245 | bool PreCallValidateCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1246 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1247 | uint32_t stride) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1248 | void PreCallRecordCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1249 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1250 | uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1251 | |
locke-lunarg | ff255f9 | 2020-05-13 18:53:52 -0600 | [diff] [blame] | 1252 | bool ValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1253 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 1254 | uint32_t stride, const char *function) const; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1255 | bool PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1256 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1257 | uint32_t stride) const override; |
sfricke-samsung | 85584a7 | 2021-09-30 21:43:38 -0700 | [diff] [blame] | 1258 | void RecordCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1259 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 1260 | uint32_t stride, CMD_TYPE cmd_type); |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1261 | void PreCallRecordCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1262 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1263 | uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1264 | bool PreCallValidateCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1265 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1266 | uint32_t stride) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1267 | void PreCallRecordCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1268 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1269 | uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1270 | bool PreCallValidateCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1271 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1272 | uint32_t stride) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1273 | void PreCallRecordCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1274 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1275 | uint32_t stride) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1276 | |
| 1277 | bool PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 1278 | const VkClearColorValue *pColor, uint32_t rangeCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1279 | const VkImageSubresourceRange *pRanges) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1280 | void PreCallRecordCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 1281 | const VkClearColorValue *pColor, uint32_t rangeCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1282 | const VkImageSubresourceRange *pRanges) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1283 | |
| 1284 | bool PreCallValidateCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 1285 | const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1286 | const VkImageSubresourceRange *pRanges) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1287 | void PreCallRecordCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 1288 | const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1289 | const VkImageSubresourceRange *pRanges) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1290 | |
| 1291 | bool PreCallValidateCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, |
| 1292 | uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1293 | VkDeviceSize stride, VkQueryResultFlags flags) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1294 | void PreCallRecordCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, |
| 1295 | uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1296 | VkQueryResultFlags flags) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1297 | |
| 1298 | bool PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1299 | uint32_t data) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1300 | void PreCallRecordCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1301 | uint32_t data) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1302 | |
| 1303 | bool PreCallValidateCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 1304 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1305 | const VkImageResolve *pRegions) const override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1306 | |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1307 | void PreCallRecordCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 1308 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1309 | const VkImageResolve *pRegions) override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1310 | |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1311 | bool PreCallValidateCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR *pResolveImageInfo) const override; |
| 1312 | void PreCallRecordCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR *pResolveImageInfo) override; |
Jeff Leger | 178b1e5 | 2020-10-05 12:22:23 -0400 | [diff] [blame] | 1313 | |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1314 | bool PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1315 | VkDeviceSize dataSize, const void *pData) const override; |
locke-lunarg | e1a6702 | 2020-04-29 00:15:36 -0600 | [diff] [blame] | 1316 | void PreCallRecordCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1317 | VkDeviceSize dataSize, const void *pData) override; |
locke-lunarg | ff255f9 | 2020-05-13 18:53:52 -0600 | [diff] [blame] | 1318 | |
| 1319 | bool PreCallValidateCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1320 | VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) const override; |
locke-lunarg | ff255f9 | 2020-05-13 18:53:52 -0600 | [diff] [blame] | 1321 | void PreCallRecordCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, |
Jeremy Gebben | f892469 | 2020-10-28 16:27:14 -0600 | [diff] [blame] | 1322 | VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) override; |
John Zulauf | 49beb11 | 2020-11-04 16:06:31 -0700 | [diff] [blame] | 1323 | |
| 1324 | bool PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const override; |
| 1325 | void PostCallRecordCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) override; |
| 1326 | |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 1327 | bool PreCallValidateCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, |
| 1328 | const VkDependencyInfoKHR *pDependencyInfo) const override; |
| 1329 | void PostCallRecordCmdSetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, |
| 1330 | const VkDependencyInfoKHR *pDependencyInfo) override; |
| 1331 | |
John Zulauf | 49beb11 | 2020-11-04 16:06:31 -0700 | [diff] [blame] | 1332 | bool PreCallValidateCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const override; |
| 1333 | void PostCallRecordCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) override; |
| 1334 | |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 1335 | bool PreCallValidateCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, |
| 1336 | VkPipelineStageFlags2KHR stageMask) const override; |
| 1337 | void PostCallRecordCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2KHR stageMask) override; |
| 1338 | |
John Zulauf | 49beb11 | 2020-11-04 16:06:31 -0700 | [diff] [blame] | 1339 | bool PreCallValidateCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, |
| 1340 | VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, |
| 1341 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 1342 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 1343 | uint32_t imageMemoryBarrierCount, |
| 1344 | const VkImageMemoryBarrier *pImageMemoryBarriers) const override; |
| 1345 | void PostCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, |
| 1346 | VkPipelineStageFlags sourceStageMask, VkPipelineStageFlags dstStageMask, |
| 1347 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 1348 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 1349 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) override; |
John Zulauf | 4edde62 | 2021-02-15 08:54:50 -0700 | [diff] [blame] | 1350 | bool PreCallValidateCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, |
| 1351 | const VkDependencyInfoKHR *pDependencyInfos) const override; |
| 1352 | void PostCallRecordCmdWaitEvents2KHR(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, |
| 1353 | const VkDependencyInfoKHR *pDependencyInfos) override; |
Jeremy Gebben | df3fcc3 | 2021-02-15 08:53:17 -0700 | [diff] [blame] | 1354 | bool PreCallValidateCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage, VkBuffer dstBuffer, |
| 1355 | VkDeviceSize dstOffset, uint32_t marker) const override; |
| 1356 | void PreCallRecordCmdWriteBufferMarker2AMD(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage, VkBuffer dstBuffer, |
| 1357 | VkDeviceSize dstOffset, uint32_t marker) override; |
John Zulauf | 9cb530d | 2019-09-30 14:14:10 -0600 | [diff] [blame] | 1358 | }; |