1 #ifndef _VKTPIPELINESPECCONSTANTUTIL_HPP
2 #define _VKTPIPELINESPECCONSTANTUTIL_HPP
3 /*------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2016 The Khronos Group Inc.
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 * \brief Pipeline specialization constants test utilities
24 *//*--------------------------------------------------------------------*/
28 #include "vkPrograms.hpp"
29 #include "vkMemUtil.hpp"
30 #include "vkRefUtil.hpp"
31 #include "vkQueryUtil.hpp"
38 class GraphicsPipelineBuilder
41 GraphicsPipelineBuilder (void) : m_renderSize (16, 16)
42 , m_shaderStageFlags (0u) {}
44 GraphicsPipelineBuilder& setRenderSize (const tcu::IVec2& size) { m_renderSize = size; return *this; }
45 GraphicsPipelineBuilder& setShader (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkShaderStageFlagBits stage, const vk::ProgramBinary& binary, const vk::VkSpecializationInfo* specInfo);
46 vk::Move<vk::VkPipeline> build (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkPipelineLayout pipelineLayout, const vk::VkRenderPass renderPass);
49 tcu::IVec2 m_renderSize;
50 vk::Move<vk::VkShaderModule> m_vertexShaderModule;
51 vk::Move<vk::VkShaderModule> m_fragmentShaderModule;
52 vk::Move<vk::VkShaderModule> m_geometryShaderModule;
53 vk::Move<vk::VkShaderModule> m_tessControlShaderModule;
54 vk::Move<vk::VkShaderModule> m_tessEvaluationShaderModule;
55 std::vector<vk::VkPipelineShaderStageCreateInfo> m_shaderStages;
56 vk::VkShaderStageFlags m_shaderStageFlags;
58 GraphicsPipelineBuilder (const GraphicsPipelineBuilder&); // "deleted"
59 GraphicsPipelineBuilder& operator= (const GraphicsPipelineBuilder&);
64 FEATURE_TESSELLATION_SHADER = 1u << 0,
65 FEATURE_GEOMETRY_SHADER = 1u << 1,
66 FEATURE_SHADER_FLOAT_64 = 1u << 2,
67 FEATURE_VERTEX_PIPELINE_STORES_AND_ATOMICS = 1u << 3,
68 FEATURE_FRAGMENT_STORES_AND_ATOMICS = 1u << 4,
70 typedef deUint32 FeatureFlags;
72 vk::VkImageCreateInfo makeImageCreateInfo (const tcu::IVec2& size, const vk::VkFormat format, const vk::VkImageUsageFlags usage);
73 void requireFeatures (const vk::InstanceInterface& vki, const vk::VkPhysicalDevice physDevice, const FeatureFlags flags);
75 // Ugly, brute-force replacement for the initializer list
78 std::vector<T> makeVector (const T& o1)
87 std::vector<T> makeVector (const T& o1, const T& o2)
97 std::vector<T> makeVector (const T& o1, const T& o2, const T& o3)
108 std::vector<T> makeVector (const T& o1, const T& o2, const T& o3, const T& o4)
122 #endif // _VKTPIPELINESPECCONSTANTUTIL_HPP