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