blob: e00c8a355686587684adcf13a701170fa3443dc9 [file] [log] [blame]
David Pinedo0257fbf2015-02-02 18:02:40 -07001/*
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002 * Vulkan null driver
David Pinedo0257fbf2015-02-02 18:02:40 -07003 *
4 * Copyright (C) 2015 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 */
25
26#include "nulldrv.h"
David Pinedo8e9cb3b2015-02-10 15:02:08 -070027#include <stdio.h>
David Pinedo0257fbf2015-02-02 18:02:40 -070028
David Pinedo8e9cb3b2015-02-10 15:02:08 -070029#if 0
30#define NULLDRV_LOG_FUNC \
31 do { \
32 fflush(stdout); \
33 fflush(stderr); \
34 printf("null driver: %s\n", __FUNCTION__); \
35 fflush(stdout); \
36 } while (0)
37#else
38 #define NULLDRV_LOG_FUNC do { } while (0)
39#endif
40
41// The null driver supports all WSI extenstions ... for now ...
David Pinedo0257fbf2015-02-02 18:02:40 -070042static const char * const nulldrv_gpu_exts[NULLDRV_EXT_COUNT] = {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060043 [NULLDRV_EXT_WSI_X11] = "VK_WSI_X11",
44 [NULLDRV_EXT_WSI_WINDOWS] = "VK_WSI_WINDOWS"
David Pinedo0257fbf2015-02-02 18:02:40 -070045};
46
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060047static struct nulldrv_base *nulldrv_base(VkBaseObject base)
David Pinedo0257fbf2015-02-02 18:02:40 -070048{
49 return (struct nulldrv_base *) base;
50}
51
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060052static VkResult nulldrv_base_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -070053 size_t *size, void *data)
54{
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060055 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -070056 size_t s;
57 uint32_t *count;
58
59 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -060060 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -070061 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060062 s = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -070063 *size = s;
64 if (data == NULL)
65 return ret;
66 memset(data, 0, s);
David Pinedo0257fbf2015-02-02 18:02:40 -070067 break;
68 }
Tony Barbour8205d902015-04-16 15:59:00 -060069 case VK_OBJECT_INFO_TYPE_MEMORY_ALLOCATION_COUNT:
David Pinedo0257fbf2015-02-02 18:02:40 -070070 *size = sizeof(uint32_t);
71 if (data == NULL)
72 return ret;
73 count = (uint32_t *) data;
74 *count = 1;
75 break;
David Pinedo0257fbf2015-02-02 18:02:40 -070076 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060077 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -070078 break;
79 }
80
81 return ret;
82}
83
84static struct nulldrv_base *nulldrv_base_create(struct nulldrv_dev *dev,
85 size_t obj_size,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060086 VK_DBG_OBJECT_TYPE type)
David Pinedo0257fbf2015-02-02 18:02:40 -070087{
88 struct nulldrv_base *base;
89
90 if (!obj_size)
91 obj_size = sizeof(*base);
92
93 assert(obj_size >= sizeof(*base));
94
Chia-I Wu493a1752015-02-22 14:40:25 +080095 base = (struct nulldrv_base*)malloc(obj_size);
David Pinedo0257fbf2015-02-02 18:02:40 -070096 if (!base)
97 return NULL;
98
99 memset(base, 0, obj_size);
100
101 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
102 set_loader_magic_value(base);
103
104 if (dev == NULL) {
105 /*
106 * dev is NULL when we are creating the base device object
107 * Set dev now so that debug setup happens correctly
108 */
109 dev = (struct nulldrv_dev *) base;
110 }
111
112
113 base->get_info = NULL;
114
115 return base;
116}
117
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600118static VkResult nulldrv_gpu_add(int devid, const char *primary_node,
David Pinedo0257fbf2015-02-02 18:02:40 -0700119 const char *render_node, struct nulldrv_gpu **gpu_ret)
120{
121 struct nulldrv_gpu *gpu;
122
Chia-I Wu493a1752015-02-22 14:40:25 +0800123 gpu = malloc(sizeof(*gpu));
David Pinedo0257fbf2015-02-02 18:02:40 -0700124 if (!gpu)
Tony Barbour8205d902015-04-16 15:59:00 -0600125 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700126 memset(gpu, 0, sizeof(*gpu));
Mark Lobodzinski97dcd042015-04-16 08:52:00 -0500127
David Pinedo0257fbf2015-02-02 18:02:40 -0700128 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
129 set_loader_magic_value(gpu);
130
131 *gpu_ret = gpu;
132
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600133 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700134}
135
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600136static VkResult nulldrv_queue_create(struct nulldrv_dev *dev,
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700137 uint32_t node_index,
David Pinedo0257fbf2015-02-02 18:02:40 -0700138 struct nulldrv_queue **queue_ret)
139{
140 struct nulldrv_queue *queue;
141
142 queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600143 VK_DBG_OBJECT_QUEUE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700144 if (!queue)
Tony Barbour8205d902015-04-16 15:59:00 -0600145 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700146
147 queue->dev = dev;
148
149 *queue_ret = queue;
150
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600151 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700152}
153
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600154static VkResult dev_create_queues(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600155 const VkDeviceQueueCreateInfo *queues,
David Pinedo0257fbf2015-02-02 18:02:40 -0700156 uint32_t count)
157{
158 uint32_t i;
159
160 if (!count)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600161 return VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700162
163 for (i = 0; i < count; i++) {
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600164 const VkDeviceQueueCreateInfo *q = &queues[i];
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600165 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700166
167 if (q->queueCount == 1 && !dev->queues[q->queueNodeIndex]) {
168 ret = nulldrv_queue_create(dev, q->queueNodeIndex,
169 &dev->queues[q->queueNodeIndex]);
170 }
171 else {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600172 ret = VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700173 }
174
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600175 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700176 return ret;
177 }
178 }
179
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600180 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700181}
182
183static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(const struct nulldrv_gpu *gpu,
184 const char *ext)
185{
186 enum nulldrv_ext_type type;
187
188 for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) {
189 if (nulldrv_gpu_exts[type] && strcmp(nulldrv_gpu_exts[type], ext) == 0)
190 break;
191 }
192
193 assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID);
194
195 return type;
196}
197
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600198static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800199 struct nulldrv_desc_ooxx **ooxx_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700200{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800201 struct nulldrv_desc_ooxx *ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700202
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800203 ooxx = malloc(sizeof(*ooxx));
204 if (!ooxx)
Tony Barbour8205d902015-04-16 15:59:00 -0600205 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700206
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800207 memset(ooxx, 0, sizeof(*ooxx));
David Pinedo0257fbf2015-02-02 18:02:40 -0700208
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800209 ooxx->surface_desc_size = 0;
210 ooxx->sampler_desc_size = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700211
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800212 *ooxx_ret = ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700213
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600214 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700215}
216
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600217static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600218 const VkDeviceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700219 struct nulldrv_dev **dev_ret)
220{
221 struct nulldrv_dev *dev;
222 uint32_t i;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600223 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -0700224
225 dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600226 VK_DBG_OBJECT_DEVICE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700227 if (!dev)
Tony Barbour8205d902015-04-16 15:59:00 -0600228 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700229
230 for (i = 0; i < info->extensionCount; i++) {
231 const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(gpu,
232 info->ppEnabledExtensionNames[i]);
233
234 if (ext == NULLDRV_EXT_INVALID)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600235 return VK_ERROR_INVALID_EXTENSION;
David Pinedo0257fbf2015-02-02 18:02:40 -0700236
237 dev->exts[ext] = true;
238 }
239
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800240 ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600241 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700242 return ret;
243 }
244
245 ret = dev_create_queues(dev, info->pRequestedQueues,
246 info->queueRecordCount);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600247 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700248 return ret;
249 }
250
251 *dev_ret = dev;
252
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600253 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700254}
255
Tony Barbour8205d902015-04-16 15:59:00 -0600256static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalDevice gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700257{
258 return (struct nulldrv_gpu *) gpu;
259}
260
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600261static VkResult nulldrv_rt_view_create(struct nulldrv_dev *dev,
262 const VkColorAttachmentViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700263 struct nulldrv_rt_view **view_ret)
264{
265 struct nulldrv_rt_view *view;
266
267 view = (struct nulldrv_rt_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600268 VK_DBG_OBJECT_COLOR_TARGET_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700269 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600270 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700271
272 *view_ret = view;
273
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600274 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700275}
276
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600277static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
278 const VkFenceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700279 struct nulldrv_fence **fence_ret)
280{
281 struct nulldrv_fence *fence;
282
283 fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600284 VK_DBG_OBJECT_FENCE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700285 if (!fence)
Tony Barbour8205d902015-04-16 15:59:00 -0600286 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700287
288 *fence_ret = fence;
289
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600290 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700291}
292
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600293static struct nulldrv_dev *nulldrv_dev(VkDevice dev)
David Pinedo0257fbf2015-02-02 18:02:40 -0700294{
295 return (struct nulldrv_dev *) dev;
296}
297
298static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base)
299{
300 return (struct nulldrv_img *) base;
301}
302
303
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600304static VkResult img_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700305 size_t *size, void *data)
306{
307 struct nulldrv_img *img = nulldrv_img_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600308 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700309
310 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -0600311 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700312 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600313 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700314
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600315 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700316 if (data == NULL)
317 return ret;
318 mem_req->size = img->total_size;
319 mem_req->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700320 }
321 break;
322 default:
323 ret = nulldrv_base_get_info(base, type, size, data);
324 break;
325 }
326
327 return ret;
328}
329
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600330static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
331 const VkImageCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700332 bool scanout,
333 struct nulldrv_img **img_ret)
334{
335 struct nulldrv_img *img;
336
337 img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600338 VK_DBG_OBJECT_IMAGE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700339 if (!img)
Tony Barbour8205d902015-04-16 15:59:00 -0600340 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700341
342 img->type = info->imageType;
343 img->depth = info->extent.depth;
344 img->mip_levels = info->mipLevels;
345 img->array_size = info->arraySize;
346 img->usage = info->usage;
David Pinedo0257fbf2015-02-02 18:02:40 -0700347 img->samples = info->samples;
348
349 img->obj.base.get_info = img_get_info;
350
351 *img_ret = img;
352
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600353 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700354}
355
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600356static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700357{
358 return (struct nulldrv_img *) image;
359}
360
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600361static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600362 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700363 struct nulldrv_mem **mem_ret)
364{
365 struct nulldrv_mem *mem;
366
367 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600368 VK_DBG_OBJECT_GPU_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700369 if (!mem)
Tony Barbour8205d902015-04-16 15:59:00 -0600370 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700371
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700372 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700373 if (!mem->bo) {
Tony Barbour8205d902015-04-16 15:59:00 -0600374 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700375 }
376
377 mem->size = info->allocationSize;
378
379 *mem_ret = mem;
380
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600381 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700382}
383
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600384static VkResult nulldrv_ds_view_create(struct nulldrv_dev *dev,
385 const VkDepthStencilViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700386 struct nulldrv_ds_view **view_ret)
387{
388 struct nulldrv_img *img = nulldrv_img(info->image);
389 struct nulldrv_ds_view *view;
390
391 view = (struct nulldrv_ds_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600392 VK_DBG_OBJECT_DEPTH_STENCIL_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700393 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600394 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700395
396 view->img = img;
397
398 view->array_size = info->arraySize;
399
400 *view_ret = view;
401
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600402 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700403}
404
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600405static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
406 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700407 struct nulldrv_sampler **sampler_ret)
408{
409 struct nulldrv_sampler *sampler;
410
411 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600412 sizeof(*sampler), VK_DBG_OBJECT_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700413 if (!sampler)
Tony Barbour8205d902015-04-16 15:59:00 -0600414 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700415
416 *sampler_ret = sampler;
417
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600418 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700419}
420
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600421static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
422 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700423 struct nulldrv_img_view **view_ret)
424{
425 struct nulldrv_img *img = nulldrv_img(info->image);
426 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700427
428 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600429 VK_DBG_OBJECT_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700430 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600431 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700432
433 view->img = img;
434 view->min_lod = info->minLod;
435
David Pinedo0257fbf2015-02-02 18:02:40 -0700436 view->cmd_len = 8;
437
438 *view_ret = view;
439
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600440 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700441}
442
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600443static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700444{
445 return mem->bo;
446}
447
Tony Barbour8205d902015-04-16 15:59:00 -0600448static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700449{
450 return (struct nulldrv_mem *) mem;
451}
452
453static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
454{
455 return (struct nulldrv_buf *) base;
456}
457
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600458static VkResult buf_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -0700459 size_t *size, void *data)
460{
461 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600462 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700463
464 switch (type) {
Tony Barbour8205d902015-04-16 15:59:00 -0600465 case VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -0700466 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600467 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700468
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600469 *size = sizeof(VkMemoryRequirements);
David Pinedo0257fbf2015-02-02 18:02:40 -0700470 if (data == NULL)
471 return ret;
472
473 mem_req->size = buf->size;
474 mem_req->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700475
476 }
477 break;
David Pinedo0257fbf2015-02-02 18:02:40 -0700478 default:
479 ret = nulldrv_base_get_info(base, type, size, data);
480 break;
481 }
482
483 return ret;
484}
485
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600486static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600487 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700488 struct nulldrv_buf **buf_ret)
489{
490 struct nulldrv_buf *buf;
491
492 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600493 VK_DBG_OBJECT_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700494 if (!buf)
Tony Barbour8205d902015-04-16 15:59:00 -0600495 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700496
497 buf->size = info->size;
498 buf->usage = info->usage;
499
500 buf->obj.base.get_info = buf_get_info;
501
502 *buf_ret = buf;
503
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600504 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700505}
506
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600507static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
508 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700509 struct nulldrv_desc_layout **layout_ret)
510{
511 struct nulldrv_desc_layout *layout;
512
513 layout = (struct nulldrv_desc_layout *)
514 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600515 VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700516 if (!layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600517 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700518
519 *layout_ret = layout;
520
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600521 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700522}
523
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600524static VkResult nulldrv_desc_layout_chain_create(struct nulldrv_dev *dev,
Chia-I Wu7732cb22015-03-26 15:27:55 +0800525 uint32_t setLayoutArrayCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600526 const VkDescriptorSetLayout *pSetLayoutArray,
Chia-I Wu7732cb22015-03-26 15:27:55 +0800527 struct nulldrv_desc_layout_chain **chain_ret)
528{
529 struct nulldrv_desc_layout_chain *chain;
530
531 chain = (struct nulldrv_desc_layout_chain *)
532 nulldrv_base_create(dev, sizeof(*chain),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600533 VK_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT_CHAIN);
Chia-I Wu7732cb22015-03-26 15:27:55 +0800534 if (!chain)
Tony Barbour8205d902015-04-16 15:59:00 -0600535 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800536
537 *chain_ret = chain;
538
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600539 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800540}
541
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600542static struct nulldrv_desc_layout *nulldrv_desc_layout(VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700543{
544 return (struct nulldrv_desc_layout *) layout;
545}
546
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600547static VkResult shader_create(struct nulldrv_dev *dev,
548 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700549 struct nulldrv_shader **sh_ret)
550{
David Pinedo0257fbf2015-02-02 18:02:40 -0700551 struct nulldrv_shader *sh;
552
553 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600554 VK_DBG_OBJECT_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700555 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600556 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700557
558 *sh_ret = sh;
559
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600560 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700561}
562
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600563static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
564 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700565 struct nulldrv_pipeline **pipeline_ret)
566{
567 struct nulldrv_pipeline *pipeline;
568
569 pipeline = (struct nulldrv_pipeline *)
570 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600571 VK_DBG_OBJECT_GRAPHICS_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700572 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600573 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700574
575 *pipeline_ret = pipeline;
576
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600577 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700578}
579
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600580static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev,
581 const VkDynamicVpStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700582 struct nulldrv_dynamic_vp **state_ret)
583{
584 struct nulldrv_dynamic_vp *state;
585
586 state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600587 sizeof(*state), VK_DBG_OBJECT_VIEWPORT_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700588 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600589 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700590
591 *state_ret = state;
592
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600593 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700594}
595
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600596static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev,
597 const VkDynamicRsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700598 struct nulldrv_dynamic_rs **state_ret)
599{
600 struct nulldrv_dynamic_rs *state;
601
602 state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600603 sizeof(*state), VK_DBG_OBJECT_RASTER_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700604 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600605 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700606
607 *state_ret = state;
608
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600609 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700610}
611
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600612static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev,
613 const VkDynamicCbStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700614 struct nulldrv_dynamic_cb **state_ret)
615{
616 struct nulldrv_dynamic_cb *state;
617
618 state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600619 sizeof(*state), VK_DBG_OBJECT_COLOR_BLEND_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700620 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600621 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700622
623 *state_ret = state;
624
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600625 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700626}
627
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600628static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev,
629 const VkDynamicDsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700630 struct nulldrv_dynamic_ds **state_ret)
631{
632 struct nulldrv_dynamic_ds *state;
633
634 state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600635 sizeof(*state), VK_DBG_OBJECT_DEPTH_STENCIL_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700636 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600637 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700638
639 *state_ret = state;
640
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600641 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700642}
643
644
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600645static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
646 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700647 struct nulldrv_cmd **cmd_ret)
648{
David Pinedo0257fbf2015-02-02 18:02:40 -0700649 struct nulldrv_cmd *cmd;
650
David Pinedo0257fbf2015-02-02 18:02:40 -0700651 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600652 VK_DBG_OBJECT_CMD_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700653 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600654 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700655
656 *cmd_ret = cmd;
657
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600658 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700659}
660
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600661static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
662 VkDescriptorPoolUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700663 uint32_t max_sets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600664 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800665 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700666{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800667 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700668
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800669 pool = (struct nulldrv_desc_pool *)
670 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600671 VK_DBG_OBJECT_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800672 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600673 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700674
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800675 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700676
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800677 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700678
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600679 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700680}
681
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600682static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800683 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600684 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700685 const struct nulldrv_desc_layout *layout,
686 struct nulldrv_desc_set **set_ret)
687{
688 struct nulldrv_desc_set *set;
689
690 set = (struct nulldrv_desc_set *)
691 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600692 VK_DBG_OBJECT_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700693 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600694 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700695
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800696 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700697 set->layout = layout;
698 *set_ret = set;
699
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600700 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700701}
702
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600703static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700704{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800705 return (struct nulldrv_desc_pool *) pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700706}
707
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600708static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
709 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700710 struct nulldrv_framebuffer ** fb_ret)
711{
712
713 struct nulldrv_framebuffer *fb;
714 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600715 VK_DBG_OBJECT_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700716 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600717 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700718
719 *fb_ret = fb;
720
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600721 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700722
723}
724
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600725static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
726 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700727 struct nulldrv_render_pass** rp_ret)
728{
729 struct nulldrv_render_pass *rp;
730 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600731 VK_DBG_OBJECT_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700732 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600733 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700734
735 *rp_ret = rp;
736
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600737 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700738}
739
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600740static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700741{
742 return (struct nulldrv_buf *) buf;
743}
744
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600745static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600746 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700747 struct nulldrv_buf_view **view_ret)
748{
749 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
750 struct nulldrv_buf_view *view;
751
752 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600753 VK_DBG_OBJECT_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700754 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600755 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700756
757 view->buf = buf;
758
759 *view_ret = view;
760
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600761 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700762}
763
David Pinedo0257fbf2015-02-02 18:02:40 -0700764
765//*********************************************
766// Driver entry points
767//*********************************************
768
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600769ICD_EXPORT VkResult VKAPI vkCreateBuffer(
770 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600771 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600772 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700773{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700774 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700775 struct nulldrv_dev *dev = nulldrv_dev(device);
776
777 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
778}
779
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600780ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
781 VkDevice device,
782 const VkCmdBufferCreateInfo* pCreateInfo,
783 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700784{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700785 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700786 struct nulldrv_dev *dev = nulldrv_dev(device);
787
788 return nulldrv_cmd_create(dev, pCreateInfo,
789 (struct nulldrv_cmd **) pCmdBuffer);
790}
791
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600792ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
793 VkCmdBuffer cmdBuffer,
794 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700795{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700796 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600797 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700798}
799
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600800ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
801 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700802{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700803 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600804 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700805}
806
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600807ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
808 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700809{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700810 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600811 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700812}
813
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600814ICD_EXPORT void VKAPI vkCmdInitAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600815 VkCmdBuffer cmdBuffer,
816 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700817 uint32_t startCounter,
818 uint32_t counterCount,
819 const uint32_t* pData)
820{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700821 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700822}
823
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600824ICD_EXPORT void VKAPI vkCmdLoadAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600825 VkCmdBuffer cmdBuffer,
826 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700827 uint32_t startCounter,
828 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600829 VkBuffer srcBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600830 VkDeviceSize srcOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700831{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700832 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700833}
834
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600835ICD_EXPORT void VKAPI vkCmdSaveAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600836 VkCmdBuffer cmdBuffer,
837 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700838 uint32_t startCounter,
839 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600840 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600841 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700842{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700843 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700844}
845
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600846ICD_EXPORT void VKAPI vkCmdDbgMarkerBegin(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600847 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700848 const char* pMarker)
849{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700850 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700851}
852
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600853ICD_EXPORT void VKAPI vkCmdDbgMarkerEnd(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600854 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700855{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700856 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700857}
858
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600859ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600860 VkCmdBuffer cmdBuffer,
861 VkBuffer srcBuffer,
862 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700863 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600864 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700865{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700866 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700867}
868
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600869ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600870 VkCmdBuffer cmdBuffer,
871 VkImage srcImage,
872 VkImageLayout srcImageLayout,
873 VkImage destImage,
874 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700875 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600876 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700877{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700878 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700879}
880
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600881ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600882 VkCmdBuffer cmdBuffer,
883 VkImage srcImage,
884 VkImageLayout srcImageLayout,
885 VkImage destImage,
886 VkImageLayout destImageLayout,
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600887 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600888 const VkImageBlit* pRegions)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600889{
890 NULLDRV_LOG_FUNC;
891}
892
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600893ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600894 VkCmdBuffer cmdBuffer,
895 VkBuffer srcBuffer,
896 VkImage destImage,
897 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700898 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600899 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700900{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700901 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700902}
903
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600904ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600905 VkCmdBuffer cmdBuffer,
906 VkImage srcImage,
907 VkImageLayout srcImageLayout,
908 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700909 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600910 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700911{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700912 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700913}
914
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600915ICD_EXPORT void VKAPI vkCmdCloneImageData(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600916 VkCmdBuffer cmdBuffer,
917 VkImage srcImage,
918 VkImageLayout srcImageLayout,
919 VkImage destImage,
920 VkImageLayout destImageLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700921{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700922 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700923}
924
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600925ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600926 VkCmdBuffer cmdBuffer,
927 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600928 VkDeviceSize destOffset,
929 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700930 const uint32_t* pData)
931{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700932 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700933}
934
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600935ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600936 VkCmdBuffer cmdBuffer,
937 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600938 VkDeviceSize destOffset,
939 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700940 uint32_t data)
941{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700942 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700943}
944
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600945ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600946 VkCmdBuffer cmdBuffer,
947 VkImage image,
948 VkImageLayout imageLayout,
949 VkClearColor color,
David Pinedo0257fbf2015-02-02 18:02:40 -0700950 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600951 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700952{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700953 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700954}
955
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600956ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600957 VkCmdBuffer cmdBuffer,
958 VkImage image,
959 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700960 float depth,
961 uint32_t stencil,
962 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600963 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700964{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700965 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700966}
967
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600968ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600969 VkCmdBuffer cmdBuffer,
970 VkImage srcImage,
971 VkImageLayout srcImageLayout,
972 VkImage destImage,
973 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -0600974 uint32_t regionCount,
975 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700976{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700977 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700978}
979
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600980ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600981 VkCmdBuffer cmdBuffer,
982 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700983 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600984 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700985{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700986 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700987}
988
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600989ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600990 VkCmdBuffer cmdBuffer,
991 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700992 uint32_t slot)
993{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700994 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700995}
996
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600997ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600998 VkCmdBuffer cmdBuffer,
999 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001000 uint32_t startQuery,
1001 uint32_t queryCount)
1002{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001003 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001004}
1005
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001006ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001007 VkCmdBuffer cmdBuffer,
1008 VkEvent event_,
1009 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001010{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001011 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001012}
1013
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001014ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001015 VkCmdBuffer cmdBuffer,
1016 VkEvent event_,
1017 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001018{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001019 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001020}
1021
Ian Elliott63f1edb2015-04-16 18:10:19 -06001022ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1023 VkCmdBuffer cmdBuffer,
1024 VkQueryPool queryPool,
1025 uint32_t startQuery,
1026 uint32_t queryCount,
1027 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001028 VkDeviceSize destOffset,
1029 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001030 VkFlags flags)
1031{
1032 NULLDRV_LOG_FUNC;
1033}
1034
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001035ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001036 VkCmdBuffer cmdBuffer,
1037 VkTimestampType timestampType,
1038 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001039 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001040{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001041 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001042}
1043
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001044ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001045 VkCmdBuffer cmdBuffer,
1046 VkPipelineBindPoint pipelineBindPoint,
1047 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001048{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001049 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001050}
1051
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001052ICD_EXPORT void VKAPI vkCmdBindDynamicStateObject(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001053 VkCmdBuffer cmdBuffer,
1054 VkStateBindPoint stateBindPoint,
1055 VkDynamicStateObject state)
David Pinedo0257fbf2015-02-02 18:02:40 -07001056{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001057 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001058}
1059
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001060ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001061 VkCmdBuffer cmdBuffer,
1062 VkPipelineBindPoint pipelineBindPoint,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001063 uint32_t firstSet,
1064 uint32_t setCount,
1065 const VkDescriptorSet* pDescriptorSets,
1066 uint32_t dynamicOffsetCount,
1067 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001068{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001069 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001070}
1071
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001072ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1073 VkCmdBuffer cmdBuffer,
1074 uint32_t startBinding,
1075 uint32_t bindingCount,
1076 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001077 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001078{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001079 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001080}
1081
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001082ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001083 VkCmdBuffer cmdBuffer,
1084 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001085 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001086 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001087{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001088 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001089}
1090
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001091ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001092 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001093 uint32_t firstVertex,
1094 uint32_t vertexCount,
1095 uint32_t firstInstance,
1096 uint32_t instanceCount)
1097{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001098 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001099}
1100
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001101ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001102 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001103 uint32_t firstIndex,
1104 uint32_t indexCount,
1105 int32_t vertexOffset,
1106 uint32_t firstInstance,
1107 uint32_t instanceCount)
1108{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001109 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001110}
1111
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001112ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001113 VkCmdBuffer cmdBuffer,
1114 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001115 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001116 uint32_t count,
1117 uint32_t stride)
1118{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001119 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001120}
1121
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001122ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001123 VkCmdBuffer cmdBuffer,
1124 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001125 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001126 uint32_t count,
1127 uint32_t stride)
1128{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001129 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001130}
1131
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001132ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001133 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001134 uint32_t x,
1135 uint32_t y,
1136 uint32_t z)
1137{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001138 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001139}
1140
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001141ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001142 VkCmdBuffer cmdBuffer,
1143 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001144 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001145{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001146 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001147}
1148
Tony Barbour8205d902015-04-16 15:59:00 -06001149void VKAPI vkCmdWaitEvents(
1150 VkCmdBuffer cmdBuffer,
1151 VkWaitEvent waitEvent,
1152 uint32_t eventCount,
1153 const VkEvent* pEvents,
1154 uint32_t memBarrierCount,
1155 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001156{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001157 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001158}
1159
Tony Barbour8205d902015-04-16 15:59:00 -06001160void VKAPI vkCmdPipelineBarrier(
1161 VkCmdBuffer cmdBuffer,
1162 VkWaitEvent waitEvent,
1163 uint32_t pipeEventCount,
1164 const VkPipeEvent* pPipeEvents,
1165 uint32_t memBarrierCount,
1166 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001167{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001168 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001169}
1170
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001171ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001172 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001173 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001174 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001175{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001176 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001177 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1178 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1179}
1180
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001181ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1182 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001183{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001184 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001185 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001186}
1187
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001188ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1189 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001190 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001191 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001192 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001193{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001194 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001195 struct nulldrv_dev *dev = nulldrv_dev(device);
1196 *pQueue = dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001197 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001198}
1199
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001200ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1201 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001202{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001203 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001204 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001205}
1206
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001207ICD_EXPORT VkResult VKAPI vkDbgSetValidationLevel(
1208 VkDevice device,
1209 VkValidationLevel validationLevel)
David Pinedo0257fbf2015-02-02 18:02:40 -07001210{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001211 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001212 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001213}
1214
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001215ICD_EXPORT VkResult VKAPI vkDbgSetMessageFilter(
1216 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001217 int32_t msgCode,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001218 VK_DBG_MSG_FILTER filter)
David Pinedo0257fbf2015-02-02 18:02:40 -07001219{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001220 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001221 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001222}
1223
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001224ICD_EXPORT VkResult VKAPI vkDbgSetDeviceOption(
1225 VkDevice device,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001226 VK_DBG_DEVICE_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001227 size_t dataSize,
1228 const void* pData)
1229{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001230 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001231 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001232}
1233
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001234ICD_EXPORT VkResult VKAPI vkCreateEvent(
1235 VkDevice device,
1236 const VkEventCreateInfo* pCreateInfo,
1237 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001238{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001239 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001240 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001241}
1242
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001243ICD_EXPORT VkResult VKAPI vkGetEventStatus(
1244 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001245{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001246 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001247 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001248}
1249
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001250ICD_EXPORT VkResult VKAPI vkSetEvent(
1251 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001252{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001253 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001254 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001255}
1256
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001257ICD_EXPORT VkResult VKAPI vkResetEvent(
1258 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001259{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001260 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001261 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001262}
1263
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001264ICD_EXPORT VkResult VKAPI vkCreateFence(
1265 VkDevice device,
1266 const VkFenceCreateInfo* pCreateInfo,
1267 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001268{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001269 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001270 struct nulldrv_dev *dev = nulldrv_dev(device);
1271
1272 return nulldrv_fence_create(dev, pCreateInfo,
1273 (struct nulldrv_fence **) pFence);
1274}
1275
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001276ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
1277 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001278{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001279 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001280 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001281}
1282
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001283ICD_EXPORT VkResult VKAPI vkResetFences(
1284 VkDevice device,
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001285 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001286 VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001287{
1288 NULLDRV_LOG_FUNC;
1289 return VK_SUCCESS;
1290}
1291
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001292ICD_EXPORT VkResult VKAPI vkWaitForFences(
1293 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001294 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001295 const VkFence* pFences,
David Pinedo0257fbf2015-02-02 18:02:40 -07001296 bool32_t waitAll,
1297 uint64_t timeout)
1298{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001299 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001300 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001301}
1302
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001303ICD_EXPORT VkResult VKAPI vkGetFormatInfo(
1304 VkDevice device,
1305 VkFormat format,
1306 VkFormatInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001307 size_t* pDataSize,
1308 void* pData)
1309{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001310 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001311 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001312}
1313
Tony Barbour8205d902015-04-16 15:59:00 -06001314ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo(
1315 VkPhysicalDevice gpu_,
1316 VkPhysicalDeviceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001317 size_t* pDataSize,
1318 void* pData)
1319{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001320 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001321 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001322}
1323
Jon Ashburneb2728b2015-04-10 14:33:07 -06001324ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
1325 VkExtensionInfoType infoType,
1326 uint32_t extensionIndex,
1327 size_t* pDataSize,
1328 void* pData)
1329{
1330 uint32_t *count;
1331
1332 if (pDataSize == NULL)
1333 return VK_ERROR_INVALID_POINTER;
1334
1335 switch (infoType) {
1336 case VK_EXTENSION_INFO_TYPE_COUNT:
1337 *pDataSize = sizeof(uint32_t);
1338 if (pData == NULL)
1339 return VK_SUCCESS;
1340 count = (uint32_t *) pData;
1341 *count = 0;
1342 break;
1343 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1344 *pDataSize = 0;
1345 if (pData == NULL)
1346 return VK_SUCCESS;
1347 else
1348 return VK_ERROR_INVALID_EXTENSION;
1349 break;
1350 default:
1351 return VK_ERROR_INVALID_VALUE;
1352 };
1353
1354 return VK_SUCCESS;
1355}
1356
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001357VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
Tony Barbour8205d902015-04-16 15:59:00 -06001358 VkPhysicalDevice gpu,
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001359 VkExtensionInfoType infoType,
1360 uint32_t extensionIndex,
1361 size_t* pDataSize,
1362 void* pData)
David Pinedo0257fbf2015-02-02 18:02:40 -07001363{
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001364 uint32_t *count;
1365
1366 if (pDataSize == NULL)
1367 return VK_ERROR_INVALID_POINTER;
1368
1369 switch (infoType) {
1370 case VK_EXTENSION_INFO_TYPE_COUNT:
1371 *pDataSize = sizeof(uint32_t);
1372 if (pData == NULL)
1373 return VK_SUCCESS;
1374 count = (uint32_t *) pData;
1375 *count = 0;
1376 break;
1377 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1378 *pDataSize = 0;
1379 if (pData == NULL)
1380 return VK_SUCCESS;
1381 return VK_ERROR_INVALID_EXTENSION;
1382 break;
1383 default:
1384 return VK_ERROR_INVALID_VALUE;
1385 };
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001386 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001387}
1388
Tony Barbour8205d902015-04-16 15:59:00 -06001389ICD_EXPORT VkResult VKAPI vkGetMultiDeviceCompatibility(
1390 VkPhysicalDevice gpu0_,
1391 VkPhysicalDevice gpu1_,
1392 VkPhysicalDeviceCompatibilityInfo* pInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001393{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001394 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001395 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001396}
1397
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001398ICD_EXPORT VkResult VKAPI vkOpenPeerImage(
1399 VkDevice device,
1400 const VkPeerImageOpenInfo* pOpenInfo,
1401 VkImage* pImage,
Tony Barbour8205d902015-04-16 15:59:00 -06001402 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001403{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001404 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001405 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001406}
1407
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001408ICD_EXPORT VkResult VKAPI vkCreateImage(
1409 VkDevice device,
1410 const VkImageCreateInfo* pCreateInfo,
1411 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001412{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001413 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001414 struct nulldrv_dev *dev = nulldrv_dev(device);
1415
1416 return nulldrv_img_create(dev, pCreateInfo, false,
1417 (struct nulldrv_img **) pImage);
1418}
1419
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001420ICD_EXPORT VkResult VKAPI vkGetImageSubresourceInfo(
1421 VkImage image,
1422 const VkImageSubresource* pSubresource,
1423 VkSubresourceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001424 size_t* pDataSize,
1425 void* pData)
1426{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001427 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001428 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001429
1430 switch (infoType) {
Tony Barbour8205d902015-04-16 15:59:00 -06001431 case VK_SUBRESOURCE_INFO_TYPE_LAYOUT:
David Pinedo0257fbf2015-02-02 18:02:40 -07001432 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001433 VkSubresourceLayout *layout = (VkSubresourceLayout *) pData;
David Pinedo0257fbf2015-02-02 18:02:40 -07001434
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001435 *pDataSize = sizeof(VkSubresourceLayout);
David Pinedo0257fbf2015-02-02 18:02:40 -07001436
1437 if (pData == NULL)
1438 return ret;
1439 layout->offset = 0;
1440 layout->size = 1;
1441 layout->rowPitch = 4;
1442 layout->depthPitch = 4;
1443 }
1444 break;
1445 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001446 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -07001447 break;
1448 }
1449
1450 return ret;
1451}
1452
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001453ICD_EXPORT VkResult VKAPI vkAllocMemory(
1454 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001455 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001456 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001457{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001458 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001459 struct nulldrv_dev *dev = nulldrv_dev(device);
1460
1461 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1462}
1463
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001464ICD_EXPORT VkResult VKAPI vkFreeMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001465 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001466{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001467 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001468 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001469}
1470
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001471ICD_EXPORT VkResult VKAPI vkSetMemoryPriority(
Tony Barbour8205d902015-04-16 15:59:00 -06001472 VkDeviceMemory mem_,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001473 VkMemoryPriority priority)
David Pinedo0257fbf2015-02-02 18:02:40 -07001474{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001475 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001476 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001477}
1478
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001479ICD_EXPORT VkResult VKAPI vkMapMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001480 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001481 VkDeviceSize offset,
1482 VkDeviceSize size,
1483 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001484 void** ppData)
1485{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001486 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001487 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1488 void *ptr = nulldrv_mem_map(mem, flags);
1489
1490 *ppData = ptr;
1491
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001492 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001493}
1494
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001495ICD_EXPORT VkResult VKAPI vkUnmapMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001496 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001497{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001498 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001499 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001500}
1501
Ian Elliott07de9232015-04-17 10:04:00 -06001502ICD_EXPORT VkResult VKAPI vkFlushMappedMemory(
1503 VkDeviceMemory mem_,
1504 VkDeviceSize offset,
1505 VkDeviceSize size)
1506{
1507 NULLDRV_LOG_FUNC;
1508 return VK_SUCCESS;
1509}
1510
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001511ICD_EXPORT VkResult VKAPI vkPinSystemMemory(
1512 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001513 const void* pSysMem,
1514 size_t memSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001515 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001516{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001517 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001518 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001519}
1520
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001521ICD_EXPORT VkResult VKAPI vkOpenSharedMemory(
1522 VkDevice device,
1523 const VkMemoryOpenInfo* pOpenInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001524 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001525{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001526 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001527 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001528}
1529
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001530ICD_EXPORT VkResult VKAPI vkOpenPeerMemory(
1531 VkDevice device,
1532 const VkPeerMemoryOpenInfo* pOpenInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001533 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001534{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001535 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001536 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001537}
1538
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001539ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001540 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001541 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001542{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001543 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001544 struct nulldrv_instance *inst;
1545
1546 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001547 VK_DBG_OBJECT_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001548 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001549 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001550
1551 inst->obj.base.get_info = NULL;
1552
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001553 *pInstance = (VkInstance*)inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001554
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001555 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001556}
1557
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001558ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1559 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001560{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001561 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001562 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001563}
1564
Tony Barbour8205d902015-04-16 15:59:00 -06001565ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001566 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001567 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001568 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001569{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001570 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001571 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001572 struct nulldrv_gpu *gpu;
1573 *pGpuCount = 1;
1574 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001575 if (ret == VK_SUCCESS)
Tony Barbour8205d902015-04-16 15:59:00 -06001576 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001577 return ret;
1578}
1579
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001580ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001581 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001582 size_t maxLayerCount,
1583 size_t maxStringSize,
1584 size_t* pOutLayerCount,
1585 char* const* pOutLayers,
1586 void* pReserved)
1587{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001588 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001589 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001590}
1591
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001592ICD_EXPORT VkResult VKAPI vkDbgRegisterMsgCallback(
1593 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001594 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback,
David Pinedo0257fbf2015-02-02 18:02:40 -07001595 void* pUserData)
1596{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001597 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001598 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001599}
1600
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001601ICD_EXPORT VkResult VKAPI vkDbgUnregisterMsgCallback(
1602 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001603 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
David Pinedo0257fbf2015-02-02 18:02:40 -07001604{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001605 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001606 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001607}
1608
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001609ICD_EXPORT VkResult VKAPI vkDbgSetGlobalOption(
1610 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001611 VK_DBG_GLOBAL_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001612 size_t dataSize,
1613 const void* pData)
1614{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001615 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001616 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001617}
1618
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001619ICD_EXPORT VkResult VKAPI vkDestroyObject(
1620 VkObject object)
David Pinedo0257fbf2015-02-02 18:02:40 -07001621{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001622 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001623 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001624}
1625
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001626ICD_EXPORT VkResult VKAPI vkGetObjectInfo(
1627 VkBaseObject object,
1628 VkObjectInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001629 size_t* pDataSize,
1630 void* pData)
1631{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001632 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001633 struct nulldrv_base *base = nulldrv_base(object);
1634
1635 return base->get_info(base, infoType, pDataSize, pData);
1636}
1637
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001638ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemory(
1639 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001640 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001641 uint32_t allocationIdx,
Tony Barbour8205d902015-04-16 15:59:00 -06001642 VkDeviceMemory mem_,
1643 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001644{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001645 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001646 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001647}
1648
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001649ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(
1650 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001651 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001652 uint32_t allocationIdx,
Tony Barbour8205d902015-04-16 15:59:00 -06001653 VkDeviceSize rangeOffset,
1654 VkDeviceSize rangeSize,
1655 VkDeviceMemory mem,
1656 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001657{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001658 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001659 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001660}
1661
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001662ICD_EXPORT VkResult VKAPI vkQueueBindImageMemoryRange(
1663 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001664 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001665 uint32_t allocationIdx,
1666 const VkImageMemoryBindInfo* pBindInfo,
1667 VkDeviceMemory mem,
1668 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001669{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001670 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001671 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001672}
1673
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001674ICD_EXPORT VkResult VKAPI vkDbgSetObjectTag(
1675 VkBaseObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001676 size_t tagSize,
1677 const void* pTag)
1678{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001679 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001680 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001681}
1682
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001683ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(
1684 VkDevice device,
1685 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1686 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001687{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001688 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001689 struct nulldrv_dev *dev = nulldrv_dev(device);
1690
1691 return graphics_pipeline_create(dev, pCreateInfo,
1692 (struct nulldrv_pipeline **) pPipeline);
1693}
1694
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001695ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative(
1696 VkDevice device,
1697 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1698 VkPipeline basePipeline,
1699 VkPipeline* pPipeline)
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001700{
1701 NULLDRV_LOG_FUNC;
1702 struct nulldrv_dev *dev = nulldrv_dev(device);
1703
1704 return graphics_pipeline_create(dev, pCreateInfo,
1705 (struct nulldrv_pipeline **) pPipeline);
1706}
1707
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001708ICD_EXPORT VkResult VKAPI vkCreateComputePipeline(
1709 VkDevice device,
1710 const VkComputePipelineCreateInfo* pCreateInfo,
1711 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001712{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001713 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001714 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001715}
1716
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001717ICD_EXPORT VkResult VKAPI vkStorePipeline(
1718 VkPipeline pipeline,
David Pinedo0257fbf2015-02-02 18:02:40 -07001719 size_t* pDataSize,
1720 void* pData)
1721{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001722 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001723 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001724}
1725
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001726ICD_EXPORT VkResult VKAPI vkLoadPipeline(
1727 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001728 size_t dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001729 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001730 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001731{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001732 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001733 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001734}
1735
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001736ICD_EXPORT VkResult VKAPI vkLoadPipelineDerivative(
1737 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001738 size_t dataSize,
1739 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001740 VkPipeline basePipeline,
1741 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001742{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001743 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001744 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001745}
1746
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001747ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1748 VkDevice device,
1749 const VkQueryPoolCreateInfo* pCreateInfo,
1750 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001751{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001752 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001753 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001754}
1755
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001756ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
1757 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001758 uint32_t startQuery,
1759 uint32_t queryCount,
1760 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001761 void* pData,
1762 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001763{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001764 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001765 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001766}
1767
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001768ICD_EXPORT VkResult VKAPI vkQueueAddMemReferences(
1769 VkQueue queue,
1770 uint32_t count,
Tony Barbour8205d902015-04-16 15:59:00 -06001771 const VkDeviceMemory* pMems)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001772{
1773 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001774 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001775}
1776
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001777ICD_EXPORT VkResult VKAPI vkQueueRemoveMemReferences(
1778 VkQueue queue,
1779 uint32_t count,
Tony Barbour8205d902015-04-16 15:59:00 -06001780 const VkDeviceMemory* pMems)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001781{
1782 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001783 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001784}
1785
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001786ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1787 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001788{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001789 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001790 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001791}
1792
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001793ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1794 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001795 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001796 const VkCmdBuffer* pCmdBuffers,
1797 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001798{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001799 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001800 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001801}
1802
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001803ICD_EXPORT VkResult VKAPI vkOpenSharedSemaphore(
1804 VkDevice device,
1805 const VkSemaphoreOpenInfo* pOpenInfo,
1806 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001807{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001808 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001809 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001810}
1811
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001812ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1813 VkDevice device,
1814 const VkSemaphoreCreateInfo* pCreateInfo,
1815 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001816{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001817 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001818 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001819}
1820
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001821ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1822 VkQueue queue,
1823 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001824{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001825 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001826 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001827}
1828
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001829ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1830 VkQueue queue,
1831 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001832{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001833 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001834 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001835}
1836
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001837ICD_EXPORT VkResult VKAPI vkCreateSampler(
1838 VkDevice device,
1839 const VkSamplerCreateInfo* pCreateInfo,
1840 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001841{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001842 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001843 struct nulldrv_dev *dev = nulldrv_dev(device);
1844
1845 return nulldrv_sampler_create(dev, pCreateInfo,
1846 (struct nulldrv_sampler **) pSampler);
1847}
1848
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001849ICD_EXPORT VkResult VKAPI vkCreateShader(
1850 VkDevice device,
1851 const VkShaderCreateInfo* pCreateInfo,
1852 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001853{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001854 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001855 struct nulldrv_dev *dev = nulldrv_dev(device);
1856
1857 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1858}
1859
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001860ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
1861 VkDevice device,
1862 const VkDynamicVpStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001863 VkDynamicVpState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001864{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001865 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001866 struct nulldrv_dev *dev = nulldrv_dev(device);
1867
1868 return nulldrv_viewport_state_create(dev, pCreateInfo,
1869 (struct nulldrv_dynamic_vp **) pState);
1870}
1871
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001872ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
1873 VkDevice device,
1874 const VkDynamicRsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001875 VkDynamicRsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001876{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001877 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001878 struct nulldrv_dev *dev = nulldrv_dev(device);
1879
1880 return nulldrv_raster_state_create(dev, pCreateInfo,
1881 (struct nulldrv_dynamic_rs **) pState);
1882}
1883
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001884ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
1885 VkDevice device,
1886 const VkDynamicCbStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001887 VkDynamicCbState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001888{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001889 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001890 struct nulldrv_dev *dev = nulldrv_dev(device);
1891
1892 return nulldrv_blend_state_create(dev, pCreateInfo,
1893 (struct nulldrv_dynamic_cb **) pState);
1894}
1895
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001896ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
1897 VkDevice device,
1898 const VkDynamicDsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001899 VkDynamicDsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001900{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001901 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001902 struct nulldrv_dev *dev = nulldrv_dev(device);
1903
1904 return nulldrv_ds_state_create(dev, pCreateInfo,
1905 (struct nulldrv_dynamic_ds **) pState);
1906}
1907
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001908ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1909 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001910 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001911 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001912{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001913 NULLDRV_LOG_FUNC;
1914 struct nulldrv_dev *dev = nulldrv_dev(device);
1915
1916 return nulldrv_buf_view_create(dev, pCreateInfo,
1917 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001918}
1919
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001920ICD_EXPORT VkResult VKAPI vkCreateImageView(
1921 VkDevice device,
1922 const VkImageViewCreateInfo* pCreateInfo,
1923 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001924{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001925 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001926 struct nulldrv_dev *dev = nulldrv_dev(device);
1927
1928 return nulldrv_img_view_create(dev, pCreateInfo,
1929 (struct nulldrv_img_view **) pView);
1930}
1931
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001932ICD_EXPORT VkResult VKAPI vkCreateColorAttachmentView(
1933 VkDevice device,
1934 const VkColorAttachmentViewCreateInfo* pCreateInfo,
1935 VkColorAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001936{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001937 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001938 struct nulldrv_dev *dev = nulldrv_dev(device);
1939
1940 return nulldrv_rt_view_create(dev, pCreateInfo,
1941 (struct nulldrv_rt_view **) pView);
1942}
1943
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001944ICD_EXPORT VkResult VKAPI vkCreateDepthStencilView(
1945 VkDevice device,
1946 const VkDepthStencilViewCreateInfo* pCreateInfo,
1947 VkDepthStencilView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001948{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001949 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001950 struct nulldrv_dev *dev = nulldrv_dev(device);
1951
1952 return nulldrv_ds_view_create(dev, pCreateInfo,
1953 (struct nulldrv_ds_view **) pView);
1954
1955}
1956
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001957ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1958 VkDevice device,
1959 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1960 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001961{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001962 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001963 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001964
Chia-I Wu7732cb22015-03-26 15:27:55 +08001965 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001966 (struct nulldrv_desc_layout **) pSetLayout);
1967}
1968
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001969ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayoutChain(
1970 VkDevice device,
Chia-I Wu7732cb22015-03-26 15:27:55 +08001971 uint32_t setLayoutArrayCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001972 const VkDescriptorSetLayout* pSetLayoutArray,
1973 VkDescriptorSetLayoutChain* pLayoutChain)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001974{
1975 NULLDRV_LOG_FUNC;
1976 struct nulldrv_dev *dev = nulldrv_dev(device);
1977
1978 return nulldrv_desc_layout_chain_create(dev,
1979 setLayoutArrayCount, pSetLayoutArray,
1980 (struct nulldrv_desc_layout_chain **) pLayoutChain);
1981}
1982
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001983ICD_EXPORT VkResult VKAPI vkBeginDescriptorPoolUpdate(
1984 VkDevice device,
1985 VkDescriptorUpdateMode updateMode)
David Pinedo0257fbf2015-02-02 18:02:40 -07001986{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001987 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001988 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001989}
1990
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001991ICD_EXPORT VkResult VKAPI vkEndDescriptorPoolUpdate(
1992 VkDevice device,
1993 VkCmdBuffer cmd_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001994{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001995 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001996 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001997}
1998
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001999ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
2000 VkDevice device,
2001 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002002 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002003 const VkDescriptorPoolCreateInfo* pCreateInfo,
2004 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002005{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002006 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002007 struct nulldrv_dev *dev = nulldrv_dev(device);
2008
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002009 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
2010 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002011}
2012
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002013ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
2014 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002015{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002016 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002017 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002018}
2019
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002020ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
2021 VkDescriptorPool descriptorPool,
2022 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002023 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002024 const VkDescriptorSetLayout* pSetLayouts,
2025 VkDescriptorSet* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07002026 uint32_t* pCount)
2027{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002028 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002029 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2030 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002031 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002032 uint32_t i;
2033
2034 for (i = 0; i < count; i++) {
2035 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002036 nulldrv_desc_layout((VkDescriptorSetLayout) pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002037
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002038 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002039 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002040 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002041 break;
2042 }
2043
2044 if (pCount)
2045 *pCount = i;
2046
2047 return ret;
2048}
2049
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002050ICD_EXPORT void VKAPI vkClearDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002051 VkDescriptorPool descriptorPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07002052 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002053 const VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002054{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002055 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002056}
2057
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002058ICD_EXPORT void VKAPI vkUpdateDescriptors(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002059 VkDescriptorSet descriptorSet,
Chia-I Wu7732cb22015-03-26 15:27:55 +08002060 uint32_t updateCount,
2061 const void** ppUpdateArray)
David Pinedo0257fbf2015-02-02 18:02:40 -07002062{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002063 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002064}
2065
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002066ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2067 VkDevice device,
2068 const VkFramebufferCreateInfo* info,
2069 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002070{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002071 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002072 struct nulldrv_dev *dev = nulldrv_dev(device);
2073
2074 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2075}
2076
2077
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002078ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2079 VkDevice device,
2080 const VkRenderPassCreateInfo* info,
2081 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002082{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002083 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002084 struct nulldrv_dev *dev = nulldrv_dev(device);
2085
2086 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2087}
2088
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002089ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002090 VkCmdBuffer cmdBuffer,
2091 const VkRenderPassBegin* pRenderPassBegin)
David Pinedo0257fbf2015-02-02 18:02:40 -07002092{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002093 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002094}
2095
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002096ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002097 VkCmdBuffer cmdBuffer,
2098 VkRenderPass renderPass)
David Pinedo0257fbf2015-02-02 18:02:40 -07002099{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002100 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002101}
Ian Elliottf93069f2015-02-19 14:26:19 -07002102
2103ICD_EXPORT void* xcbCreateWindow(
2104 uint16_t width,
2105 uint16_t height)
2106{
2107 static uint32_t window; // Kludge to the max
2108 NULLDRV_LOG_FUNC;
2109 return &window;
2110}
2111
2112// May not be needed, if we stub out stuf in tri.c
2113ICD_EXPORT void xcbDestroyWindow()
2114{
2115 NULLDRV_LOG_FUNC;
2116}
2117
2118ICD_EXPORT int xcbGetMessage(void *msg)
2119{
2120 NULLDRV_LOG_FUNC;
2121 return 0;
2122}
2123
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002124ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002125{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002126 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002127}