1 #ifndef _VKCMDUTIL_HPP 2 #define _VKCMDUTIL_HPP 3 /*------------------------------------------------------------------------- 4 * Vulkan CTS Framework 5 * -------------------- 6 * 7 * Copyright (c) 2018 Google Inc. 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 * 21 *//*! 22 * \file 23 * \brief Utilities for commonly used command tasks 24 *//*--------------------------------------------------------------------*/ 25 26 #include "vkDefs.hpp" 27 #include "tcuVector.hpp" 28 29 namespace vk 30 { 31 32 void beginCommandBuffer (const DeviceInterface& vk, 33 const VkCommandBuffer commandBuffer, 34 VkCommandBufferUsageFlags flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT); 35 36 void endCommandBuffer (const DeviceInterface& vk, 37 const VkCommandBuffer commandBuffer); 38 39 void beginRenderPass (const DeviceInterface& vk, 40 const VkCommandBuffer commandBuffer, 41 const VkRenderPass renderPass, 42 const VkFramebuffer framebuffer, 43 const VkRect2D& renderArea, 44 const deUint32 clearValueCount, 45 const VkClearValue* clearValues, 46 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE, 47 const void* pNext = DE_NULL); 48 49 void beginRenderPass (const DeviceInterface& vk, 50 const VkCommandBuffer commandBuffer, 51 const VkRenderPass renderPass, 52 const VkFramebuffer framebuffer, 53 const VkRect2D& renderArea, 54 const VkClearValue& clearValue, 55 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); 56 57 void beginRenderPass (const DeviceInterface& vk, 58 const VkCommandBuffer commandBuffer, 59 const VkRenderPass renderPass, 60 const VkFramebuffer framebuffer, 61 const VkRect2D& renderArea, 62 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); 63 64 void beginRenderPass (const DeviceInterface& vk, 65 const VkCommandBuffer commandBuffer, 66 const VkRenderPass renderPass, 67 const VkFramebuffer framebuffer, 68 const VkRect2D& renderArea, 69 const tcu::Vec4& clearColor, 70 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); 71 72 void beginRenderPass (const DeviceInterface& vk, 73 const VkCommandBuffer commandBuffer, 74 const VkRenderPass renderPass, 75 const VkFramebuffer framebuffer, 76 const VkRect2D& renderArea, 77 const tcu::Vec4& clearColor, 78 const void* pNext, 79 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); 80 81 void beginRenderPass (const DeviceInterface& vk, 82 const VkCommandBuffer commandBuffer, 83 const VkRenderPass renderPass, 84 const VkFramebuffer framebuffer, 85 const VkRect2D& renderArea, 86 const tcu::Vec4& clearColor, 87 const float clearDepth, 88 const deUint32 clearStencil, 89 const void* pNext, 90 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); 91 92 void beginRenderPass (const DeviceInterface& vk, 93 const VkCommandBuffer commandBuffer, 94 const VkRenderPass renderPass, 95 const VkFramebuffer framebuffer, 96 const VkRect2D& renderArea, 97 const tcu::UVec4& clearColor, 98 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); 99 100 void beginRenderPass (const DeviceInterface& vk, 101 const VkCommandBuffer commandBuffer, 102 const VkRenderPass renderPass, 103 const VkFramebuffer framebuffer, 104 const VkRect2D& renderArea, 105 const tcu::Vec4& clearColor, 106 const float clearDepth, 107 const deUint32 clearStencil, 108 const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); 109 110 void endRenderPass (const DeviceInterface& vk, 111 const VkCommandBuffer commandBuffer); 112 113 void submitCommandsAndWait (const DeviceInterface& vk, 114 const VkDevice device, 115 const VkQueue queue, 116 const VkCommandBuffer commandBuffer, 117 const bool useDeviceGroups = false, 118 const deUint32 deviceMask = 1u, 119 const deUint32 waitSemaphoreCount = 0u, 120 const VkSemaphore* waitSemaphores = nullptr, 121 const VkPipelineStageFlags* waitStages = nullptr); 122 123 } // vk 124 125 #endif // _VKCMDUTIL_HPP 126