blob: f6fbe164dacebc7a32bc3683e4f32053f3e13a13 [file] [log] [blame]
David Pinedo0257fbf2015-02-02 18:02:40 -07001/*
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002 * Vulkan null driver
David Pinedo0257fbf2015-02-02 18:02:40 -07003 *
4 * Copyright (C) 2015 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 */
25
26#include "nulldrv.h"
David Pinedo8e9cb3b2015-02-10 15:02:08 -070027#include <stdio.h>
David Pinedo0257fbf2015-02-02 18:02:40 -070028
David Pinedo8e9cb3b2015-02-10 15:02:08 -070029#if 0
30#define NULLDRV_LOG_FUNC \
31 do { \
32 fflush(stdout); \
33 fflush(stderr); \
34 printf("null driver: %s\n", __FUNCTION__); \
35 fflush(stdout); \
36 } while (0)
37#else
38 #define NULLDRV_LOG_FUNC do { } while (0)
39#endif
40
41// The null driver supports all WSI extenstions ... for now ...
David Pinedo0257fbf2015-02-02 18:02:40 -070042static const char * const nulldrv_gpu_exts[NULLDRV_EXT_COUNT] = {
Ian Elliott338dedb2015-08-21 15:09:33 -060043 [NULLDRV_EXT_KHR_SWAPCHAIN] = VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME,
David Pinedo0257fbf2015-02-02 18:02:40 -070044};
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -060045static const VkExtensionProperties intel_gpu_exts[NULLDRV_EXT_COUNT] = {
46 {
Ian Elliott338dedb2015-08-21 15:09:33 -060047 .extName = VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME,
David Pinedob0833bd2015-09-04 15:33:22 -060048 .specVersion = VK_EXT_KHR_SWAPCHAIN_REVISION,
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -060049 }
50};
David Pinedo0257fbf2015-02-02 18:02:40 -070051
Tony Barbourde4124d2015-07-03 10:33:54 -060052static struct nulldrv_base *nulldrv_base(void* base)
David Pinedo0257fbf2015-02-02 18:02:40 -070053{
54 return (struct nulldrv_base *) base;
55}
56
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060057static struct nulldrv_base *nulldrv_base_create(
58 struct nulldrv_dev *dev,
59 size_t obj_size,
Tony Barbourde4124d2015-07-03 10:33:54 -060060 VkDbgObjectType type)
David Pinedo0257fbf2015-02-02 18:02:40 -070061{
62 struct nulldrv_base *base;
63
64 if (!obj_size)
65 obj_size = sizeof(*base);
66
67 assert(obj_size >= sizeof(*base));
68
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060069 base = (struct nulldrv_base*)malloc(obj_size);
David Pinedo0257fbf2015-02-02 18:02:40 -070070 if (!base)
71 return NULL;
72
73 memset(base, 0, obj_size);
74
75 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
Tony Barbourde4124d2015-07-03 10:33:54 -060076 set_loader_magic_value(base);
David Pinedo0257fbf2015-02-02 18:02:40 -070077
78 if (dev == NULL) {
79 /*
80 * dev is NULL when we are creating the base device object
81 * Set dev now so that debug setup happens correctly
82 */
83 dev = (struct nulldrv_dev *) base;
84 }
85
86
Tony Barbour426b9052015-06-24 16:06:58 -060087 base->get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -070088
89 return base;
90}
91
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060092static VkResult nulldrv_gpu_add(int devid, const char *primary_node,
David Pinedo0257fbf2015-02-02 18:02:40 -070093 const char *render_node, struct nulldrv_gpu **gpu_ret)
94{
95 struct nulldrv_gpu *gpu;
96
Chia-I Wu493a1752015-02-22 14:40:25 +080097 gpu = malloc(sizeof(*gpu));
David Pinedo0257fbf2015-02-02 18:02:40 -070098 if (!gpu)
Tony Barbour8205d902015-04-16 15:59:00 -060099 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700100 memset(gpu, 0, sizeof(*gpu));
Mark Lobodzinski97dcd042015-04-16 08:52:00 -0500101
David Pinedo0257fbf2015-02-02 18:02:40 -0700102 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
Tony Barbourde4124d2015-07-03 10:33:54 -0600103 set_loader_magic_value(gpu);
David Pinedo0257fbf2015-02-02 18:02:40 -0700104
105 *gpu_ret = gpu;
106
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600107 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700108}
109
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600110static VkResult nulldrv_queue_create(struct nulldrv_dev *dev,
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700111 uint32_t node_index,
David Pinedo0257fbf2015-02-02 18:02:40 -0700112 struct nulldrv_queue **queue_ret)
113{
114 struct nulldrv_queue *queue;
115
116 queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600117 VK_OBJECT_TYPE_QUEUE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700118 if (!queue)
Tony Barbour8205d902015-04-16 15:59:00 -0600119 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700120
121 queue->dev = dev;
122
123 *queue_ret = queue;
124
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600125 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700126}
127
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600128static VkResult dev_create_queues(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterea975642015-09-16 16:23:55 -0600129 const VkDeviceQueueCreateInfo *queues,
130 uint32_t count)
David Pinedo0257fbf2015-02-02 18:02:40 -0700131{
132 uint32_t i;
133
David Pinedo0257fbf2015-02-02 18:02:40 -0700134 for (i = 0; i < count; i++) {
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600135 const VkDeviceQueueCreateInfo *q = &queues[i];
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600136 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700137
Tony Barbour29b12062015-07-13 13:37:24 -0600138 if (q->queueCount == 1 && !dev->queues[q->queueFamilyIndex]) {
139 ret = nulldrv_queue_create(dev, q->queueFamilyIndex,
140 &dev->queues[q->queueFamilyIndex]);
David Pinedo0257fbf2015-02-02 18:02:40 -0700141 }
David Pinedo0257fbf2015-02-02 18:02:40 -0700142
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600143 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700144 return ret;
145 }
146 }
147
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600148 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700149}
150
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600151static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(
152 const struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600153 const char* extName)
David Pinedo0257fbf2015-02-02 18:02:40 -0700154{
155 enum nulldrv_ext_type type;
156
157 for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) {
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600158 if (strcmp(nulldrv_gpu_exts[type], extName) == 0)
David Pinedo0257fbf2015-02-02 18:02:40 -0700159 break;
160 }
161
162 assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID);
163
164 return type;
165}
166
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600167static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800168 struct nulldrv_desc_ooxx **ooxx_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700169{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800170 struct nulldrv_desc_ooxx *ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700171
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800172 ooxx = malloc(sizeof(*ooxx));
173 if (!ooxx)
Tony Barbour8205d902015-04-16 15:59:00 -0600174 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700175
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800176 memset(ooxx, 0, sizeof(*ooxx));
David Pinedo0257fbf2015-02-02 18:02:40 -0700177
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800178 ooxx->surface_desc_size = 0;
179 ooxx->sampler_desc_size = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700180
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800181 *ooxx_ret = ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700182
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600183 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700184}
185
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600186static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600187 const VkDeviceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700188 struct nulldrv_dev **dev_ret)
189{
190 struct nulldrv_dev *dev;
191 uint32_t i;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600192 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -0700193
194 dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600195 VK_OBJECT_TYPE_DEVICE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700196 if (!dev)
Tony Barbour8205d902015-04-16 15:59:00 -0600197 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700198
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600199 for (i = 0; i < info->extensionCount; i++) {
200 const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(
201 gpu,
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600202 info->ppEnabledExtensionNames[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -0700203
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600204 if (ext == NULLDRV_EXT_INVALID)
Courtney Goeltzenleuchterac544f32015-09-14 18:01:17 -0600205 return VK_ERROR_EXTENSION_NOT_PRESENT;
David Pinedo0257fbf2015-02-02 18:02:40 -0700206
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600207 dev->exts[ext] = true;
208 }
David Pinedo0257fbf2015-02-02 18:02:40 -0700209
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800210 ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600211 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700212 return ret;
213 }
214
215 ret = dev_create_queues(dev, info->pRequestedQueues,
216 info->queueRecordCount);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600217 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700218 return ret;
219 }
220
221 *dev_ret = dev;
222
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600223 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700224}
225
Tony Barbour8205d902015-04-16 15:59:00 -0600226static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalDevice gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700227{
228 return (struct nulldrv_gpu *) gpu;
229}
230
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600231static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
232 const VkFenceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700233 struct nulldrv_fence **fence_ret)
234{
235 struct nulldrv_fence *fence;
236
237 fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600238 VK_OBJECT_TYPE_FENCE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700239 if (!fence)
Tony Barbour8205d902015-04-16 15:59:00 -0600240 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700241
242 *fence_ret = fence;
243
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600244 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700245}
246
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600247static struct nulldrv_dev *nulldrv_dev(VkDevice dev)
David Pinedo0257fbf2015-02-02 18:02:40 -0700248{
249 return (struct nulldrv_dev *) dev;
250}
251
252static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base)
253{
254 return (struct nulldrv_img *) base;
255}
256
257
Tony Barbour426b9052015-06-24 16:06:58 -0600258static VkResult img_get_memory_requirements(struct nulldrv_base *base,
259 VkMemoryRequirements *pRequirements)
David Pinedo0257fbf2015-02-02 18:02:40 -0700260{
261 struct nulldrv_img *img = nulldrv_img_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600262 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700263
Tony Barbour426b9052015-06-24 16:06:58 -0600264 pRequirements->size = img->total_size;
265 pRequirements->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700266
267 return ret;
268}
269
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600270static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
271 const VkImageCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700272 bool scanout,
273 struct nulldrv_img **img_ret)
274{
275 struct nulldrv_img *img;
276
277 img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600278 VK_OBJECT_TYPE_IMAGE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700279 if (!img)
Tony Barbour8205d902015-04-16 15:59:00 -0600280 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700281
282 img->type = info->imageType;
283 img->depth = info->extent.depth;
284 img->mip_levels = info->mipLevels;
285 img->array_size = info->arraySize;
286 img->usage = info->usage;
David Pinedo0257fbf2015-02-02 18:02:40 -0700287 img->samples = info->samples;
288
Tony Barbour426b9052015-06-24 16:06:58 -0600289 img->obj.base.get_memory_requirements = img_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700290
291 *img_ret = img;
292
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600293 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700294}
295
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600296static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700297{
Tony Barbourde4124d2015-07-03 10:33:54 -0600298 return *(struct nulldrv_img **) &image;
David Pinedo0257fbf2015-02-02 18:02:40 -0700299}
300
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600301static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600302 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700303 struct nulldrv_mem **mem_ret)
304{
305 struct nulldrv_mem *mem;
306
307 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600308 VK_OBJECT_TYPE_DEVICE_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700309 if (!mem)
Tony Barbour8205d902015-04-16 15:59:00 -0600310 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700311
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700312 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700313 if (!mem->bo) {
Tony Barbour8205d902015-04-16 15:59:00 -0600314 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700315 }
316
317 mem->size = info->allocationSize;
318
319 *mem_ret = mem;
320
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600321 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700322}
323
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600324static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
325 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700326 struct nulldrv_sampler **sampler_ret)
327{
328 struct nulldrv_sampler *sampler;
329
330 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600331 sizeof(*sampler), VK_OBJECT_TYPE_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700332 if (!sampler)
Tony Barbour8205d902015-04-16 15:59:00 -0600333 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700334
335 *sampler_ret = sampler;
336
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600337 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700338}
339
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600340static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
341 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700342 struct nulldrv_img_view **view_ret)
343{
344 struct nulldrv_img *img = nulldrv_img(info->image);
345 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700346
347 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600348 VK_OBJECT_TYPE_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700349 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600350 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700351
352 view->img = img;
David Pinedo0257fbf2015-02-02 18:02:40 -0700353
David Pinedo0257fbf2015-02-02 18:02:40 -0700354 view->cmd_len = 8;
355
356 *view_ret = view;
357
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600358 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700359}
360
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600361static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700362{
363 return mem->bo;
364}
365
Tony Barbour8205d902015-04-16 15:59:00 -0600366static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700367{
Tony Barbourde4124d2015-07-03 10:33:54 -0600368 return *(struct nulldrv_mem **) &mem;
David Pinedo0257fbf2015-02-02 18:02:40 -0700369}
370
371static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
372{
373 return (struct nulldrv_buf *) base;
374}
375
Tony Barbour426b9052015-06-24 16:06:58 -0600376static VkResult buf_get_memory_requirements(struct nulldrv_base *base,
377 VkMemoryRequirements* pMemoryRequirements)
David Pinedo0257fbf2015-02-02 18:02:40 -0700378{
379 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
David Pinedo0257fbf2015-02-02 18:02:40 -0700380
Tony Barbour426b9052015-06-24 16:06:58 -0600381 if (pMemoryRequirements == NULL)
382 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700383
Tony Barbour426b9052015-06-24 16:06:58 -0600384 pMemoryRequirements->size = buf->size;
385 pMemoryRequirements->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700386
Tony Barbour426b9052015-06-24 16:06:58 -0600387 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700388}
389
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600390static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600391 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700392 struct nulldrv_buf **buf_ret)
393{
394 struct nulldrv_buf *buf;
395
396 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600397 VK_OBJECT_TYPE_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700398 if (!buf)
Tony Barbour8205d902015-04-16 15:59:00 -0600399 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700400
401 buf->size = info->size;
402 buf->usage = info->usage;
403
Tony Barbour426b9052015-06-24 16:06:58 -0600404 buf->obj.base.get_memory_requirements = buf_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700405
406 *buf_ret = buf;
407
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600408 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700409}
410
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600411static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
412 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700413 struct nulldrv_desc_layout **layout_ret)
414{
415 struct nulldrv_desc_layout *layout;
416
417 layout = (struct nulldrv_desc_layout *)
418 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600419 VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700420 if (!layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600421 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700422
423 *layout_ret = layout;
424
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600425 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700426}
427
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500428static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev,
429 const VkPipelineLayoutCreateInfo* pCreateInfo,
430 struct nulldrv_pipeline_layout **pipeline_layout_ret)
Chia-I Wu7732cb22015-03-26 15:27:55 +0800431{
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500432 struct nulldrv_pipeline_layout *pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800433
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500434 pipeline_layout = (struct nulldrv_pipeline_layout *)
435 nulldrv_base_create(dev, sizeof(*pipeline_layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600436 VK_OBJECT_TYPE_PIPELINE_LAYOUT);
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500437 if (!pipeline_layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600438 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800439
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500440 *pipeline_layout_ret = pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800441
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600442 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800443}
444
Tony Barbour8db65372015-07-10 18:32:33 -0600445static struct nulldrv_desc_layout *nulldrv_desc_layout(const VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700446{
Tony Barbourde4124d2015-07-03 10:33:54 -0600447 return *(struct nulldrv_desc_layout **) &layout;
David Pinedo0257fbf2015-02-02 18:02:40 -0700448}
449
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600450static VkResult shader_create(struct nulldrv_dev *dev,
451 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700452 struct nulldrv_shader **sh_ret)
453{
David Pinedo0257fbf2015-02-02 18:02:40 -0700454 struct nulldrv_shader *sh;
455
456 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600457 VK_OBJECT_TYPE_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700458 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600459 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700460
461 *sh_ret = sh;
462
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600463 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700464}
465
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600466static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
467 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700468 struct nulldrv_pipeline **pipeline_ret)
469{
470 struct nulldrv_pipeline *pipeline;
471
472 pipeline = (struct nulldrv_pipeline *)
473 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600474 VK_OBJECT_TYPE_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700475 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600476 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700477
478 *pipeline_ret = pipeline;
479
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600480 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700481}
482
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600483static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
484 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700485 struct nulldrv_cmd **cmd_ret)
486{
David Pinedo0257fbf2015-02-02 18:02:40 -0700487 struct nulldrv_cmd *cmd;
488
David Pinedo0257fbf2015-02-02 18:02:40 -0700489 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600490 VK_OBJECT_TYPE_COMMAND_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700491 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600492 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700493
494 *cmd_ret = cmd;
495
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600496 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700497}
498
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600499static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600500 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800501 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700502{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800503 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700504
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800505 pool = (struct nulldrv_desc_pool *)
506 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600507 VK_OBJECT_TYPE_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800508 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600509 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700510
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800511 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700512
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800513 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700514
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600515 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700516}
517
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600518static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800519 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600520 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700521 const struct nulldrv_desc_layout *layout,
522 struct nulldrv_desc_set **set_ret)
523{
524 struct nulldrv_desc_set *set;
525
526 set = (struct nulldrv_desc_set *)
527 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600528 VK_OBJECT_TYPE_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700529 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600530 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700531
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800532 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700533 set->layout = layout;
534 *set_ret = set;
535
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600536 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700537}
538
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600539static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700540{
Tony Barbourde4124d2015-07-03 10:33:54 -0600541 return *(struct nulldrv_desc_pool **) &pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700542}
543
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600544static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
545 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700546 struct nulldrv_framebuffer ** fb_ret)
547{
548
549 struct nulldrv_framebuffer *fb;
550 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600551 VK_OBJECT_TYPE_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700552 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600553 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700554
555 *fb_ret = fb;
556
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600557 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700558
559}
560
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600561static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
562 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700563 struct nulldrv_render_pass** rp_ret)
564{
565 struct nulldrv_render_pass *rp;
566 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600567 VK_OBJECT_TYPE_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700568 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600569 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700570
571 *rp_ret = rp;
572
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600573 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700574}
575
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600576static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700577{
Tony Barbourde4124d2015-07-03 10:33:54 -0600578 return *(struct nulldrv_buf **) &buf;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700579}
580
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600581static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600582 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700583 struct nulldrv_buf_view **view_ret)
584{
585 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
586 struct nulldrv_buf_view *view;
587
588 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600589 VK_OBJECT_TYPE_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700590 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600591 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700592
593 view->buf = buf;
594
595 *view_ret = view;
596
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600597 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700598}
599
David Pinedo0257fbf2015-02-02 18:02:40 -0700600
601//*********************************************
602// Driver entry points
603//*********************************************
604
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600605ICD_EXPORT VkResult VKAPI vkCreateBuffer(
606 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600607 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600608 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700609{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700610 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700611 struct nulldrv_dev *dev = nulldrv_dev(device);
612
613 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
614}
615
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600616ICD_EXPORT void VKAPI vkDestroyBuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -0600617 VkDevice device,
618 VkBuffer buffer)
619{
620 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -0600621}
622
Cody Northropf02f9f82015-07-09 18:08:05 -0600623ICD_EXPORT VkResult VKAPI vkCreateCommandPool(
624 VkDevice device,
625 const VkCmdPoolCreateInfo* pCreateInfo,
626 VkCmdPool* pCmdPool)
627{
628 NULLDRV_LOG_FUNC;
629 return VK_SUCCESS;
630}
631
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600632ICD_EXPORT void VKAPI vkDestroyCommandPool(
Cody Northropf02f9f82015-07-09 18:08:05 -0600633 VkDevice device,
634 VkCmdPool cmdPool)
635{
636 NULLDRV_LOG_FUNC;
Cody Northropf02f9f82015-07-09 18:08:05 -0600637}
638
639ICD_EXPORT VkResult VKAPI vkResetCommandPool(
640 VkDevice device,
641 VkCmdPool cmdPool,
642 VkCmdPoolResetFlags flags)
643{
644 NULLDRV_LOG_FUNC;
645 return VK_SUCCESS;
646}
647
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600648ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
649 VkDevice device,
650 const VkCmdBufferCreateInfo* pCreateInfo,
651 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700652{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700653 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700654 struct nulldrv_dev *dev = nulldrv_dev(device);
655
656 return nulldrv_cmd_create(dev, pCreateInfo,
657 (struct nulldrv_cmd **) pCmdBuffer);
658}
659
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600660ICD_EXPORT void VKAPI vkDestroyCommandBuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -0600661 VkDevice device,
662 VkCmdBuffer cmdBuffer)
663{
664 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -0600665}
666
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600667ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
668 VkCmdBuffer cmdBuffer,
669 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700670{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700671 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600672 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700673}
674
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600675ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
676 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700677{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700678 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600679 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700680}
681
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600682ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
Cody Northropf02f9f82015-07-09 18:08:05 -0600683 VkCmdBuffer cmdBuffer,
684 VkCmdBufferResetFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700685{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700686 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600687 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700688}
689
Ian Elliott64a68e12015-04-16 11:57:46 -0600690static const VkFormat nulldrv_presentable_formats[] = {
691 VK_FORMAT_B8G8R8A8_UNORM,
692};
693
Jon Ashburnba4a1952015-06-16 12:44:51 -0600694#if 0
Ian Elliott338dedb2015-08-21 15:09:33 -0600695ICD_EXPORT VkResult VKAPI vkGetDisplayInfoKHR(
696 VkDisplayKHR display,
697 VkDisplayInfoTypeKHR infoType,
Ian Elliott64a68e12015-04-16 11:57:46 -0600698 size_t* pDataSize,
699 void* pData)
700{
701 VkResult ret = VK_SUCCESS;
702
703 NULLDRV_LOG_FUNC;
704
705 if (!pDataSize)
706 return VK_ERROR_INVALID_POINTER;
707
708 switch (infoType) {
Ian Elliott338dedb2015-08-21 15:09:33 -0600709 case VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_KHR:
Ian Elliott64a68e12015-04-16 11:57:46 -0600710 {
Ian Elliott338dedb2015-08-21 15:09:33 -0600711 VkDisplayFormatPropertiesKHR *dst = pData;
Ian Elliott64a68e12015-04-16 11:57:46 -0600712 size_t size_ret;
713 uint32_t i;
714
715 size_ret = sizeof(*dst) * ARRAY_SIZE(nulldrv_presentable_formats);
716
717 if (dst && *pDataSize < size_ret)
718 return VK_ERROR_INVALID_VALUE;
719
720 *pDataSize = size_ret;
721 if (!dst)
722 return VK_SUCCESS;
723
724 for (i = 0; i < ARRAY_SIZE(nulldrv_presentable_formats); i++)
Ian Elliott338dedb2015-08-21 15:09:33 -0600725 dst[i].swapchainFormat = nulldrv_presentable_formats[i];
Ian Elliott64a68e12015-04-16 11:57:46 -0600726 }
727 break;
728 default:
729 ret = VK_ERROR_INVALID_VALUE;
730 break;
731 }
732
733 return ret;
734}
Jon Ashburnba4a1952015-06-16 12:44:51 -0600735#endif
Ian Elliott64a68e12015-04-16 11:57:46 -0600736
Ian Elliott338dedb2015-08-21 15:09:33 -0600737ICD_EXPORT VkResult VKAPI vkCreateSwapchainKHR(
Ian Elliott64a68e12015-04-16 11:57:46 -0600738 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600739 const VkSwapchainCreateInfoKHR* pCreateInfo,
740 VkSwapchainKHR* pSwapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600741{
742 NULLDRV_LOG_FUNC;
743 struct nulldrv_dev *dev = nulldrv_dev(device);
744 struct nulldrv_swap_chain *sc;
745
746 sc = (struct nulldrv_swap_chain *) nulldrv_base_create(dev, sizeof(*sc),
Ian Elliott338dedb2015-08-21 15:09:33 -0600747 VK_OBJECT_TYPE_SWAPCHAIN_KHR);
Ian Elliott64a68e12015-04-16 11:57:46 -0600748 if (!sc) {
749 return VK_ERROR_OUT_OF_HOST_MEMORY;
750 }
751 sc->dev = dev;
752
Ian Elliott338dedb2015-08-21 15:09:33 -0600753 *(VkSwapchainKHR **)pSwapchain = *(VkSwapchainKHR **)&sc;
Ian Elliott64a68e12015-04-16 11:57:46 -0600754
755 return VK_SUCCESS;
756}
757
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -0600758ICD_EXPORT VkResult VKAPI vkDestroySwapchainKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600759 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600760 VkSwapchainKHR swapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600761{
762 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600763 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600764
765 free(sc);
766
767 return VK_SUCCESS;
768}
769
Ian Elliott338dedb2015-08-21 15:09:33 -0600770ICD_EXPORT VkResult VKAPI vkGetSwapchainImagesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600771 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600772 VkSwapchainKHR swapchain,
Ian Elliott3333bb42015-08-10 13:56:08 -0600773 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600774 VkImage* pSwapchainImages)
Ian Elliott64a68e12015-04-16 11:57:46 -0600775{
776 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600777 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600778 struct nulldrv_dev *dev = sc->dev;
779 VkResult ret = VK_SUCCESS;
780
Ian Elliott3333bb42015-08-10 13:56:08 -0600781 *pCount = 2;
Ian Elliott338dedb2015-08-21 15:09:33 -0600782 if (pSwapchainImages) {
Ian Elliott3333bb42015-08-10 13:56:08 -0600783 uint32_t i;
784 for (i = 0; i < 2; i++) {
Ian Elliott64a68e12015-04-16 11:57:46 -0600785 struct nulldrv_img *img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600786
787 img = (struct nulldrv_img *) nulldrv_base_create(dev,
788 sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600789 VK_OBJECT_TYPE_IMAGE);
Ian Elliott64a68e12015-04-16 11:57:46 -0600790 if (!img)
791 return VK_ERROR_OUT_OF_HOST_MEMORY;
Ian Elliott338dedb2015-08-21 15:09:33 -0600792 pSwapchainImages[i].handle = (uint64_t) &img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600793 }
Ian Elliott64a68e12015-04-16 11:57:46 -0600794 }
795
796 return ret;
797}
798
Ian Elliott338dedb2015-08-21 15:09:33 -0600799ICD_EXPORT VkResult VKAPI vkAcquireNextImageKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600800 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600801 VkSwapchainKHR swapchain,
Tony Barbour7910de72015-07-13 16:37:21 -0600802 uint64_t timeout,
803 VkSemaphore semaphore,
804 uint32_t* pImageIndex)
805{
806 NULLDRV_LOG_FUNC;
807
808 return VK_SUCCESS;
809}
810
Ian Elliott338dedb2015-08-21 15:09:33 -0600811VkResult VKAPI vkGetSurfacePropertiesKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600812 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600813 const VkSurfaceDescriptionKHR* pSurfaceDescription,
814 VkSurfacePropertiesKHR* pSurfaceProperties)
Ian Elliott3333bb42015-08-10 13:56:08 -0600815{
816 NULLDRV_LOG_FUNC;
817
818 return VK_SUCCESS;
819}
820
Ian Elliott338dedb2015-08-21 15:09:33 -0600821VkResult VKAPI vkGetSurfaceFormatsKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600822 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600823 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600824 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600825 VkSurfaceFormatKHR* pSurfaceFormats)
Ian Elliott3333bb42015-08-10 13:56:08 -0600826{
827 NULLDRV_LOG_FUNC;
828
829 return VK_SUCCESS;
830}
831
Ian Elliott338dedb2015-08-21 15:09:33 -0600832VkResult VKAPI vkGetSurfacePresentModesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600833 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600834 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600835 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600836 VkPresentModeKHR* pPresentModes)
Tony Barbour7910de72015-07-13 16:37:21 -0600837{
838 NULLDRV_LOG_FUNC;
839
840 return VK_SUCCESS;
841}
842
Ian Elliott338dedb2015-08-21 15:09:33 -0600843ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600844 VkPhysicalDevice physicalDevice,
845 uint32_t queueFamilyIndex,
Ian Elliott338dedb2015-08-21 15:09:33 -0600846 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Tony Barbour7910de72015-07-13 16:37:21 -0600847 VkBool32* pSupported)
848{
849 NULLDRV_LOG_FUNC;
850
851 return VK_SUCCESS;
852}
853
Ian Elliott338dedb2015-08-21 15:09:33 -0600854ICD_EXPORT VkResult VKAPI vkQueuePresentKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600855 VkQueue queue_,
Ian Elliott338dedb2015-08-21 15:09:33 -0600856 VkPresentInfoKHR* pPresentInfo)
Ian Elliott64a68e12015-04-16 11:57:46 -0600857{
858 NULLDRV_LOG_FUNC;
859
860 return VK_SUCCESS;
861}
862
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600863ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600864 VkCmdBuffer cmdBuffer,
865 VkBuffer srcBuffer,
866 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700867 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600868 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700869{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700870 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700871}
872
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600873ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600874 VkCmdBuffer cmdBuffer,
875 VkImage srcImage,
876 VkImageLayout srcImageLayout,
877 VkImage destImage,
878 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700879 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600880 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700881{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700882 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700883}
884
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600885ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600886 VkCmdBuffer cmdBuffer,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500887 VkImage srcImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600888 VkImageLayout srcImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500889 VkImage destImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600890 VkImageLayout destImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500891 uint32_t regionCount,
892 const VkImageBlit* pRegions,
893 VkTexFilter filter)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600894{
895 NULLDRV_LOG_FUNC;
896}
897
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600898ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600899 VkCmdBuffer cmdBuffer,
900 VkBuffer srcBuffer,
901 VkImage destImage,
902 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700903 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600904 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700905{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700906 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700907}
908
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600909ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600910 VkCmdBuffer cmdBuffer,
911 VkImage srcImage,
912 VkImageLayout srcImageLayout,
913 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700914 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600915 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700916{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700917 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700918}
919
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600920ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600921 VkCmdBuffer cmdBuffer,
922 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600923 VkDeviceSize destOffset,
924 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700925 const uint32_t* pData)
926{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700927 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700928}
929
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600930ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600931 VkCmdBuffer cmdBuffer,
932 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600933 VkDeviceSize destOffset,
934 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700935 uint32_t data)
936{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700937 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700938}
939
Ian Elliotte924ab22015-07-08 13:24:30 -0600940ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage(
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600941 VkCmdBuffer cmdBuffer,
942 VkImage image,
943 VkImageLayout imageLayout,
944 const VkClearDepthStencilValue* pDepthStencil,
Ian Elliotte924ab22015-07-08 13:24:30 -0600945 uint32_t rangeCount,
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600946 const VkImageSubresourceRange* pRanges)
Ian Elliotte924ab22015-07-08 13:24:30 -0600947{
948 NULLDRV_LOG_FUNC;
949}
950
951ICD_EXPORT void VKAPI vkCmdClearColorAttachment(
952 VkCmdBuffer cmdBuffer,
953 uint32_t colorAttachment,
954 VkImageLayout imageLayout,
955 const VkClearColorValue *pColor,
956 uint32_t rectCount,
957 const VkRect3D *pRects)
958{
959 NULLDRV_LOG_FUNC;
960}
961
962ICD_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
963 VkCmdBuffer cmdBuffer,
964 VkImageAspectFlags imageAspectMask,
965 VkImageLayout imageLayout,
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600966 const VkClearDepthStencilValue* pDepthStencil,
Ian Elliotte924ab22015-07-08 13:24:30 -0600967 uint32_t rectCount,
968 const VkRect3D *pRects)
969{
970 NULLDRV_LOG_FUNC;
971}
972
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600973ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600974 VkCmdBuffer cmdBuffer,
975 VkImage image,
976 VkImageLayout imageLayout,
Chris Forbese3105972015-06-24 14:34:53 +1200977 const VkClearColorValue *pColor,
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600978 uint32_t rangeCount,
979 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700980{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700981 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700982}
983
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600984ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600985 VkCmdBuffer cmdBuffer,
986 VkImage image,
987 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700988 float depth,
989 uint32_t stencil,
990 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600991 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700992{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700993 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700994}
995
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600996ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600997 VkCmdBuffer cmdBuffer,
998 VkImage srcImage,
999 VkImageLayout srcImageLayout,
1000 VkImage destImage,
1001 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -06001002 uint32_t regionCount,
1003 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001004{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001005 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001006}
1007
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001008ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001009 VkCmdBuffer cmdBuffer,
1010 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001011 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001012 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001013{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001014 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001015}
1016
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001017ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001018 VkCmdBuffer cmdBuffer,
1019 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001020 uint32_t slot)
1021{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001022 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001023}
1024
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001025ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001026 VkCmdBuffer cmdBuffer,
1027 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001028 uint32_t startQuery,
1029 uint32_t queryCount)
1030{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001031 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001032}
1033
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001034ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001035 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001036 VkEvent event_,
1037 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001038{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001039 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001040}
1041
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001042ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001043 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001044 VkEvent event_,
1045 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001046{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001047 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001048}
1049
Ian Elliott63f1edb2015-04-16 18:10:19 -06001050ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1051 VkCmdBuffer cmdBuffer,
1052 VkQueryPool queryPool,
1053 uint32_t startQuery,
1054 uint32_t queryCount,
1055 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001056 VkDeviceSize destOffset,
1057 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001058 VkFlags flags)
1059{
1060 NULLDRV_LOG_FUNC;
1061}
1062
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001063ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001064 VkCmdBuffer cmdBuffer,
1065 VkTimestampType timestampType,
1066 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001067 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001068{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001069 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001070}
1071
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001072ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001073 VkCmdBuffer cmdBuffer,
Tony Barbourde4124d2015-07-03 10:33:54 -06001074 VkPipelineBindPoint pipelineBindPoint,
1075 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001076{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001077 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001078}
1079
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001080ICD_EXPORT void VKAPI vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportAndScissorCount, const VkViewport* pViewports, const VkRect2D* pScissors)
Tony Barbourde4124d2015-07-03 10:33:54 -06001081{
1082 NULLDRV_LOG_FUNC;
1083}
1084
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001085ICD_EXPORT void VKAPI vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth)
Cody Northropf5bd2252015-08-17 11:10:49 -06001086{
1087 NULLDRV_LOG_FUNC;
1088}
1089
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001090ICD_EXPORT void VKAPI vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias)
Tony Barbourde4124d2015-07-03 10:33:54 -06001091{
1092 NULLDRV_LOG_FUNC;
1093}
1094
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001095ICD_EXPORT void VKAPI vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4])
Tony Barbourde4124d2015-07-03 10:33:54 -06001096{
1097 NULLDRV_LOG_FUNC;
1098}
1099
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001100ICD_EXPORT void VKAPI vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds)
Cody Northrop2605cb02015-08-18 15:21:16 -06001101{
1102 NULLDRV_LOG_FUNC;
1103}
1104
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001105ICD_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask)
1106{
1107 NULLDRV_LOG_FUNC;
1108}
1109
1110ICD_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask)
1111{
1112 NULLDRV_LOG_FUNC;
1113}
1114
1115ICD_EXPORT void VKAPI vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference)
David Pinedo0257fbf2015-02-02 18:02:40 -07001116{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001117 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001118}
1119
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001120ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001121 VkCmdBuffer cmdBuffer,
1122 VkPipelineBindPoint pipelineBindPoint,
Mark Lobodzinskia65c4632015-06-15 13:21:21 -06001123 VkPipelineLayout layout,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001124 uint32_t firstSet,
1125 uint32_t setCount,
1126 const VkDescriptorSet* pDescriptorSets,
1127 uint32_t dynamicOffsetCount,
1128 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001129{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001130 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001131}
1132
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001133ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1134 VkCmdBuffer cmdBuffer,
1135 uint32_t startBinding,
1136 uint32_t bindingCount,
1137 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001138 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001139{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001140 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001141}
1142
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001143ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001144 VkCmdBuffer cmdBuffer,
1145 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001146 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001147 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001148{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001149 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001150}
1151
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001152ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001153 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001154 uint32_t firstVertex,
1155 uint32_t vertexCount,
1156 uint32_t firstInstance,
1157 uint32_t instanceCount)
1158{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001159 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001160}
1161
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001162ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001163 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001164 uint32_t firstIndex,
1165 uint32_t indexCount,
1166 int32_t vertexOffset,
1167 uint32_t firstInstance,
1168 uint32_t instanceCount)
1169{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001170 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001171}
1172
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001173ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001174 VkCmdBuffer cmdBuffer,
1175 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001176 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001177 uint32_t count,
1178 uint32_t stride)
1179{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001180 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001181}
1182
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001183ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001184 VkCmdBuffer cmdBuffer,
1185 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001186 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001187 uint32_t count,
1188 uint32_t stride)
1189{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001190 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001191}
1192
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001193ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001194 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001195 uint32_t x,
1196 uint32_t y,
1197 uint32_t z)
1198{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001199 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001200}
1201
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001202ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001203 VkCmdBuffer cmdBuffer,
1204 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001205 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001206{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001207 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001208}
1209
Tony Barbour8205d902015-04-16 15:59:00 -06001210void VKAPI vkCmdWaitEvents(
1211 VkCmdBuffer cmdBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001212 uint32_t eventCount,
1213 const VkEvent* pEvents,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001214 VkPipelineStageFlags sourceStageMask,
1215 VkPipelineStageFlags destStageMask,
Tony Barbour8205d902015-04-16 15:59:00 -06001216 uint32_t memBarrierCount,
Courtney Goeltzenleuchterd9ba3422015-07-12 12:58:58 -06001217 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001218{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001219 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001220}
1221
Tony Barbour8205d902015-04-16 15:59:00 -06001222void VKAPI vkCmdPipelineBarrier(
1223 VkCmdBuffer cmdBuffer,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001224 VkPipelineStageFlags srcStageMask,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001225 VkPipelineStageFlags destStageMask,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001226 VkBool32 byRegion,
Tony Barbour8205d902015-04-16 15:59:00 -06001227 uint32_t memBarrierCount,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001228 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001229{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001230 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001231}
1232
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001233ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001234 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001235 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001236 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001237{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001238 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001239 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1240 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1241}
1242
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001243ICD_EXPORT void VKAPI vkDestroyDevice(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001244 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001245{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001246 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001247}
1248
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001249ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1250 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001251 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001252 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001253 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001254{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001255 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001256 struct nulldrv_dev *dev = nulldrv_dev(device);
Mike Stroyan230e6252015-04-17 12:36:38 -06001257 *pQueue = (VkQueue) dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001258 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001259}
1260
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001261ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1262 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001263{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001264 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001265 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001266}
1267
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001268ICD_EXPORT VkResult VKAPI vkCreateEvent(
1269 VkDevice device,
1270 const VkEventCreateInfo* pCreateInfo,
1271 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001272{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001273 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001274 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001275}
1276
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001277ICD_EXPORT void VKAPI vkDestroyEvent(
Tony Barbourde4124d2015-07-03 10:33:54 -06001278 VkDevice device,
1279 VkEvent event)
1280{
1281 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001282}
1283
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001284ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001285 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001286 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001287{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001288 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001289 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001290}
1291
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001292ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001293 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001294 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001295{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001296 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001297 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001298}
1299
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001300ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001301 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001302 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001303{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001304 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001305 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001306}
1307
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001308ICD_EXPORT VkResult VKAPI vkCreateFence(
1309 VkDevice device,
1310 const VkFenceCreateInfo* pCreateInfo,
1311 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001312{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001313 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001314 struct nulldrv_dev *dev = nulldrv_dev(device);
1315
1316 return nulldrv_fence_create(dev, pCreateInfo,
1317 (struct nulldrv_fence **) pFence);
1318}
1319
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001320ICD_EXPORT void VKAPI vkDestroyFence(
Tony Barbourde4124d2015-07-03 10:33:54 -06001321 VkDevice device,
1322 VkFence fence)
1323{
1324 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001325}
1326
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001327ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001328 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001329 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001330{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001331 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001332 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001333}
1334
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001335ICD_EXPORT VkResult VKAPI vkResetFences(
Courtney Goeltzenleuchterf2e33ad2015-06-18 17:28:20 -06001336 VkDevice device,
1337 uint32_t fenceCount,
1338 const VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001339{
1340 NULLDRV_LOG_FUNC;
1341 return VK_SUCCESS;
1342}
1343
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001344ICD_EXPORT VkResult VKAPI vkWaitForFences(
1345 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001346 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001347 const VkFence* pFences,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001348 VkBool32 waitAll,
David Pinedo0257fbf2015-02-02 18:02:40 -07001349 uint64_t timeout)
1350{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001351 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001352 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001353}
1354
Tony Barbour426b9052015-06-24 16:06:58 -06001355ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
1356 VkPhysicalDevice gpu_,
1357 VkPhysicalDeviceProperties* pProperties)
David Pinedo0257fbf2015-02-02 18:02:40 -07001358{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001359 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001360 VkResult ret = VK_SUCCESS;
1361
Tony Barbour426b9052015-06-24 16:06:58 -06001362 pProperties->apiVersion = VK_API_VERSION;
1363 pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's
1364 pProperties->vendorId = 0;
1365 pProperties->deviceId = 0;
1366 pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1367 strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
Ian Elliott64a68e12015-04-16 11:57:46 -06001368
Mark Lobodzinski7dae6862015-09-07 12:56:17 -06001369 /* TODO: fill out limits */
1370 memset(&pProperties->limits, 0, sizeof(VkPhysicalDeviceLimits));
1371 memset(&pProperties->sparseProperties, 0, sizeof(VkPhysicalDeviceSparseProperties));
Ian Elliott64a68e12015-04-16 11:57:46 -06001372 return ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001373}
1374
Chris Forbesd7576302015-06-21 22:55:02 +12001375ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
1376 VkPhysicalDevice physicalDevice,
1377 VkPhysicalDeviceFeatures* pFeatures)
1378{
1379 NULLDRV_LOG_FUNC;
1380 VkResult ret = VK_SUCCESS;
1381
1382 /* TODO: fill out features */
1383 memset(pFeatures, 0, sizeof(*pFeatures));
1384
1385 return ret;
1386}
1387
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -06001388ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties(
Chris Forbesd7576302015-06-21 22:55:02 +12001389 VkPhysicalDevice physicalDevice,
1390 VkFormat format,
1391 VkFormatProperties* pFormatInfo)
1392{
1393 NULLDRV_LOG_FUNC;
1394 VkResult ret = VK_SUCCESS;
1395
1396 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1397 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
Mark Lobodzinski4b36dd42015-09-03 15:21:52 -06001398 pFormatInfo->bufferFeatures = 0;
Chris Forbesd7576302015-06-21 22:55:02 +12001399
1400 return ret;
1401}
1402
Cody Northropef72e2a2015-08-03 17:04:53 -06001403ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001404 VkPhysicalDevice gpu_,
Cody Northropef72e2a2015-08-03 17:04:53 -06001405 uint32_t* pCount,
1406 VkQueueFamilyProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001407 {
Cody Northropef72e2a2015-08-03 17:04:53 -06001408 if (pProperties == NULL) {
1409 *pCount = 1;
1410 return VK_SUCCESS;
1411 }
Tony Barbour426b9052015-06-24 16:06:58 -06001412 pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
1413 pProperties->queueCount = 1;
Tony Barbour426b9052015-06-24 16:06:58 -06001414 pProperties->supportsTimestamps = false;
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001415
Tony Barbour426b9052015-06-24 16:06:58 -06001416 return VK_SUCCESS;
1417}
1418
Ian Elliotte924ab22015-07-08 13:24:30 -06001419ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
1420 VkPhysicalDevice gpu_,
1421 VkPhysicalDeviceMemoryProperties* pProperties)
1422{
1423 // TODO: Fill in with real data
1424 return VK_SUCCESS;
1425}
1426
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001427ICD_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001428 VkPhysicalDevice physicalDevice,
1429 uint32_t* pCount,
1430 VkLayerProperties* pProperties)
1431{
1432 // TODO: Fill in with real data
1433 return VK_SUCCESS;
1434}
1435
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001436ICD_EXPORT VkResult VKAPI vkEnumerateInstanceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001437 const char* pLayerName,
1438 uint32_t* pCount,
1439 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001440{
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001441 uint32_t copy_size;
Tony Barbour426b9052015-06-24 16:06:58 -06001442
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001443 if (pProperties == NULL) {
1444 *pCount = NULLDRV_EXT_COUNT;
1445 return VK_SUCCESS;
1446 }
Tony Barbour426b9052015-06-24 16:06:58 -06001447
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001448 copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT;
1449 memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties));
1450 *pCount = copy_size;
1451 if (copy_size < NULLDRV_EXT_COUNT) {
1452 return VK_INCOMPLETE;
1453 }
Tony Barbour426b9052015-06-24 16:06:58 -06001454 return VK_SUCCESS;
1455}
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001456ICD_EXPORT VkResult VKAPI vkEnumerateInstanceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001457 uint32_t* pCount,
1458 VkLayerProperties* pProperties)
1459{
1460 // TODO: Fill in with real data
1461 return VK_SUCCESS;
1462}
Tony Barbour426b9052015-06-24 16:06:58 -06001463
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001464VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001465 VkPhysicalDevice physicalDevice,
1466 const char* pLayerName,
1467 uint32_t* pCount,
1468 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001469{
Tony Barbour426b9052015-06-24 16:06:58 -06001470
Tony Barbour426b9052015-06-24 16:06:58 -06001471 *pCount = 0;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001472
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001473 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001474}
1475
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001476ICD_EXPORT VkResult VKAPI vkCreateImage(
1477 VkDevice device,
1478 const VkImageCreateInfo* pCreateInfo,
1479 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001480{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001481 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001482 struct nulldrv_dev *dev = nulldrv_dev(device);
1483
1484 return nulldrv_img_create(dev, pCreateInfo, false,
1485 (struct nulldrv_img **) pImage);
1486}
1487
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001488ICD_EXPORT void VKAPI vkDestroyImage(
Tony Barbourde4124d2015-07-03 10:33:54 -06001489 VkDevice device,
1490 VkImage image)
1491{
1492 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001493}
1494
Tony Barbour426b9052015-06-24 16:06:58 -06001495ICD_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(
Mike Stroyan230e6252015-04-17 12:36:38 -06001496 VkDevice device,
1497 VkImage image,
1498 const VkImageSubresource* pSubresource,
Tony Barbour426b9052015-06-24 16:06:58 -06001499 VkSubresourceLayout* pLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001500{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001501 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001502
Tony Barbour426b9052015-06-24 16:06:58 -06001503 pLayout->offset = 0;
1504 pLayout->size = 1;
1505 pLayout->rowPitch = 4;
1506 pLayout->depthPitch = 4;
David Pinedo0257fbf2015-02-02 18:02:40 -07001507
Tony Barbour426b9052015-06-24 16:06:58 -06001508 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001509}
1510
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001511ICD_EXPORT VkResult VKAPI vkAllocMemory(
1512 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001513 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001514 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001515{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001516 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001517 struct nulldrv_dev *dev = nulldrv_dev(device);
1518
1519 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1520}
1521
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001522ICD_EXPORT void VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001523 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001524 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001525{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001526 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001527}
1528
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001529ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001530 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001531 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001532 VkDeviceSize offset,
1533 VkDeviceSize size,
1534 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001535 void** ppData)
1536{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001537 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001538 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1539 void *ptr = nulldrv_mem_map(mem, flags);
1540
1541 *ppData = ptr;
1542
Courtney Goeltzenleuchterac544f32015-09-14 18:01:17 -06001543 return (ptr) ? VK_SUCCESS : VK_ERROR_MEMORY_MAP_FAILED;
David Pinedo0257fbf2015-02-02 18:02:40 -07001544}
1545
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001546ICD_EXPORT void VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001547 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001548 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001549{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001550 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001551}
1552
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001553ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001554 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001555 uint32_t memRangeCount,
1556 const VkMappedMemoryRange* pMemRanges)
1557{
1558 NULLDRV_LOG_FUNC;
1559 return VK_SUCCESS;
1560}
1561
1562ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1563 VkDevice device,
1564 uint32_t memRangeCount,
1565 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001566{
1567 NULLDRV_LOG_FUNC;
1568 return VK_SUCCESS;
1569}
1570
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001571ICD_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(
1572 VkDevice device,
1573 VkDeviceMemory memory,
1574 VkDeviceSize* pCommittedMemoryInBytes)
1575{
1576 return VK_SUCCESS;
1577}
1578
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001579ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001580 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001581 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001582{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001583 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001584 struct nulldrv_instance *inst;
1585
1586 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001587 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001588 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001589 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001590
Tony Barbour426b9052015-06-24 16:06:58 -06001591 inst->obj.base.get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -07001592
Mike Stroyan230e6252015-04-17 12:36:38 -06001593 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001594
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001595 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001596}
1597
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001598ICD_EXPORT void VKAPI vkDestroyInstance(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001599 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001600{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001601 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001602}
1603
Tony Barbour8205d902015-04-16 15:59:00 -06001604ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001605 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001606 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001607 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001608{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001609 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001610 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001611 struct nulldrv_gpu *gpu;
1612 *pGpuCount = 1;
1613 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001614 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001615 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001616 return ret;
1617}
1618
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001619ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001620 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001621 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001622 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001623 char* const* pOutLayers,
1624 void* pReserved)
1625{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001626 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001627 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001628}
1629
Tony Barbourde4124d2015-07-03 10:33:54 -06001630ICD_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(
1631 VkDevice device,
1632 VkBuffer buffer,
1633 VkMemoryRequirements* pMemoryRequirements)
1634{
1635 NULLDRV_LOG_FUNC;
1636 struct nulldrv_base *base = nulldrv_base((void*)buffer.handle);
1637
1638 return base->get_memory_requirements(base, pMemoryRequirements);
1639}
1640
1641ICD_EXPORT VkResult VKAPI vkGetImageMemoryRequirements(
1642 VkDevice device,
1643 VkImage image,
1644 VkMemoryRequirements* pMemoryRequirements)
1645{
1646 NULLDRV_LOG_FUNC;
1647 struct nulldrv_base *base = nulldrv_base((void*)image.handle);
1648
1649 return base->get_memory_requirements(base, pMemoryRequirements);
1650}
1651
1652ICD_EXPORT VkResult VKAPI vkBindBufferMemory(
1653 VkDevice device,
1654 VkBuffer buffer,
1655 VkDeviceMemory mem_,
1656 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001657{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001658 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001659 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001660}
1661
Tony Barbourde4124d2015-07-03 10:33:54 -06001662ICD_EXPORT VkResult VKAPI vkBindImageMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001663 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001664 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001665 VkDeviceMemory mem_,
1666 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001667{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001668 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001669 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001670}
1671
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001672ICD_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(
1673 VkDevice device,
1674 VkImage image,
1675 uint32_t* pNumRequirements,
1676 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1677{
1678 NULLDRV_LOG_FUNC;
1679 return VK_SUCCESS;
1680}
1681
1682ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(
1683 VkPhysicalDevice physicalDevice,
1684 VkFormat format,
1685 VkImageType type,
1686 uint32_t samples,
1687 VkImageUsageFlags usage,
1688 VkImageTiling tiling,
1689 uint32_t* pNumProperties,
1690 VkSparseImageFormatProperties* pProperties)
1691{
1692 NULLDRV_LOG_FUNC;
1693 return VK_SUCCESS;
1694}
1695
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001696ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001697 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001698 VkBuffer buffer,
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001699 uint32_t numBindings,
1700 const VkSparseMemoryBindInfo* pBindInfo)
1701{
1702 NULLDRV_LOG_FUNC;
1703 return VK_SUCCESS;
1704}
1705
1706ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(
1707 VkQueue queue,
1708 VkImage image,
1709 uint32_t numBindings,
1710 const VkSparseMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001711{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001712 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001713 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001714}
1715
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001716ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001717 VkQueue queue,
1718 VkImage image,
1719 uint32_t numBindings,
1720 const VkSparseImageMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001721{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001722 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001723 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001724}
Jon Ashburn0e249962015-07-10 09:41:15 -07001725ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
1726 VkDevice device,
1727 const VkPipelineCacheCreateInfo* pCreateInfo,
1728 VkPipelineCache* pPipelineCache)
1729{
David Pinedo0257fbf2015-02-02 18:02:40 -07001730
Jon Ashburn0e249962015-07-10 09:41:15 -07001731 NULLDRV_LOG_FUNC;
1732 return VK_SUCCESS;
1733}
1734
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001735ICD_EXPORT void VKAPI vkDestroyPipeline(
Tony Barbourde4124d2015-07-03 10:33:54 -06001736 VkDevice device,
1737 VkPipeline pipeline)
1738{
1739 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001740}
1741
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001742void VKAPI vkDestroyPipelineCache(
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06001743 VkDevice device,
1744 VkPipelineCache pipelineCache)
Jon Ashburn0e249962015-07-10 09:41:15 -07001745{
1746 NULLDRV_LOG_FUNC;
Jon Ashburn0e249962015-07-10 09:41:15 -07001747}
1748
1749ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize(
1750 VkDevice device,
1751 VkPipelineCache pipelineCache)
1752{
1753 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001754 return 0;
Jon Ashburn0e249962015-07-10 09:41:15 -07001755}
1756
1757ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
1758 VkDevice device,
1759 VkPipelineCache pipelineCache,
1760 void* pData)
1761{
1762 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001763 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001764}
1765
1766ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
1767 VkDevice device,
1768 VkPipelineCache destCache,
1769 uint32_t srcCacheCount,
1770 const VkPipelineCache* pSrcCaches)
1771{
1772 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001773 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001774}
1775ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001776 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001777 VkPipelineCache pipelineCache,
1778 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001779 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1780 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001781{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001782 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001783 struct nulldrv_dev *dev = nulldrv_dev(device);
1784
1785 return graphics_pipeline_create(dev, pCreateInfo,
1786 (struct nulldrv_pipeline **) pPipeline);
1787}
1788
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001789
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001790
Jon Ashburn0e249962015-07-10 09:41:15 -07001791ICD_EXPORT VkResult VKAPI vkCreateComputePipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001792 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001793 VkPipelineCache pipelineCache,
1794 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001795 const VkComputePipelineCreateInfo* pCreateInfo,
1796 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001797{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001798 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001799 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001800}
1801
David Pinedo0257fbf2015-02-02 18:02:40 -07001802
David Pinedo0257fbf2015-02-02 18:02:40 -07001803
Jon Ashburn0e249962015-07-10 09:41:15 -07001804
David Pinedo0257fbf2015-02-02 18:02:40 -07001805
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001806ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1807 VkDevice device,
1808 const VkQueryPoolCreateInfo* pCreateInfo,
1809 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001810{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001811 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001812 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001813}
1814
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001815ICD_EXPORT void VKAPI vkDestroyQueryPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06001816 VkDevice device,
1817 VkQueryPool queryPoool)
1818{
1819 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001820}
1821
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001822ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001823 VkDevice device,
1824 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001825 uint32_t startQuery,
1826 uint32_t queryCount,
1827 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001828 void* pData,
1829 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001830{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001831 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001832 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001833}
1834
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001835ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1836 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001837{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001838 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001839 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001840}
1841
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001842ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1843 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001844 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001845 const VkCmdBuffer* pCmdBuffers,
1846 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001847{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001848 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001849 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001850}
1851
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001852ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1853 VkDevice device,
1854 const VkSemaphoreCreateInfo* pCreateInfo,
1855 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001856{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001857 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001858 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001859}
1860
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001861ICD_EXPORT void VKAPI vkDestroySemaphore(
Tony Barbourde4124d2015-07-03 10:33:54 -06001862 VkDevice device,
1863 VkSemaphore semaphore)
1864{
1865 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001866}
1867
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001868ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1869 VkQueue queue,
1870 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001871{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001872 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001873 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001874}
1875
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001876ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1877 VkQueue queue,
1878 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001879{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001880 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001881 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001882}
1883
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001884ICD_EXPORT VkResult VKAPI vkCreateSampler(
1885 VkDevice device,
1886 const VkSamplerCreateInfo* pCreateInfo,
1887 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001888{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001889 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001890 struct nulldrv_dev *dev = nulldrv_dev(device);
1891
1892 return nulldrv_sampler_create(dev, pCreateInfo,
1893 (struct nulldrv_sampler **) pSampler);
1894}
1895
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001896ICD_EXPORT void VKAPI vkDestroySampler(
Tony Barbourde4124d2015-07-03 10:33:54 -06001897 VkDevice device,
1898 VkSampler sampler)
1899{
1900 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001901}
1902
Ian Elliotte924ab22015-07-08 13:24:30 -06001903ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
1904 VkDevice device,
1905 const VkShaderModuleCreateInfo* pCreateInfo,
1906 VkShaderModule* pShaderModule)
1907{
1908 // TODO: Fill in with real data
Tony Barbourde4124d2015-07-03 10:33:54 -06001909 NULLDRV_LOG_FUNC;
1910 return VK_SUCCESS;
1911}
1912
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001913ICD_EXPORT void VKAPI vkDestroyShaderModule(
Tony Barbourde4124d2015-07-03 10:33:54 -06001914 VkDevice device,
1915 VkShaderModule shaderModule)
1916{
1917 // TODO: Fill in with real data
1918 NULLDRV_LOG_FUNC;
Ian Elliotte924ab22015-07-08 13:24:30 -06001919}
1920
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001921ICD_EXPORT VkResult VKAPI vkCreateShader(
1922 VkDevice device,
1923 const VkShaderCreateInfo* pCreateInfo,
1924 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001925{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001926 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001927 struct nulldrv_dev *dev = nulldrv_dev(device);
1928
1929 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1930}
1931
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001932ICD_EXPORT void VKAPI vkDestroyShader(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001933 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001934 VkShader shader)
1935{
1936 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001937}
1938
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001939ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1940 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001941 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001942 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001943{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001944 NULLDRV_LOG_FUNC;
1945 struct nulldrv_dev *dev = nulldrv_dev(device);
1946
1947 return nulldrv_buf_view_create(dev, pCreateInfo,
1948 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001949}
1950
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001951ICD_EXPORT void VKAPI vkDestroyBufferView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001952 VkDevice device,
1953 VkBufferView bufferView)
1954{
1955 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001956}
1957
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001958ICD_EXPORT VkResult VKAPI vkCreateImageView(
1959 VkDevice device,
1960 const VkImageViewCreateInfo* pCreateInfo,
1961 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001962{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001963 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001964 struct nulldrv_dev *dev = nulldrv_dev(device);
1965
1966 return nulldrv_img_view_create(dev, pCreateInfo,
1967 (struct nulldrv_img_view **) pView);
1968}
1969
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001970ICD_EXPORT void VKAPI vkDestroyImageView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001971 VkDevice device,
1972 VkImageView imageView)
1973{
1974 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001975}
1976
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001977ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1978 VkDevice device,
1979 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1980 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001981{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001982 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001983 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001984
Chia-I Wu7732cb22015-03-26 15:27:55 +08001985 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001986 (struct nulldrv_desc_layout **) pSetLayout);
1987}
1988
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001989ICD_EXPORT void VKAPI vkDestroyDescriptorSetLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06001990 VkDevice device,
1991 VkDescriptorSetLayout descriptorSetLayout)
1992{
1993 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001994}
1995
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001996ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
1997 VkDevice device,
1998 const VkPipelineLayoutCreateInfo* pCreateInfo,
1999 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08002000{
2001 NULLDRV_LOG_FUNC;
2002 struct nulldrv_dev *dev = nulldrv_dev(device);
2003
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002004 return nulldrv_pipeline_layout_create(dev,
2005 pCreateInfo,
2006 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08002007}
2008
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002009ICD_EXPORT void VKAPI vkDestroyPipelineLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06002010 VkDevice device,
2011 VkPipelineLayout pipelineLayout)
2012{
2013 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002014}
2015
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002016ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002017 VkDevice device,
2018 const VkDescriptorPoolCreateInfo* pCreateInfo,
2019 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002020{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002021 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002022 struct nulldrv_dev *dev = nulldrv_dev(device);
2023
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002024 return nulldrv_desc_pool_create(dev, pCreateInfo,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002025 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002026}
2027
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002028ICD_EXPORT void VKAPI vkDestroyDescriptorPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06002029 VkDevice device,
2030 VkDescriptorPool descriptorPool)
2031{
2032 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002033}
2034
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002035ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002036 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002037 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002038{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002039 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002040 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002041}
2042
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002043ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002044 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002045 VkDescriptorPool descriptorPool,
2046 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002047 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002048 const VkDescriptorSetLayout* pSetLayouts,
Cody Northropc8aa4a52015-08-03 12:47:29 -06002049 VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002050{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002051 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002052 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2053 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002054 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002055 uint32_t i;
2056
2057 for (i = 0; i < count; i++) {
2058 const struct nulldrv_desc_layout *layout =
Tony Barbour8db65372015-07-10 18:32:33 -06002059 nulldrv_desc_layout(pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002060
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002061 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002062 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002063 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002064 break;
2065 }
2066
David Pinedo0257fbf2015-02-02 18:02:40 -07002067 return ret;
2068}
2069
Tony Barbourb857d312015-07-10 10:50:45 -06002070ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
2071 VkDevice device,
2072 VkDescriptorPool descriptorPool,
2073 uint32_t count,
2074 const VkDescriptorSet* pDescriptorSets)
2075{
2076 NULLDRV_LOG_FUNC;
2077 return VK_SUCCESS;
2078}
2079
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002080ICD_EXPORT void VKAPI vkUpdateDescriptorSets(
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002081 VkDevice device,
2082 uint32_t writeCount,
2083 const VkWriteDescriptorSet* pDescriptorWrites,
2084 uint32_t copyCount,
2085 const VkCopyDescriptorSet* pDescriptorCopies)
David Pinedo0257fbf2015-02-02 18:02:40 -07002086{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002087 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002088}
2089
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002090ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2091 VkDevice device,
2092 const VkFramebufferCreateInfo* info,
2093 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002094{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002095 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002096 struct nulldrv_dev *dev = nulldrv_dev(device);
2097
2098 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2099}
2100
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002101ICD_EXPORT void VKAPI vkDestroyFramebuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -06002102 VkDevice device,
2103 VkFramebuffer framebuffer)
2104{
2105 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002106}
David Pinedo0257fbf2015-02-02 18:02:40 -07002107
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002108ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2109 VkDevice device,
2110 const VkRenderPassCreateInfo* info,
2111 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002112{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002113 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002114 struct nulldrv_dev *dev = nulldrv_dev(device);
2115
2116 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2117}
2118
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002119ICD_EXPORT void VKAPI vkDestroyRenderPass(
Tony Barbourde4124d2015-07-03 10:33:54 -06002120 VkDevice device,
2121 VkRenderPass renderPass)
2122{
2123 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002124}
2125
Courtney Goeltzenleuchtera375b622015-07-27 14:04:01 -06002126ICD_EXPORT void VKAPI vkCmdPushConstants(
2127 VkCmdBuffer cmdBuffer,
2128 VkPipelineLayout layout,
2129 VkShaderStageFlags stageFlags,
2130 uint32_t start,
2131 uint32_t length,
2132 const void* values)
2133{
2134 /* TODO: Implement */
2135}
2136
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002137ICD_EXPORT VkResult VKAPI vkGetRenderAreaGranularity(
2138 VkDevice device,
2139 VkRenderPass renderPass,
2140 VkExtent2D* pGranularity)
2141{
2142 pGranularity->height = 1;
2143 pGranularity->width = 1;
2144
2145 return VK_SUCCESS;
2146}
2147
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002148ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Chia-I Wuc278df82015-07-07 11:50:03 +08002149 VkCmdBuffer cmdBuffer,
2150 const VkRenderPassBeginInfo* pRenderPassBegin,
2151 VkRenderPassContents contents)
2152{
2153 NULLDRV_LOG_FUNC;
2154}
2155
2156ICD_EXPORT void VKAPI vkCmdNextSubpass(
2157 VkCmdBuffer cmdBuffer,
2158 VkRenderPassContents contents)
David Pinedo0257fbf2015-02-02 18:02:40 -07002159{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002160 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002161}
2162
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002163ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08002164 VkCmdBuffer cmdBuffer)
2165{
2166 NULLDRV_LOG_FUNC;
2167}
2168
2169ICD_EXPORT void VKAPI vkCmdExecuteCommands(
2170 VkCmdBuffer cmdBuffer,
2171 uint32_t cmdBuffersCount,
2172 const VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -07002173{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002174 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002175}
Ian Elliottf93069f2015-02-19 14:26:19 -07002176
2177ICD_EXPORT void* xcbCreateWindow(
2178 uint16_t width,
2179 uint16_t height)
2180{
2181 static uint32_t window; // Kludge to the max
2182 NULLDRV_LOG_FUNC;
2183 return &window;
2184}
2185
2186// May not be needed, if we stub out stuf in tri.c
2187ICD_EXPORT void xcbDestroyWindow()
2188{
2189 NULLDRV_LOG_FUNC;
2190}
2191
2192ICD_EXPORT int xcbGetMessage(void *msg)
2193{
2194 NULLDRV_LOG_FUNC;
2195 return 0;
2196}
2197
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002198ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002199{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002200 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002201}
David Pinedo07494fd2015-07-24 10:54:41 -06002202
2203ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties(
2204 VkPhysicalDevice physicalDevice,
2205 VkFormat format,
2206 VkImageType type,
2207 VkImageTiling tiling,
2208 VkImageUsageFlags usage,
Courtney Goeltzenleuchter06d94a52015-09-17 11:21:14 -06002209 VkImageCreateFlags flags,
David Pinedo07494fd2015-07-24 10:54:41 -06002210 VkImageFormatProperties* pImageFormatProperties)
2211{
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06002212 return VK_ERROR_INITIALIZATION_FAILED;
David Pinedo07494fd2015-07-24 10:54:41 -06002213}