1 #ifndef _VKTPIPELINEIMAGESAMPLINGINSTANCE_HPP
2 #define _VKTPIPELINEIMAGESAMPLINGINSTANCE_HPP
3 /*------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2015 The Khronos Group Inc.
8 * Copyright (c) 2015 Imagination Technologies Ltd.
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and/or associated documentation files (the
12 * "Materials"), to deal in the Materials without restriction, including
13 * without limitation the rights to use, copy, modify, merge, publish,
14 * distribute, sublicense, and/or sell copies of the Materials, and to
15 * permit persons to whom the Materials are furnished to do so, subject to
16 * the following conditions:
18 * The above copyright notice(s) and this permission notice shall be included
19 * in all copies or substantial portions of the Materials.
21 * The Materials are Confidential Information as defined by the
22 * Khronos Membership Agreement until designated non-confidential by Khronos,
23 * at which point this condition clause shall be removed.
25 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
28 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
29 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
30 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
31 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
35 * \brief Image sampling case
36 *//*--------------------------------------------------------------------*/
40 #include "vktTestCase.hpp"
41 #include "vktTestCaseUtil.hpp"
42 #include "vktPipelineImageUtil.hpp"
43 #include "vktPipelineReferenceRenderer.hpp"
44 #include "vktPipelineVertexUtil.hpp"
45 #include "tcuVectorUtil.hpp"
52 class ImageSamplingInstance : public vkt::TestInstance
55 ImageSamplingInstance (Context& context,
56 const tcu::UVec2& renderSize,
57 vk::VkImageViewType imageViewType,
58 vk::VkFormat imageFormat,
59 const tcu::IVec3& imageSize,
61 const vk::VkComponentMapping& componentMapping,
62 const vk::VkImageSubresourceRange& subresourceRange,
63 const vk::VkSamplerCreateInfo& samplerParams,
65 const std::vector<Vertex4Tex4>& vertices);
67 virtual ~ImageSamplingInstance (void);
69 virtual tcu::TestStatus iterate (void);
72 tcu::TestStatus verifyImage (void);
75 const vk::VkImageViewType m_imageViewType;
76 const tcu::IVec3 m_imageSize;
77 const int m_layerCount;
79 const vk::VkComponentMapping m_componentMapping;
80 const vk::VkImageSubresourceRange m_subresourceRange;
81 const vk::VkSamplerCreateInfo m_samplerParams;
82 const float m_samplerLod;
84 vk::Move<vk::VkImage> m_image;
85 de::MovePtr<vk::Allocation> m_imageAlloc;
86 vk::Move<vk::VkImageView> m_imageView;
87 vk::Move<vk::VkSampler> m_sampler;
88 de::MovePtr<TestTexture> m_texture;
90 const tcu::UVec2 m_renderSize;
91 const vk::VkFormat m_colorFormat;
93 vk::Move<vk::VkDescriptorPool> m_descriptorPool;
94 vk::Move<vk::VkDescriptorSetLayout> m_descriptorSetLayout;
95 vk::Move<vk::VkDescriptorSet> m_descriptorSet;
97 vk::Move<vk::VkImage> m_colorImage;
98 de::MovePtr<vk::Allocation> m_colorImageAlloc;
99 vk::Move<vk::VkImageView> m_colorAttachmentView;
100 vk::Move<vk::VkRenderPass> m_renderPass;
101 vk::Move<vk::VkFramebuffer> m_framebuffer;
103 vk::Move<vk::VkShaderModule> m_vertexShaderModule;
104 vk::Move<vk::VkShaderModule> m_fragmentShaderModule;
106 vk::Move<vk::VkBuffer> m_vertexBuffer;
107 std::vector<Vertex4Tex4> m_vertices;
108 de::MovePtr<vk::Allocation> m_vertexBufferAlloc;
110 vk::Move<vk::VkPipelineLayout> m_pipelineLayout;
111 vk::Move<vk::VkPipeline> m_graphicsPipeline;
113 vk::Move<vk::VkCommandPool> m_cmdPool;
114 vk::Move<vk::VkCommandBuffer> m_cmdBuffer;
116 vk::Move<vk::VkFence> m_fence;
122 #endif // _VKTPIPELINEIMAGESAMPLINGINSTANCE_HPP