blob: d7902d19b4a1329e91ccb02bf80a862945da8bca [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] = {
Jon Ashburncedc15f2015-05-21 18:13:33 -060043 [NULLDRV_EXT_WSI_LUNARG] = VK_WSI_LUNARG_EXTENSION_NAME,
David Pinedo0257fbf2015-02-02 18:02:40 -070044};
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -060045static const VkExtensionProperties intel_gpu_exts[NULLDRV_EXT_COUNT] = {
46 {
47 .sType = VK_STRUCTURE_TYPE_EXTENSION_PROPERTIES,
48 .name = VK_WSI_LUNARG_EXTENSION_NAME,
49 .version = VK_WSI_LUNARG_REVISION,
50 .description = "Null driver",
51 }
52};
David Pinedo0257fbf2015-02-02 18:02:40 -070053
Mike Stroyan230e6252015-04-17 12:36:38 -060054static struct nulldrv_base *nulldrv_base(VkObject base)
David Pinedo0257fbf2015-02-02 18:02:40 -070055{
56 return (struct nulldrv_base *) base;
57}
58
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060059static VkResult nulldrv_base_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -070060 size_t *size, void *data)
61{
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060062 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -070063 size_t s;
David Pinedo0257fbf2015-02-02 18:02:40 -070064
65 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -060066 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -070067 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060068 s = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -070069 *size = s;
70 if (data == NULL)
71 return ret;
72 memset(data, 0, s);
David Pinedo0257fbf2015-02-02 18:02:40 -070073 break;
74 }
David Pinedo0257fbf2015-02-02 18:02:40 -070075 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060076 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -070077 break;
78 }
79
80 return ret;
81}
82
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060083static struct nulldrv_base *nulldrv_base_create(
84 struct nulldrv_dev *dev,
85 size_t obj_size,
86 VkObjectType type)
David Pinedo0257fbf2015-02-02 18:02:40 -070087{
88 struct nulldrv_base *base;
89
90 if (!obj_size)
91 obj_size = sizeof(*base);
92
93 assert(obj_size >= sizeof(*base));
94
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060095 base = (struct nulldrv_base*)malloc(obj_size);
David Pinedo0257fbf2015-02-02 18:02:40 -070096 if (!base)
97 return NULL;
98
99 memset(base, 0, obj_size);
100
101 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
Tony Barbour11e76ac2015-04-20 16:28:46 -0600102 set_loader_magic_value((VkObject) base);
David Pinedo0257fbf2015-02-02 18:02:40 -0700103
104 if (dev == NULL) {
105 /*
106 * dev is NULL when we are creating the base device object
107 * Set dev now so that debug setup happens correctly
108 */
109 dev = (struct nulldrv_dev *) base;
110 }
111
112
113 base->get_info = NULL;
114
115 return base;
116}
117
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600118static VkResult nulldrv_gpu_add(int devid, const char *primary_node,
David Pinedo0257fbf2015-02-02 18:02:40 -0700119 const char *render_node, struct nulldrv_gpu **gpu_ret)
120{
121 struct nulldrv_gpu *gpu;
122
Chia-I Wu493a1752015-02-22 14:40:25 +0800123 gpu = malloc(sizeof(*gpu));
David Pinedo0257fbf2015-02-02 18:02:40 -0700124 if (!gpu)
Tony Barbour8205d902015-04-16 15:59:00 -0600125 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700126 memset(gpu, 0, sizeof(*gpu));
Mark Lobodzinski97dcd042015-04-16 08:52:00 -0500127
David Pinedo0257fbf2015-02-02 18:02:40 -0700128 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
Tony Barbour11e76ac2015-04-20 16:28:46 -0600129 set_loader_magic_value((VkObject) gpu);
David Pinedo0257fbf2015-02-02 18:02:40 -0700130
131 *gpu_ret = gpu;
132
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600133 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700134}
135
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600136static VkResult nulldrv_queue_create(struct nulldrv_dev *dev,
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700137 uint32_t node_index,
David Pinedo0257fbf2015-02-02 18:02:40 -0700138 struct nulldrv_queue **queue_ret)
139{
140 struct nulldrv_queue *queue;
141
142 queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600143 VK_OBJECT_TYPE_QUEUE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700144 if (!queue)
Tony Barbour8205d902015-04-16 15:59:00 -0600145 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700146
147 queue->dev = dev;
148
149 *queue_ret = queue;
150
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600151 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700152}
153
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600154static VkResult dev_create_queues(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600155 const VkDeviceQueueCreateInfo *queues,
David Pinedo0257fbf2015-02-02 18:02:40 -0700156 uint32_t count)
157{
158 uint32_t i;
159
160 if (!count)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600161 return VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700162
163 for (i = 0; i < count; i++) {
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600164 const VkDeviceQueueCreateInfo *q = &queues[i];
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600165 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700166
167 if (q->queueCount == 1 && !dev->queues[q->queueNodeIndex]) {
168 ret = nulldrv_queue_create(dev, q->queueNodeIndex,
169 &dev->queues[q->queueNodeIndex]);
170 }
171 else {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600172 ret = VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700173 }
174
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600175 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700176 return ret;
177 }
178 }
179
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600180 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700181}
182
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600183static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(
184 const struct nulldrv_gpu *gpu,
185 const VkExtensionProperties *ext)
David Pinedo0257fbf2015-02-02 18:02:40 -0700186{
187 enum nulldrv_ext_type type;
188
189 for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) {
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600190 if (memcmp(&nulldrv_gpu_exts[type], ext, sizeof(VkExtensionProperties)) == 0)
David Pinedo0257fbf2015-02-02 18:02:40 -0700191 break;
192 }
193
194 assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID);
195
196 return type;
197}
198
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600199static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800200 struct nulldrv_desc_ooxx **ooxx_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700201{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800202 struct nulldrv_desc_ooxx *ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700203
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800204 ooxx = malloc(sizeof(*ooxx));
205 if (!ooxx)
Tony Barbour8205d902015-04-16 15:59:00 -0600206 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700207
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800208 memset(ooxx, 0, sizeof(*ooxx));
David Pinedo0257fbf2015-02-02 18:02:40 -0700209
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800210 ooxx->surface_desc_size = 0;
211 ooxx->sampler_desc_size = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700212
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800213 *ooxx_ret = ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700214
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600215 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700216}
217
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600218static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600219 const VkDeviceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700220 struct nulldrv_dev **dev_ret)
221{
222 struct nulldrv_dev *dev;
223 uint32_t i;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600224 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -0700225
226 dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600227 VK_OBJECT_TYPE_DEVICE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700228 if (!dev)
Tony Barbour8205d902015-04-16 15:59:00 -0600229 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700230
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600231 for (i = 0; i < info->extensionCount; i++) {
232 const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(
233 gpu,
234 &info->pEnabledExtensions[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -0700235
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600236 if (ext == NULLDRV_EXT_INVALID)
237 return VK_ERROR_INVALID_EXTENSION;
David Pinedo0257fbf2015-02-02 18:02:40 -0700238
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600239 dev->exts[ext] = true;
240 }
David Pinedo0257fbf2015-02-02 18:02:40 -0700241
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800242 ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600243 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700244 return ret;
245 }
246
247 ret = dev_create_queues(dev, info->pRequestedQueues,
248 info->queueRecordCount);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600249 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700250 return ret;
251 }
252
253 *dev_ret = dev;
254
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600255 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700256}
257
Tony Barbour8205d902015-04-16 15:59:00 -0600258static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalDevice gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700259{
260 return (struct nulldrv_gpu *) gpu;
261}
262
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600263static VkResult nulldrv_rt_view_create(struct nulldrv_dev *dev,
264 const VkColorAttachmentViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700265 struct nulldrv_rt_view **view_ret)
266{
267 struct nulldrv_rt_view *view;
268
269 view = (struct nulldrv_rt_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600270 VK_OBJECT_TYPE_COLOR_ATTACHMENT_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700271 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600272 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700273
274 *view_ret = view;
275
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600276 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700277}
278
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600279static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
280 const VkFenceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700281 struct nulldrv_fence **fence_ret)
282{
283 struct nulldrv_fence *fence;
284
285 fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600286 VK_OBJECT_TYPE_FENCE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700287 if (!fence)
Tony Barbour8205d902015-04-16 15:59:00 -0600288 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700289
290 *fence_ret = fence;
291
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600292 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700293}
294
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600295static struct nulldrv_dev *nulldrv_dev(VkDevice dev)
David Pinedo0257fbf2015-02-02 18:02:40 -0700296{
297 return (struct nulldrv_dev *) dev;
298}
299
300static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base)
301{
302 return (struct nulldrv_img *) base;
303}
304
305
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600306static VkResult img_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700307 size_t *size, void *data)
308{
309 struct nulldrv_img *img = nulldrv_img_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600310 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700311
312 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -0600313 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700314 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600315 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700316
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600317 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700318 if (data == NULL)
319 return ret;
320 mem_req->size = img->total_size;
321 mem_req->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700322 }
323 break;
324 default:
325 ret = nulldrv_base_get_info(base, type, size, data);
326 break;
327 }
328
329 return ret;
330}
331
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600332static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
333 const VkImageCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700334 bool scanout,
335 struct nulldrv_img **img_ret)
336{
337 struct nulldrv_img *img;
338
339 img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600340 VK_OBJECT_TYPE_IMAGE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700341 if (!img)
Tony Barbour8205d902015-04-16 15:59:00 -0600342 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700343
344 img->type = info->imageType;
345 img->depth = info->extent.depth;
346 img->mip_levels = info->mipLevels;
347 img->array_size = info->arraySize;
348 img->usage = info->usage;
David Pinedo0257fbf2015-02-02 18:02:40 -0700349 img->samples = info->samples;
350
351 img->obj.base.get_info = img_get_info;
352
353 *img_ret = img;
354
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600355 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700356}
357
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600358static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700359{
360 return (struct nulldrv_img *) image;
361}
362
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600363static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600364 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700365 struct nulldrv_mem **mem_ret)
366{
367 struct nulldrv_mem *mem;
368
369 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600370 VK_OBJECT_TYPE_DEVICE_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700371 if (!mem)
Tony Barbour8205d902015-04-16 15:59:00 -0600372 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700373
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700374 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700375 if (!mem->bo) {
Tony Barbour8205d902015-04-16 15:59:00 -0600376 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700377 }
378
379 mem->size = info->allocationSize;
380
381 *mem_ret = mem;
382
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600383 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700384}
385
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600386static VkResult nulldrv_ds_view_create(struct nulldrv_dev *dev,
387 const VkDepthStencilViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700388 struct nulldrv_ds_view **view_ret)
389{
390 struct nulldrv_img *img = nulldrv_img(info->image);
391 struct nulldrv_ds_view *view;
392
393 view = (struct nulldrv_ds_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600394 VK_OBJECT_TYPE_DEPTH_STENCIL_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700395 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600396 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700397
398 view->img = img;
399
400 view->array_size = info->arraySize;
401
402 *view_ret = view;
403
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600404 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700405}
406
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600407static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
408 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700409 struct nulldrv_sampler **sampler_ret)
410{
411 struct nulldrv_sampler *sampler;
412
413 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600414 sizeof(*sampler), VK_OBJECT_TYPE_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700415 if (!sampler)
Tony Barbour8205d902015-04-16 15:59:00 -0600416 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700417
418 *sampler_ret = sampler;
419
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600420 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700421}
422
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600423static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
424 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700425 struct nulldrv_img_view **view_ret)
426{
427 struct nulldrv_img *img = nulldrv_img(info->image);
428 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700429
430 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600431 VK_OBJECT_TYPE_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700432 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600433 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700434
435 view->img = img;
436 view->min_lod = info->minLod;
437
David Pinedo0257fbf2015-02-02 18:02:40 -0700438 view->cmd_len = 8;
439
440 *view_ret = view;
441
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600442 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700443}
444
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600445static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700446{
447 return mem->bo;
448}
449
Tony Barbour8205d902015-04-16 15:59:00 -0600450static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700451{
452 return (struct nulldrv_mem *) mem;
453}
454
455static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
456{
457 return (struct nulldrv_buf *) base;
458}
459
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600460static VkResult buf_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700461 size_t *size, void *data)
462{
463 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600464 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700465
466 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -0600467 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700468 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600469 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700470
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600471 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700472 if (data == NULL)
473 return ret;
474
475 mem_req->size = buf->size;
476 mem_req->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700477
478 }
479 break;
David Pinedo0257fbf2015-02-02 18:02:40 -0700480 default:
481 ret = nulldrv_base_get_info(base, type, size, data);
482 break;
483 }
484
485 return ret;
486}
487
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600488static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600489 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700490 struct nulldrv_buf **buf_ret)
491{
492 struct nulldrv_buf *buf;
493
494 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600495 VK_OBJECT_TYPE_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700496 if (!buf)
Tony Barbour8205d902015-04-16 15:59:00 -0600497 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700498
499 buf->size = info->size;
500 buf->usage = info->usage;
501
502 buf->obj.base.get_info = buf_get_info;
503
504 *buf_ret = buf;
505
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600506 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700507}
508
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600509static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
510 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700511 struct nulldrv_desc_layout **layout_ret)
512{
513 struct nulldrv_desc_layout *layout;
514
515 layout = (struct nulldrv_desc_layout *)
516 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600517 VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700518 if (!layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600519 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700520
521 *layout_ret = layout;
522
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600523 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700524}
525
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500526static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev,
527 const VkPipelineLayoutCreateInfo* pCreateInfo,
528 struct nulldrv_pipeline_layout **pipeline_layout_ret)
Chia-I Wu7732cb22015-03-26 15:27:55 +0800529{
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500530 struct nulldrv_pipeline_layout *pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800531
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500532 pipeline_layout = (struct nulldrv_pipeline_layout *)
533 nulldrv_base_create(dev, sizeof(*pipeline_layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600534 VK_OBJECT_TYPE_PIPELINE_LAYOUT);
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500535 if (!pipeline_layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600536 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800537
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500538 *pipeline_layout_ret = pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800539
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600540 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800541}
542
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600543static struct nulldrv_desc_layout *nulldrv_desc_layout(VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700544{
545 return (struct nulldrv_desc_layout *) layout;
546}
547
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600548static VkResult shader_create(struct nulldrv_dev *dev,
549 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700550 struct nulldrv_shader **sh_ret)
551{
David Pinedo0257fbf2015-02-02 18:02:40 -0700552 struct nulldrv_shader *sh;
553
554 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600555 VK_OBJECT_TYPE_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700556 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600557 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700558
559 *sh_ret = sh;
560
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600561 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700562}
563
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600564static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
565 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700566 struct nulldrv_pipeline **pipeline_ret)
567{
568 struct nulldrv_pipeline *pipeline;
569
570 pipeline = (struct nulldrv_pipeline *)
571 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600572 VK_OBJECT_TYPE_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700573 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600574 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700575
576 *pipeline_ret = pipeline;
577
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600578 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700579}
580
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600581static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev,
582 const VkDynamicVpStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700583 struct nulldrv_dynamic_vp **state_ret)
584{
585 struct nulldrv_dynamic_vp *state;
586
587 state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600588 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_VP_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700589 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600590 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700591
592 *state_ret = state;
593
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600594 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700595}
596
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600597static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev,
598 const VkDynamicRsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700599 struct nulldrv_dynamic_rs **state_ret)
600{
601 struct nulldrv_dynamic_rs *state;
602
603 state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600604 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_RS_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700605 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600606 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700607
608 *state_ret = state;
609
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600610 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700611}
612
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600613static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev,
614 const VkDynamicCbStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700615 struct nulldrv_dynamic_cb **state_ret)
616{
617 struct nulldrv_dynamic_cb *state;
618
619 state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600620 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_CB_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700621 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600622 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700623
624 *state_ret = state;
625
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600626 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700627}
628
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600629static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev,
630 const VkDynamicDsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700631 struct nulldrv_dynamic_ds **state_ret)
632{
633 struct nulldrv_dynamic_ds *state;
634
635 state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600636 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_DS_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700637 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600638 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700639
640 *state_ret = state;
641
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600642 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700643}
644
645
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600646static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
647 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700648 struct nulldrv_cmd **cmd_ret)
649{
David Pinedo0257fbf2015-02-02 18:02:40 -0700650 struct nulldrv_cmd *cmd;
651
David Pinedo0257fbf2015-02-02 18:02:40 -0700652 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600653 VK_OBJECT_TYPE_COMMAND_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700654 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600655 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700656
657 *cmd_ret = cmd;
658
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600659 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700660}
661
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600662static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
663 VkDescriptorPoolUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700664 uint32_t max_sets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600665 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800666 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700667{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800668 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700669
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800670 pool = (struct nulldrv_desc_pool *)
671 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600672 VK_OBJECT_TYPE_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800673 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600674 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700675
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800676 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700677
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800678 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700679
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600680 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700681}
682
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600683static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800684 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600685 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700686 const struct nulldrv_desc_layout *layout,
687 struct nulldrv_desc_set **set_ret)
688{
689 struct nulldrv_desc_set *set;
690
691 set = (struct nulldrv_desc_set *)
692 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600693 VK_OBJECT_TYPE_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700694 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600695 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700696
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800697 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700698 set->layout = layout;
699 *set_ret = set;
700
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600701 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700702}
703
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600704static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700705{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800706 return (struct nulldrv_desc_pool *) pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700707}
708
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600709static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
710 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700711 struct nulldrv_framebuffer ** fb_ret)
712{
713
714 struct nulldrv_framebuffer *fb;
715 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600716 VK_OBJECT_TYPE_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700717 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600718 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700719
720 *fb_ret = fb;
721
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600722 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700723
724}
725
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600726static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
727 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700728 struct nulldrv_render_pass** rp_ret)
729{
730 struct nulldrv_render_pass *rp;
731 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600732 VK_OBJECT_TYPE_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700733 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600734 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700735
736 *rp_ret = rp;
737
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600738 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700739}
740
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600741static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700742{
743 return (struct nulldrv_buf *) buf;
744}
745
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600746static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600747 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700748 struct nulldrv_buf_view **view_ret)
749{
750 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
751 struct nulldrv_buf_view *view;
752
753 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600754 VK_OBJECT_TYPE_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700755 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600756 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700757
758 view->buf = buf;
759
760 *view_ret = view;
761
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600762 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700763}
764
David Pinedo0257fbf2015-02-02 18:02:40 -0700765
766//*********************************************
767// Driver entry points
768//*********************************************
769
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600770ICD_EXPORT VkResult VKAPI vkCreateBuffer(
771 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600772 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600773 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700774{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700775 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700776 struct nulldrv_dev *dev = nulldrv_dev(device);
777
778 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
779}
780
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600781ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
782 VkDevice device,
783 const VkCmdBufferCreateInfo* pCreateInfo,
784 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700785{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700786 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700787 struct nulldrv_dev *dev = nulldrv_dev(device);
788
789 return nulldrv_cmd_create(dev, pCreateInfo,
790 (struct nulldrv_cmd **) pCmdBuffer);
791}
792
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600793ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
794 VkCmdBuffer cmdBuffer,
795 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700796{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700797 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600798 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700799}
800
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600801ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
802 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700803{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700804 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600805 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700806}
807
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600808ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
809 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700810{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700811 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600812 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700813}
814
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600815ICD_EXPORT void VKAPI vkCmdInitAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600816 VkCmdBuffer cmdBuffer,
817 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700818 uint32_t startCounter,
819 uint32_t counterCount,
820 const uint32_t* pData)
821{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700822 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700823}
824
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600825ICD_EXPORT void VKAPI vkCmdLoadAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600826 VkCmdBuffer cmdBuffer,
827 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700828 uint32_t startCounter,
829 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600830 VkBuffer srcBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600831 VkDeviceSize srcOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700832{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700833 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700834}
835
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600836ICD_EXPORT void VKAPI vkCmdSaveAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600837 VkCmdBuffer cmdBuffer,
838 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700839 uint32_t startCounter,
840 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600841 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600842 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700843{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700844 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700845}
846
David Pinedo0257fbf2015-02-02 18:02:40 -0700847
Ian Elliott64a68e12015-04-16 11:57:46 -0600848static const VkFormat nulldrv_presentable_formats[] = {
849 VK_FORMAT_B8G8R8A8_UNORM,
850};
851
Jon Ashburnba4a1952015-06-16 12:44:51 -0600852#if 0
Ian Elliott64a68e12015-04-16 11:57:46 -0600853ICD_EXPORT VkResult VKAPI vkGetDisplayInfoWSI(
854 VkDisplayWSI display,
855 VkDisplayInfoTypeWSI infoType,
856 size_t* pDataSize,
857 void* pData)
858{
859 VkResult ret = VK_SUCCESS;
860
861 NULLDRV_LOG_FUNC;
862
863 if (!pDataSize)
864 return VK_ERROR_INVALID_POINTER;
865
866 switch (infoType) {
867 case VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_WSI:
868 {
869 VkDisplayFormatPropertiesWSI *dst = pData;
870 size_t size_ret;
871 uint32_t i;
872
873 size_ret = sizeof(*dst) * ARRAY_SIZE(nulldrv_presentable_formats);
874
875 if (dst && *pDataSize < size_ret)
876 return VK_ERROR_INVALID_VALUE;
877
878 *pDataSize = size_ret;
879 if (!dst)
880 return VK_SUCCESS;
881
882 for (i = 0; i < ARRAY_SIZE(nulldrv_presentable_formats); i++)
883 dst[i].swapChainFormat = nulldrv_presentable_formats[i];
884 }
885 break;
886 default:
887 ret = VK_ERROR_INVALID_VALUE;
888 break;
889 }
890
891 return ret;
892}
Jon Ashburnba4a1952015-06-16 12:44:51 -0600893#endif
Ian Elliott64a68e12015-04-16 11:57:46 -0600894
895ICD_EXPORT VkResult VKAPI vkCreateSwapChainWSI(
896 VkDevice device,
897 const VkSwapChainCreateInfoWSI* pCreateInfo,
898 VkSwapChainWSI* pSwapChain)
899{
900 NULLDRV_LOG_FUNC;
901 struct nulldrv_dev *dev = nulldrv_dev(device);
902 struct nulldrv_swap_chain *sc;
903
904 sc = (struct nulldrv_swap_chain *) nulldrv_base_create(dev, sizeof(*sc),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600905 VK_OBJECT_TYPE_SWAP_CHAIN_WSI);
Ian Elliott64a68e12015-04-16 11:57:46 -0600906 if (!sc) {
907 return VK_ERROR_OUT_OF_HOST_MEMORY;
908 }
909 sc->dev = dev;
910
Tony Barbour11e76ac2015-04-20 16:28:46 -0600911 *pSwapChain = (VkSwapChainWSI) sc;
Ian Elliott64a68e12015-04-16 11:57:46 -0600912
913 return VK_SUCCESS;
914}
915
916ICD_EXPORT VkResult VKAPI vkDestroySwapChainWSI(
917 VkSwapChainWSI swapChain)
918{
919 NULLDRV_LOG_FUNC;
920 struct nulldrv_swap_chain *sc = (struct nulldrv_swap_chain *) swapChain;
921
922 free(sc);
923
924 return VK_SUCCESS;
925}
926
927ICD_EXPORT VkResult VKAPI vkGetSwapChainInfoWSI(
928 VkSwapChainWSI swapChain,
929 VkSwapChainInfoTypeWSI infoType,
930 size_t* pDataSize,
931 void* pData)
932{
933 NULLDRV_LOG_FUNC;
934 struct nulldrv_swap_chain *sc = (struct nulldrv_swap_chain *) swapChain;
935 struct nulldrv_dev *dev = sc->dev;
936 VkResult ret = VK_SUCCESS;
937
938 if (!pDataSize)
939 return VK_ERROR_INVALID_POINTER;
940
941 switch (infoType) {
942 case VK_SWAP_CHAIN_INFO_TYPE_PERSISTENT_IMAGES_WSI:
943 {
944 VkSwapChainImageInfoWSI *images;
945 const size_t size = sizeof(*images) * 2;
946 uint32_t i;
947
948 if (pData && *pDataSize < size)
949 return VK_ERROR_INVALID_VALUE;
950
951 *pDataSize = size;
952 if (!pData)
953 return VK_SUCCESS;
954
955 images = (VkSwapChainImageInfoWSI *) pData;
956 for (i = 0; i < 2; i++) {
957 struct nulldrv_img *img;
958 struct nulldrv_mem *mem;
959
960 img = (struct nulldrv_img *) nulldrv_base_create(dev,
961 sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600962 VK_OBJECT_TYPE_IMAGE);
Ian Elliott64a68e12015-04-16 11:57:46 -0600963 if (!img)
964 return VK_ERROR_OUT_OF_HOST_MEMORY;
965
966 mem = (struct nulldrv_mem *) nulldrv_base_create(dev,
967 sizeof(*mem),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600968 VK_OBJECT_TYPE_DEVICE_MEMORY);
Ian Elliott64a68e12015-04-16 11:57:46 -0600969 if (!mem)
970 return VK_ERROR_OUT_OF_HOST_MEMORY;
971
972 images[i].image = (VkImage) img;
973 images[i].memory = (VkDeviceMemory) mem;
974 }
975 }
976 break;
977 default:
978 ret = VK_ERROR_INVALID_VALUE;
979 break;
980 }
981
982 return ret;
983}
984
985ICD_EXPORT VkResult VKAPI vkQueuePresentWSI(
986 VkQueue queue_,
987 const VkPresentInfoWSI* pPresentInfo)
988{
989 NULLDRV_LOG_FUNC;
990
991 return VK_SUCCESS;
992}
993
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600994ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600995 VkCmdBuffer cmdBuffer,
996 VkBuffer srcBuffer,
997 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700998 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600999 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001000{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001001 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001002}
1003
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001004ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001005 VkCmdBuffer cmdBuffer,
1006 VkImage srcImage,
1007 VkImageLayout srcImageLayout,
1008 VkImage destImage,
1009 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001010 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001011 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001012{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001013 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001014}
1015
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001016ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001017 VkCmdBuffer cmdBuffer,
Mark Lobodzinski20f68592015-05-22 14:43:25 -05001018 VkImage srcImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001019 VkImageLayout srcImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -05001020 VkImage destImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001021 VkImageLayout destImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -05001022 uint32_t regionCount,
1023 const VkImageBlit* pRegions,
1024 VkTexFilter filter)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -06001025{
1026 NULLDRV_LOG_FUNC;
1027}
1028
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001029ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001030 VkCmdBuffer cmdBuffer,
1031 VkBuffer srcBuffer,
1032 VkImage destImage,
1033 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001034 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001035 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001036{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001037 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001038}
1039
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001040ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001041 VkCmdBuffer cmdBuffer,
1042 VkImage srcImage,
1043 VkImageLayout srcImageLayout,
1044 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001045 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001046 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001047{
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 vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001052 VkCmdBuffer cmdBuffer,
1053 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001054 VkDeviceSize destOffset,
1055 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001056 const uint32_t* pData)
1057{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001058 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001059}
1060
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001061ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001062 VkCmdBuffer cmdBuffer,
1063 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001064 VkDeviceSize destOffset,
1065 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001066 uint32_t data)
1067{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001068 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001069}
1070
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001071ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -06001072 VkCmdBuffer cmdBuffer,
1073 VkImage image,
1074 VkImageLayout imageLayout,
1075 const VkClearColor *pColor,
1076 uint32_t rangeCount,
1077 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001078{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001079 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001080}
1081
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001082ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001083 VkCmdBuffer cmdBuffer,
1084 VkImage image,
1085 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001086 float depth,
1087 uint32_t stencil,
1088 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001089 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001090{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001091 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001092}
1093
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001094ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001095 VkCmdBuffer cmdBuffer,
1096 VkImage srcImage,
1097 VkImageLayout srcImageLayout,
1098 VkImage destImage,
1099 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -06001100 uint32_t regionCount,
1101 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001102{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001103 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001104}
1105
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001106ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001107 VkCmdBuffer cmdBuffer,
1108 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001109 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001110 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001111{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001112 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001113}
1114
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001115ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001116 VkCmdBuffer cmdBuffer,
1117 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001118 uint32_t slot)
1119{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001120 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001121}
1122
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001123ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001124 VkCmdBuffer cmdBuffer,
1125 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001126 uint32_t startQuery,
1127 uint32_t queryCount)
1128{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001129 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001130}
1131
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001132ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001133 VkCmdBuffer cmdBuffer,
1134 VkEvent event_,
1135 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001136{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001137 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001138}
1139
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001140ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001141 VkCmdBuffer cmdBuffer,
1142 VkEvent event_,
1143 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001144{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001145 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001146}
1147
Ian Elliott63f1edb2015-04-16 18:10:19 -06001148ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1149 VkCmdBuffer cmdBuffer,
1150 VkQueryPool queryPool,
1151 uint32_t startQuery,
1152 uint32_t queryCount,
1153 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001154 VkDeviceSize destOffset,
1155 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001156 VkFlags flags)
1157{
1158 NULLDRV_LOG_FUNC;
1159}
1160
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001161ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001162 VkCmdBuffer cmdBuffer,
1163 VkTimestampType timestampType,
1164 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001165 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001166{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001167 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001168}
1169
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001170ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001171 VkCmdBuffer cmdBuffer,
1172 VkPipelineBindPoint pipelineBindPoint,
1173 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001174{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001175 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001176}
1177
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001178ICD_EXPORT void VKAPI vkCmdBindDynamicStateObject(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001179 VkCmdBuffer cmdBuffer,
1180 VkStateBindPoint stateBindPoint,
1181 VkDynamicStateObject state)
David Pinedo0257fbf2015-02-02 18:02:40 -07001182{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001183 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001184}
1185
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001186ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001187 VkCmdBuffer cmdBuffer,
1188 VkPipelineBindPoint pipelineBindPoint,
Mark Lobodzinskia65c4632015-06-15 13:21:21 -06001189 VkPipelineLayout layout,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001190 uint32_t firstSet,
1191 uint32_t setCount,
1192 const VkDescriptorSet* pDescriptorSets,
1193 uint32_t dynamicOffsetCount,
1194 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001195{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001196 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001197}
1198
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001199ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1200 VkCmdBuffer cmdBuffer,
1201 uint32_t startBinding,
1202 uint32_t bindingCount,
1203 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001204 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001205{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001206 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001207}
1208
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001209ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001210 VkCmdBuffer cmdBuffer,
1211 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001212 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001213 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001214{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001215 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001216}
1217
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001218ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001219 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001220 uint32_t firstVertex,
1221 uint32_t vertexCount,
1222 uint32_t firstInstance,
1223 uint32_t instanceCount)
1224{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001225 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001226}
1227
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001228ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001229 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001230 uint32_t firstIndex,
1231 uint32_t indexCount,
1232 int32_t vertexOffset,
1233 uint32_t firstInstance,
1234 uint32_t instanceCount)
1235{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001236 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001237}
1238
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001239ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001240 VkCmdBuffer cmdBuffer,
1241 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001242 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001243 uint32_t count,
1244 uint32_t stride)
1245{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001246 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001247}
1248
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001249ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001250 VkCmdBuffer cmdBuffer,
1251 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001252 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001253 uint32_t count,
1254 uint32_t stride)
1255{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001256 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001257}
1258
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001259ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001260 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001261 uint32_t x,
1262 uint32_t y,
1263 uint32_t z)
1264{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001265 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001266}
1267
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001268ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001269 VkCmdBuffer cmdBuffer,
1270 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001271 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001272{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001273 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001274}
1275
Tony Barbour8205d902015-04-16 15:59:00 -06001276void VKAPI vkCmdWaitEvents(
1277 VkCmdBuffer cmdBuffer,
1278 VkWaitEvent waitEvent,
1279 uint32_t eventCount,
1280 const VkEvent* pEvents,
1281 uint32_t memBarrierCount,
1282 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001283{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001284 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001285}
1286
Tony Barbour8205d902015-04-16 15:59:00 -06001287void VKAPI vkCmdPipelineBarrier(
1288 VkCmdBuffer cmdBuffer,
1289 VkWaitEvent waitEvent,
1290 uint32_t pipeEventCount,
1291 const VkPipeEvent* pPipeEvents,
1292 uint32_t memBarrierCount,
1293 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001294{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001295 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001296}
1297
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001298ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001299 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001300 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001301 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001302{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001303 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001304 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1305 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1306}
1307
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001308ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1309 VkDevice device)
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 vkGetDeviceQueue(
1316 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001317 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001318 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001319 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001320{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001321 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001322 struct nulldrv_dev *dev = nulldrv_dev(device);
Mike Stroyan230e6252015-04-17 12:36:38 -06001323 *pQueue = (VkQueue) dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001324 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001325}
1326
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001327ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1328 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001329{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001330 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001331 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001332}
1333
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001334ICD_EXPORT VkResult VKAPI vkCreateEvent(
1335 VkDevice device,
1336 const VkEventCreateInfo* pCreateInfo,
1337 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001338{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001339 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001340 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001341}
1342
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001343ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001344 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001345 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001346{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001347 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001348 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001349}
1350
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001351ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001352 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001353 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001354{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001355 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001356 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001357}
1358
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001359ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001360 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001361 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001362{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001363 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001364 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001365}
1366
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001367ICD_EXPORT VkResult VKAPI vkCreateFence(
1368 VkDevice device,
1369 const VkFenceCreateInfo* pCreateInfo,
1370 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001371{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001372 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001373 struct nulldrv_dev *dev = nulldrv_dev(device);
1374
1375 return nulldrv_fence_create(dev, pCreateInfo,
1376 (struct nulldrv_fence **) pFence);
1377}
1378
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001379ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001380 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001381 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001382{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001383 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001384 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001385}
1386
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001387ICD_EXPORT VkResult VKAPI vkResetFences(
1388 VkDevice device,
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001389 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001390 VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001391{
1392 NULLDRV_LOG_FUNC;
1393 return VK_SUCCESS;
1394}
1395
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001396ICD_EXPORT VkResult VKAPI vkWaitForFences(
1397 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001398 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001399 const VkFence* pFences,
David Pinedo0257fbf2015-02-02 18:02:40 -07001400 bool32_t waitAll,
1401 uint64_t timeout)
1402{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001403 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001404 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001405}
1406
Tony Barbour8205d902015-04-16 15:59:00 -06001407ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo(
1408 VkPhysicalDevice gpu_,
1409 VkPhysicalDeviceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001410 size_t* pDataSize,
1411 void* pData)
1412{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001413 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001414 VkResult ret = VK_SUCCESS;
1415
1416 switch (infoType) {
1417 case VK_PHYSICAL_DEVICE_INFO_TYPE_PROPERTIES:
1418 {
1419 VkPhysicalDeviceProperties *props =
1420 (VkPhysicalDeviceProperties *) pData;
1421 *pDataSize = sizeof(VkPhysicalDeviceProperties);
1422 if (pData == NULL) {
1423 return ret;
1424 }
1425 props->apiVersion = VK_API_VERSION;
1426 props->driverVersion = 0; // Appropriate that the nulldrv have 0's
1427 props->vendorId = 0;
1428 props->deviceId = 0;
1429 props->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1430 strncpy(props->deviceName, "nulldrv", strlen("nulldrv"));
1431 props->maxInlineMemoryUpdateSize = 0;
1432 props->maxBoundDescriptorSets = 0;
1433 props->maxThreadGroupSize = 0;
1434 props->timestampFrequency = 0;
1435 props->multiColorAttachmentClears = false;
1436 break;
1437 }
1438 case VK_PHYSICAL_DEVICE_INFO_TYPE_PERFORMANCE:
1439 {
1440 VkPhysicalDevicePerformance *perf =
1441 (VkPhysicalDevicePerformance *) pData;
1442 *pDataSize = sizeof(VkPhysicalDevicePerformance);
1443 if (pData == NULL) {
1444 return ret;
1445 }
1446 perf->maxDeviceClock = 1.0f;
1447 perf->aluPerClock = 1.0f;
1448 perf->texPerClock = 1.0f;
1449 perf->primsPerClock = 1.0f;
1450 perf->pixelsPerClock = 1.0f;
1451 break;
1452 }
1453 case VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES:
1454 {
1455 VkPhysicalDeviceQueueProperties *props =
1456 (VkPhysicalDeviceQueueProperties *) pData;
1457 *pDataSize = sizeof(VkPhysicalDeviceQueueProperties);
1458 if (pData == NULL) {
1459 return ret;
1460 }
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001461 props->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
Ian Elliott64a68e12015-04-16 11:57:46 -06001462 props->queueCount = 1;
1463 props->maxAtomicCounters = 1;
1464 props->supportsTimestamps = false;
Ian Elliott64a68e12015-04-16 11:57:46 -06001465 break;
1466 }
1467 default:
1468/* FIXME: WRITE THE REAL CODE*/return ret;
1469 break;
1470 }
1471
1472 return ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001473}
1474
Chris Forbesd7576302015-06-21 22:55:02 +12001475ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
1476 VkPhysicalDevice physicalDevice,
1477 VkPhysicalDeviceFeatures* pFeatures)
1478{
1479 NULLDRV_LOG_FUNC;
1480 VkResult ret = VK_SUCCESS;
1481
1482 /* TODO: fill out features */
1483 memset(pFeatures, 0, sizeof(*pFeatures));
1484
1485 return ret;
1486}
1487
1488ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatInfo(
1489 VkPhysicalDevice physicalDevice,
1490 VkFormat format,
1491 VkFormatProperties* pFormatInfo)
1492{
1493 NULLDRV_LOG_FUNC;
1494 VkResult ret = VK_SUCCESS;
1495
1496 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1497 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
1498
1499 return ret;
1500}
1501
1502ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits(
1503 VkPhysicalDevice physicalDevice,
1504 VkPhysicalDeviceLimits* pLimits)
1505{
1506 NULLDRV_LOG_FUNC;
1507 VkResult ret = VK_SUCCESS;
1508
1509 /* TODO: fill out limits */
1510 memset(pLimits, 0, sizeof(*pLimits));
1511
1512 return ret;
1513}
1514
Jon Ashburneb2728b2015-04-10 14:33:07 -06001515ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
1516 VkExtensionInfoType infoType,
1517 uint32_t extensionIndex,
1518 size_t* pDataSize,
1519 void* pData)
1520{
1521 uint32_t *count;
1522
1523 if (pDataSize == NULL)
1524 return VK_ERROR_INVALID_POINTER;
1525
1526 switch (infoType) {
1527 case VK_EXTENSION_INFO_TYPE_COUNT:
1528 *pDataSize = sizeof(uint32_t);
1529 if (pData == NULL)
1530 return VK_SUCCESS;
1531 count = (uint32_t *) pData;
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -06001532 *count = NULLDRV_EXT_COUNT;
Jon Ashburneb2728b2015-04-10 14:33:07 -06001533 break;
1534 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
Ian Elliott64a68e12015-04-16 11:57:46 -06001535 *pDataSize = sizeof(VkExtensionProperties);
Jon Ashburneb2728b2015-04-10 14:33:07 -06001536 if (pData == NULL)
1537 return VK_SUCCESS;
Ian Elliott64a68e12015-04-16 11:57:46 -06001538 else {
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -06001539 if (extensionIndex >= NULLDRV_EXT_COUNT)
1540 return VK_ERROR_INVALID_VALUE;
1541
1542 memcpy((VkExtensionProperties *) pData, &intel_gpu_exts[extensionIndex], sizeof(VkExtensionProperties));
Ian Elliott64a68e12015-04-16 11:57:46 -06001543 return VK_SUCCESS;
1544 }
Jon Ashburneb2728b2015-04-10 14:33:07 -06001545 break;
1546 default:
1547 return VK_ERROR_INVALID_VALUE;
1548 };
1549
1550 return VK_SUCCESS;
1551}
1552
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001553VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
Tony Barbour8205d902015-04-16 15:59:00 -06001554 VkPhysicalDevice gpu,
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001555 VkExtensionInfoType infoType,
1556 uint32_t extensionIndex,
1557 size_t* pDataSize,
1558 void* pData)
David Pinedo0257fbf2015-02-02 18:02:40 -07001559{
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001560 uint32_t *count;
1561
1562 if (pDataSize == NULL)
1563 return VK_ERROR_INVALID_POINTER;
1564
1565 switch (infoType) {
1566 case VK_EXTENSION_INFO_TYPE_COUNT:
1567 *pDataSize = sizeof(uint32_t);
1568 if (pData == NULL)
1569 return VK_SUCCESS;
1570 count = (uint32_t *) pData;
1571 *count = 0;
1572 break;
1573 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1574 *pDataSize = 0;
1575 if (pData == NULL)
1576 return VK_SUCCESS;
1577 return VK_ERROR_INVALID_EXTENSION;
1578 break;
1579 default:
1580 return VK_ERROR_INVALID_VALUE;
1581 };
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001582 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001583}
1584
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001585ICD_EXPORT VkResult VKAPI vkCreateImage(
1586 VkDevice device,
1587 const VkImageCreateInfo* pCreateInfo,
1588 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001589{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001590 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001591 struct nulldrv_dev *dev = nulldrv_dev(device);
1592
1593 return nulldrv_img_create(dev, pCreateInfo, false,
1594 (struct nulldrv_img **) pImage);
1595}
1596
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001597ICD_EXPORT VkResult VKAPI vkGetImageSubresourceInfo(
Mike Stroyan230e6252015-04-17 12:36:38 -06001598 VkDevice device,
1599 VkImage image,
1600 const VkImageSubresource* pSubresource,
1601 VkSubresourceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001602 size_t* pDataSize,
1603 void* pData)
1604{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001605 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001606 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001607
1608 switch (infoType) {
Tony Barbour8205d902015-04-16 15:59:00 -06001609 case VK_SUBRESOURCE_INFO_TYPE_LAYOUT:
David Pinedo0257fbf2015-02-02 18:02:40 -07001610 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001611 VkSubresourceLayout *layout = (VkSubresourceLayout *) pData;
David Pinedo0257fbf2015-02-02 18:02:40 -07001612
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001613 *pDataSize = sizeof(VkSubresourceLayout);
David Pinedo0257fbf2015-02-02 18:02:40 -07001614
1615 if (pData == NULL)
1616 return ret;
1617 layout->offset = 0;
1618 layout->size = 1;
1619 layout->rowPitch = 4;
1620 layout->depthPitch = 4;
1621 }
1622 break;
1623 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001624 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -07001625 break;
1626 }
1627
1628 return ret;
1629}
1630
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001631ICD_EXPORT VkResult VKAPI vkAllocMemory(
1632 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001633 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001634 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001635{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001636 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001637 struct nulldrv_dev *dev = nulldrv_dev(device);
1638
1639 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1640}
1641
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001642ICD_EXPORT VkResult VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001643 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001644 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001645{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001646 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001647 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001648}
1649
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001650ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001651 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001652 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001653 VkDeviceSize offset,
1654 VkDeviceSize size,
1655 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001656 void** ppData)
1657{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001658 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001659 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1660 void *ptr = nulldrv_mem_map(mem, flags);
1661
1662 *ppData = ptr;
1663
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001664 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001665}
1666
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001667ICD_EXPORT VkResult VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001668 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001669 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001670{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001671 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001672 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001673}
1674
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001675ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001676 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001677 uint32_t memRangeCount,
1678 const VkMappedMemoryRange* pMemRanges)
1679{
1680 NULLDRV_LOG_FUNC;
1681 return VK_SUCCESS;
1682}
1683
1684ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1685 VkDevice device,
1686 uint32_t memRangeCount,
1687 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001688{
1689 NULLDRV_LOG_FUNC;
1690 return VK_SUCCESS;
1691}
1692
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001693ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001694 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001695 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001696{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001697 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001698 struct nulldrv_instance *inst;
1699
1700 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001701 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001702 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001703 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001704
1705 inst->obj.base.get_info = NULL;
1706
Mike Stroyan230e6252015-04-17 12:36:38 -06001707 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001708
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001709 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001710}
1711
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001712ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1713 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001714{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001715 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001716 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001717}
1718
Tony Barbour8205d902015-04-16 15:59:00 -06001719ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001720 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001721 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001722 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001723{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001724 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001725 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001726 struct nulldrv_gpu *gpu;
1727 *pGpuCount = 1;
1728 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001729 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001730 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001731 return ret;
1732}
1733
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001734ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001735 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001736 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001737 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001738 char* const* pOutLayers,
1739 void* pReserved)
1740{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001741 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001742 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001743}
1744
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001745ICD_EXPORT VkResult VKAPI vkDestroyObject(
Mike Stroyan230e6252015-04-17 12:36:38 -06001746 VkDevice device,
1747 VkObjectType objType,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001748 VkObject object)
David Pinedo0257fbf2015-02-02 18:02:40 -07001749{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001750 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001751 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001752}
1753
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001754ICD_EXPORT VkResult VKAPI vkGetObjectInfo(
Mike Stroyan230e6252015-04-17 12:36:38 -06001755 VkDevice device,
1756 VkObjectType objType,
1757 VkObject object,
1758 VkObjectInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001759 size_t* pDataSize,
1760 void* pData)
1761{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001762 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001763 struct nulldrv_base *base = nulldrv_base(object);
1764
1765 return base->get_info(base, infoType, pDataSize, pData);
1766}
1767
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001768ICD_EXPORT VkResult VKAPI vkBindObjectMemory(
1769 VkDevice device,
Mike Stroyan230e6252015-04-17 12:36:38 -06001770 VkObjectType objType,
1771 VkObject object,
Tony Barbour8205d902015-04-16 15:59:00 -06001772 VkDeviceMemory mem_,
1773 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001774{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001775 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001776 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001777}
1778
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001779ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001780 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001781 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001782 VkDeviceSize rangeOffset,
1783 VkDeviceSize rangeSize,
1784 VkDeviceMemory mem,
1785 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001786{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001787 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001788 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001789}
1790
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001791ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001792 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001793 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001794 const VkImageMemoryBindInfo* pBindInfo,
1795 VkDeviceMemory mem,
1796 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001797{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001798 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001799 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001800}
1801
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001802ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(
1803 VkDevice device,
1804 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1805 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001806{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001807 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001808 struct nulldrv_dev *dev = nulldrv_dev(device);
1809
1810 return graphics_pipeline_create(dev, pCreateInfo,
1811 (struct nulldrv_pipeline **) pPipeline);
1812}
1813
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001814ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative(
1815 VkDevice device,
1816 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1817 VkPipeline basePipeline,
1818 VkPipeline* pPipeline)
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001819{
1820 NULLDRV_LOG_FUNC;
1821 struct nulldrv_dev *dev = nulldrv_dev(device);
1822
1823 return graphics_pipeline_create(dev, pCreateInfo,
1824 (struct nulldrv_pipeline **) pPipeline);
1825}
1826
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001827ICD_EXPORT VkResult VKAPI vkCreateComputePipeline(
1828 VkDevice device,
1829 const VkComputePipelineCreateInfo* pCreateInfo,
1830 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001831{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001832 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001833 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001834}
1835
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001836ICD_EXPORT VkResult VKAPI vkStorePipeline(
Mike Stroyan230e6252015-04-17 12:36:38 -06001837 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001838 VkPipeline pipeline,
David Pinedo0257fbf2015-02-02 18:02:40 -07001839 size_t* pDataSize,
1840 void* pData)
1841{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001842 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001843 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001844}
1845
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001846ICD_EXPORT VkResult VKAPI vkLoadPipeline(
1847 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001848 size_t dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001849 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001850 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001851{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001852 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001853 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001854}
1855
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001856ICD_EXPORT VkResult VKAPI vkLoadPipelineDerivative(
1857 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001858 size_t dataSize,
1859 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001860 VkPipeline basePipeline,
1861 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001862{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001863 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001864 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001865}
1866
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001867ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1868 VkDevice device,
1869 const VkQueryPoolCreateInfo* pCreateInfo,
1870 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001871{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001872 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001873 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001874}
1875
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001876ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001877 VkDevice device,
1878 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001879 uint32_t startQuery,
1880 uint32_t queryCount,
1881 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001882 void* pData,
1883 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001884{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001885 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001886 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001887}
1888
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001889ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1890 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001891{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001892 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001893 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001894}
1895
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001896ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1897 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001898 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001899 const VkCmdBuffer* pCmdBuffers,
1900 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001901{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001902 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001903 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001904}
1905
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001906ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1907 VkDevice device,
1908 const VkSemaphoreCreateInfo* pCreateInfo,
1909 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001910{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001911 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001912 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001913}
1914
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001915ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1916 VkQueue queue,
1917 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001918{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001919 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001920 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001921}
1922
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001923ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1924 VkQueue queue,
1925 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001926{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001927 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001928 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001929}
1930
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001931ICD_EXPORT VkResult VKAPI vkCreateSampler(
1932 VkDevice device,
1933 const VkSamplerCreateInfo* pCreateInfo,
1934 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001935{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001936 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001937 struct nulldrv_dev *dev = nulldrv_dev(device);
1938
1939 return nulldrv_sampler_create(dev, pCreateInfo,
1940 (struct nulldrv_sampler **) pSampler);
1941}
1942
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001943ICD_EXPORT VkResult VKAPI vkCreateShader(
1944 VkDevice device,
1945 const VkShaderCreateInfo* pCreateInfo,
1946 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001947{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001948 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001949 struct nulldrv_dev *dev = nulldrv_dev(device);
1950
1951 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1952}
1953
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001954ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
1955 VkDevice device,
1956 const VkDynamicVpStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001957 VkDynamicVpState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001958{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001959 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001960 struct nulldrv_dev *dev = nulldrv_dev(device);
1961
1962 return nulldrv_viewport_state_create(dev, pCreateInfo,
1963 (struct nulldrv_dynamic_vp **) pState);
1964}
1965
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001966ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
1967 VkDevice device,
1968 const VkDynamicRsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001969 VkDynamicRsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001970{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001971 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001972 struct nulldrv_dev *dev = nulldrv_dev(device);
1973
1974 return nulldrv_raster_state_create(dev, pCreateInfo,
1975 (struct nulldrv_dynamic_rs **) pState);
1976}
1977
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001978ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
1979 VkDevice device,
1980 const VkDynamicCbStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001981 VkDynamicCbState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001982{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001983 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001984 struct nulldrv_dev *dev = nulldrv_dev(device);
1985
1986 return nulldrv_blend_state_create(dev, pCreateInfo,
1987 (struct nulldrv_dynamic_cb **) pState);
1988}
1989
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001990ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
1991 VkDevice device,
1992 const VkDynamicDsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001993 VkDynamicDsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001994{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001995 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001996 struct nulldrv_dev *dev = nulldrv_dev(device);
1997
1998 return nulldrv_ds_state_create(dev, pCreateInfo,
1999 (struct nulldrv_dynamic_ds **) pState);
2000}
2001
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002002ICD_EXPORT VkResult VKAPI vkCreateBufferView(
2003 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06002004 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002005 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002006{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002007 NULLDRV_LOG_FUNC;
2008 struct nulldrv_dev *dev = nulldrv_dev(device);
2009
2010 return nulldrv_buf_view_create(dev, pCreateInfo,
2011 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07002012}
2013
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002014ICD_EXPORT VkResult VKAPI vkCreateImageView(
2015 VkDevice device,
2016 const VkImageViewCreateInfo* pCreateInfo,
2017 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002018{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002019 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002020 struct nulldrv_dev *dev = nulldrv_dev(device);
2021
2022 return nulldrv_img_view_create(dev, pCreateInfo,
2023 (struct nulldrv_img_view **) pView);
2024}
2025
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002026ICD_EXPORT VkResult VKAPI vkCreateColorAttachmentView(
2027 VkDevice device,
2028 const VkColorAttachmentViewCreateInfo* pCreateInfo,
2029 VkColorAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002030{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002031 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002032 struct nulldrv_dev *dev = nulldrv_dev(device);
2033
2034 return nulldrv_rt_view_create(dev, pCreateInfo,
2035 (struct nulldrv_rt_view **) pView);
2036}
2037
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002038ICD_EXPORT VkResult VKAPI vkCreateDepthStencilView(
2039 VkDevice device,
2040 const VkDepthStencilViewCreateInfo* pCreateInfo,
2041 VkDepthStencilView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002042{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002043 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002044 struct nulldrv_dev *dev = nulldrv_dev(device);
2045
2046 return nulldrv_ds_view_create(dev, pCreateInfo,
2047 (struct nulldrv_ds_view **) pView);
2048
2049}
2050
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002051ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
2052 VkDevice device,
2053 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
2054 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07002055{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002056 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002057 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07002058
Chia-I Wu7732cb22015-03-26 15:27:55 +08002059 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07002060 (struct nulldrv_desc_layout **) pSetLayout);
2061}
2062
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002063ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
2064 VkDevice device,
2065 const VkPipelineLayoutCreateInfo* pCreateInfo,
2066 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08002067{
2068 NULLDRV_LOG_FUNC;
2069 struct nulldrv_dev *dev = nulldrv_dev(device);
2070
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002071 return nulldrv_pipeline_layout_create(dev,
2072 pCreateInfo,
2073 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08002074}
2075
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002076ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
2077 VkDevice device,
2078 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002079 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002080 const VkDescriptorPoolCreateInfo* pCreateInfo,
2081 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002082{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002083 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002084 struct nulldrv_dev *dev = nulldrv_dev(device);
2085
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002086 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
2087 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002088}
2089
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002090ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002091 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002092 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002093{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002094 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002095 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002096}
2097
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002098ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002099 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002100 VkDescriptorPool descriptorPool,
2101 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002102 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002103 const VkDescriptorSetLayout* pSetLayouts,
2104 VkDescriptorSet* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07002105 uint32_t* pCount)
2106{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002107 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002108 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2109 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002110 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002111 uint32_t i;
2112
2113 for (i = 0; i < count; i++) {
2114 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002115 nulldrv_desc_layout((VkDescriptorSetLayout) pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002116
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002117 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002118 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002119 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002120 break;
2121 }
2122
2123 if (pCount)
2124 *pCount = i;
2125
2126 return ret;
2127}
2128
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002129ICD_EXPORT VkResult VKAPI vkUpdateDescriptorSets(
2130 VkDevice device,
2131 uint32_t writeCount,
2132 const VkWriteDescriptorSet* pDescriptorWrites,
2133 uint32_t copyCount,
2134 const VkCopyDescriptorSet* pDescriptorCopies)
David Pinedo0257fbf2015-02-02 18:02:40 -07002135{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002136 NULLDRV_LOG_FUNC;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002137 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002138}
2139
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002140ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2141 VkDevice device,
2142 const VkFramebufferCreateInfo* info,
2143 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002144{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002145 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002146 struct nulldrv_dev *dev = nulldrv_dev(device);
2147
2148 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2149}
2150
2151
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002152ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2153 VkDevice device,
2154 const VkRenderPassCreateInfo* info,
2155 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002156{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002157 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002158 struct nulldrv_dev *dev = nulldrv_dev(device);
2159
2160 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2161}
2162
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002163ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002164 VkCmdBuffer cmdBuffer,
2165 const VkRenderPassBegin* pRenderPassBegin)
David Pinedo0257fbf2015-02-02 18:02:40 -07002166{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002167 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002168}
2169
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002170ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002171 VkCmdBuffer cmdBuffer,
2172 VkRenderPass renderPass)
David Pinedo0257fbf2015-02-02 18:02:40 -07002173{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002174 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002175}
Ian Elliottf93069f2015-02-19 14:26:19 -07002176
2177ICD_EXPORT void* xcbCreateWindow(
2178 uint16_t width,
2179 uint16_t height)
2180{
2181 static uint32_t window; // Kludge to the max
2182 NULLDRV_LOG_FUNC;
2183 return &window;
2184}
2185
2186// May not be needed, if we stub out stuf in tri.c
2187ICD_EXPORT void xcbDestroyWindow()
2188{
2189 NULLDRV_LOG_FUNC;
2190}
2191
2192ICD_EXPORT int xcbGetMessage(void *msg)
2193{
2194 NULLDRV_LOG_FUNC;
2195 return 0;
2196}
2197
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002198ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002199{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002200 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002201}