blob: f63e9f601546612ec52241182289d0d37a75240c [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] = {
Chia-I Wu5b66aa52015-04-16 22:02:10 +080043 [NULLDRV_EXT_WSI_LUNARG] = "VK_WSI_LunarG",
David Pinedo0257fbf2015-02-02 18:02:40 -070044};
45
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060046static struct nulldrv_base *nulldrv_base(VkBaseObject base)
David Pinedo0257fbf2015-02-02 18:02:40 -070047{
48 return (struct nulldrv_base *) base;
49}
50
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060051static VkResult nulldrv_base_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -070052 size_t *size, void *data)
53{
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060054 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -070055 size_t s;
56 uint32_t *count;
57
58 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -060059 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -070060 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060061 s = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -070062 *size = s;
63 if (data == NULL)
64 return ret;
65 memset(data, 0, s);
David Pinedo0257fbf2015-02-02 18:02:40 -070066 break;
67 }
Tony Barbour8205d902015-04-16 15:59:00 -060068 case VK_OBJECT_INFO_TYPE_MEMORY_ALLOCATION_COUNT:
David Pinedo0257fbf2015-02-02 18:02:40 -070069 *size = sizeof(uint32_t);
70 if (data == NULL)
71 return ret;
72 count = (uint32_t *) data;
73 *count = 1;
74 break;
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
83static struct nulldrv_base *nulldrv_base_create(struct nulldrv_dev *dev,
84 size_t obj_size,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060085 VK_DBG_OBJECT_TYPE type)
David Pinedo0257fbf2015-02-02 18:02:40 -070086{
87 struct nulldrv_base *base;
88
89 if (!obj_size)
90 obj_size = sizeof(*base);
91
92 assert(obj_size >= sizeof(*base));
93
Chia-I Wu493a1752015-02-22 14:40:25 +080094 base = (struct nulldrv_base*)malloc(obj_size);
David Pinedo0257fbf2015-02-02 18:02:40 -070095 if (!base)
96 return NULL;
97
98 memset(base, 0, obj_size);
99
100 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
101 set_loader_magic_value(base);
102
103 if (dev == NULL) {
104 /*
105 * dev is NULL when we are creating the base device object
106 * Set dev now so that debug setup happens correctly
107 */
108 dev = (struct nulldrv_dev *) base;
109 }
110
111
112 base->get_info = NULL;
113
114 return base;
115}
116
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600117static VkResult nulldrv_gpu_add(int devid, const char *primary_node,
David Pinedo0257fbf2015-02-02 18:02:40 -0700118 const char *render_node, struct nulldrv_gpu **gpu_ret)
119{
120 struct nulldrv_gpu *gpu;
121
Chia-I Wu493a1752015-02-22 14:40:25 +0800122 gpu = malloc(sizeof(*gpu));
David Pinedo0257fbf2015-02-02 18:02:40 -0700123 if (!gpu)
Tony Barbour8205d902015-04-16 15:59:00 -0600124 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700125 memset(gpu, 0, sizeof(*gpu));
Mark Lobodzinski97dcd042015-04-16 08:52:00 -0500126
David Pinedo0257fbf2015-02-02 18:02:40 -0700127 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
128 set_loader_magic_value(gpu);
129
130 *gpu_ret = gpu;
131
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600132 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700133}
134
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600135static VkResult nulldrv_queue_create(struct nulldrv_dev *dev,
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700136 uint32_t node_index,
David Pinedo0257fbf2015-02-02 18:02:40 -0700137 struct nulldrv_queue **queue_ret)
138{
139 struct nulldrv_queue *queue;
140
141 queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600142 VK_DBG_OBJECT_QUEUE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700143 if (!queue)
Tony Barbour8205d902015-04-16 15:59:00 -0600144 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700145
146 queue->dev = dev;
147
148 *queue_ret = queue;
149
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600150 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700151}
152
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600153static VkResult dev_create_queues(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600154 const VkDeviceQueueCreateInfo *queues,
David Pinedo0257fbf2015-02-02 18:02:40 -0700155 uint32_t count)
156{
157 uint32_t i;
158
159 if (!count)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600160 return VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700161
162 for (i = 0; i < count; i++) {
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600163 const VkDeviceQueueCreateInfo *q = &queues[i];
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600164 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700165
166 if (q->queueCount == 1 && !dev->queues[q->queueNodeIndex]) {
167 ret = nulldrv_queue_create(dev, q->queueNodeIndex,
168 &dev->queues[q->queueNodeIndex]);
169 }
170 else {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600171 ret = VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700172 }
173
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600174 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700175 return ret;
176 }
177 }
178
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600179 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700180}
181
182static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(const struct nulldrv_gpu *gpu,
183 const char *ext)
184{
185 enum nulldrv_ext_type type;
186
187 for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) {
188 if (nulldrv_gpu_exts[type] && strcmp(nulldrv_gpu_exts[type], ext) == 0)
189 break;
190 }
191
192 assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID);
193
194 return type;
195}
196
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600197static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800198 struct nulldrv_desc_ooxx **ooxx_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700199{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800200 struct nulldrv_desc_ooxx *ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700201
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800202 ooxx = malloc(sizeof(*ooxx));
203 if (!ooxx)
Tony Barbour8205d902015-04-16 15:59:00 -0600204 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700205
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800206 memset(ooxx, 0, sizeof(*ooxx));
David Pinedo0257fbf2015-02-02 18:02:40 -0700207
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800208 ooxx->surface_desc_size = 0;
209 ooxx->sampler_desc_size = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700210
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800211 *ooxx_ret = ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700212
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600213 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700214}
215
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600216static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600217 const VkDeviceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700218 struct nulldrv_dev **dev_ret)
219{
220 struct nulldrv_dev *dev;
221 uint32_t i;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600222 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -0700223
224 dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600225 VK_DBG_OBJECT_DEVICE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700226 if (!dev)
Tony Barbour8205d902015-04-16 15:59:00 -0600227 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700228
229 for (i = 0; i < info->extensionCount; i++) {
230 const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(gpu,
231 info->ppEnabledExtensionNames[i]);
232
233 if (ext == NULLDRV_EXT_INVALID)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600234 return VK_ERROR_INVALID_EXTENSION;
David Pinedo0257fbf2015-02-02 18:02:40 -0700235
236 dev->exts[ext] = true;
237 }
238
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800239 ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600240 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700241 return ret;
242 }
243
244 ret = dev_create_queues(dev, info->pRequestedQueues,
245 info->queueRecordCount);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600246 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700247 return ret;
248 }
249
250 *dev_ret = dev;
251
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600252 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700253}
254
Tony Barbour8205d902015-04-16 15:59:00 -0600255static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalDevice gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700256{
257 return (struct nulldrv_gpu *) gpu;
258}
259
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600260static VkResult nulldrv_rt_view_create(struct nulldrv_dev *dev,
261 const VkColorAttachmentViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700262 struct nulldrv_rt_view **view_ret)
263{
264 struct nulldrv_rt_view *view;
265
266 view = (struct nulldrv_rt_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600267 VK_DBG_OBJECT_COLOR_TARGET_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700268 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600269 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700270
271 *view_ret = view;
272
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600273 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700274}
275
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600276static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
277 const VkFenceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700278 struct nulldrv_fence **fence_ret)
279{
280 struct nulldrv_fence *fence;
281
282 fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600283 VK_DBG_OBJECT_FENCE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700284 if (!fence)
Tony Barbour8205d902015-04-16 15:59:00 -0600285 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700286
287 *fence_ret = fence;
288
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600289 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700290}
291
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600292static struct nulldrv_dev *nulldrv_dev(VkDevice dev)
David Pinedo0257fbf2015-02-02 18:02:40 -0700293{
294 return (struct nulldrv_dev *) dev;
295}
296
297static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base)
298{
299 return (struct nulldrv_img *) base;
300}
301
302
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600303static VkResult img_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700304 size_t *size, void *data)
305{
306 struct nulldrv_img *img = nulldrv_img_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600307 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700308
309 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -0600310 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700311 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600312 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700313
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600314 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700315 if (data == NULL)
316 return ret;
317 mem_req->size = img->total_size;
318 mem_req->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700319 }
320 break;
321 default:
322 ret = nulldrv_base_get_info(base, type, size, data);
323 break;
324 }
325
326 return ret;
327}
328
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600329static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
330 const VkImageCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700331 bool scanout,
332 struct nulldrv_img **img_ret)
333{
334 struct nulldrv_img *img;
335
336 img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600337 VK_DBG_OBJECT_IMAGE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700338 if (!img)
Tony Barbour8205d902015-04-16 15:59:00 -0600339 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700340
341 img->type = info->imageType;
342 img->depth = info->extent.depth;
343 img->mip_levels = info->mipLevels;
344 img->array_size = info->arraySize;
345 img->usage = info->usage;
David Pinedo0257fbf2015-02-02 18:02:40 -0700346 img->samples = info->samples;
347
348 img->obj.base.get_info = img_get_info;
349
350 *img_ret = img;
351
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600352 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700353}
354
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600355static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700356{
357 return (struct nulldrv_img *) image;
358}
359
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600360static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600361 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700362 struct nulldrv_mem **mem_ret)
363{
364 struct nulldrv_mem *mem;
365
366 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600367 VK_DBG_OBJECT_GPU_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700368 if (!mem)
Tony Barbour8205d902015-04-16 15:59:00 -0600369 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700370
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700371 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700372 if (!mem->bo) {
Tony Barbour8205d902015-04-16 15:59:00 -0600373 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700374 }
375
376 mem->size = info->allocationSize;
377
378 *mem_ret = mem;
379
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600380 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700381}
382
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600383static VkResult nulldrv_ds_view_create(struct nulldrv_dev *dev,
384 const VkDepthStencilViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700385 struct nulldrv_ds_view **view_ret)
386{
387 struct nulldrv_img *img = nulldrv_img(info->image);
388 struct nulldrv_ds_view *view;
389
390 view = (struct nulldrv_ds_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600391 VK_DBG_OBJECT_DEPTH_STENCIL_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700392 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600393 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700394
395 view->img = img;
396
397 view->array_size = info->arraySize;
398
399 *view_ret = view;
400
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600401 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700402}
403
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600404static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
405 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700406 struct nulldrv_sampler **sampler_ret)
407{
408 struct nulldrv_sampler *sampler;
409
410 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600411 sizeof(*sampler), VK_DBG_OBJECT_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700412 if (!sampler)
Tony Barbour8205d902015-04-16 15:59:00 -0600413 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700414
415 *sampler_ret = sampler;
416
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600417 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700418}
419
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600420static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
421 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700422 struct nulldrv_img_view **view_ret)
423{
424 struct nulldrv_img *img = nulldrv_img(info->image);
425 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700426
427 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600428 VK_DBG_OBJECT_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700429 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600430 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700431
432 view->img = img;
433 view->min_lod = info->minLod;
434
David Pinedo0257fbf2015-02-02 18:02:40 -0700435 view->cmd_len = 8;
436
437 *view_ret = view;
438
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600439 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700440}
441
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600442static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700443{
444 return mem->bo;
445}
446
Tony Barbour8205d902015-04-16 15:59:00 -0600447static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700448{
449 return (struct nulldrv_mem *) mem;
450}
451
452static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
453{
454 return (struct nulldrv_buf *) base;
455}
456
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600457static VkResult buf_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700458 size_t *size, void *data)
459{
460 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600461 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700462
463 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -0600464 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700465 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600466 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700467
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600468 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700469 if (data == NULL)
470 return ret;
471
472 mem_req->size = buf->size;
473 mem_req->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700474
475 }
476 break;
David Pinedo0257fbf2015-02-02 18:02:40 -0700477 default:
478 ret = nulldrv_base_get_info(base, type, size, data);
479 break;
480 }
481
482 return ret;
483}
484
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600485static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600486 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700487 struct nulldrv_buf **buf_ret)
488{
489 struct nulldrv_buf *buf;
490
491 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600492 VK_DBG_OBJECT_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700493 if (!buf)
Tony Barbour8205d902015-04-16 15:59:00 -0600494 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700495
496 buf->size = info->size;
497 buf->usage = info->usage;
498
499 buf->obj.base.get_info = buf_get_info;
500
501 *buf_ret = buf;
502
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600503 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700504}
505
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600506static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
507 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700508 struct nulldrv_desc_layout **layout_ret)
509{
510 struct nulldrv_desc_layout *layout;
511
512 layout = (struct nulldrv_desc_layout *)
513 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600514 VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700515 if (!layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600516 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700517
518 *layout_ret = layout;
519
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600520 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700521}
522
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500523static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev,
524 const VkPipelineLayoutCreateInfo* pCreateInfo,
525 struct nulldrv_pipeline_layout **pipeline_layout_ret)
Chia-I Wu7732cb22015-03-26 15:27:55 +0800526{
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500527 struct nulldrv_pipeline_layout *pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800528
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500529 pipeline_layout = (struct nulldrv_pipeline_layout *)
530 nulldrv_base_create(dev, sizeof(*pipeline_layout),
531 VK_DBG_OBJECT_PIPELINE_LAYOUT);
532 if (!pipeline_layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600533 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800534
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500535 *pipeline_layout_ret = pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800536
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600537 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800538}
539
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600540static struct nulldrv_desc_layout *nulldrv_desc_layout(VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700541{
542 return (struct nulldrv_desc_layout *) layout;
543}
544
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600545static VkResult shader_create(struct nulldrv_dev *dev,
546 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700547 struct nulldrv_shader **sh_ret)
548{
David Pinedo0257fbf2015-02-02 18:02:40 -0700549 struct nulldrv_shader *sh;
550
551 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600552 VK_DBG_OBJECT_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700553 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600554 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700555
556 *sh_ret = sh;
557
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600558 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700559}
560
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600561static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
562 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700563 struct nulldrv_pipeline **pipeline_ret)
564{
565 struct nulldrv_pipeline *pipeline;
566
567 pipeline = (struct nulldrv_pipeline *)
568 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600569 VK_DBG_OBJECT_GRAPHICS_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700570 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600571 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700572
573 *pipeline_ret = pipeline;
574
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600575 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700576}
577
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600578static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev,
579 const VkDynamicVpStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700580 struct nulldrv_dynamic_vp **state_ret)
581{
582 struct nulldrv_dynamic_vp *state;
583
584 state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600585 sizeof(*state), VK_DBG_OBJECT_VIEWPORT_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700586 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600587 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700588
589 *state_ret = state;
590
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600591 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700592}
593
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600594static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev,
595 const VkDynamicRsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700596 struct nulldrv_dynamic_rs **state_ret)
597{
598 struct nulldrv_dynamic_rs *state;
599
600 state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600601 sizeof(*state), VK_DBG_OBJECT_RASTER_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700602 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600603 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700604
605 *state_ret = state;
606
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600607 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700608}
609
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600610static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev,
611 const VkDynamicCbStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700612 struct nulldrv_dynamic_cb **state_ret)
613{
614 struct nulldrv_dynamic_cb *state;
615
616 state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600617 sizeof(*state), VK_DBG_OBJECT_COLOR_BLEND_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700618 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600619 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700620
621 *state_ret = state;
622
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600623 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700624}
625
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600626static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev,
627 const VkDynamicDsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700628 struct nulldrv_dynamic_ds **state_ret)
629{
630 struct nulldrv_dynamic_ds *state;
631
632 state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600633 sizeof(*state), VK_DBG_OBJECT_DEPTH_STENCIL_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700634 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600635 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700636
637 *state_ret = state;
638
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600639 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700640}
641
642
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600643static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
644 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700645 struct nulldrv_cmd **cmd_ret)
646{
David Pinedo0257fbf2015-02-02 18:02:40 -0700647 struct nulldrv_cmd *cmd;
648
David Pinedo0257fbf2015-02-02 18:02:40 -0700649 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600650 VK_DBG_OBJECT_CMD_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700651 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600652 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700653
654 *cmd_ret = cmd;
655
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600656 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700657}
658
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600659static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
660 VkDescriptorPoolUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700661 uint32_t max_sets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600662 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800663 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700664{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800665 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700666
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800667 pool = (struct nulldrv_desc_pool *)
668 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600669 VK_DBG_OBJECT_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800670 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600671 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700672
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800673 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700674
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800675 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700676
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600677 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700678}
679
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600680static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800681 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600682 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700683 const struct nulldrv_desc_layout *layout,
684 struct nulldrv_desc_set **set_ret)
685{
686 struct nulldrv_desc_set *set;
687
688 set = (struct nulldrv_desc_set *)
689 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600690 VK_DBG_OBJECT_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700691 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600692 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700693
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800694 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700695 set->layout = layout;
696 *set_ret = set;
697
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600698 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700699}
700
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600701static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700702{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800703 return (struct nulldrv_desc_pool *) pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700704}
705
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600706static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
707 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700708 struct nulldrv_framebuffer ** fb_ret)
709{
710
711 struct nulldrv_framebuffer *fb;
712 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600713 VK_DBG_OBJECT_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700714 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600715 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700716
717 *fb_ret = fb;
718
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600719 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700720
721}
722
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600723static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
724 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700725 struct nulldrv_render_pass** rp_ret)
726{
727 struct nulldrv_render_pass *rp;
728 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600729 VK_DBG_OBJECT_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700730 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600731 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700732
733 *rp_ret = rp;
734
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600735 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700736}
737
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600738static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700739{
740 return (struct nulldrv_buf *) buf;
741}
742
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600743static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600744 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700745 struct nulldrv_buf_view **view_ret)
746{
747 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
748 struct nulldrv_buf_view *view;
749
750 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600751 VK_DBG_OBJECT_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700752 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600753 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700754
755 view->buf = buf;
756
757 *view_ret = view;
758
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600759 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700760}
761
David Pinedo0257fbf2015-02-02 18:02:40 -0700762
763//*********************************************
764// Driver entry points
765//*********************************************
766
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600767ICD_EXPORT VkResult VKAPI vkCreateBuffer(
768 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600769 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600770 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700771{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700772 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700773 struct nulldrv_dev *dev = nulldrv_dev(device);
774
775 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
776}
777
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600778ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
779 VkDevice device,
780 const VkCmdBufferCreateInfo* pCreateInfo,
781 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700782{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700783 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700784 struct nulldrv_dev *dev = nulldrv_dev(device);
785
786 return nulldrv_cmd_create(dev, pCreateInfo,
787 (struct nulldrv_cmd **) pCmdBuffer);
788}
789
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600790ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
791 VkCmdBuffer cmdBuffer,
792 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700793{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700794 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600795 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700796}
797
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600798ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
799 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700800{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700801 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600802 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700803}
804
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600805ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
806 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700807{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700808 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600809 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700810}
811
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600812ICD_EXPORT void VKAPI vkCmdInitAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600813 VkCmdBuffer cmdBuffer,
814 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700815 uint32_t startCounter,
816 uint32_t counterCount,
817 const uint32_t* pData)
818{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700819 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700820}
821
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600822ICD_EXPORT void VKAPI vkCmdLoadAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600823 VkCmdBuffer cmdBuffer,
824 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700825 uint32_t startCounter,
826 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600827 VkBuffer srcBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600828 VkDeviceSize srcOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700829{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700830 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700831}
832
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600833ICD_EXPORT void VKAPI vkCmdSaveAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600834 VkCmdBuffer cmdBuffer,
835 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700836 uint32_t startCounter,
837 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600838 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600839 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700840{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700841 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700842}
843
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600844ICD_EXPORT void VKAPI vkCmdDbgMarkerBegin(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600845 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700846 const char* pMarker)
847{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700848 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700849}
850
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600851ICD_EXPORT void VKAPI vkCmdDbgMarkerEnd(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600852 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700853{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700854 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700855}
856
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600857ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600858 VkCmdBuffer cmdBuffer,
859 VkBuffer srcBuffer,
860 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700861 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600862 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700863{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700864 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700865}
866
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600867ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600868 VkCmdBuffer cmdBuffer,
869 VkImage srcImage,
870 VkImageLayout srcImageLayout,
871 VkImage destImage,
872 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700873 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600874 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700875{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700876 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700877}
878
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600879ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600880 VkCmdBuffer cmdBuffer,
881 VkImage srcImage,
882 VkImageLayout srcImageLayout,
883 VkImage destImage,
884 VkImageLayout destImageLayout,
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600885 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600886 const VkImageBlit* pRegions)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600887{
888 NULLDRV_LOG_FUNC;
889}
890
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600891ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600892 VkCmdBuffer cmdBuffer,
893 VkBuffer srcBuffer,
894 VkImage destImage,
895 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700896 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600897 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700898{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700899 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700900}
901
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600902ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600903 VkCmdBuffer cmdBuffer,
904 VkImage srcImage,
905 VkImageLayout srcImageLayout,
906 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700907 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600908 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700909{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700910 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700911}
912
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600913ICD_EXPORT void VKAPI vkCmdCloneImageData(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600914 VkCmdBuffer cmdBuffer,
915 VkImage srcImage,
916 VkImageLayout srcImageLayout,
917 VkImage destImage,
918 VkImageLayout destImageLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700919{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700920 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700921}
922
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600923ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600924 VkCmdBuffer cmdBuffer,
925 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600926 VkDeviceSize destOffset,
927 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700928 const uint32_t* pData)
929{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700930 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700931}
932
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600933ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600934 VkCmdBuffer cmdBuffer,
935 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600936 VkDeviceSize destOffset,
937 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700938 uint32_t data)
939{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700940 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700941}
942
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600943ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600944 VkCmdBuffer cmdBuffer,
945 VkImage image,
946 VkImageLayout imageLayout,
947 VkClearColor color,
David Pinedo0257fbf2015-02-02 18:02:40 -0700948 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600949 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700950{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700951 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700952}
953
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600954ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600955 VkCmdBuffer cmdBuffer,
956 VkImage image,
957 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700958 float depth,
959 uint32_t stencil,
960 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600961 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700962{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700963 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700964}
965
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600966ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600967 VkCmdBuffer cmdBuffer,
968 VkImage srcImage,
969 VkImageLayout srcImageLayout,
970 VkImage destImage,
971 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -0600972 uint32_t regionCount,
973 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700974{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700975 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700976}
977
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600978ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600979 VkCmdBuffer cmdBuffer,
980 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700981 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600982 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700983{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700984 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700985}
986
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600987ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600988 VkCmdBuffer cmdBuffer,
989 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700990 uint32_t slot)
991{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700992 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700993}
994
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600995ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600996 VkCmdBuffer cmdBuffer,
997 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700998 uint32_t startQuery,
999 uint32_t queryCount)
1000{
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 vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001005 VkCmdBuffer cmdBuffer,
1006 VkEvent event_,
1007 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001008{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001009 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001010}
1011
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001012ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001013 VkCmdBuffer cmdBuffer,
1014 VkEvent event_,
1015 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001016{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001017 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001018}
1019
Ian Elliott63f1edb2015-04-16 18:10:19 -06001020ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1021 VkCmdBuffer cmdBuffer,
1022 VkQueryPool queryPool,
1023 uint32_t startQuery,
1024 uint32_t queryCount,
1025 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001026 VkDeviceSize destOffset,
1027 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001028 VkFlags flags)
1029{
1030 NULLDRV_LOG_FUNC;
1031}
1032
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001033ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001034 VkCmdBuffer cmdBuffer,
1035 VkTimestampType timestampType,
1036 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001037 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001038{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001039 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001040}
1041
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001042ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001043 VkCmdBuffer cmdBuffer,
1044 VkPipelineBindPoint pipelineBindPoint,
1045 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001046{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001047 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001048}
1049
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001050ICD_EXPORT void VKAPI vkCmdBindDynamicStateObject(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001051 VkCmdBuffer cmdBuffer,
1052 VkStateBindPoint stateBindPoint,
1053 VkDynamicStateObject state)
David Pinedo0257fbf2015-02-02 18:02:40 -07001054{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001055 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001056}
1057
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001058ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001059 VkCmdBuffer cmdBuffer,
1060 VkPipelineBindPoint pipelineBindPoint,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001061 uint32_t firstSet,
1062 uint32_t setCount,
1063 const VkDescriptorSet* pDescriptorSets,
1064 uint32_t dynamicOffsetCount,
1065 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001066{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001067 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001068}
1069
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001070ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1071 VkCmdBuffer cmdBuffer,
1072 uint32_t startBinding,
1073 uint32_t bindingCount,
1074 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001075 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001076{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001077 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001078}
1079
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001080ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001081 VkCmdBuffer cmdBuffer,
1082 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001083 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001084 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001085{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001086 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001087}
1088
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001089ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001090 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001091 uint32_t firstVertex,
1092 uint32_t vertexCount,
1093 uint32_t firstInstance,
1094 uint32_t instanceCount)
1095{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001096 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001097}
1098
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001099ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001100 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001101 uint32_t firstIndex,
1102 uint32_t indexCount,
1103 int32_t vertexOffset,
1104 uint32_t firstInstance,
1105 uint32_t instanceCount)
1106{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001107 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001108}
1109
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001110ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001111 VkCmdBuffer cmdBuffer,
1112 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001113 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001114 uint32_t count,
1115 uint32_t stride)
1116{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001117 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001118}
1119
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001120ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001121 VkCmdBuffer cmdBuffer,
1122 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001123 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001124 uint32_t count,
1125 uint32_t stride)
1126{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001127 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001128}
1129
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001130ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001131 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001132 uint32_t x,
1133 uint32_t y,
1134 uint32_t z)
1135{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001136 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001137}
1138
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001139ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001140 VkCmdBuffer cmdBuffer,
1141 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001142 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001143{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001144 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001145}
1146
Tony Barbour8205d902015-04-16 15:59:00 -06001147void VKAPI vkCmdWaitEvents(
1148 VkCmdBuffer cmdBuffer,
1149 VkWaitEvent waitEvent,
1150 uint32_t eventCount,
1151 const VkEvent* pEvents,
1152 uint32_t memBarrierCount,
1153 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001154{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001155 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001156}
1157
Tony Barbour8205d902015-04-16 15:59:00 -06001158void VKAPI vkCmdPipelineBarrier(
1159 VkCmdBuffer cmdBuffer,
1160 VkWaitEvent waitEvent,
1161 uint32_t pipeEventCount,
1162 const VkPipeEvent* pPipeEvents,
1163 uint32_t memBarrierCount,
1164 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001165{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001166 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001167}
1168
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001169ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001170 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001171 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001172 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001173{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001174 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001175 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1176 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1177}
1178
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001179ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1180 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001181{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001182 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001183 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001184}
1185
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001186ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1187 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001188 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001189 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001190 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001191{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001192 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001193 struct nulldrv_dev *dev = nulldrv_dev(device);
1194 *pQueue = dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001195 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001196}
1197
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001198ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1199 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001200{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001201 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001202 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001203}
1204
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001205ICD_EXPORT VkResult VKAPI vkDbgSetValidationLevel(
1206 VkDevice device,
1207 VkValidationLevel validationLevel)
David Pinedo0257fbf2015-02-02 18:02:40 -07001208{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001209 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001210 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001211}
1212
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001213ICD_EXPORT VkResult VKAPI vkDbgSetMessageFilter(
1214 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001215 int32_t msgCode,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001216 VK_DBG_MSG_FILTER filter)
David Pinedo0257fbf2015-02-02 18:02:40 -07001217{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001218 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001219 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001220}
1221
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001222ICD_EXPORT VkResult VKAPI vkDbgSetDeviceOption(
1223 VkDevice device,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001224 VK_DBG_DEVICE_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001225 size_t dataSize,
1226 const void* pData)
1227{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001228 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001229 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001230}
1231
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001232ICD_EXPORT VkResult VKAPI vkCreateEvent(
1233 VkDevice device,
1234 const VkEventCreateInfo* pCreateInfo,
1235 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001236{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001237 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001238 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001239}
1240
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001241ICD_EXPORT VkResult VKAPI vkGetEventStatus(
1242 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001243{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001244 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001245 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001246}
1247
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001248ICD_EXPORT VkResult VKAPI vkSetEvent(
1249 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001250{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001251 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001252 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001253}
1254
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001255ICD_EXPORT VkResult VKAPI vkResetEvent(
1256 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001257{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001258 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001259 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001260}
1261
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001262ICD_EXPORT VkResult VKAPI vkCreateFence(
1263 VkDevice device,
1264 const VkFenceCreateInfo* pCreateInfo,
1265 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001266{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001267 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001268 struct nulldrv_dev *dev = nulldrv_dev(device);
1269
1270 return nulldrv_fence_create(dev, pCreateInfo,
1271 (struct nulldrv_fence **) pFence);
1272}
1273
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001274ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
1275 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001276{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001277 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001278 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001279}
1280
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001281ICD_EXPORT VkResult VKAPI vkResetFences(
1282 VkDevice device,
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001283 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001284 VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001285{
1286 NULLDRV_LOG_FUNC;
1287 return VK_SUCCESS;
1288}
1289
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001290ICD_EXPORT VkResult VKAPI vkWaitForFences(
1291 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001292 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001293 const VkFence* pFences,
David Pinedo0257fbf2015-02-02 18:02:40 -07001294 bool32_t waitAll,
1295 uint64_t timeout)
1296{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001297 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001298 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001299}
1300
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001301ICD_EXPORT VkResult VKAPI vkGetFormatInfo(
1302 VkDevice device,
1303 VkFormat format,
1304 VkFormatInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001305 size_t* pDataSize,
1306 void* pData)
1307{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001308 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001309 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001310}
1311
Tony Barbour8205d902015-04-16 15:59:00 -06001312ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo(
1313 VkPhysicalDevice gpu_,
1314 VkPhysicalDeviceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001315 size_t* pDataSize,
1316 void* pData)
1317{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001318 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001319 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001320}
1321
Jon Ashburneb2728b2015-04-10 14:33:07 -06001322ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
1323 VkExtensionInfoType infoType,
1324 uint32_t extensionIndex,
1325 size_t* pDataSize,
1326 void* pData)
1327{
1328 uint32_t *count;
1329
1330 if (pDataSize == NULL)
1331 return VK_ERROR_INVALID_POINTER;
1332
1333 switch (infoType) {
1334 case VK_EXTENSION_INFO_TYPE_COUNT:
1335 *pDataSize = sizeof(uint32_t);
1336 if (pData == NULL)
1337 return VK_SUCCESS;
1338 count = (uint32_t *) pData;
1339 *count = 0;
1340 break;
1341 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1342 *pDataSize = 0;
1343 if (pData == NULL)
1344 return VK_SUCCESS;
1345 else
1346 return VK_ERROR_INVALID_EXTENSION;
1347 break;
1348 default:
1349 return VK_ERROR_INVALID_VALUE;
1350 };
1351
1352 return VK_SUCCESS;
1353}
1354
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001355VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
Tony Barbour8205d902015-04-16 15:59:00 -06001356 VkPhysicalDevice gpu,
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001357 VkExtensionInfoType infoType,
1358 uint32_t extensionIndex,
1359 size_t* pDataSize,
1360 void* pData)
David Pinedo0257fbf2015-02-02 18:02:40 -07001361{
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001362 uint32_t *count;
1363
1364 if (pDataSize == NULL)
1365 return VK_ERROR_INVALID_POINTER;
1366
1367 switch (infoType) {
1368 case VK_EXTENSION_INFO_TYPE_COUNT:
1369 *pDataSize = sizeof(uint32_t);
1370 if (pData == NULL)
1371 return VK_SUCCESS;
1372 count = (uint32_t *) pData;
1373 *count = 0;
1374 break;
1375 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1376 *pDataSize = 0;
1377 if (pData == NULL)
1378 return VK_SUCCESS;
1379 return VK_ERROR_INVALID_EXTENSION;
1380 break;
1381 default:
1382 return VK_ERROR_INVALID_VALUE;
1383 };
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001384 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001385}
1386
Tony Barbour8205d902015-04-16 15:59:00 -06001387ICD_EXPORT VkResult VKAPI vkGetMultiDeviceCompatibility(
1388 VkPhysicalDevice gpu0_,
1389 VkPhysicalDevice gpu1_,
1390 VkPhysicalDeviceCompatibilityInfo* pInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001391{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001392 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001393 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001394}
1395
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001396ICD_EXPORT VkResult VKAPI vkOpenPeerImage(
1397 VkDevice device,
1398 const VkPeerImageOpenInfo* pOpenInfo,
1399 VkImage* pImage,
Tony Barbour8205d902015-04-16 15:59:00 -06001400 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001401{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001402 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001403 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001404}
1405
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001406ICD_EXPORT VkResult VKAPI vkCreateImage(
1407 VkDevice device,
1408 const VkImageCreateInfo* pCreateInfo,
1409 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001410{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001411 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001412 struct nulldrv_dev *dev = nulldrv_dev(device);
1413
1414 return nulldrv_img_create(dev, pCreateInfo, false,
1415 (struct nulldrv_img **) pImage);
1416}
1417
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001418ICD_EXPORT VkResult VKAPI vkGetImageSubresourceInfo(
1419 VkImage image,
1420 const VkImageSubresource* pSubresource,
1421 VkSubresourceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001422 size_t* pDataSize,
1423 void* pData)
1424{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001425 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001426 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001427
1428 switch (infoType) {
Tony Barbour8205d902015-04-16 15:59:00 -06001429 case VK_SUBRESOURCE_INFO_TYPE_LAYOUT:
David Pinedo0257fbf2015-02-02 18:02:40 -07001430 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001431 VkSubresourceLayout *layout = (VkSubresourceLayout *) pData;
David Pinedo0257fbf2015-02-02 18:02:40 -07001432
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001433 *pDataSize = sizeof(VkSubresourceLayout);
David Pinedo0257fbf2015-02-02 18:02:40 -07001434
1435 if (pData == NULL)
1436 return ret;
1437 layout->offset = 0;
1438 layout->size = 1;
1439 layout->rowPitch = 4;
1440 layout->depthPitch = 4;
1441 }
1442 break;
1443 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001444 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -07001445 break;
1446 }
1447
1448 return ret;
1449}
1450
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001451ICD_EXPORT VkResult VKAPI vkAllocMemory(
1452 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001453 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001454 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001455{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001456 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001457 struct nulldrv_dev *dev = nulldrv_dev(device);
1458
1459 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1460}
1461
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001462ICD_EXPORT VkResult VKAPI vkFreeMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001463 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001464{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001465 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001466 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001467}
1468
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001469ICD_EXPORT VkResult VKAPI vkSetMemoryPriority(
Tony Barbour8205d902015-04-16 15:59:00 -06001470 VkDeviceMemory mem_,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001471 VkMemoryPriority priority)
David Pinedo0257fbf2015-02-02 18:02:40 -07001472{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001473 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001474 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001475}
1476
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001477ICD_EXPORT VkResult VKAPI vkMapMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001478 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001479 VkDeviceSize offset,
1480 VkDeviceSize size,
1481 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001482 void** ppData)
1483{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001484 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001485 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1486 void *ptr = nulldrv_mem_map(mem, flags);
1487
1488 *ppData = ptr;
1489
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001490 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001491}
1492
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001493ICD_EXPORT VkResult VKAPI vkUnmapMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001494 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001495{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001496 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001497 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001498}
1499
Ian Elliott07de9232015-04-17 10:04:00 -06001500ICD_EXPORT VkResult VKAPI vkFlushMappedMemory(
1501 VkDeviceMemory mem_,
1502 VkDeviceSize offset,
1503 VkDeviceSize size)
1504{
1505 NULLDRV_LOG_FUNC;
1506 return VK_SUCCESS;
1507}
1508
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001509ICD_EXPORT VkResult VKAPI vkPinSystemMemory(
1510 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001511 const void* pSysMem,
1512 size_t memSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001513 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001514{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001515 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001516 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001517}
1518
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001519ICD_EXPORT VkResult VKAPI vkOpenSharedMemory(
1520 VkDevice device,
1521 const VkMemoryOpenInfo* pOpenInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001522 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001523{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001524 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001525 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001526}
1527
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001528ICD_EXPORT VkResult VKAPI vkOpenPeerMemory(
1529 VkDevice device,
1530 const VkPeerMemoryOpenInfo* pOpenInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001531 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001532{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001533 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001534 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001535}
1536
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001537ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001538 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001539 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001540{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001541 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001542 struct nulldrv_instance *inst;
1543
1544 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001545 VK_DBG_OBJECT_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001546 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001547 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001548
1549 inst->obj.base.get_info = NULL;
1550
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001551 *pInstance = (VkInstance*)inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001552
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001553 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001554}
1555
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001556ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1557 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001558{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001559 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001560 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001561}
1562
Tony Barbour8205d902015-04-16 15:59:00 -06001563ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001564 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001565 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001566 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001567{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001568 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001569 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001570 struct nulldrv_gpu *gpu;
1571 *pGpuCount = 1;
1572 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001573 if (ret == VK_SUCCESS)
Tony Barbour8205d902015-04-16 15:59:00 -06001574 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001575 return ret;
1576}
1577
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001578ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001579 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001580 size_t maxLayerCount,
1581 size_t maxStringSize,
1582 size_t* pOutLayerCount,
1583 char* const* pOutLayers,
1584 void* pReserved)
1585{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001586 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001587 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001588}
1589
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001590ICD_EXPORT VkResult VKAPI vkDbgRegisterMsgCallback(
1591 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001592 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback,
David Pinedo0257fbf2015-02-02 18:02:40 -07001593 void* pUserData)
1594{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001595 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001596 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001597}
1598
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001599ICD_EXPORT VkResult VKAPI vkDbgUnregisterMsgCallback(
1600 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001601 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
David Pinedo0257fbf2015-02-02 18:02:40 -07001602{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001603 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001604 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001605}
1606
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001607ICD_EXPORT VkResult VKAPI vkDbgSetGlobalOption(
1608 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001609 VK_DBG_GLOBAL_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001610 size_t dataSize,
1611 const void* pData)
1612{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001613 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001614 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001615}
1616
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001617ICD_EXPORT VkResult VKAPI vkDestroyObject(
1618 VkObject object)
David Pinedo0257fbf2015-02-02 18:02:40 -07001619{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001620 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001621 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001622}
1623
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001624ICD_EXPORT VkResult VKAPI vkGetObjectInfo(
1625 VkBaseObject object,
1626 VkObjectInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001627 size_t* pDataSize,
1628 void* pData)
1629{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001630 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001631 struct nulldrv_base *base = nulldrv_base(object);
1632
1633 return base->get_info(base, infoType, pDataSize, pData);
1634}
1635
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001636ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemory(
1637 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001638 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001639 uint32_t allocationIdx,
Tony Barbour8205d902015-04-16 15:59:00 -06001640 VkDeviceMemory mem_,
1641 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001642{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001643 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001644 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001645}
1646
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001647ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(
1648 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001649 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001650 uint32_t allocationIdx,
Tony Barbour8205d902015-04-16 15:59:00 -06001651 VkDeviceSize rangeOffset,
1652 VkDeviceSize rangeSize,
1653 VkDeviceMemory mem,
1654 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001655{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001656 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001657 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001658}
1659
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001660ICD_EXPORT VkResult VKAPI vkQueueBindImageMemoryRange(
1661 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001662 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001663 uint32_t allocationIdx,
1664 const VkImageMemoryBindInfo* pBindInfo,
1665 VkDeviceMemory mem,
1666 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001667{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001668 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001669 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001670}
1671
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001672ICD_EXPORT VkResult VKAPI vkDbgSetObjectTag(
1673 VkBaseObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001674 size_t tagSize,
1675 const void* pTag)
1676{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001677 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001678 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001679}
1680
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001681ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(
1682 VkDevice device,
1683 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1684 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001685{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001686 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001687 struct nulldrv_dev *dev = nulldrv_dev(device);
1688
1689 return graphics_pipeline_create(dev, pCreateInfo,
1690 (struct nulldrv_pipeline **) pPipeline);
1691}
1692
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001693ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative(
1694 VkDevice device,
1695 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1696 VkPipeline basePipeline,
1697 VkPipeline* pPipeline)
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001698{
1699 NULLDRV_LOG_FUNC;
1700 struct nulldrv_dev *dev = nulldrv_dev(device);
1701
1702 return graphics_pipeline_create(dev, pCreateInfo,
1703 (struct nulldrv_pipeline **) pPipeline);
1704}
1705
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001706ICD_EXPORT VkResult VKAPI vkCreateComputePipeline(
1707 VkDevice device,
1708 const VkComputePipelineCreateInfo* pCreateInfo,
1709 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001710{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001711 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001712 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001713}
1714
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001715ICD_EXPORT VkResult VKAPI vkStorePipeline(
1716 VkPipeline pipeline,
David Pinedo0257fbf2015-02-02 18:02:40 -07001717 size_t* pDataSize,
1718 void* pData)
1719{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001720 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001721 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001722}
1723
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001724ICD_EXPORT VkResult VKAPI vkLoadPipeline(
1725 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001726 size_t dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001727 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001728 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001729{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001730 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001731 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001732}
1733
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001734ICD_EXPORT VkResult VKAPI vkLoadPipelineDerivative(
1735 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001736 size_t dataSize,
1737 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001738 VkPipeline basePipeline,
1739 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001740{
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 vkCreateQueryPool(
1746 VkDevice device,
1747 const VkQueryPoolCreateInfo* pCreateInfo,
1748 VkQueryPool* pQueryPool)
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 vkGetQueryPoolResults(
1755 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001756 uint32_t startQuery,
1757 uint32_t queryCount,
1758 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001759 void* pData,
1760 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001761{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001762 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001763 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001764}
1765
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001766ICD_EXPORT VkResult VKAPI vkQueueAddMemReferences(
1767 VkQueue queue,
1768 uint32_t count,
Tony Barbour8205d902015-04-16 15:59:00 -06001769 const VkDeviceMemory* pMems)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001770{
1771 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001772 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001773}
1774
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001775ICD_EXPORT VkResult VKAPI vkQueueRemoveMemReferences(
1776 VkQueue queue,
1777 uint32_t count,
Tony Barbour8205d902015-04-16 15:59:00 -06001778 const VkDeviceMemory* pMems)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001779{
1780 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001781 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001782}
1783
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001784ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1785 VkQueue queue_)
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
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001791ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1792 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001793 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001794 const VkCmdBuffer* pCmdBuffers,
1795 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001796{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001797 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001798 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001799}
1800
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001801ICD_EXPORT VkResult VKAPI vkOpenSharedSemaphore(
1802 VkDevice device,
1803 const VkSemaphoreOpenInfo* pOpenInfo,
1804 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001805{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001806 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001807 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001808}
1809
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001810ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1811 VkDevice device,
1812 const VkSemaphoreCreateInfo* pCreateInfo,
1813 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001814{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001815 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001816 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001817}
1818
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001819ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1820 VkQueue queue,
1821 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001822{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001823 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001824 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001825}
1826
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001827ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1828 VkQueue queue,
1829 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001830{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001831 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001832 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001833}
1834
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001835ICD_EXPORT VkResult VKAPI vkCreateSampler(
1836 VkDevice device,
1837 const VkSamplerCreateInfo* pCreateInfo,
1838 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001839{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001840 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001841 struct nulldrv_dev *dev = nulldrv_dev(device);
1842
1843 return nulldrv_sampler_create(dev, pCreateInfo,
1844 (struct nulldrv_sampler **) pSampler);
1845}
1846
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001847ICD_EXPORT VkResult VKAPI vkCreateShader(
1848 VkDevice device,
1849 const VkShaderCreateInfo* pCreateInfo,
1850 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001851{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001852 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001853 struct nulldrv_dev *dev = nulldrv_dev(device);
1854
1855 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1856}
1857
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001858ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
1859 VkDevice device,
1860 const VkDynamicVpStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001861 VkDynamicVpState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001862{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001863 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001864 struct nulldrv_dev *dev = nulldrv_dev(device);
1865
1866 return nulldrv_viewport_state_create(dev, pCreateInfo,
1867 (struct nulldrv_dynamic_vp **) pState);
1868}
1869
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001870ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
1871 VkDevice device,
1872 const VkDynamicRsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001873 VkDynamicRsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001874{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001875 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001876 struct nulldrv_dev *dev = nulldrv_dev(device);
1877
1878 return nulldrv_raster_state_create(dev, pCreateInfo,
1879 (struct nulldrv_dynamic_rs **) pState);
1880}
1881
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001882ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
1883 VkDevice device,
1884 const VkDynamicCbStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001885 VkDynamicCbState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001886{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001887 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001888 struct nulldrv_dev *dev = nulldrv_dev(device);
1889
1890 return nulldrv_blend_state_create(dev, pCreateInfo,
1891 (struct nulldrv_dynamic_cb **) pState);
1892}
1893
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001894ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
1895 VkDevice device,
1896 const VkDynamicDsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001897 VkDynamicDsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001898{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001899 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001900 struct nulldrv_dev *dev = nulldrv_dev(device);
1901
1902 return nulldrv_ds_state_create(dev, pCreateInfo,
1903 (struct nulldrv_dynamic_ds **) pState);
1904}
1905
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001906ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1907 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001908 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001909 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001910{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001911 NULLDRV_LOG_FUNC;
1912 struct nulldrv_dev *dev = nulldrv_dev(device);
1913
1914 return nulldrv_buf_view_create(dev, pCreateInfo,
1915 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001916}
1917
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001918ICD_EXPORT VkResult VKAPI vkCreateImageView(
1919 VkDevice device,
1920 const VkImageViewCreateInfo* pCreateInfo,
1921 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001922{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001923 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001924 struct nulldrv_dev *dev = nulldrv_dev(device);
1925
1926 return nulldrv_img_view_create(dev, pCreateInfo,
1927 (struct nulldrv_img_view **) pView);
1928}
1929
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001930ICD_EXPORT VkResult VKAPI vkCreateColorAttachmentView(
1931 VkDevice device,
1932 const VkColorAttachmentViewCreateInfo* pCreateInfo,
1933 VkColorAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001934{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001935 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001936 struct nulldrv_dev *dev = nulldrv_dev(device);
1937
1938 return nulldrv_rt_view_create(dev, pCreateInfo,
1939 (struct nulldrv_rt_view **) pView);
1940}
1941
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001942ICD_EXPORT VkResult VKAPI vkCreateDepthStencilView(
1943 VkDevice device,
1944 const VkDepthStencilViewCreateInfo* pCreateInfo,
1945 VkDepthStencilView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001946{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001947 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001948 struct nulldrv_dev *dev = nulldrv_dev(device);
1949
1950 return nulldrv_ds_view_create(dev, pCreateInfo,
1951 (struct nulldrv_ds_view **) pView);
1952
1953}
1954
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001955ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1956 VkDevice device,
1957 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1958 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001959{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001960 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001961 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001962
Chia-I Wu7732cb22015-03-26 15:27:55 +08001963 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001964 (struct nulldrv_desc_layout **) pSetLayout);
1965}
1966
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001967ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
1968 VkDevice device,
1969 const VkPipelineLayoutCreateInfo* pCreateInfo,
1970 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001971{
1972 NULLDRV_LOG_FUNC;
1973 struct nulldrv_dev *dev = nulldrv_dev(device);
1974
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001975 return nulldrv_pipeline_layout_create(dev,
1976 pCreateInfo,
1977 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08001978}
1979
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001980ICD_EXPORT VkResult VKAPI vkBeginDescriptorPoolUpdate(
1981 VkDevice device,
1982 VkDescriptorUpdateMode updateMode)
David Pinedo0257fbf2015-02-02 18:02:40 -07001983{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001984 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001985 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001986}
1987
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001988ICD_EXPORT VkResult VKAPI vkEndDescriptorPoolUpdate(
1989 VkDevice device,
1990 VkCmdBuffer cmd_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001991{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001992 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001993 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001994}
1995
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001996ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
1997 VkDevice device,
1998 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07001999 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002000 const VkDescriptorPoolCreateInfo* pCreateInfo,
2001 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002002{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002003 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002004 struct nulldrv_dev *dev = nulldrv_dev(device);
2005
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002006 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
2007 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002008}
2009
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002010ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
2011 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002012{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002013 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002014 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002015}
2016
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002017ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
2018 VkDescriptorPool descriptorPool,
2019 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002020 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002021 const VkDescriptorSetLayout* pSetLayouts,
2022 VkDescriptorSet* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07002023 uint32_t* pCount)
2024{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002025 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002026 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2027 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002028 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002029 uint32_t i;
2030
2031 for (i = 0; i < count; i++) {
2032 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002033 nulldrv_desc_layout((VkDescriptorSetLayout) pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002034
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002035 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002036 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002037 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002038 break;
2039 }
2040
2041 if (pCount)
2042 *pCount = i;
2043
2044 return ret;
2045}
2046
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002047ICD_EXPORT void VKAPI vkClearDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002048 VkDescriptorPool descriptorPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07002049 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002050 const VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002051{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002052 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002053}
2054
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002055ICD_EXPORT void VKAPI vkUpdateDescriptors(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002056 VkDescriptorSet descriptorSet,
Chia-I Wu7732cb22015-03-26 15:27:55 +08002057 uint32_t updateCount,
2058 const void** ppUpdateArray)
David Pinedo0257fbf2015-02-02 18:02:40 -07002059{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002060 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002061}
2062
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002063ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2064 VkDevice device,
2065 const VkFramebufferCreateInfo* info,
2066 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002067{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002068 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002069 struct nulldrv_dev *dev = nulldrv_dev(device);
2070
2071 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2072}
2073
2074
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002075ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2076 VkDevice device,
2077 const VkRenderPassCreateInfo* info,
2078 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002079{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002080 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002081 struct nulldrv_dev *dev = nulldrv_dev(device);
2082
2083 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2084}
2085
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002086ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002087 VkCmdBuffer cmdBuffer,
2088 const VkRenderPassBegin* pRenderPassBegin)
David Pinedo0257fbf2015-02-02 18:02:40 -07002089{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002090 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002091}
2092
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002093ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002094 VkCmdBuffer cmdBuffer,
2095 VkRenderPass renderPass)
David Pinedo0257fbf2015-02-02 18:02:40 -07002096{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002097 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002098}
Ian Elliottf93069f2015-02-19 14:26:19 -07002099
2100ICD_EXPORT void* xcbCreateWindow(
2101 uint16_t width,
2102 uint16_t height)
2103{
2104 static uint32_t window; // Kludge to the max
2105 NULLDRV_LOG_FUNC;
2106 return &window;
2107}
2108
2109// May not be needed, if we stub out stuf in tri.c
2110ICD_EXPORT void xcbDestroyWindow()
2111{
2112 NULLDRV_LOG_FUNC;
2113}
2114
2115ICD_EXPORT int xcbGetMessage(void *msg)
2116{
2117 NULLDRV_LOG_FUNC;
2118 return 0;
2119}
2120
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002121ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002122{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002123 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002124}