blob: c5da8063a47c0f3ce81295ad695852c9c4a65e67 [file] [log] [blame]
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -06001// Copyright 2005, Google Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14// * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060031// VK tests
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060032//
33// Copyright (C) 2014 LunarG, Inc.
34//
35// Permission is hereby granted, free of charge, to any person obtaining a
36// copy of this software and associated documentation files (the "Software"),
37// to deal in the Software without restriction, including without limitation
38// the rights to use, copy, modify, merge, publish, distribute, sublicense,
39// and/or sell copies of the Software, and to permit persons to whom the
40// Software is furnished to do so, subject to the following conditions:
41//
42// The above copyright notice and this permission notice shall be included
43// in all copies or substantial portions of the Software.
44//
45// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
48// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
50// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
51// DEALINGS IN THE SOFTWARE.
52
53
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060054// Verify VK driver initialization
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060055
56#include <stdlib.h>
57#include <stdio.h>
58#include <stdbool.h>
59#include <string.h>
60
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060061#include <vulkan.h>
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060062#include "gtest-1.7.0/include/gtest/gtest.h"
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060063#include "vktestbinding.h"
Chia-I Wu3b78d312014-12-29 15:39:23 +080064#include "test_common.h"
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060065
Jon Ashburn07b309a2015-04-15 11:31:12 -060066#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
67
Tony Barbour01999182015-04-09 12:58:51 -060068class VkImageTest : public ::testing::Test {
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060069public:
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -060070 void CreateImage(uint32_t w, uint32_t h);
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -060071 void DestroyImage();
72
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060073 void CreateImageView(VkImageViewCreateInfo* pCreateInfo,
74 VkImageView* pView);
75 void DestroyImageView(VkImageView imageView);
76 VkDevice device() {return m_device->obj();}
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060077
78protected:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060079 vk_testing::Device *m_device;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060080 VkApplicationInfo app_info;
Tony Barbour8205d902015-04-16 15:59:00 -060081 VkPhysicalDevice objs[16];
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -060082 uint32_t gpu_count;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060083 VkInstance inst;
84 VkImage m_image;
Mark Lobodzinski23182612015-05-29 09:32:35 -050085 VkDeviceMemory m_image_mem;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060086
87 virtual void SetUp() {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060088 VkResult err;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060089
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060090 this->app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060091 this->app_info.pNext = NULL;
Chia-I Wu7461fcf2014-12-27 15:16:07 +080092 this->app_info.pAppName = "base";
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060093 this->app_info.appVersion = 1;
Chia-I Wu7461fcf2014-12-27 15:16:07 +080094 this->app_info.pEngineName = "unittest";
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -060095 this->app_info.engineVersion = 1;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060096 this->app_info.apiVersion = VK_API_VERSION;
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -060097 VkInstanceCreateInfo inst_info = {};
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060098 inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
Jon Ashburn29669a42015-04-04 14:52:07 -060099 inst_info.pNext = NULL;
100 inst_info.pAppInfo = &app_info;
101 inst_info.pAllocCb = NULL;
102 inst_info.extensionCount = 0;
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600103 inst_info.pEnabledExtensions = NULL;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600104 err = vkCreateInstance(&inst_info, &this->inst);
105 ASSERT_VK_SUCCESS(err);
Jon Ashburn07b309a2015-04-15 11:31:12 -0600106 err = vkEnumeratePhysicalDevices(this->inst, &this->gpu_count, NULL);
107 ASSERT_VK_SUCCESS(err);
108 ASSERT_LE(this->gpu_count, ARRAY_SIZE(objs)) << "Too many GPUs";
109 err = vkEnumeratePhysicalDevices(this->inst, &this->gpu_count, objs);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600110 ASSERT_VK_SUCCESS(err);
Jon Ashburn19733c92014-11-26 11:06:49 -0700111 ASSERT_GE(this->gpu_count, 1) << "No GPU available";
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600112
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600113 this->m_device = new vk_testing::Device(objs[0]);
Chia-I Wu3b78d312014-12-29 15:39:23 +0800114 this->m_device->init();
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600115 }
116
117 virtual void TearDown() {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600118 vkDestroyInstance(this->inst);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600119 }
120};
121
122
Tony Barbour01999182015-04-09 12:58:51 -0600123void VkImageTest::CreateImage(uint32_t w, uint32_t h)
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600124{
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600125 VkResult err;
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600126 uint32_t mipCount;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600127 VkFormat fmt;
128 VkFormatProperties image_fmt;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600129
130 mipCount = 0;
131
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600132 uint32_t _w = w;
133 uint32_t _h = h;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600134 while( ( _w > 0 ) || ( _h > 0 ) )
135 {
136 _w >>= 1;
137 _h >>= 1;
138 mipCount++;
139 }
140
Tony Barbour8205d902015-04-16 15:59:00 -0600141 fmt = VK_FORMAT_R8G8B8A8_UINT;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600142 // TODO: Pick known good format rather than just expect common format
143 /*
144 * XXX: What should happen if given NULL HANDLE for the pData argument?
Tony Barbour8205d902015-04-16 15:59:00 -0600145 * We're not requesting VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS so there is
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600146 * an expectation that pData is a valid pointer.
147 * However, why include a returned size value? That implies that the
148 * amount of data may vary and that doesn't work well for using a
149 * fixed structure.
150 */
Chris Forbesd7576302015-06-21 22:55:02 +1200151 err = vkGetPhysicalDeviceFormatInfo(this->objs[0], fmt, &image_fmt);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600152 ASSERT_VK_SUCCESS(err);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600153
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600154 // typedef struct VkImageCreateInfo_
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600155 // {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600156 // VkStructureType sType; // Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600157 // const void* pNext; // Pointer to next structure.
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600158 // VkImageType imageType;
159 // VkFormat format;
160 // VkExtent3D extent;
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600161 // uint32_t mipLevels;
162 // uint32_t arraySize;
163 // uint32_t samples;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600164 // VkImageTiling tiling;
165 // VkFlags usage; // VkImageUsageFlags
166 // VkFlags flags; // VkImageCreateFlags
167 // } VkImageCreateInfo;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600168
169
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600170 VkImageCreateInfo imageCreateInfo = {};
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600171 imageCreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
Tony Barbour8205d902015-04-16 15:59:00 -0600172 imageCreateInfo.imageType = VK_IMAGE_TYPE_2D;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600173 imageCreateInfo.format = fmt;
174 imageCreateInfo.arraySize = 1;
175 imageCreateInfo.extent.width = w;
176 imageCreateInfo.extent.height = h;
177 imageCreateInfo.extent.depth = 1;
178 imageCreateInfo.mipLevels = mipCount;
179 imageCreateInfo.samples = 1;
Tony Barbour8205d902015-04-16 15:59:00 -0600180 if (image_fmt.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) {
181 imageCreateInfo.tiling = VK_IMAGE_TILING_LINEAR;
Tony Barbourbb6a4132015-03-31 08:59:00 -0600182 }
Tony Barbour8205d902015-04-16 15:59:00 -0600183 else if (image_fmt.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) {
184 imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
Tony Barbourbb6a4132015-03-31 08:59:00 -0600185 }
186 else {
187 ASSERT_TRUE(false) << "Cannot find supported tiling format - Exiting";
188 }
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600189
190 // Image usage flags
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600191 // VK_IMAGE_USAGE_DEPTH_STENCIL_BIT = 0x00000008,
Courtney Goeltzenleuchterad870812015-04-15 15:29:59 -0600192 //typedef enum VkImageUsageFlags_
193 //{
194 // VK_IMAGE_USAGE_GENERAL = 0x00000000, // no special usage
195 // VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT = 0x00000001, // Can be used as a source of transfer operations
196 // VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT = 0x00000002, // Can be used as a destination of transfer operations
197 // VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, // Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
198 // VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, // Can be used as storage image (STORAGE_IMAGE descriptor type)
199 // VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, // Can be used as framebuffer color attachment
200 // VK_IMAGE_USAGE_DEPTH_STENCIL_BIT = 0x00000020, // Can be used as framebuffer depth/stencil attachment
201 // VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, // Image data not needed outside of rendering
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600202 // } VkImageUsageFlags;
Courtney Goeltzenleuchterad870812015-04-15 15:29:59 -0600203 imageCreateInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600204
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600205 // VkResult VKAPI vkCreateImage(
206 // VkDevice device,
207 // const VkImageCreateInfo* pCreateInfo,
208 // VkImage* pImage);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600209 err = vkCreateImage(device(), &imageCreateInfo, &m_image);
210 ASSERT_VK_SUCCESS(err);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600211
Mark Lobodzinski23182612015-05-29 09:32:35 -0500212 VkMemoryRequirements mem_req;
Tony Barbour901f3bc2015-04-01 17:10:07 -0600213
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600214 VkMemoryAllocInfo mem_info = {};
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600215 mem_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
Mark Lobodzinski97dcd042015-04-16 08:52:00 -0500216 mem_info.pNext = NULL;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600217
Tony Barbour426b9052015-06-24 16:06:58 -0600218 err = vkGetObjectMemoryRequirements(device(), VK_OBJECT_TYPE_IMAGE, m_image, &mem_req);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600219 ASSERT_VK_SUCCESS(err);
Jon Ashburna9ae3832015-01-16 09:37:43 -0700220
Tony Barbour426b9052015-06-24 16:06:58 -0600221 ASSERT_NE(0, mem_req.size) << "vkGetObjectMemoryRequirements (Image): Failed - expect images to require memory";
Mark Lobodzinski23182612015-05-29 09:32:35 -0500222 mem_info.allocationSize = mem_req.size;
Courtney Goeltzenleuchterb25c9b92015-06-18 17:01:41 -0600223 mem_info.memProps = 0;
Jon Ashburna9ae3832015-01-16 09:37:43 -0700224
Mark Lobodzinski23182612015-05-29 09:32:35 -0500225 /* allocate memory */
226 err = vkAllocMemory(device(), &mem_info, &m_image_mem);
227 ASSERT_VK_SUCCESS(err);
Jon Ashburna9ae3832015-01-16 09:37:43 -0700228
Mark Lobodzinski23182612015-05-29 09:32:35 -0500229 /* bind memory */
230 err = vkBindObjectMemory(device(), VK_OBJECT_TYPE_IMAGE, m_image, m_image_mem, 0);
231 ASSERT_VK_SUCCESS(err);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600232}
233
Tony Barbour01999182015-04-09 12:58:51 -0600234void VkImageTest::DestroyImage()
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600235{
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600236 VkResult err;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600237 // All done with image memory, clean up
Mark Lobodzinski23182612015-05-29 09:32:35 -0500238 err = vkFreeMemory(device(), m_image_mem);
239 ASSERT_VK_SUCCESS(err);
Jon Ashburna9ae3832015-01-16 09:37:43 -0700240
Mike Stroyan230e6252015-04-17 12:36:38 -0600241 ASSERT_VK_SUCCESS(vkDestroyObject(device(), VK_OBJECT_TYPE_IMAGE, m_image));
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600242}
243
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600244void VkImageTest::CreateImageView(VkImageViewCreateInfo *pCreateInfo,
245 VkImageView *pView)
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -0600246{
247 pCreateInfo->image = this->m_image;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600248 ASSERT_VK_SUCCESS(vkCreateImageView(device(), pCreateInfo, pView));
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -0600249}
250
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600251void VkImageTest::DestroyImageView(VkImageView imageView)
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -0600252{
Mark Lobodzinski2f7b17c2015-04-28 18:05:35 -0500253 ASSERT_VK_SUCCESS(vkDestroyObject(device(), VK_OBJECT_TYPE_IMAGE_VIEW, imageView));
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -0600254}
255
Tony Barbour01999182015-04-09 12:58:51 -0600256TEST_F(VkImageTest, CreateImageViewTest) {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600257 VkFormat fmt;
258 VkImageView imageView;
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -0600259
Tony Barbour8205d902015-04-16 15:59:00 -0600260 fmt = VK_FORMAT_R8G8B8A8_UINT;
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -0600261
262 CreateImage(512, 256);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600263
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600264 // typedef struct VkImageViewCreateInfo_
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600265 // {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600266 // VkStructureType sType; // Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600267 // const void* pNext; // Pointer to next structure
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600268 // VkImage image;
269 // VkImageViewType viewType;
270 // VkFormat format;
271 // VkChannelMapping channels;
272 // VkImageSubresourceRange subresourceRange;
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -0600273 // float minLod;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600274 // } VkImageViewCreateInfo;
275 VkImageViewCreateInfo viewInfo = {};
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600276 viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
Tony Barbour8205d902015-04-16 15:59:00 -0600277 viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600278 viewInfo.format = fmt;
279
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600280 viewInfo.channels.r = VK_CHANNEL_SWIZZLE_R;
281 viewInfo.channels.g = VK_CHANNEL_SWIZZLE_G;
282 viewInfo.channels.b = VK_CHANNEL_SWIZZLE_B;
283 viewInfo.channels.a = VK_CHANNEL_SWIZZLE_A;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600284
285 viewInfo.subresourceRange.baseArraySlice = 0;
286 viewInfo.subresourceRange.arraySize = 1;
287 viewInfo.subresourceRange.baseMipLevel = 0;
288 viewInfo.subresourceRange.mipLevels = 1;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600289 viewInfo.subresourceRange.aspect = VK_IMAGE_ASPECT_COLOR;
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600290
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600291 // VkResult VKAPI vkCreateImageView(
292 // VkDevice device,
293 // const VkImageViewCreateInfo* pCreateInfo,
294 // VkImageView* pView);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600295
Courtney Goeltzenleuchter263e7f52014-08-14 17:41:57 -0600296 CreateImageView(&viewInfo, &imageView);
297
298 DestroyImageView(imageView);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600299}
300
301int main(int argc, char **argv) {
302 ::testing::InitGoogleTest(&argc, argv);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600303 vk_testing::set_error_callback(test_error_callback);
Courtney Goeltzenleuchter62928d12014-08-13 17:53:57 -0600304 return RUN_ALL_TESTS();
305}