blob: 12e73649232b4d32f63c7ef951de807ba2c5f448 [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] = {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060043 [NULLDRV_EXT_WSI_X11] = "VK_WSI_X11",
44 [NULLDRV_EXT_WSI_WINDOWS] = "VK_WSI_WINDOWS"
David Pinedo0257fbf2015-02-02 18:02:40 -070045};
46
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060047static struct nulldrv_base *nulldrv_base(VkBaseObject base)
David Pinedo0257fbf2015-02-02 18:02:40 -070048{
49 return (struct nulldrv_base *) base;
50}
51
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060052static VkResult nulldrv_base_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -070053 size_t *size, void *data)
54{
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060055 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -070056 size_t s;
57 uint32_t *count;
58
59 switch (type) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060060 case VK_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -070061 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060062 VkMemoryRequirements *mem_req = data;
63 s = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -070064 *size = s;
65 if (data == NULL)
66 return ret;
67 memset(data, 0, s);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060068 mem_req->memType = VK_MEMORY_TYPE_OTHER;
David Pinedo0257fbf2015-02-02 18:02:40 -070069 break;
70 }
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060071 case VK_INFO_TYPE_MEMORY_ALLOCATION_COUNT:
David Pinedo0257fbf2015-02-02 18:02:40 -070072 *size = sizeof(uint32_t);
73 if (data == NULL)
74 return ret;
75 count = (uint32_t *) data;
76 *count = 1;
77 break;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060078 case VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS:
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060079 s = sizeof(VkImageMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -070080 *size = s;
81 if (data == NULL)
82 return ret;
83 memset(data, 0, s);
84 break;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060085 case VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS:
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060086 s = sizeof(VkBufferMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -070087 *size = s;
88 if (data == NULL)
89 return ret;
90 memset(data, 0, s);
91 break;
92 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060093 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -070094 break;
95 }
96
97 return ret;
98}
99
100static struct nulldrv_base *nulldrv_base_create(struct nulldrv_dev *dev,
101 size_t obj_size,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600102 VK_DBG_OBJECT_TYPE type)
David Pinedo0257fbf2015-02-02 18:02:40 -0700103{
104 struct nulldrv_base *base;
105
106 if (!obj_size)
107 obj_size = sizeof(*base);
108
109 assert(obj_size >= sizeof(*base));
110
Chia-I Wu493a1752015-02-22 14:40:25 +0800111 base = (struct nulldrv_base*)malloc(obj_size);
David Pinedo0257fbf2015-02-02 18:02:40 -0700112 if (!base)
113 return NULL;
114
115 memset(base, 0, obj_size);
116
117 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
118 set_loader_magic_value(base);
119
120 if (dev == NULL) {
121 /*
122 * dev is NULL when we are creating the base device object
123 * Set dev now so that debug setup happens correctly
124 */
125 dev = (struct nulldrv_dev *) base;
126 }
127
128
129 base->get_info = NULL;
130
131 return base;
132}
133
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600134static VkResult nulldrv_gpu_add(int devid, const char *primary_node,
David Pinedo0257fbf2015-02-02 18:02:40 -0700135 const char *render_node, struct nulldrv_gpu **gpu_ret)
136{
137 struct nulldrv_gpu *gpu;
138
Chia-I Wu493a1752015-02-22 14:40:25 +0800139 gpu = malloc(sizeof(*gpu));
David Pinedo0257fbf2015-02-02 18:02:40 -0700140 if (!gpu)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600141 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700142 memset(gpu, 0, sizeof(*gpu));
143
144 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
145 set_loader_magic_value(gpu);
146
147 *gpu_ret = gpu;
148
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600149 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700150}
151
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600152static VkResult nulldrv_queue_create(struct nulldrv_dev *dev,
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700153 uint32_t node_index,
David Pinedo0257fbf2015-02-02 18:02:40 -0700154 struct nulldrv_queue **queue_ret)
155{
156 struct nulldrv_queue *queue;
157
158 queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600159 VK_DBG_OBJECT_QUEUE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700160 if (!queue)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600161 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700162
163 queue->dev = dev;
164
165 *queue_ret = queue;
166
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600167 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700168}
169
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600170static VkResult dev_create_queues(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600171 const VkDeviceQueueCreateInfo *queues,
David Pinedo0257fbf2015-02-02 18:02:40 -0700172 uint32_t count)
173{
174 uint32_t i;
175
176 if (!count)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600177 return VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700178
179 for (i = 0; i < count; i++) {
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600180 const VkDeviceQueueCreateInfo *q = &queues[i];
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600181 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700182
183 if (q->queueCount == 1 && !dev->queues[q->queueNodeIndex]) {
184 ret = nulldrv_queue_create(dev, q->queueNodeIndex,
185 &dev->queues[q->queueNodeIndex]);
186 }
187 else {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600188 ret = VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700189 }
190
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600191 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700192 return ret;
193 }
194 }
195
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600196 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700197}
198
199static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(const struct nulldrv_gpu *gpu,
200 const char *ext)
201{
202 enum nulldrv_ext_type type;
203
204 for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) {
205 if (nulldrv_gpu_exts[type] && strcmp(nulldrv_gpu_exts[type], ext) == 0)
206 break;
207 }
208
209 assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID);
210
211 return type;
212}
213
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600214static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800215 struct nulldrv_desc_ooxx **ooxx_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700216{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800217 struct nulldrv_desc_ooxx *ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700218
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800219 ooxx = malloc(sizeof(*ooxx));
220 if (!ooxx)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600221 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700222
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800223 memset(ooxx, 0, sizeof(*ooxx));
David Pinedo0257fbf2015-02-02 18:02:40 -0700224
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800225 ooxx->surface_desc_size = 0;
226 ooxx->sampler_desc_size = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700227
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800228 *ooxx_ret = ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700229
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600230 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700231}
232
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600233static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600234 const VkDeviceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700235 struct nulldrv_dev **dev_ret)
236{
237 struct nulldrv_dev *dev;
238 uint32_t i;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600239 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -0700240
241 dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600242 VK_DBG_OBJECT_DEVICE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700243 if (!dev)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600244 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700245
246 for (i = 0; i < info->extensionCount; i++) {
247 const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(gpu,
248 info->ppEnabledExtensionNames[i]);
249
250 if (ext == NULLDRV_EXT_INVALID)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600251 return VK_ERROR_INVALID_EXTENSION;
David Pinedo0257fbf2015-02-02 18:02:40 -0700252
253 dev->exts[ext] = true;
254 }
255
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800256 ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600257 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700258 return ret;
259 }
260
261 ret = dev_create_queues(dev, info->pRequestedQueues,
262 info->queueRecordCount);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600263 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700264 return ret;
265 }
266
267 *dev_ret = dev;
268
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600269 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700270}
271
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600272static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalGpu gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700273{
274 return (struct nulldrv_gpu *) gpu;
275}
276
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600277static VkResult nulldrv_rt_view_create(struct nulldrv_dev *dev,
278 const VkColorAttachmentViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700279 struct nulldrv_rt_view **view_ret)
280{
281 struct nulldrv_rt_view *view;
282
283 view = (struct nulldrv_rt_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600284 VK_DBG_OBJECT_COLOR_TARGET_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700285 if (!view)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600286 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700287
288 *view_ret = view;
289
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600290 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700291}
292
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600293static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
294 const VkFenceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700295 struct nulldrv_fence **fence_ret)
296{
297 struct nulldrv_fence *fence;
298
299 fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600300 VK_DBG_OBJECT_FENCE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700301 if (!fence)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600302 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700303
304 *fence_ret = fence;
305
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600306 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700307}
308
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600309static struct nulldrv_dev *nulldrv_dev(VkDevice dev)
David Pinedo0257fbf2015-02-02 18:02:40 -0700310{
311 return (struct nulldrv_dev *) dev;
312}
313
314static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base)
315{
316 return (struct nulldrv_img *) base;
317}
318
319
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600320static VkResult img_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700321 size_t *size, void *data)
322{
323 struct nulldrv_img *img = nulldrv_img_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600324 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700325
326 switch (type) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600327 case VK_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700328 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600329 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700330
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600331 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700332 if (data == NULL)
333 return ret;
334 mem_req->size = img->total_size;
335 mem_req->alignment = 4096;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600336 mem_req->memType = VK_MEMORY_TYPE_IMAGE;
David Pinedo0257fbf2015-02-02 18:02:40 -0700337 }
338 break;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600339 case VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700340 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600341 VkImageMemoryRequirements *img_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700342
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600343 *size = sizeof(VkImageMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700344 if (data == NULL)
345 return ret;
346 img_req->usage = img->usage;
347 img_req->formatClass = img->format_class;
348 img_req->samples = img->samples;
349 }
350 break;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600351 case VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700352 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600353 VkBufferMemoryRequirements *buf_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700354
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600355 *size = sizeof(VkBufferMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700356 if (data == NULL)
357 return ret;
358 buf_req->usage = img->usage;
359 }
360 break;
361 default:
362 ret = nulldrv_base_get_info(base, type, size, data);
363 break;
364 }
365
366 return ret;
367}
368
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600369static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
370 const VkImageCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700371 bool scanout,
372 struct nulldrv_img **img_ret)
373{
374 struct nulldrv_img *img;
375
376 img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600377 VK_DBG_OBJECT_IMAGE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700378 if (!img)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600379 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700380
381 img->type = info->imageType;
382 img->depth = info->extent.depth;
383 img->mip_levels = info->mipLevels;
384 img->array_size = info->arraySize;
385 img->usage = info->usage;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600386 if (info->tiling == VK_LINEAR_TILING)
387 img->format_class = VK_IMAGE_FORMAT_CLASS_LINEAR;
David Pinedo0257fbf2015-02-02 18:02:40 -0700388 else
389 img->format_class = icd_format_get_class(info->format);
390 img->samples = info->samples;
391
392 img->obj.base.get_info = img_get_info;
393
394 *img_ret = img;
395
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600396 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700397}
398
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600399static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700400{
401 return (struct nulldrv_img *) image;
402}
403
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600404static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600405 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700406 struct nulldrv_mem **mem_ret)
407{
408 struct nulldrv_mem *mem;
409
410 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600411 VK_DBG_OBJECT_GPU_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700412 if (!mem)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600413 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700414
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700415 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700416 if (!mem->bo) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600417 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700418 }
419
420 mem->size = info->allocationSize;
421
422 *mem_ret = mem;
423
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600424 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700425}
426
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600427static VkResult nulldrv_ds_view_create(struct nulldrv_dev *dev,
428 const VkDepthStencilViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700429 struct nulldrv_ds_view **view_ret)
430{
431 struct nulldrv_img *img = nulldrv_img(info->image);
432 struct nulldrv_ds_view *view;
433
434 view = (struct nulldrv_ds_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600435 VK_DBG_OBJECT_DEPTH_STENCIL_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700436 if (!view)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600437 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700438
439 view->img = img;
440
441 view->array_size = info->arraySize;
442
443 *view_ret = view;
444
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600445 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700446}
447
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600448static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
449 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700450 struct nulldrv_sampler **sampler_ret)
451{
452 struct nulldrv_sampler *sampler;
453
454 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600455 sizeof(*sampler), VK_DBG_OBJECT_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700456 if (!sampler)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600457 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700458
459 *sampler_ret = sampler;
460
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600461 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700462}
463
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600464static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
465 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700466 struct nulldrv_img_view **view_ret)
467{
468 struct nulldrv_img *img = nulldrv_img(info->image);
469 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700470
471 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600472 VK_DBG_OBJECT_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700473 if (!view)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600474 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700475
476 view->img = img;
477 view->min_lod = info->minLod;
478
David Pinedo0257fbf2015-02-02 18:02:40 -0700479 view->cmd_len = 8;
480
481 *view_ret = view;
482
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600483 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700484}
485
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600486static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700487{
488 return mem->bo;
489}
490
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600491static struct nulldrv_mem *nulldrv_mem(VkGpuMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700492{
493 return (struct nulldrv_mem *) mem;
494}
495
496static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
497{
498 return (struct nulldrv_buf *) base;
499}
500
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600501static VkResult buf_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700502 size_t *size, void *data)
503{
504 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600505 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700506
507 switch (type) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600508 case VK_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700509 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600510 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700511
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600512 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700513 if (data == NULL)
514 return ret;
515
516 mem_req->size = buf->size;
517 mem_req->alignment = 4096;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600518 mem_req->memType = VK_MEMORY_TYPE_BUFFER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700519
520 }
521 break;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600522 case VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700523 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600524 VkBufferMemoryRequirements *buf_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700525
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600526 *size = sizeof(VkBufferMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700527 if (data == NULL)
528 return ret;
529 buf_req->usage = buf->usage;
530 }
531 break;
532 default:
533 ret = nulldrv_base_get_info(base, type, size, data);
534 break;
535 }
536
537 return ret;
538}
539
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600540static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600541 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700542 struct nulldrv_buf **buf_ret)
543{
544 struct nulldrv_buf *buf;
545
546 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600547 VK_DBG_OBJECT_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700548 if (!buf)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600549 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700550
551 buf->size = info->size;
552 buf->usage = info->usage;
553
554 buf->obj.base.get_info = buf_get_info;
555
556 *buf_ret = buf;
557
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600558 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700559}
560
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600561static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
562 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700563 struct nulldrv_desc_layout **layout_ret)
564{
565 struct nulldrv_desc_layout *layout;
566
567 layout = (struct nulldrv_desc_layout *)
568 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600569 VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700570 if (!layout)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600571 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700572
573 *layout_ret = layout;
574
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600575 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700576}
577
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600578static VkResult nulldrv_desc_layout_chain_create(struct nulldrv_dev *dev,
Chia-I Wu7732cb22015-03-26 15:27:55 +0800579 uint32_t setLayoutArrayCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600580 const VkDescriptorSetLayout *pSetLayoutArray,
Chia-I Wu7732cb22015-03-26 15:27:55 +0800581 struct nulldrv_desc_layout_chain **chain_ret)
582{
583 struct nulldrv_desc_layout_chain *chain;
584
585 chain = (struct nulldrv_desc_layout_chain *)
586 nulldrv_base_create(dev, sizeof(*chain),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600587 VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT_CHAIN);
Chia-I Wu7732cb22015-03-26 15:27:55 +0800588 if (!chain)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600589 return VK_ERROR_OUT_OF_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800590
591 *chain_ret = chain;
592
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600593 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800594}
595
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600596static struct nulldrv_desc_layout *nulldrv_desc_layout(VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700597{
598 return (struct nulldrv_desc_layout *) layout;
599}
600
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600601static VkResult shader_create(struct nulldrv_dev *dev,
602 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700603 struct nulldrv_shader **sh_ret)
604{
David Pinedo0257fbf2015-02-02 18:02:40 -0700605 struct nulldrv_shader *sh;
606
607 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600608 VK_DBG_OBJECT_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700609 if (!sh)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600610 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700611
612 *sh_ret = sh;
613
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600614 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700615}
616
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600617static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
618 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700619 struct nulldrv_pipeline **pipeline_ret)
620{
621 struct nulldrv_pipeline *pipeline;
622
623 pipeline = (struct nulldrv_pipeline *)
624 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600625 VK_DBG_OBJECT_GRAPHICS_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700626 if (!pipeline)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600627 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700628
629 *pipeline_ret = pipeline;
630
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600631 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700632}
633
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600634static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev,
635 const VkDynamicVpStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700636 struct nulldrv_dynamic_vp **state_ret)
637{
638 struct nulldrv_dynamic_vp *state;
639
640 state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600641 sizeof(*state), VK_DBG_OBJECT_VIEWPORT_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700642 if (!state)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600643 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700644
645 *state_ret = state;
646
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600647 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700648}
649
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600650static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev,
651 const VkDynamicRsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700652 struct nulldrv_dynamic_rs **state_ret)
653{
654 struct nulldrv_dynamic_rs *state;
655
656 state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600657 sizeof(*state), VK_DBG_OBJECT_RASTER_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700658 if (!state)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600659 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700660
661 *state_ret = state;
662
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600663 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700664}
665
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600666static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev,
667 const VkDynamicCbStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700668 struct nulldrv_dynamic_cb **state_ret)
669{
670 struct nulldrv_dynamic_cb *state;
671
672 state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600673 sizeof(*state), VK_DBG_OBJECT_COLOR_BLEND_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700674 if (!state)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600675 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700676
677 *state_ret = state;
678
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 -0600682static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev,
683 const VkDynamicDsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700684 struct nulldrv_dynamic_ds **state_ret)
685{
686 struct nulldrv_dynamic_ds *state;
687
688 state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600689 sizeof(*state), VK_DBG_OBJECT_DEPTH_STENCIL_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700690 if (!state)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600691 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700692
693 *state_ret = state;
694
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600695 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700696}
697
698
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600699static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
700 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700701 struct nulldrv_cmd **cmd_ret)
702{
David Pinedo0257fbf2015-02-02 18:02:40 -0700703 struct nulldrv_cmd *cmd;
704
David Pinedo0257fbf2015-02-02 18:02:40 -0700705 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600706 VK_DBG_OBJECT_CMD_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700707 if (!cmd)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600708 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700709
710 *cmd_ret = cmd;
711
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600712 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700713}
714
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600715static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
716 VkDescriptorPoolUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700717 uint32_t max_sets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600718 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800719 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700720{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800721 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700722
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800723 pool = (struct nulldrv_desc_pool *)
724 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600725 VK_DBG_OBJECT_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800726 if (!pool)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600727 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700728
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800729 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700730
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800731 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700732
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600733 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700734}
735
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600736static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800737 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600738 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700739 const struct nulldrv_desc_layout *layout,
740 struct nulldrv_desc_set **set_ret)
741{
742 struct nulldrv_desc_set *set;
743
744 set = (struct nulldrv_desc_set *)
745 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600746 VK_DBG_OBJECT_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700747 if (!set)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600748 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700749
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800750 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700751 set->layout = layout;
752 *set_ret = set;
753
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600754 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700755}
756
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600757static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700758{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800759 return (struct nulldrv_desc_pool *) pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700760}
761
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600762static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
763 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700764 struct nulldrv_framebuffer ** fb_ret)
765{
766
767 struct nulldrv_framebuffer *fb;
768 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600769 VK_DBG_OBJECT_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700770 if (!fb)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600771 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700772
773 *fb_ret = fb;
774
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600775 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700776
777}
778
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600779static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
780 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700781 struct nulldrv_render_pass** rp_ret)
782{
783 struct nulldrv_render_pass *rp;
784 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600785 VK_DBG_OBJECT_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700786 if (!rp)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600787 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700788
789 *rp_ret = rp;
790
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600791 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700792}
793
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600794static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700795{
796 return (struct nulldrv_buf *) buf;
797}
798
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600799static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600800 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700801 struct nulldrv_buf_view **view_ret)
802{
803 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
804 struct nulldrv_buf_view *view;
805
806 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600807 VK_DBG_OBJECT_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700808 if (!view)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600809 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700810
811 view->buf = buf;
812
813 *view_ret = view;
814
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600815 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700816}
817
David Pinedo0257fbf2015-02-02 18:02:40 -0700818
819//*********************************************
820// Driver entry points
821//*********************************************
822
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600823ICD_EXPORT VkResult VKAPI vkCreateBuffer(
824 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600825 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600826 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700827{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700828 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700829 struct nulldrv_dev *dev = nulldrv_dev(device);
830
831 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
832}
833
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600834ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
835 VkDevice device,
836 const VkCmdBufferCreateInfo* pCreateInfo,
837 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700838{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700839 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700840 struct nulldrv_dev *dev = nulldrv_dev(device);
841
842 return nulldrv_cmd_create(dev, pCreateInfo,
843 (struct nulldrv_cmd **) pCmdBuffer);
844}
845
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600846ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
847 VkCmdBuffer cmdBuffer,
848 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700849{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700850 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600851 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700852}
853
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600854ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
855 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700856{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700857 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600858 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700859}
860
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600861ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
862 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700863{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700864 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600865 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700866}
867
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600868ICD_EXPORT void VKAPI vkCmdInitAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600869 VkCmdBuffer cmdBuffer,
870 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700871 uint32_t startCounter,
872 uint32_t counterCount,
873 const uint32_t* pData)
874{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700875 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700876}
877
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600878ICD_EXPORT void VKAPI vkCmdLoadAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600879 VkCmdBuffer cmdBuffer,
880 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700881 uint32_t startCounter,
882 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600883 VkBuffer srcBuffer,
884 VkGpuSize srcOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700885{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700886 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700887}
888
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600889ICD_EXPORT void VKAPI vkCmdSaveAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600890 VkCmdBuffer cmdBuffer,
891 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700892 uint32_t startCounter,
893 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600894 VkBuffer destBuffer,
895 VkGpuSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700896{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700897 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700898}
899
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600900ICD_EXPORT void VKAPI vkCmdDbgMarkerBegin(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600901 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700902 const char* pMarker)
903{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700904 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700905}
906
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600907ICD_EXPORT void VKAPI vkCmdDbgMarkerEnd(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600908 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700909{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700910 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700911}
912
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600913ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600914 VkCmdBuffer cmdBuffer,
915 VkBuffer srcBuffer,
916 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700917 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600918 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700919{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700920 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700921}
922
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600923ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600924 VkCmdBuffer cmdBuffer,
925 VkImage srcImage,
926 VkImageLayout srcImageLayout,
927 VkImage destImage,
928 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700929 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600930 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700931{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700932 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700933}
934
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600935ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600936 VkCmdBuffer cmdBuffer,
937 VkImage srcImage,
938 VkImageLayout srcImageLayout,
939 VkImage destImage,
940 VkImageLayout destImageLayout,
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600941 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600942 const VkImageBlit* pRegions)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600943{
944 NULLDRV_LOG_FUNC;
945}
946
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600947ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600948 VkCmdBuffer cmdBuffer,
949 VkBuffer srcBuffer,
950 VkImage destImage,
951 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700952 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600953 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700954{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700955 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700956}
957
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600958ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600959 VkCmdBuffer cmdBuffer,
960 VkImage srcImage,
961 VkImageLayout srcImageLayout,
962 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700963 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600964 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700965{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700966 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700967}
968
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600969ICD_EXPORT void VKAPI vkCmdCloneImageData(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600970 VkCmdBuffer cmdBuffer,
971 VkImage srcImage,
972 VkImageLayout srcImageLayout,
973 VkImage destImage,
974 VkImageLayout destImageLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700975{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700976 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700977}
978
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600979ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600980 VkCmdBuffer cmdBuffer,
981 VkBuffer destBuffer,
982 VkGpuSize destOffset,
983 VkGpuSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700984 const uint32_t* pData)
985{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700986 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700987}
988
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600989ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600990 VkCmdBuffer cmdBuffer,
991 VkBuffer destBuffer,
992 VkGpuSize destOffset,
993 VkGpuSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700994 uint32_t data)
995{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700996 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700997}
998
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600999ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001000 VkCmdBuffer cmdBuffer,
1001 VkImage image,
1002 VkImageLayout imageLayout,
1003 VkClearColor color,
David Pinedo0257fbf2015-02-02 18:02:40 -07001004 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001005 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001006{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001007 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001008}
1009
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001010ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001011 VkCmdBuffer cmdBuffer,
1012 VkImage image,
1013 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001014 float depth,
1015 uint32_t stencil,
1016 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001017 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001018{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001019 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001020}
1021
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001022ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001023 VkCmdBuffer cmdBuffer,
1024 VkImage srcImage,
1025 VkImageLayout srcImageLayout,
1026 VkImage destImage,
1027 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001028 uint32_t rectCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001029 const VkImageResolve* pRects)
David Pinedo0257fbf2015-02-02 18:02:40 -07001030{
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 vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001035 VkCmdBuffer cmdBuffer,
1036 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001037 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001038 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001039{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001040 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001041}
1042
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001043ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001044 VkCmdBuffer cmdBuffer,
1045 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001046 uint32_t slot)
1047{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001048 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001049}
1050
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001051ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001052 VkCmdBuffer cmdBuffer,
1053 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001054 uint32_t startQuery,
1055 uint32_t queryCount)
1056{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001057 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001058}
1059
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001060ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001061 VkCmdBuffer cmdBuffer,
1062 VkEvent event_,
1063 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001064{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001065 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001066}
1067
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001068ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001069 VkCmdBuffer cmdBuffer,
1070 VkEvent event_,
1071 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001072{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001073 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001074}
1075
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001076ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001077 VkCmdBuffer cmdBuffer,
1078 VkTimestampType timestampType,
1079 VkBuffer destBuffer,
1080 VkGpuSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001081{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001082 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001083}
1084
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001085ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001086 VkCmdBuffer cmdBuffer,
1087 VkPipelineBindPoint pipelineBindPoint,
1088 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001089{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001090 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001091}
1092
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001093ICD_EXPORT void VKAPI vkCmdBindDynamicStateObject(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001094 VkCmdBuffer cmdBuffer,
1095 VkStateBindPoint stateBindPoint,
1096 VkDynamicStateObject state)
David Pinedo0257fbf2015-02-02 18:02:40 -07001097{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001098 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001099}
1100
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001101ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001102 VkCmdBuffer cmdBuffer,
1103 VkPipelineBindPoint pipelineBindPoint,
1104 VkDescriptorSetLayoutChain layoutChain,
Chia-I Wu862c5572015-03-28 15:23:55 +08001105 uint32_t layoutChainSlot,
1106 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001107 const VkDescriptorSet* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07001108 const uint32_t* pUserData)
1109{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001110 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001111}
1112
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001113ICD_EXPORT void VKAPI vkCmdBindVertexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001114 VkCmdBuffer cmdBuffer,
1115 VkBuffer buffer,
1116 VkGpuSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001117 uint32_t binding)
1118{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001119 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001120}
1121
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001122ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001123 VkCmdBuffer cmdBuffer,
1124 VkBuffer buffer,
1125 VkGpuSize offset,
1126 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001127{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001128 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001129}
1130
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001131ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001132 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001133 uint32_t firstVertex,
1134 uint32_t vertexCount,
1135 uint32_t firstInstance,
1136 uint32_t instanceCount)
1137{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001138 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001139}
1140
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001141ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001142 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001143 uint32_t firstIndex,
1144 uint32_t indexCount,
1145 int32_t vertexOffset,
1146 uint32_t firstInstance,
1147 uint32_t instanceCount)
1148{
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 vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001153 VkCmdBuffer cmdBuffer,
1154 VkBuffer buffer,
1155 VkGpuSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001156 uint32_t count,
1157 uint32_t stride)
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 vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001163 VkCmdBuffer cmdBuffer,
1164 VkBuffer buffer,
1165 VkGpuSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001166 uint32_t count,
1167 uint32_t stride)
1168{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001169 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001170}
1171
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001172ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001173 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001174 uint32_t x,
1175 uint32_t y,
1176 uint32_t z)
1177{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001178 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001179}
1180
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001181ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001182 VkCmdBuffer cmdBuffer,
1183 VkBuffer buffer,
1184 VkGpuSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001185{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001186 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001187}
1188
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001189ICD_EXPORT void VKAPI vkCmdWaitEvents(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001190 VkCmdBuffer cmdBuffer,
1191 const VkEventWaitInfo* pWaitInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001192{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001193 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001194}
1195
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001196ICD_EXPORT void VKAPI vkCmdPipelineBarrier(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001197 VkCmdBuffer cmdBuffer,
1198 const VkPipelineBarrier* pBarrier)
David Pinedo0257fbf2015-02-02 18:02:40 -07001199{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001200 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001201}
1202
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001203ICD_EXPORT VkResult VKAPI vkCreateDevice(
1204 VkPhysicalGpu gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001205 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001206 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001207{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001208 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001209 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1210 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1211}
1212
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001213ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1214 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001215{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001216 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001217 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001218}
1219
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001220ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1221 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001222 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001223 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001224 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001225{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001226 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001227 struct nulldrv_dev *dev = nulldrv_dev(device);
1228 *pQueue = dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001229 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001230}
1231
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001232ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1233 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001234{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001235 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001236 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001237}
1238
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001239ICD_EXPORT VkResult VKAPI vkDbgSetValidationLevel(
1240 VkDevice device,
1241 VkValidationLevel validationLevel)
David Pinedo0257fbf2015-02-02 18:02:40 -07001242{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001243 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001244 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001245}
1246
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001247ICD_EXPORT VkResult VKAPI vkDbgSetMessageFilter(
1248 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001249 int32_t msgCode,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001250 VK_DBG_MSG_FILTER filter)
David Pinedo0257fbf2015-02-02 18:02:40 -07001251{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001252 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001253 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001254}
1255
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001256ICD_EXPORT VkResult VKAPI vkDbgSetDeviceOption(
1257 VkDevice device,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001258 VK_DBG_DEVICE_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001259 size_t dataSize,
1260 const void* pData)
1261{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001262 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001263 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001264}
1265
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001266ICD_EXPORT VkResult VKAPI vkCreateEvent(
1267 VkDevice device,
1268 const VkEventCreateInfo* pCreateInfo,
1269 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001270{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001271 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001272 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001273}
1274
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001275ICD_EXPORT VkResult VKAPI vkGetEventStatus(
1276 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001277{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001278 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001279 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001280}
1281
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001282ICD_EXPORT VkResult VKAPI vkSetEvent(
1283 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001284{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001285 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001286 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001287}
1288
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001289ICD_EXPORT VkResult VKAPI vkResetEvent(
1290 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001291{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001292 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001293 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001294}
1295
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001296ICD_EXPORT VkResult VKAPI vkCreateFence(
1297 VkDevice device,
1298 const VkFenceCreateInfo* pCreateInfo,
1299 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001300{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001301 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001302 struct nulldrv_dev *dev = nulldrv_dev(device);
1303
1304 return nulldrv_fence_create(dev, pCreateInfo,
1305 (struct nulldrv_fence **) pFence);
1306}
1307
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001308ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
1309 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001310{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001311 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001312 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001313}
1314
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001315ICD_EXPORT VkResult VKAPI vkResetFences(
1316 VkDevice device,
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001317 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001318 VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001319{
1320 NULLDRV_LOG_FUNC;
1321 return VK_SUCCESS;
1322}
1323
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001324ICD_EXPORT VkResult VKAPI vkWaitForFences(
1325 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001326 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001327 const VkFence* pFences,
David Pinedo0257fbf2015-02-02 18:02:40 -07001328 bool32_t waitAll,
1329 uint64_t timeout)
1330{
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 vkGetFormatInfo(
1336 VkDevice device,
1337 VkFormat format,
1338 VkFormatInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001339 size_t* pDataSize,
1340 void* pData)
1341{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001342 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001343 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001344}
1345
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001346ICD_EXPORT VkResult VKAPI vkGetGpuInfo(
1347 VkPhysicalGpu gpu_,
1348 VkPhysicalGpuInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001349 size_t* pDataSize,
1350 void* pData)
1351{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001352 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001353 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001354}
1355
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001356ICD_EXPORT VkResult VKAPI vkGetExtensionSupport(
1357 VkPhysicalGpu gpu_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001358 const char* pExtName)
1359{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001360 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001361 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001362}
1363
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001364ICD_EXPORT VkResult VKAPI vkGetMultiGpuCompatibility(
1365 VkPhysicalGpu gpu0_,
1366 VkPhysicalGpu gpu1_,
1367 VkGpuCompatibilityInfo* pInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001368{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001369 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001370 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001371}
1372
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001373ICD_EXPORT VkResult VKAPI vkOpenPeerImage(
1374 VkDevice device,
1375 const VkPeerImageOpenInfo* pOpenInfo,
1376 VkImage* pImage,
1377 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001378{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001379 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001380 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001381}
1382
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001383ICD_EXPORT VkResult VKAPI vkCreateImage(
1384 VkDevice device,
1385 const VkImageCreateInfo* pCreateInfo,
1386 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001387{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001388 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001389 struct nulldrv_dev *dev = nulldrv_dev(device);
1390
1391 return nulldrv_img_create(dev, pCreateInfo, false,
1392 (struct nulldrv_img **) pImage);
1393}
1394
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001395ICD_EXPORT VkResult VKAPI vkGetImageSubresourceInfo(
1396 VkImage image,
1397 const VkImageSubresource* pSubresource,
1398 VkSubresourceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001399 size_t* pDataSize,
1400 void* pData)
1401{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001402 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001403 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001404
1405 switch (infoType) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001406 case VK_INFO_TYPE_SUBRESOURCE_LAYOUT:
David Pinedo0257fbf2015-02-02 18:02:40 -07001407 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001408 VkSubresourceLayout *layout = (VkSubresourceLayout *) pData;
David Pinedo0257fbf2015-02-02 18:02:40 -07001409
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001410 *pDataSize = sizeof(VkSubresourceLayout);
David Pinedo0257fbf2015-02-02 18:02:40 -07001411
1412 if (pData == NULL)
1413 return ret;
1414 layout->offset = 0;
1415 layout->size = 1;
1416 layout->rowPitch = 4;
1417 layout->depthPitch = 4;
1418 }
1419 break;
1420 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001421 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -07001422 break;
1423 }
1424
1425 return ret;
1426}
1427
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001428ICD_EXPORT VkResult VKAPI vkAllocMemory(
1429 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001430 const VkMemoryAllocInfo* pAllocInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001431 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001432{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001433 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001434 struct nulldrv_dev *dev = nulldrv_dev(device);
1435
1436 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1437}
1438
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001439ICD_EXPORT VkResult VKAPI vkFreeMemory(
1440 VkGpuMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001441{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001442 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001443 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001444}
1445
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001446ICD_EXPORT VkResult VKAPI vkSetMemoryPriority(
1447 VkGpuMemory mem_,
1448 VkMemoryPriority priority)
David Pinedo0257fbf2015-02-02 18:02:40 -07001449{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001450 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001451 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001452}
1453
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001454ICD_EXPORT VkResult VKAPI vkMapMemory(
1455 VkGpuMemory mem_,
1456 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001457 void** ppData)
1458{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001459 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001460 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1461 void *ptr = nulldrv_mem_map(mem, flags);
1462
1463 *ppData = ptr;
1464
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001465 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001466}
1467
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001468ICD_EXPORT VkResult VKAPI vkUnmapMemory(
1469 VkGpuMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001470{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001471 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001472 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001473}
1474
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001475ICD_EXPORT VkResult VKAPI vkPinSystemMemory(
1476 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001477 const void* pSysMem,
1478 size_t memSize,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001479 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001480{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001481 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001482 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001483}
1484
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001485ICD_EXPORT VkResult VKAPI vkOpenSharedMemory(
1486 VkDevice device,
1487 const VkMemoryOpenInfo* pOpenInfo,
1488 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001489{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001490 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001491 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001492}
1493
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001494ICD_EXPORT VkResult VKAPI vkOpenPeerMemory(
1495 VkDevice device,
1496 const VkPeerMemoryOpenInfo* pOpenInfo,
1497 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001498{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001499 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001500 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001501}
1502
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001503ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001504 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001505 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001506{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001507 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001508 struct nulldrv_instance *inst;
1509
1510 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001511 VK_DBG_OBJECT_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001512 if (!inst)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001513 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001514
1515 inst->obj.base.get_info = NULL;
1516
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001517 *pInstance = (VkInstance*)inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001518
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001519 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001520}
1521
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001522ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1523 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001524{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001525 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001526 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001527}
1528
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001529ICD_EXPORT VkResult VKAPI vkEnumerateGpus(
1530 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001531 uint32_t maxGpus,
1532 uint32_t* pGpuCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001533 VkPhysicalGpu* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001534{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001535 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001536 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001537 struct nulldrv_gpu *gpu;
1538 *pGpuCount = 1;
1539 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001540 if (ret == VK_SUCCESS)
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001541 pGpus[0] = (VkPhysicalGpu) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001542 return ret;
1543}
1544
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001545ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
1546 VkPhysicalGpu gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001547 size_t maxLayerCount,
1548 size_t maxStringSize,
1549 size_t* pOutLayerCount,
1550 char* const* pOutLayers,
1551 void* pReserved)
1552{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001553 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001554 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001555}
1556
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001557ICD_EXPORT VkResult VKAPI vkDbgRegisterMsgCallback(
1558 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001559 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback,
David Pinedo0257fbf2015-02-02 18:02:40 -07001560 void* pUserData)
1561{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001562 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001563 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001564}
1565
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001566ICD_EXPORT VkResult VKAPI vkDbgUnregisterMsgCallback(
1567 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001568 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
David Pinedo0257fbf2015-02-02 18:02:40 -07001569{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001570 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001571 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001572}
1573
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001574ICD_EXPORT VkResult VKAPI vkDbgSetGlobalOption(
1575 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001576 VK_DBG_GLOBAL_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001577 size_t dataSize,
1578 const void* pData)
1579{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001580 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001581 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001582}
1583
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001584ICD_EXPORT VkResult VKAPI vkDestroyObject(
1585 VkObject object)
David Pinedo0257fbf2015-02-02 18:02:40 -07001586{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001587 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001588 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001589}
1590
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001591ICD_EXPORT VkResult VKAPI vkGetObjectInfo(
1592 VkBaseObject object,
1593 VkObjectInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001594 size_t* pDataSize,
1595 void* pData)
1596{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001597 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001598 struct nulldrv_base *base = nulldrv_base(object);
1599
1600 return base->get_info(base, infoType, pDataSize, pData);
1601}
1602
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001603ICD_EXPORT VkResult VKAPI vkBindObjectMemory(
1604 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001605 uint32_t allocationIdx,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001606 VkGpuMemory mem_,
1607 VkGpuSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001608{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001609 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001610 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001611}
1612
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001613ICD_EXPORT VkResult VKAPI vkBindObjectMemoryRange(
1614 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001615 uint32_t allocationIdx,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001616 VkGpuSize rangeOffset,
1617 VkGpuSize rangeSize,
1618 VkGpuMemory mem,
1619 VkGpuSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001620{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001621 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001622 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001623}
1624
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001625ICD_EXPORT VkResult VKAPI vkBindImageMemoryRange(
1626 VkImage image,
David Pinedo0257fbf2015-02-02 18:02:40 -07001627 uint32_t allocationIdx,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001628 const VkImageMemoryBindInfo* bindInfo,
1629 VkGpuMemory mem,
1630 VkGpuSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001631{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001632 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001633 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001634}
1635
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001636ICD_EXPORT VkResult VKAPI vkDbgSetObjectTag(
1637 VkBaseObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001638 size_t tagSize,
1639 const void* pTag)
1640{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001641 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001642 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001643}
1644
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001645ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(
1646 VkDevice device,
1647 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1648 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001649{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001650 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001651 struct nulldrv_dev *dev = nulldrv_dev(device);
1652
1653 return graphics_pipeline_create(dev, pCreateInfo,
1654 (struct nulldrv_pipeline **) pPipeline);
1655}
1656
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001657ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative(
1658 VkDevice device,
1659 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1660 VkPipeline basePipeline,
1661 VkPipeline* pPipeline)
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001662{
1663 NULLDRV_LOG_FUNC;
1664 struct nulldrv_dev *dev = nulldrv_dev(device);
1665
1666 return graphics_pipeline_create(dev, pCreateInfo,
1667 (struct nulldrv_pipeline **) pPipeline);
1668}
1669
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001670ICD_EXPORT VkResult VKAPI vkCreateComputePipeline(
1671 VkDevice device,
1672 const VkComputePipelineCreateInfo* pCreateInfo,
1673 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001674{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001675 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001676 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001677}
1678
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001679ICD_EXPORT VkResult VKAPI vkStorePipeline(
1680 VkPipeline pipeline,
David Pinedo0257fbf2015-02-02 18:02:40 -07001681 size_t* pDataSize,
1682 void* pData)
1683{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001684 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001685 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001686}
1687
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001688ICD_EXPORT VkResult VKAPI vkLoadPipeline(
1689 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001690 size_t dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001691 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001692 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001693{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001694 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001695 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001696}
1697
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001698ICD_EXPORT VkResult VKAPI vkLoadPipelineDerivative(
1699 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001700 size_t dataSize,
1701 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001702 VkPipeline basePipeline,
1703 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001704{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001705 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001706 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001707}
1708
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001709ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1710 VkDevice device,
1711 const VkQueryPoolCreateInfo* pCreateInfo,
1712 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001713{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001714 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001715 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001716}
1717
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001718ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
1719 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001720 uint32_t startQuery,
1721 uint32_t queryCount,
1722 size_t* pDataSize,
1723 void* pData)
1724{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001725 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001726 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001727}
1728
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001729ICD_EXPORT VkResult VKAPI vkQueueAddMemReference(
1730 VkQueue queue,
1731 VkGpuMemory mem)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001732{
1733 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001734 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001735}
1736
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001737ICD_EXPORT VkResult VKAPI vkQueueRemoveMemReference(
1738 VkQueue queue,
1739 VkGpuMemory mem)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001740{
1741 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001742 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001743}
1744
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001745ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1746 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001747{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001748 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001749 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001750}
1751
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001752ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1753 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001754 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001755 const VkCmdBuffer* pCmdBuffers,
1756 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001757{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001758 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001759 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001760}
1761
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001762ICD_EXPORT VkResult VKAPI vkOpenSharedSemaphore(
1763 VkDevice device,
1764 const VkSemaphoreOpenInfo* pOpenInfo,
1765 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001766{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001767 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001768 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001769}
1770
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001771ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1772 VkDevice device,
1773 const VkSemaphoreCreateInfo* pCreateInfo,
1774 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001775{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001776 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001777 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001778}
1779
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001780ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1781 VkQueue queue,
1782 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001783{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001784 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001785 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001786}
1787
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001788ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1789 VkQueue queue,
1790 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001791{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001792 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001793 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001794}
1795
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001796ICD_EXPORT VkResult VKAPI vkCreateSampler(
1797 VkDevice device,
1798 const VkSamplerCreateInfo* pCreateInfo,
1799 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001800{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001801 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001802 struct nulldrv_dev *dev = nulldrv_dev(device);
1803
1804 return nulldrv_sampler_create(dev, pCreateInfo,
1805 (struct nulldrv_sampler **) pSampler);
1806}
1807
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001808ICD_EXPORT VkResult VKAPI vkCreateShader(
1809 VkDevice device,
1810 const VkShaderCreateInfo* pCreateInfo,
1811 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001812{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001813 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001814 struct nulldrv_dev *dev = nulldrv_dev(device);
1815
1816 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1817}
1818
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001819ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
1820 VkDevice device,
1821 const VkDynamicVpStateCreateInfo* pCreateInfo,
1822 VkDynamicVpStateObject* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001823{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001824 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001825 struct nulldrv_dev *dev = nulldrv_dev(device);
1826
1827 return nulldrv_viewport_state_create(dev, pCreateInfo,
1828 (struct nulldrv_dynamic_vp **) pState);
1829}
1830
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001831ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
1832 VkDevice device,
1833 const VkDynamicRsStateCreateInfo* pCreateInfo,
1834 VkDynamicRsStateObject* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001835{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001836 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001837 struct nulldrv_dev *dev = nulldrv_dev(device);
1838
1839 return nulldrv_raster_state_create(dev, pCreateInfo,
1840 (struct nulldrv_dynamic_rs **) pState);
1841}
1842
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001843ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
1844 VkDevice device,
1845 const VkDynamicCbStateCreateInfo* pCreateInfo,
1846 VkDynamicCbStateObject* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001847{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001848 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001849 struct nulldrv_dev *dev = nulldrv_dev(device);
1850
1851 return nulldrv_blend_state_create(dev, pCreateInfo,
1852 (struct nulldrv_dynamic_cb **) pState);
1853}
1854
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001855ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
1856 VkDevice device,
1857 const VkDynamicDsStateCreateInfo* pCreateInfo,
1858 VkDynamicDsStateObject* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001859{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001860 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001861 struct nulldrv_dev *dev = nulldrv_dev(device);
1862
1863 return nulldrv_ds_state_create(dev, pCreateInfo,
1864 (struct nulldrv_dynamic_ds **) pState);
1865}
1866
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001867ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1868 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001869 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001870 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001871{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001872 NULLDRV_LOG_FUNC;
1873 struct nulldrv_dev *dev = nulldrv_dev(device);
1874
1875 return nulldrv_buf_view_create(dev, pCreateInfo,
1876 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001877}
1878
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001879ICD_EXPORT VkResult VKAPI vkCreateImageView(
1880 VkDevice device,
1881 const VkImageViewCreateInfo* pCreateInfo,
1882 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001883{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001884 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001885 struct nulldrv_dev *dev = nulldrv_dev(device);
1886
1887 return nulldrv_img_view_create(dev, pCreateInfo,
1888 (struct nulldrv_img_view **) pView);
1889}
1890
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001891ICD_EXPORT VkResult VKAPI vkCreateColorAttachmentView(
1892 VkDevice device,
1893 const VkColorAttachmentViewCreateInfo* pCreateInfo,
1894 VkColorAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001895{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001896 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001897 struct nulldrv_dev *dev = nulldrv_dev(device);
1898
1899 return nulldrv_rt_view_create(dev, pCreateInfo,
1900 (struct nulldrv_rt_view **) pView);
1901}
1902
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001903ICD_EXPORT VkResult VKAPI vkCreateDepthStencilView(
1904 VkDevice device,
1905 const VkDepthStencilViewCreateInfo* pCreateInfo,
1906 VkDepthStencilView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001907{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001908 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001909 struct nulldrv_dev *dev = nulldrv_dev(device);
1910
1911 return nulldrv_ds_view_create(dev, pCreateInfo,
1912 (struct nulldrv_ds_view **) pView);
1913
1914}
1915
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001916ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1917 VkDevice device,
1918 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1919 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001920{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001921 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001922 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001923
Chia-I Wu7732cb22015-03-26 15:27:55 +08001924 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001925 (struct nulldrv_desc_layout **) pSetLayout);
1926}
1927
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001928ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayoutChain(
1929 VkDevice device,
Chia-I Wu7732cb22015-03-26 15:27:55 +08001930 uint32_t setLayoutArrayCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001931 const VkDescriptorSetLayout* pSetLayoutArray,
1932 VkDescriptorSetLayoutChain* pLayoutChain)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001933{
1934 NULLDRV_LOG_FUNC;
1935 struct nulldrv_dev *dev = nulldrv_dev(device);
1936
1937 return nulldrv_desc_layout_chain_create(dev,
1938 setLayoutArrayCount, pSetLayoutArray,
1939 (struct nulldrv_desc_layout_chain **) pLayoutChain);
1940}
1941
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001942ICD_EXPORT VkResult VKAPI vkBeginDescriptorPoolUpdate(
1943 VkDevice device,
1944 VkDescriptorUpdateMode updateMode)
David Pinedo0257fbf2015-02-02 18:02:40 -07001945{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001946 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001947 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001948}
1949
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001950ICD_EXPORT VkResult VKAPI vkEndDescriptorPoolUpdate(
1951 VkDevice device,
1952 VkCmdBuffer cmd_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001953{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001954 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001955 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001956}
1957
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001958ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
1959 VkDevice device,
1960 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07001961 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001962 const VkDescriptorPoolCreateInfo* pCreateInfo,
1963 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001964{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001965 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001966 struct nulldrv_dev *dev = nulldrv_dev(device);
1967
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08001968 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
1969 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07001970}
1971
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001972ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
1973 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001974{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001975 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001976 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001977}
1978
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001979ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
1980 VkDescriptorPool descriptorPool,
1981 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07001982 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001983 const VkDescriptorSetLayout* pSetLayouts,
1984 VkDescriptorSet* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07001985 uint32_t* pCount)
1986{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001987 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08001988 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
1989 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001990 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001991 uint32_t i;
1992
1993 for (i = 0; i < count; i++) {
1994 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001995 nulldrv_desc_layout((VkDescriptorSetLayout) pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07001996
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08001997 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001998 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001999 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002000 break;
2001 }
2002
2003 if (pCount)
2004 *pCount = i;
2005
2006 return ret;
2007}
2008
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002009ICD_EXPORT void VKAPI vkClearDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002010 VkDescriptorPool descriptorPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07002011 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002012 const VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002013{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002014 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002015}
2016
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002017ICD_EXPORT void VKAPI vkUpdateDescriptors(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002018 VkDescriptorSet descriptorSet,
Chia-I Wu7732cb22015-03-26 15:27:55 +08002019 uint32_t updateCount,
2020 const void** ppUpdateArray)
David Pinedo0257fbf2015-02-02 18:02:40 -07002021{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002022 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002023}
2024
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002025ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2026 VkDevice device,
2027 const VkFramebufferCreateInfo* info,
2028 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002029{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002030 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002031 struct nulldrv_dev *dev = nulldrv_dev(device);
2032
2033 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2034}
2035
2036
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002037ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2038 VkDevice device,
2039 const VkRenderPassCreateInfo* info,
2040 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002041{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002042 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002043 struct nulldrv_dev *dev = nulldrv_dev(device);
2044
2045 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2046}
2047
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002048ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002049 VkCmdBuffer cmdBuffer,
2050 const VkRenderPassBegin* pRenderPassBegin)
David Pinedo0257fbf2015-02-02 18:02:40 -07002051{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002052 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002053}
2054
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002055ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002056 VkCmdBuffer cmdBuffer,
2057 VkRenderPass renderPass)
David Pinedo0257fbf2015-02-02 18:02:40 -07002058{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002059 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002060}
Ian Elliottf93069f2015-02-19 14:26:19 -07002061
2062ICD_EXPORT void* xcbCreateWindow(
2063 uint16_t width,
2064 uint16_t height)
2065{
2066 static uint32_t window; // Kludge to the max
2067 NULLDRV_LOG_FUNC;
2068 return &window;
2069}
2070
2071// May not be needed, if we stub out stuf in tri.c
2072ICD_EXPORT void xcbDestroyWindow()
2073{
2074 NULLDRV_LOG_FUNC;
2075}
2076
2077ICD_EXPORT int xcbGetMessage(void *msg)
2078{
2079 NULLDRV_LOG_FUNC;
2080 return 0;
2081}
2082
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002083ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002084{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002085 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002086}