• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
48 void beginRenderPass (const DeviceInterface&	vk,
49 					  const VkCommandBuffer		commandBuffer,
50 					  const VkRenderPass		renderPass,
51 					  const VkFramebuffer		framebuffer,
52 					  const VkRect2D&			renderArea,
53 					  const VkClearValue&		clearValue,
54 					  const VkSubpassContents	contents = VK_SUBPASS_CONTENTS_INLINE);
55 
56 void beginRenderPass (const DeviceInterface&	vk,
57 					  const VkCommandBuffer		commandBuffer,
58 					  const VkRenderPass		renderPass,
59 					  const VkFramebuffer		framebuffer,
60 					  const VkRect2D&			renderArea,
61 					  const VkSubpassContents	contents = VK_SUBPASS_CONTENTS_INLINE);
62 
63 void beginRenderPass (const DeviceInterface&	vk,
64 					  const VkCommandBuffer		commandBuffer,
65 					  const VkRenderPass		renderPass,
66 					  const VkFramebuffer		framebuffer,
67 					  const VkRect2D&			renderArea,
68 					  const tcu::Vec4&			clearColor,
69 					  const VkSubpassContents	contents = VK_SUBPASS_CONTENTS_INLINE);
70 
71 void beginRenderPass (const DeviceInterface&	vk,
72 					  const VkCommandBuffer		commandBuffer,
73 					  const VkRenderPass		renderPass,
74 					  const VkFramebuffer		framebuffer,
75 					  const VkRect2D&			renderArea,
76 					  const tcu::UVec4&			clearColor,
77 					  const VkSubpassContents	contents = VK_SUBPASS_CONTENTS_INLINE);
78 
79 void beginRenderPass (const DeviceInterface&	vk,
80 					  const VkCommandBuffer		commandBuffer,
81 					  const VkRenderPass		renderPass,
82 					  const VkFramebuffer		framebuffer,
83 					  const VkRect2D&			renderArea,
84 					  const tcu::Vec4&			clearColor,
85 					  const float				clearDepth,
86 					  const deUint32			clearStencil,
87 					  const VkSubpassContents	contents = VK_SUBPASS_CONTENTS_INLINE);
88 
89 void endRenderPass (const DeviceInterface&	vk,
90 					const VkCommandBuffer	commandBuffer);
91 
92 void submitCommandsAndWait	(const DeviceInterface&	vk,
93 							 const VkDevice			device,
94 							 const VkQueue			queue,
95 							 const VkCommandBuffer	commandBuffer,
96 							 const bool				useDeviceGroups = false,
97 							 const deUint32			deviceMask = 1u);
98 
99 } // vk
100 
101 #endif // _VKCMDUTIL_HPP
102