1 // Copyright 2019 The Dawn Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 #ifndef DAWNNATIVE_VULKAN_COMMANDRECORDINGCONTEXT_H_ 15 #define DAWNNATIVE_VULKAN_COMMANDRECORDINGCONTEXT_H_ 16 17 #include "common/vulkan_platform.h" 18 19 #include "dawn_native/vulkan/BufferVk.h" 20 21 namespace dawn_native { namespace vulkan { 22 // Used to track operations that are handled after recording. 23 // Currently only tracks semaphores, but may be used to do barrier coalescing in the future. 24 struct CommandRecordingContext { 25 VkCommandBuffer commandBuffer = VK_NULL_HANDLE; 26 std::vector<VkSemaphore> waitSemaphores = {}; 27 std::vector<VkSemaphore> signalSemaphores = {}; 28 29 // The internal buffers used in the workaround of texture-to-texture copies with compressed 30 // formats. 31 std::vector<Ref<Buffer>> tempBuffers; 32 33 // For Device state tracking only. 34 VkCommandPool commandPool = VK_NULL_HANDLE; 35 bool used = false; 36 }; 37 38 }} // namespace dawn_native::vulkan 39 40 #endif // DAWNNATIVE_VULKAN_COMMANDRECORDINGCONTEXT_H_ 41