• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _VKOBJUTIL_HPP
2 #define _VKOBJUTIL_HPP
3 /*-------------------------------------------------------------------------
4  * Vulkan CTS Framework
5  * --------------------
6  *
7  * Copyright (c) 2015 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 creating commonly used Vulkan objects
24  *//*--------------------------------------------------------------------*/
25 
26 #include <vector>
27 #include "vkRef.hpp"
28 
29 namespace vk
30 {
31 
32 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&							vk,
33 									   const VkDevice									device,
34 									   const VkPipelineLayout							pipelineLayout,
35 									   const VkShaderModule								vertexShaderModule,
36 									   const VkShaderModule								tessellationControlShaderModule,
37 									   const VkShaderModule								tessellationEvalShaderModule,
38 									   const VkShaderModule								geometryShaderModule,
39 									   const VkShaderModule								fragmentShaderModule,
40 									   const VkRenderPass								renderPass,
41 									   const std::vector<VkViewport>&					viewports,
42 									   const std::vector<VkRect2D>&						scissors,
43 									   const VkPrimitiveTopology						topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
44 									   const deUint32									subpass = 0u,
45 									   const deUint32									patchControlPoints = 0u,
46 									   const VkPipelineVertexInputStateCreateInfo*		vertexInputStateCreateInfo = DE_NULL,
47 									   const VkPipelineRasterizationStateCreateInfo*	rasterizationStateCreateInfo = DE_NULL,
48 									   const VkPipelineMultisampleStateCreateInfo*		multisampleStateCreateInfo = DE_NULL,
49 									   const VkPipelineDepthStencilStateCreateInfo*		depthStencilStateCreateInfo = DE_NULL,
50 									   const VkPipelineColorBlendStateCreateInfo*		colorBlendStateCreateInfo = DE_NULL,
51 									   const VkPipelineDynamicStateCreateInfo*			dynamicStateCreateInfo = DE_NULL);
52 
53 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&							vk,
54 									   const VkDevice									device,
55 									   const VkPipelineLayout							pipelineLayout,
56 									   const VkShaderModule								vertexShaderModule,
57 									   const VkShaderModule								tessellationControlShaderModule,
58 									   const VkShaderModule								tessellationEvalShaderModule,
59 									   const VkShaderModule								geometryShaderModule,
60 									   const VkShaderModule								fragmentShaderModule,
61 									   const VkRenderPass								renderPass,
62 									   const deUint32									subpass = 0u,
63 									   const VkPipelineVertexInputStateCreateInfo*		vertexInputStateCreateInfo = DE_NULL,
64 									   const VkPipelineInputAssemblyStateCreateInfo*	inputAssemblyStateCreateInfo = DE_NULL,
65 									   const VkPipelineTessellationStateCreateInfo*		tessStateCreateInfo = DE_NULL,
66 									   const VkPipelineViewportStateCreateInfo*			viewportStateCreateInfo = DE_NULL,
67 									   const VkPipelineRasterizationStateCreateInfo*	rasterizationStateCreateInfo = DE_NULL,
68 									   const VkPipelineMultisampleStateCreateInfo*		multisampleStateCreateInfo = DE_NULL,
69 									   const VkPipelineDepthStencilStateCreateInfo*		depthStencilStateCreateInfo = DE_NULL,
70 									   const VkPipelineColorBlendStateCreateInfo*		colorBlendStateCreateInfo = DE_NULL,
71 									   const VkPipelineDynamicStateCreateInfo*			dynamicStateCreateInfo = DE_NULL);
72 
73 Move<VkRenderPass> makeRenderPass (const DeviceInterface&				vk,
74 								   const VkDevice						device,
75 								   const VkFormat						colorFormat,
76 								   const VkFormat						depthStencilFormat			= VK_FORMAT_UNDEFINED,
77 								   const VkAttachmentLoadOp				loadOperation				= VK_ATTACHMENT_LOAD_OP_CLEAR,
78 								   const VkImageLayout					finalLayoutColor			= VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
79 								   const VkImageLayout					finalLayoutDepthStencil		= VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
80 								   const VkImageLayout					subpassLayoutColor			= VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
81 								   const VkImageLayout					subpassLayoutDepthStencil	= VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
82 								   const VkAllocationCallbacks* const	allocationCallbacks			= DE_NULL);
83 
84 } // vk
85 
86 #endif // _VKOBJUTIL_HPP
87