| 69 | } |
| 70 | |
| 71 | static SyncAccessFlags AccessScope(const SyncAccessFlags& stage_scope, VkAccessFlags2 accesses) { |
| 72 | SyncAccessFlags access_scope = stage_scope & AccessScopeByAccess(accesses); |
| 73 | |
| 74 | // Special case. AS copy operations (e.g., vkCmdCopyAccelerationStructureKHR) can be synchronized using |
| 75 | // the ACCELERATION_STRUCTURE_COPY stage, but it's also valid to use ACCELERATION_STRUCTURE_BUILD stage. |
| 76 | // Internally, AS copy accesses are represented via ACCELERATION_STRUCTURE_COPY stage. The logic below |
| 77 | // ensures that a barrier using ACCELERATION_STRUCTURE_BUILD stage can also protect accesses on |
| 78 | // ACCELERATION_STRUCTURE_COPY stage. |
| 79 | if (access_scope[SYNC_ACCELERATION_STRUCTURE_BUILD_ACCELERATION_STRUCTURE_READ]) { |
| 80 | access_scope.set(SYNC_ACCELERATION_STRUCTURE_COPY_ACCELERATION_STRUCTURE_READ); |
| 81 | } |
| 82 | if (access_scope[SYNC_ACCELERATION_STRUCTURE_BUILD_ACCELERATION_STRUCTURE_WRITE]) { |
| 83 | access_scope.set(SYNC_ACCELERATION_STRUCTURE_COPY_ACCELERATION_STRUCTURE_WRITE); |
| 84 | } |
| 85 | return access_scope; |
| 86 | } |
| 87 | |
| 88 | namespace syncval { |
| 89 |
no test coverage detected