blob: e94b76766474f4bbc0e5ea5abb904e22a7f30c56 [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
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500524static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev,
525 const VkPipelineLayoutCreateInfo* pCreateInfo,
526 struct nulldrv_pipeline_layout **pipeline_layout_ret)
Chia-I Wu7732cb22015-03-26 15:27:55 +0800527{
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500528 struct nulldrv_pipeline_layout *pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800529
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500530 pipeline_layout = (struct nulldrv_pipeline_layout *)
531 nulldrv_base_create(dev, sizeof(*pipeline_layout),
532 VK_DBG_OBJECT_PIPELINE_LAYOUT);
533 if (!pipeline_layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600534 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800535
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500536 *pipeline_layout_ret = pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800537
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600538 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800539}
540
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600541static struct nulldrv_desc_layout *nulldrv_desc_layout(VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700542{
543 return (struct nulldrv_desc_layout *) layout;
544}
545
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600546static VkResult shader_create(struct nulldrv_dev *dev,
547 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700548 struct nulldrv_shader **sh_ret)
549{
David Pinedo0257fbf2015-02-02 18:02:40 -0700550 struct nulldrv_shader *sh;
551
552 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600553 VK_DBG_OBJECT_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700554 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600555 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700556
557 *sh_ret = sh;
558
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600559 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700560}
561
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600562static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
563 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700564 struct nulldrv_pipeline **pipeline_ret)
565{
566 struct nulldrv_pipeline *pipeline;
567
568 pipeline = (struct nulldrv_pipeline *)
569 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600570 VK_DBG_OBJECT_GRAPHICS_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700571 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600572 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700573
574 *pipeline_ret = pipeline;
575
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600576 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700577}
578
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600579static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev,
580 const VkDynamicVpStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700581 struct nulldrv_dynamic_vp **state_ret)
582{
583 struct nulldrv_dynamic_vp *state;
584
585 state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600586 sizeof(*state), VK_DBG_OBJECT_VIEWPORT_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700587 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600588 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700589
590 *state_ret = state;
591
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600592 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700593}
594
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600595static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev,
596 const VkDynamicRsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700597 struct nulldrv_dynamic_rs **state_ret)
598{
599 struct nulldrv_dynamic_rs *state;
600
601 state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600602 sizeof(*state), VK_DBG_OBJECT_RASTER_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700603 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600604 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700605
606 *state_ret = state;
607
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600608 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700609}
610
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600611static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev,
612 const VkDynamicCbStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700613 struct nulldrv_dynamic_cb **state_ret)
614{
615 struct nulldrv_dynamic_cb *state;
616
617 state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600618 sizeof(*state), VK_DBG_OBJECT_COLOR_BLEND_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700619 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600620 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700621
622 *state_ret = state;
623
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600624 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700625}
626
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600627static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev,
628 const VkDynamicDsStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700629 struct nulldrv_dynamic_ds **state_ret)
630{
631 struct nulldrv_dynamic_ds *state;
632
633 state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600634 sizeof(*state), VK_DBG_OBJECT_DEPTH_STENCIL_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700635 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600636 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700637
638 *state_ret = state;
639
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600640 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700641}
642
643
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600644static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
645 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700646 struct nulldrv_cmd **cmd_ret)
647{
David Pinedo0257fbf2015-02-02 18:02:40 -0700648 struct nulldrv_cmd *cmd;
649
David Pinedo0257fbf2015-02-02 18:02:40 -0700650 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600651 VK_DBG_OBJECT_CMD_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700652 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600653 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700654
655 *cmd_ret = cmd;
656
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600657 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700658}
659
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600660static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
661 VkDescriptorPoolUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700662 uint32_t max_sets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600663 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800664 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700665{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800666 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700667
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800668 pool = (struct nulldrv_desc_pool *)
669 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600670 VK_DBG_OBJECT_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800671 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600672 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700673
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800674 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700675
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800676 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700677
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600678 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700679}
680
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600681static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800682 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600683 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700684 const struct nulldrv_desc_layout *layout,
685 struct nulldrv_desc_set **set_ret)
686{
687 struct nulldrv_desc_set *set;
688
689 set = (struct nulldrv_desc_set *)
690 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600691 VK_DBG_OBJECT_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700692 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600693 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700694
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800695 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700696 set->layout = layout;
697 *set_ret = set;
698
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600699 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700700}
701
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600702static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700703{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800704 return (struct nulldrv_desc_pool *) pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700705}
706
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600707static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
708 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700709 struct nulldrv_framebuffer ** fb_ret)
710{
711
712 struct nulldrv_framebuffer *fb;
713 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600714 VK_DBG_OBJECT_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700715 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600716 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700717
718 *fb_ret = fb;
719
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600720 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700721
722}
723
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600724static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
725 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700726 struct nulldrv_render_pass** rp_ret)
727{
728 struct nulldrv_render_pass *rp;
729 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600730 VK_DBG_OBJECT_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700731 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600732 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700733
734 *rp_ret = rp;
735
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600736 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700737}
738
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600739static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700740{
741 return (struct nulldrv_buf *) buf;
742}
743
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600744static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600745 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700746 struct nulldrv_buf_view **view_ret)
747{
748 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
749 struct nulldrv_buf_view *view;
750
751 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600752 VK_DBG_OBJECT_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700753 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600754 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700755
756 view->buf = buf;
757
758 *view_ret = view;
759
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600760 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700761}
762
David Pinedo0257fbf2015-02-02 18:02:40 -0700763
764//*********************************************
765// Driver entry points
766//*********************************************
767
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600768ICD_EXPORT VkResult VKAPI vkCreateBuffer(
769 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600770 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600771 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700772{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700773 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700774 struct nulldrv_dev *dev = nulldrv_dev(device);
775
776 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
777}
778
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600779ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
780 VkDevice device,
781 const VkCmdBufferCreateInfo* pCreateInfo,
782 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700783{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700784 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700785 struct nulldrv_dev *dev = nulldrv_dev(device);
786
787 return nulldrv_cmd_create(dev, pCreateInfo,
788 (struct nulldrv_cmd **) pCmdBuffer);
789}
790
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600791ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
792 VkCmdBuffer cmdBuffer,
793 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700794{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700795 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600796 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700797}
798
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600799ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
800 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700801{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700802 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600803 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700804}
805
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600806ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
807 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700808{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700809 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600810 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700811}
812
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600813ICD_EXPORT void VKAPI vkCmdInitAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600814 VkCmdBuffer cmdBuffer,
815 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700816 uint32_t startCounter,
817 uint32_t counterCount,
818 const uint32_t* pData)
819{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700820 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700821}
822
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600823ICD_EXPORT void VKAPI vkCmdLoadAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600824 VkCmdBuffer cmdBuffer,
825 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700826 uint32_t startCounter,
827 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600828 VkBuffer srcBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600829 VkDeviceSize srcOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700830{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700831 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700832}
833
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600834ICD_EXPORT void VKAPI vkCmdSaveAtomicCounters(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600835 VkCmdBuffer cmdBuffer,
836 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700837 uint32_t startCounter,
838 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600839 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600840 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -0700841{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700842 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700843}
844
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600845ICD_EXPORT void VKAPI vkCmdDbgMarkerBegin(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600846 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700847 const char* pMarker)
848{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700849 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700850}
851
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600852ICD_EXPORT void VKAPI vkCmdDbgMarkerEnd(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600853 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700854{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700855 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700856}
857
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600858ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600859 VkCmdBuffer cmdBuffer,
860 VkBuffer srcBuffer,
861 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700862 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600863 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700864{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700865 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700866}
867
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600868ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600869 VkCmdBuffer cmdBuffer,
870 VkImage srcImage,
871 VkImageLayout srcImageLayout,
872 VkImage destImage,
873 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700874 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600875 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700876{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700877 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700878}
879
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600880ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600881 VkCmdBuffer cmdBuffer,
882 VkImage srcImage,
883 VkImageLayout srcImageLayout,
884 VkImage destImage,
885 VkImageLayout destImageLayout,
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600886 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600887 const VkImageBlit* pRegions)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600888{
889 NULLDRV_LOG_FUNC;
890}
891
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600892ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600893 VkCmdBuffer cmdBuffer,
894 VkBuffer srcBuffer,
895 VkImage destImage,
896 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700897 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600898 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700899{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700900 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700901}
902
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600903ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600904 VkCmdBuffer cmdBuffer,
905 VkImage srcImage,
906 VkImageLayout srcImageLayout,
907 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700908 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600909 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700910{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700911 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700912}
913
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600914ICD_EXPORT void VKAPI vkCmdCloneImageData(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600915 VkCmdBuffer cmdBuffer,
916 VkImage srcImage,
917 VkImageLayout srcImageLayout,
918 VkImage destImage,
919 VkImageLayout destImageLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700920{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700921 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700922}
923
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600924ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600925 VkCmdBuffer cmdBuffer,
926 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600927 VkDeviceSize destOffset,
928 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700929 const uint32_t* pData)
930{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700931 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700932}
933
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600934ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600935 VkCmdBuffer cmdBuffer,
936 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600937 VkDeviceSize destOffset,
938 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700939 uint32_t data)
940{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700941 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700942}
943
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600944ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600945 VkCmdBuffer cmdBuffer,
946 VkImage image,
947 VkImageLayout imageLayout,
948 VkClearColor color,
David Pinedo0257fbf2015-02-02 18:02:40 -0700949 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600950 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700951{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700952 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700953}
954
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600955ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600956 VkCmdBuffer cmdBuffer,
957 VkImage image,
958 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700959 float depth,
960 uint32_t stencil,
961 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600962 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700963{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700964 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700965}
966
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600967ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600968 VkCmdBuffer cmdBuffer,
969 VkImage srcImage,
970 VkImageLayout srcImageLayout,
971 VkImage destImage,
972 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -0600973 uint32_t regionCount,
974 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700975{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700976 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700977}
978
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600979ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600980 VkCmdBuffer cmdBuffer,
981 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700982 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600983 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700984{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700985 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700986}
987
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600988ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600989 VkCmdBuffer cmdBuffer,
990 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700991 uint32_t slot)
992{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700993 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700994}
995
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600996ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600997 VkCmdBuffer cmdBuffer,
998 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700999 uint32_t startQuery,
1000 uint32_t queryCount)
1001{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001002 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001003}
1004
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001005ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001006 VkCmdBuffer cmdBuffer,
1007 VkEvent event_,
1008 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001009{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001010 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001011}
1012
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001013ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001014 VkCmdBuffer cmdBuffer,
1015 VkEvent event_,
1016 VkPipeEvent pipeEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001017{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001018 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001019}
1020
Ian Elliott63f1edb2015-04-16 18:10:19 -06001021ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1022 VkCmdBuffer cmdBuffer,
1023 VkQueryPool queryPool,
1024 uint32_t startQuery,
1025 uint32_t queryCount,
1026 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001027 VkDeviceSize destOffset,
1028 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001029 VkFlags flags)
1030{
1031 NULLDRV_LOG_FUNC;
1032}
1033
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001034ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001035 VkCmdBuffer cmdBuffer,
1036 VkTimestampType timestampType,
1037 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001038 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001039{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001040 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001041}
1042
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001043ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001044 VkCmdBuffer cmdBuffer,
1045 VkPipelineBindPoint pipelineBindPoint,
1046 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001047{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001048 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001049}
1050
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001051ICD_EXPORT void VKAPI vkCmdBindDynamicStateObject(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001052 VkCmdBuffer cmdBuffer,
1053 VkStateBindPoint stateBindPoint,
1054 VkDynamicStateObject state)
David Pinedo0257fbf2015-02-02 18:02:40 -07001055{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001056 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001057}
1058
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001059ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001060 VkCmdBuffer cmdBuffer,
1061 VkPipelineBindPoint pipelineBindPoint,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001062 uint32_t firstSet,
1063 uint32_t setCount,
1064 const VkDescriptorSet* pDescriptorSets,
1065 uint32_t dynamicOffsetCount,
1066 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001067{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001068 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001069}
1070
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001071ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1072 VkCmdBuffer cmdBuffer,
1073 uint32_t startBinding,
1074 uint32_t bindingCount,
1075 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001076 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001077{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001078 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001079}
1080
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001081ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001082 VkCmdBuffer cmdBuffer,
1083 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001084 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001085 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001086{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001087 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001088}
1089
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001090ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001091 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001092 uint32_t firstVertex,
1093 uint32_t vertexCount,
1094 uint32_t firstInstance,
1095 uint32_t instanceCount)
1096{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001097 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001098}
1099
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001100ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001101 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001102 uint32_t firstIndex,
1103 uint32_t indexCount,
1104 int32_t vertexOffset,
1105 uint32_t firstInstance,
1106 uint32_t instanceCount)
1107{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001108 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001109}
1110
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001111ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001112 VkCmdBuffer cmdBuffer,
1113 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001114 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001115 uint32_t count,
1116 uint32_t stride)
1117{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001118 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001119}
1120
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001121ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001122 VkCmdBuffer cmdBuffer,
1123 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001124 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001125 uint32_t count,
1126 uint32_t stride)
1127{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001128 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001129}
1130
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001131ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001132 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001133 uint32_t x,
1134 uint32_t y,
1135 uint32_t z)
1136{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001137 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001138}
1139
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001140ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001141 VkCmdBuffer cmdBuffer,
1142 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001143 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001144{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001145 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001146}
1147
Tony Barbour8205d902015-04-16 15:59:00 -06001148void VKAPI vkCmdWaitEvents(
1149 VkCmdBuffer cmdBuffer,
1150 VkWaitEvent waitEvent,
1151 uint32_t eventCount,
1152 const VkEvent* pEvents,
1153 uint32_t memBarrierCount,
1154 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001155{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001156 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001157}
1158
Tony Barbour8205d902015-04-16 15:59:00 -06001159void VKAPI vkCmdPipelineBarrier(
1160 VkCmdBuffer cmdBuffer,
1161 VkWaitEvent waitEvent,
1162 uint32_t pipeEventCount,
1163 const VkPipeEvent* pPipeEvents,
1164 uint32_t memBarrierCount,
1165 const void** ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001166{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001167 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001168}
1169
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001170ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001171 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001172 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001173 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001174{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001175 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001176 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1177 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1178}
1179
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001180ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1181 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001182{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001183 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001184 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001185}
1186
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001187ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1188 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001189 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001190 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001191 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001192{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001193 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001194 struct nulldrv_dev *dev = nulldrv_dev(device);
1195 *pQueue = dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001196 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001197}
1198
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001199ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1200 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001201{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001202 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001203 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001204}
1205
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001206ICD_EXPORT VkResult VKAPI vkDbgSetValidationLevel(
1207 VkDevice device,
1208 VkValidationLevel validationLevel)
David Pinedo0257fbf2015-02-02 18:02:40 -07001209{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001210 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001211 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001212}
1213
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001214ICD_EXPORT VkResult VKAPI vkDbgSetMessageFilter(
1215 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001216 int32_t msgCode,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001217 VK_DBG_MSG_FILTER filter)
David Pinedo0257fbf2015-02-02 18:02:40 -07001218{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001219 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001220 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001221}
1222
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001223ICD_EXPORT VkResult VKAPI vkDbgSetDeviceOption(
1224 VkDevice device,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001225 VK_DBG_DEVICE_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001226 size_t dataSize,
1227 const void* pData)
1228{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001229 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001230 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001231}
1232
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001233ICD_EXPORT VkResult VKAPI vkCreateEvent(
1234 VkDevice device,
1235 const VkEventCreateInfo* pCreateInfo,
1236 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001237{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001238 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001239 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001240}
1241
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001242ICD_EXPORT VkResult VKAPI vkGetEventStatus(
1243 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001244{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001245 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001246 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001247}
1248
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001249ICD_EXPORT VkResult VKAPI vkSetEvent(
1250 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001251{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001252 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001253 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001254}
1255
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001256ICD_EXPORT VkResult VKAPI vkResetEvent(
1257 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001258{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001259 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001260 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001261}
1262
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001263ICD_EXPORT VkResult VKAPI vkCreateFence(
1264 VkDevice device,
1265 const VkFenceCreateInfo* pCreateInfo,
1266 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001267{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001268 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001269 struct nulldrv_dev *dev = nulldrv_dev(device);
1270
1271 return nulldrv_fence_create(dev, pCreateInfo,
1272 (struct nulldrv_fence **) pFence);
1273}
1274
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001275ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
1276 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001277{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001278 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001279 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001280}
1281
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001282ICD_EXPORT VkResult VKAPI vkResetFences(
1283 VkDevice device,
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001284 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001285 VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001286{
1287 NULLDRV_LOG_FUNC;
1288 return VK_SUCCESS;
1289}
1290
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001291ICD_EXPORT VkResult VKAPI vkWaitForFences(
1292 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001293 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001294 const VkFence* pFences,
David Pinedo0257fbf2015-02-02 18:02:40 -07001295 bool32_t waitAll,
1296 uint64_t timeout)
1297{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001298 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001299 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001300}
1301
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001302ICD_EXPORT VkResult VKAPI vkGetFormatInfo(
1303 VkDevice device,
1304 VkFormat format,
1305 VkFormatInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001306 size_t* pDataSize,
1307 void* pData)
1308{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001309 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001310 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001311}
1312
Tony Barbour8205d902015-04-16 15:59:00 -06001313ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceInfo(
1314 VkPhysicalDevice gpu_,
1315 VkPhysicalDeviceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001316 size_t* pDataSize,
1317 void* pData)
1318{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001319 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001320 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001321}
1322
Jon Ashburneb2728b2015-04-10 14:33:07 -06001323ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
1324 VkExtensionInfoType infoType,
1325 uint32_t extensionIndex,
1326 size_t* pDataSize,
1327 void* pData)
1328{
1329 uint32_t *count;
1330
1331 if (pDataSize == NULL)
1332 return VK_ERROR_INVALID_POINTER;
1333
1334 switch (infoType) {
1335 case VK_EXTENSION_INFO_TYPE_COUNT:
1336 *pDataSize = sizeof(uint32_t);
1337 if (pData == NULL)
1338 return VK_SUCCESS;
1339 count = (uint32_t *) pData;
1340 *count = 0;
1341 break;
1342 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1343 *pDataSize = 0;
1344 if (pData == NULL)
1345 return VK_SUCCESS;
1346 else
1347 return VK_ERROR_INVALID_EXTENSION;
1348 break;
1349 default:
1350 return VK_ERROR_INVALID_VALUE;
1351 };
1352
1353 return VK_SUCCESS;
1354}
1355
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001356VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
Tony Barbour8205d902015-04-16 15:59:00 -06001357 VkPhysicalDevice gpu,
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001358 VkExtensionInfoType infoType,
1359 uint32_t extensionIndex,
1360 size_t* pDataSize,
1361 void* pData)
David Pinedo0257fbf2015-02-02 18:02:40 -07001362{
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001363 uint32_t *count;
1364
1365 if (pDataSize == NULL)
1366 return VK_ERROR_INVALID_POINTER;
1367
1368 switch (infoType) {
1369 case VK_EXTENSION_INFO_TYPE_COUNT:
1370 *pDataSize = sizeof(uint32_t);
1371 if (pData == NULL)
1372 return VK_SUCCESS;
1373 count = (uint32_t *) pData;
1374 *count = 0;
1375 break;
1376 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1377 *pDataSize = 0;
1378 if (pData == NULL)
1379 return VK_SUCCESS;
1380 return VK_ERROR_INVALID_EXTENSION;
1381 break;
1382 default:
1383 return VK_ERROR_INVALID_VALUE;
1384 };
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001385 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001386}
1387
Tony Barbour8205d902015-04-16 15:59:00 -06001388ICD_EXPORT VkResult VKAPI vkGetMultiDeviceCompatibility(
1389 VkPhysicalDevice gpu0_,
1390 VkPhysicalDevice gpu1_,
1391 VkPhysicalDeviceCompatibilityInfo* pInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001392{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001393 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001394 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001395}
1396
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001397ICD_EXPORT VkResult VKAPI vkOpenPeerImage(
1398 VkDevice device,
1399 const VkPeerImageOpenInfo* pOpenInfo,
1400 VkImage* pImage,
Tony Barbour8205d902015-04-16 15:59:00 -06001401 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001402{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001403 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001404 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001405}
1406
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001407ICD_EXPORT VkResult VKAPI vkCreateImage(
1408 VkDevice device,
1409 const VkImageCreateInfo* pCreateInfo,
1410 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001411{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001412 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001413 struct nulldrv_dev *dev = nulldrv_dev(device);
1414
1415 return nulldrv_img_create(dev, pCreateInfo, false,
1416 (struct nulldrv_img **) pImage);
1417}
1418
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001419ICD_EXPORT VkResult VKAPI vkGetImageSubresourceInfo(
1420 VkImage image,
1421 const VkImageSubresource* pSubresource,
1422 VkSubresourceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001423 size_t* pDataSize,
1424 void* pData)
1425{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001426 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001427 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001428
1429 switch (infoType) {
Tony Barbour8205d902015-04-16 15:59:00 -06001430 case VK_SUBRESOURCE_INFO_TYPE_LAYOUT:
David Pinedo0257fbf2015-02-02 18:02:40 -07001431 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001432 VkSubresourceLayout *layout = (VkSubresourceLayout *) pData;
David Pinedo0257fbf2015-02-02 18:02:40 -07001433
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001434 *pDataSize = sizeof(VkSubresourceLayout);
David Pinedo0257fbf2015-02-02 18:02:40 -07001435
1436 if (pData == NULL)
1437 return ret;
1438 layout->offset = 0;
1439 layout->size = 1;
1440 layout->rowPitch = 4;
1441 layout->depthPitch = 4;
1442 }
1443 break;
1444 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001445 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -07001446 break;
1447 }
1448
1449 return ret;
1450}
1451
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001452ICD_EXPORT VkResult VKAPI vkAllocMemory(
1453 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001454 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001455 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001456{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001457 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001458 struct nulldrv_dev *dev = nulldrv_dev(device);
1459
1460 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1461}
1462
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001463ICD_EXPORT VkResult VKAPI vkFreeMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001464 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001465{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001466 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001467 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001468}
1469
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001470ICD_EXPORT VkResult VKAPI vkSetMemoryPriority(
Tony Barbour8205d902015-04-16 15:59:00 -06001471 VkDeviceMemory mem_,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001472 VkMemoryPriority priority)
David Pinedo0257fbf2015-02-02 18:02:40 -07001473{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001474 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001475 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001476}
1477
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001478ICD_EXPORT VkResult VKAPI vkMapMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001479 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001480 VkDeviceSize offset,
1481 VkDeviceSize size,
1482 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001483 void** ppData)
1484{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001485 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001486 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1487 void *ptr = nulldrv_mem_map(mem, flags);
1488
1489 *ppData = ptr;
1490
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001491 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001492}
1493
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001494ICD_EXPORT VkResult VKAPI vkUnmapMemory(
Tony Barbour8205d902015-04-16 15:59:00 -06001495 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001496{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001497 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001498 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001499}
1500
Ian Elliott07de9232015-04-17 10:04:00 -06001501ICD_EXPORT VkResult VKAPI vkFlushMappedMemory(
1502 VkDeviceMemory mem_,
1503 VkDeviceSize offset,
1504 VkDeviceSize size)
1505{
1506 NULLDRV_LOG_FUNC;
1507 return VK_SUCCESS;
1508}
1509
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001510ICD_EXPORT VkResult VKAPI vkPinSystemMemory(
1511 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001512 const void* pSysMem,
1513 size_t memSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001514 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001515{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001516 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001517 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001518}
1519
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001520ICD_EXPORT VkResult VKAPI vkOpenSharedMemory(
1521 VkDevice device,
1522 const VkMemoryOpenInfo* pOpenInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001523 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001524{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001525 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001526 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001527}
1528
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001529ICD_EXPORT VkResult VKAPI vkOpenPeerMemory(
1530 VkDevice device,
1531 const VkPeerMemoryOpenInfo* pOpenInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001532 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001533{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001534 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001535 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001536}
1537
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001538ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001539 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001540 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001541{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001542 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001543 struct nulldrv_instance *inst;
1544
1545 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001546 VK_DBG_OBJECT_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001547 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001548 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001549
1550 inst->obj.base.get_info = NULL;
1551
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001552 *pInstance = (VkInstance*)inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001553
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001554 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001555}
1556
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001557ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1558 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001559{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001560 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001561 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001562}
1563
Tony Barbour8205d902015-04-16 15:59:00 -06001564ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001565 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001566 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001567 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001568{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001569 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001570 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001571 struct nulldrv_gpu *gpu;
1572 *pGpuCount = 1;
1573 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001574 if (ret == VK_SUCCESS)
Tony Barbour8205d902015-04-16 15:59:00 -06001575 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001576 return ret;
1577}
1578
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001579ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001580 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001581 size_t maxLayerCount,
1582 size_t maxStringSize,
1583 size_t* pOutLayerCount,
1584 char* const* pOutLayers,
1585 void* pReserved)
1586{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001587 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001588 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001589}
1590
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001591ICD_EXPORT VkResult VKAPI vkDbgRegisterMsgCallback(
1592 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001593 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback,
David Pinedo0257fbf2015-02-02 18:02:40 -07001594 void* pUserData)
1595{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001596 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001597 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001598}
1599
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001600ICD_EXPORT VkResult VKAPI vkDbgUnregisterMsgCallback(
1601 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001602 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
David Pinedo0257fbf2015-02-02 18:02:40 -07001603{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001604 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001605 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001606}
1607
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001608ICD_EXPORT VkResult VKAPI vkDbgSetGlobalOption(
1609 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001610 VK_DBG_GLOBAL_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001611 size_t dataSize,
1612 const void* pData)
1613{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001614 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001615 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001616}
1617
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001618ICD_EXPORT VkResult VKAPI vkDestroyObject(
1619 VkObject object)
David Pinedo0257fbf2015-02-02 18:02:40 -07001620{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001621 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001622 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001623}
1624
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001625ICD_EXPORT VkResult VKAPI vkGetObjectInfo(
1626 VkBaseObject object,
1627 VkObjectInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001628 size_t* pDataSize,
1629 void* pData)
1630{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001631 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001632 struct nulldrv_base *base = nulldrv_base(object);
1633
1634 return base->get_info(base, infoType, pDataSize, pData);
1635}
1636
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001637ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemory(
1638 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001639 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001640 uint32_t allocationIdx,
Tony Barbour8205d902015-04-16 15:59:00 -06001641 VkDeviceMemory mem_,
1642 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001643{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001644 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001645 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001646}
1647
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001648ICD_EXPORT VkResult VKAPI vkQueueBindObjectMemoryRange(
1649 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001650 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001651 uint32_t allocationIdx,
Tony Barbour8205d902015-04-16 15:59:00 -06001652 VkDeviceSize rangeOffset,
1653 VkDeviceSize rangeSize,
1654 VkDeviceMemory mem,
1655 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001656{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001657 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001658 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001659}
1660
Mark Lobodzinskicf26e072015-04-16 11:44:05 -05001661ICD_EXPORT VkResult VKAPI vkQueueBindImageMemoryRange(
1662 VkQueue queue,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001663 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001664 uint32_t allocationIdx,
1665 const VkImageMemoryBindInfo* pBindInfo,
1666 VkDeviceMemory mem,
1667 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001668{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001669 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001670 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001671}
1672
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001673ICD_EXPORT VkResult VKAPI vkDbgSetObjectTag(
1674 VkBaseObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001675 size_t tagSize,
1676 const void* pTag)
1677{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001678 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001679 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001680}
1681
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001682ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(
1683 VkDevice device,
1684 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1685 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001686{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001687 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001688 struct nulldrv_dev *dev = nulldrv_dev(device);
1689
1690 return graphics_pipeline_create(dev, pCreateInfo,
1691 (struct nulldrv_pipeline **) pPipeline);
1692}
1693
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001694ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative(
1695 VkDevice device,
1696 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1697 VkPipeline basePipeline,
1698 VkPipeline* pPipeline)
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001699{
1700 NULLDRV_LOG_FUNC;
1701 struct nulldrv_dev *dev = nulldrv_dev(device);
1702
1703 return graphics_pipeline_create(dev, pCreateInfo,
1704 (struct nulldrv_pipeline **) pPipeline);
1705}
1706
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001707ICD_EXPORT VkResult VKAPI vkCreateComputePipeline(
1708 VkDevice device,
1709 const VkComputePipelineCreateInfo* pCreateInfo,
1710 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001711{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001712 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001713 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001714}
1715
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001716ICD_EXPORT VkResult VKAPI vkStorePipeline(
1717 VkPipeline pipeline,
David Pinedo0257fbf2015-02-02 18:02:40 -07001718 size_t* pDataSize,
1719 void* pData)
1720{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001721 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001722 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001723}
1724
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001725ICD_EXPORT VkResult VKAPI vkLoadPipeline(
1726 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001727 size_t dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001728 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001729 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001730{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001731 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001732 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001733}
1734
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001735ICD_EXPORT VkResult VKAPI vkLoadPipelineDerivative(
1736 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001737 size_t dataSize,
1738 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001739 VkPipeline basePipeline,
1740 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001741{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001742 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001743 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001744}
1745
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001746ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1747 VkDevice device,
1748 const VkQueryPoolCreateInfo* pCreateInfo,
1749 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001750{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001751 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001752 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001753}
1754
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001755ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
1756 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001757 uint32_t startQuery,
1758 uint32_t queryCount,
1759 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001760 void* pData,
1761 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001762{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001763 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001764 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001765}
1766
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001767ICD_EXPORT VkResult VKAPI vkQueueAddMemReferences(
1768 VkQueue queue,
1769 uint32_t count,
Tony Barbour8205d902015-04-16 15:59:00 -06001770 const VkDeviceMemory* pMems)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001771{
1772 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001773 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001774}
1775
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001776ICD_EXPORT VkResult VKAPI vkQueueRemoveMemReferences(
1777 VkQueue queue,
1778 uint32_t count,
Tony Barbour8205d902015-04-16 15:59:00 -06001779 const VkDeviceMemory* pMems)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001780{
1781 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001782 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001783}
1784
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001785ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1786 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001787{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001788 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001789 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001790}
1791
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001792ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1793 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001794 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001795 const VkCmdBuffer* pCmdBuffers,
1796 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001797{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001798 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001799 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001800}
1801
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001802ICD_EXPORT VkResult VKAPI vkOpenSharedSemaphore(
1803 VkDevice device,
1804 const VkSemaphoreOpenInfo* pOpenInfo,
1805 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001806{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001807 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001808 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001809}
1810
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001811ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1812 VkDevice device,
1813 const VkSemaphoreCreateInfo* pCreateInfo,
1814 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001815{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001816 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001817 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001818}
1819
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001820ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1821 VkQueue queue,
1822 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001823{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001824 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001825 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001826}
1827
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001828ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1829 VkQueue queue,
1830 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001831{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001832 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001833 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001834}
1835
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001836ICD_EXPORT VkResult VKAPI vkCreateSampler(
1837 VkDevice device,
1838 const VkSamplerCreateInfo* pCreateInfo,
1839 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001840{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001841 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001842 struct nulldrv_dev *dev = nulldrv_dev(device);
1843
1844 return nulldrv_sampler_create(dev, pCreateInfo,
1845 (struct nulldrv_sampler **) pSampler);
1846}
1847
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001848ICD_EXPORT VkResult VKAPI vkCreateShader(
1849 VkDevice device,
1850 const VkShaderCreateInfo* pCreateInfo,
1851 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001852{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001853 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001854 struct nulldrv_dev *dev = nulldrv_dev(device);
1855
1856 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1857}
1858
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001859ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
1860 VkDevice device,
1861 const VkDynamicVpStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001862 VkDynamicVpState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001863{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001864 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001865 struct nulldrv_dev *dev = nulldrv_dev(device);
1866
1867 return nulldrv_viewport_state_create(dev, pCreateInfo,
1868 (struct nulldrv_dynamic_vp **) pState);
1869}
1870
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001871ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
1872 VkDevice device,
1873 const VkDynamicRsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001874 VkDynamicRsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001875{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001876 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001877 struct nulldrv_dev *dev = nulldrv_dev(device);
1878
1879 return nulldrv_raster_state_create(dev, pCreateInfo,
1880 (struct nulldrv_dynamic_rs **) pState);
1881}
1882
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001883ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
1884 VkDevice device,
1885 const VkDynamicCbStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001886 VkDynamicCbState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001887{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001888 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001889 struct nulldrv_dev *dev = nulldrv_dev(device);
1890
1891 return nulldrv_blend_state_create(dev, pCreateInfo,
1892 (struct nulldrv_dynamic_cb **) pState);
1893}
1894
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001895ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
1896 VkDevice device,
1897 const VkDynamicDsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001898 VkDynamicDsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001899{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001900 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001901 struct nulldrv_dev *dev = nulldrv_dev(device);
1902
1903 return nulldrv_ds_state_create(dev, pCreateInfo,
1904 (struct nulldrv_dynamic_ds **) pState);
1905}
1906
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001907ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1908 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001909 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001910 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001911{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001912 NULLDRV_LOG_FUNC;
1913 struct nulldrv_dev *dev = nulldrv_dev(device);
1914
1915 return nulldrv_buf_view_create(dev, pCreateInfo,
1916 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001917}
1918
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001919ICD_EXPORT VkResult VKAPI vkCreateImageView(
1920 VkDevice device,
1921 const VkImageViewCreateInfo* pCreateInfo,
1922 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001923{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001924 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001925 struct nulldrv_dev *dev = nulldrv_dev(device);
1926
1927 return nulldrv_img_view_create(dev, pCreateInfo,
1928 (struct nulldrv_img_view **) pView);
1929}
1930
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001931ICD_EXPORT VkResult VKAPI vkCreateColorAttachmentView(
1932 VkDevice device,
1933 const VkColorAttachmentViewCreateInfo* pCreateInfo,
1934 VkColorAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001935{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001936 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001937 struct nulldrv_dev *dev = nulldrv_dev(device);
1938
1939 return nulldrv_rt_view_create(dev, pCreateInfo,
1940 (struct nulldrv_rt_view **) pView);
1941}
1942
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001943ICD_EXPORT VkResult VKAPI vkCreateDepthStencilView(
1944 VkDevice device,
1945 const VkDepthStencilViewCreateInfo* pCreateInfo,
1946 VkDepthStencilView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001947{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001948 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001949 struct nulldrv_dev *dev = nulldrv_dev(device);
1950
1951 return nulldrv_ds_view_create(dev, pCreateInfo,
1952 (struct nulldrv_ds_view **) pView);
1953
1954}
1955
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001956ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1957 VkDevice device,
1958 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1959 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001960{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001961 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001962 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001963
Chia-I Wu7732cb22015-03-26 15:27:55 +08001964 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001965 (struct nulldrv_desc_layout **) pSetLayout);
1966}
1967
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001968ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
1969 VkDevice device,
1970 const VkPipelineLayoutCreateInfo* pCreateInfo,
1971 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001972{
1973 NULLDRV_LOG_FUNC;
1974 struct nulldrv_dev *dev = nulldrv_dev(device);
1975
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001976 return nulldrv_pipeline_layout_create(dev,
1977 pCreateInfo,
1978 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08001979}
1980
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001981ICD_EXPORT VkResult VKAPI vkBeginDescriptorPoolUpdate(
1982 VkDevice device,
1983 VkDescriptorUpdateMode updateMode)
David Pinedo0257fbf2015-02-02 18:02:40 -07001984{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001985 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001986 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001987}
1988
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001989ICD_EXPORT VkResult VKAPI vkEndDescriptorPoolUpdate(
1990 VkDevice device,
1991 VkCmdBuffer cmd_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001992{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001993 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001994 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001995}
1996
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001997ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
1998 VkDevice device,
1999 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002000 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002001 const VkDescriptorPoolCreateInfo* pCreateInfo,
2002 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002003{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002004 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002005 struct nulldrv_dev *dev = nulldrv_dev(device);
2006
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002007 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
2008 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002009}
2010
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002011ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
2012 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002013{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002014 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002015 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002016}
2017
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002018ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
2019 VkDescriptorPool descriptorPool,
2020 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002021 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002022 const VkDescriptorSetLayout* pSetLayouts,
2023 VkDescriptorSet* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07002024 uint32_t* pCount)
2025{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002026 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002027 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2028 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002029 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002030 uint32_t i;
2031
2032 for (i = 0; i < count; i++) {
2033 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002034 nulldrv_desc_layout((VkDescriptorSetLayout) pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002035
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002036 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002037 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002038 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002039 break;
2040 }
2041
2042 if (pCount)
2043 *pCount = i;
2044
2045 return ret;
2046}
2047
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002048ICD_EXPORT void VKAPI vkClearDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002049 VkDescriptorPool descriptorPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07002050 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002051 const VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002052{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002053 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002054}
2055
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002056ICD_EXPORT void VKAPI vkUpdateDescriptors(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002057 VkDescriptorSet descriptorSet,
Chia-I Wu7732cb22015-03-26 15:27:55 +08002058 uint32_t updateCount,
2059 const void** ppUpdateArray)
David Pinedo0257fbf2015-02-02 18:02:40 -07002060{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002061 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002062}
2063
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002064ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2065 VkDevice device,
2066 const VkFramebufferCreateInfo* info,
2067 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002068{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002069 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002070 struct nulldrv_dev *dev = nulldrv_dev(device);
2071
2072 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2073}
2074
2075
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002076ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2077 VkDevice device,
2078 const VkRenderPassCreateInfo* info,
2079 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002080{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002081 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002082 struct nulldrv_dev *dev = nulldrv_dev(device);
2083
2084 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2085}
2086
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002087ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002088 VkCmdBuffer cmdBuffer,
2089 const VkRenderPassBegin* pRenderPassBegin)
David Pinedo0257fbf2015-02-02 18:02:40 -07002090{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002091 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002092}
2093
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002094ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002095 VkCmdBuffer cmdBuffer,
2096 VkRenderPass renderPass)
David Pinedo0257fbf2015-02-02 18:02:40 -07002097{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002098 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002099}
Ian Elliottf93069f2015-02-19 14:26:19 -07002100
2101ICD_EXPORT void* xcbCreateWindow(
2102 uint16_t width,
2103 uint16_t height)
2104{
2105 static uint32_t window; // Kludge to the max
2106 NULLDRV_LOG_FUNC;
2107 return &window;
2108}
2109
2110// May not be needed, if we stub out stuf in tri.c
2111ICD_EXPORT void xcbDestroyWindow()
2112{
2113 NULLDRV_LOG_FUNC;
2114}
2115
2116ICD_EXPORT int xcbGetMessage(void *msg)
2117{
2118 NULLDRV_LOG_FUNC;
2119 return 0;
2120}
2121
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002122ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002123{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002124 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002125}