blob: 41de195d020a707455ccd6e9c8635294c0d03cdd [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 Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001315ICD_EXPORT VK_RESULT VKAPI vkWaitForFences(
1316 VK_DEVICE device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001317 uint32_t fenceCount,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001318 const VK_FENCE* pFences,
David Pinedo0257fbf2015-02-02 18:02:40 -07001319 bool32_t waitAll,
1320 uint64_t timeout)
1321{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001322 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001323 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001324}
1325
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001326ICD_EXPORT VK_RESULT VKAPI vkGetFormatInfo(
1327 VK_DEVICE device,
1328 VK_FORMAT format,
1329 VK_FORMAT_INFO_TYPE infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001330 size_t* pDataSize,
1331 void* pData)
1332{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001333 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001334 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001335}
1336
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001337ICD_EXPORT VK_RESULT VKAPI vkGetGpuInfo(
1338 VK_PHYSICAL_GPU gpu_,
1339 VK_PHYSICAL_GPU_INFO_TYPE infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001340 size_t* pDataSize,
1341 void* pData)
1342{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001343 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001344 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001345}
1346
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001347ICD_EXPORT VK_RESULT VKAPI vkGetExtensionSupport(
1348 VK_PHYSICAL_GPU gpu_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001349 const char* pExtName)
1350{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001351 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001352 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001353}
1354
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001355ICD_EXPORT VK_RESULT VKAPI vkGetMultiGpuCompatibility(
1356 VK_PHYSICAL_GPU gpu0_,
1357 VK_PHYSICAL_GPU gpu1_,
1358 VK_GPU_COMPATIBILITY_INFO* pInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001359{
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 vkOpenPeerImage(
1365 VK_DEVICE device,
1366 const VK_PEER_IMAGE_OPEN_INFO* pOpenInfo,
1367 VK_IMAGE* pImage,
1368 VK_GPU_MEMORY* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001369{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001370 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001371 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001372}
1373
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001374ICD_EXPORT VK_RESULT VKAPI vkCreateImage(
1375 VK_DEVICE device,
1376 const VK_IMAGE_CREATE_INFO* pCreateInfo,
1377 VK_IMAGE* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001378{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001379 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001380 struct nulldrv_dev *dev = nulldrv_dev(device);
1381
1382 return nulldrv_img_create(dev, pCreateInfo, false,
1383 (struct nulldrv_img **) pImage);
1384}
1385
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001386ICD_EXPORT VK_RESULT VKAPI vkGetImageSubresourceInfo(
1387 VK_IMAGE image,
1388 const VK_IMAGE_SUBRESOURCE* pSubresource,
1389 VK_SUBRESOURCE_INFO_TYPE infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001390 size_t* pDataSize,
1391 void* pData)
1392{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001393 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001394 VK_RESULT ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001395
1396 switch (infoType) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001397 case VK_INFO_TYPE_SUBRESOURCE_LAYOUT:
David Pinedo0257fbf2015-02-02 18:02:40 -07001398 {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001399 VK_SUBRESOURCE_LAYOUT *layout = (VK_SUBRESOURCE_LAYOUT *) pData;
David Pinedo0257fbf2015-02-02 18:02:40 -07001400
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001401 *pDataSize = sizeof(VK_SUBRESOURCE_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -07001402
1403 if (pData == NULL)
1404 return ret;
1405 layout->offset = 0;
1406 layout->size = 1;
1407 layout->rowPitch = 4;
1408 layout->depthPitch = 4;
1409 }
1410 break;
1411 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001412 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -07001413 break;
1414 }
1415
1416 return ret;
1417}
1418
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001419ICD_EXPORT VK_RESULT VKAPI vkAllocMemory(
1420 VK_DEVICE device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001421 const VkMemoryAllocInfo* pAllocInfo,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001422 VK_GPU_MEMORY* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001423{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001424 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001425 struct nulldrv_dev *dev = nulldrv_dev(device);
1426
1427 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1428}
1429
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001430ICD_EXPORT VK_RESULT VKAPI vkFreeMemory(
1431 VK_GPU_MEMORY mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001432{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001433 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001434 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001435}
1436
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001437ICD_EXPORT VK_RESULT VKAPI vkSetMemoryPriority(
1438 VK_GPU_MEMORY mem_,
1439 VK_MEMORY_PRIORITY priority)
David Pinedo0257fbf2015-02-02 18:02:40 -07001440{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001441 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001442 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001443}
1444
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001445ICD_EXPORT VK_RESULT VKAPI vkMapMemory(
1446 VK_GPU_MEMORY mem_,
1447 VK_FLAGS flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001448 void** ppData)
1449{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001450 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001451 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1452 void *ptr = nulldrv_mem_map(mem, flags);
1453
1454 *ppData = ptr;
1455
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001456 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001457}
1458
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001459ICD_EXPORT VK_RESULT VKAPI vkUnmapMemory(
1460 VK_GPU_MEMORY mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001461{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001462 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001463 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001464}
1465
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001466ICD_EXPORT VK_RESULT VKAPI vkPinSystemMemory(
1467 VK_DEVICE device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001468 const void* pSysMem,
1469 size_t memSize,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001470 VK_GPU_MEMORY* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001471{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001472 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001473 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001474}
1475
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001476ICD_EXPORT VK_RESULT VKAPI vkOpenSharedMemory(
1477 VK_DEVICE device,
1478 const VK_MEMORY_OPEN_INFO* pOpenInfo,
1479 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 vkOpenPeerMemory(
1486 VK_DEVICE device,
1487 const VK_PEER_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 vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001495 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001496 VK_INSTANCE* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001497{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001498 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001499 struct nulldrv_instance *inst;
1500
1501 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001502 VK_DBG_OBJECT_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001503 if (!inst)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001504 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001505
1506 inst->obj.base.get_info = NULL;
1507
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001508 *pInstance = (VK_INSTANCE*)inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001509
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001510 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001511}
1512
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001513ICD_EXPORT VK_RESULT VKAPI vkDestroyInstance(
1514 VK_INSTANCE pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001515{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001516 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001517 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001518}
1519
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001520ICD_EXPORT VK_RESULT VKAPI vkEnumerateGpus(
1521 VK_INSTANCE instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001522 uint32_t maxGpus,
1523 uint32_t* pGpuCount,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001524 VK_PHYSICAL_GPU* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001525{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001526 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001527 VK_RESULT ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001528 struct nulldrv_gpu *gpu;
1529 *pGpuCount = 1;
1530 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001531 if (ret == VK_SUCCESS)
1532 pGpus[0] = (VK_PHYSICAL_GPU) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001533 return ret;
1534}
1535
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001536ICD_EXPORT VK_RESULT VKAPI vkEnumerateLayers(
1537 VK_PHYSICAL_GPU gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001538 size_t maxLayerCount,
1539 size_t maxStringSize,
1540 size_t* pOutLayerCount,
1541 char* const* pOutLayers,
1542 void* pReserved)
1543{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001544 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001545 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001546}
1547
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001548ICD_EXPORT VK_RESULT VKAPI vkDbgRegisterMsgCallback(
1549 VK_INSTANCE instance,
1550 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback,
David Pinedo0257fbf2015-02-02 18:02:40 -07001551 void* pUserData)
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 vkDbgUnregisterMsgCallback(
1558 VK_INSTANCE instance,
1559 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
David Pinedo0257fbf2015-02-02 18:02:40 -07001560{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001561 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001562 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001563}
1564
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001565ICD_EXPORT VK_RESULT VKAPI vkDbgSetGlobalOption(
1566 VK_INSTANCE instance,
1567 VK_DBG_GLOBAL_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001568 size_t dataSize,
1569 const void* pData)
1570{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001571 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001572 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001573}
1574
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001575ICD_EXPORT VK_RESULT VKAPI vkDestroyObject(
1576 VK_OBJECT object)
David Pinedo0257fbf2015-02-02 18:02:40 -07001577{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001578 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001579 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001580}
1581
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001582ICD_EXPORT VK_RESULT VKAPI vkGetObjectInfo(
1583 VK_BASE_OBJECT object,
1584 VK_OBJECT_INFO_TYPE infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001585 size_t* pDataSize,
1586 void* pData)
1587{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001588 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001589 struct nulldrv_base *base = nulldrv_base(object);
1590
1591 return base->get_info(base, infoType, pDataSize, pData);
1592}
1593
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001594ICD_EXPORT VK_RESULT VKAPI vkBindObjectMemory(
1595 VK_OBJECT object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001596 uint32_t allocationIdx,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001597 VK_GPU_MEMORY mem_,
1598 VK_GPU_SIZE memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001599{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001600 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001601 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001602}
1603
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001604ICD_EXPORT VK_RESULT VKAPI vkBindObjectMemoryRange(
1605 VK_OBJECT object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001606 uint32_t allocationIdx,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001607 VK_GPU_SIZE rangeOffset,
1608 VK_GPU_SIZE rangeSize,
1609 VK_GPU_MEMORY mem,
1610 VK_GPU_SIZE memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001611{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001612 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001613 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001614}
1615
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001616ICD_EXPORT VK_RESULT VKAPI vkBindImageMemoryRange(
1617 VK_IMAGE image,
David Pinedo0257fbf2015-02-02 18:02:40 -07001618 uint32_t allocationIdx,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001619 const VK_IMAGE_MEMORY_BIND_INFO* bindInfo,
1620 VK_GPU_MEMORY mem,
1621 VK_GPU_SIZE memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001622{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001623 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001624 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001625}
1626
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001627ICD_EXPORT VK_RESULT VKAPI vkDbgSetObjectTag(
1628 VK_BASE_OBJECT object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001629 size_t tagSize,
1630 const void* pTag)
1631{
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 vkCreateGraphicsPipeline(
1637 VK_DEVICE device,
1638 const VK_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo,
1639 VK_PIPELINE* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001640{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001641 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001642 struct nulldrv_dev *dev = nulldrv_dev(device);
1643
1644 return graphics_pipeline_create(dev, pCreateInfo,
1645 (struct nulldrv_pipeline **) pPipeline);
1646}
1647
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001648ICD_EXPORT VK_RESULT VKAPI vkCreateGraphicsPipelineDerivative(
1649 VK_DEVICE device,
1650 const VK_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo,
1651 VK_PIPELINE basePipeline,
1652 VK_PIPELINE* pPipeline)
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001653{
1654 NULLDRV_LOG_FUNC;
1655 struct nulldrv_dev *dev = nulldrv_dev(device);
1656
1657 return graphics_pipeline_create(dev, pCreateInfo,
1658 (struct nulldrv_pipeline **) pPipeline);
1659}
1660
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001661ICD_EXPORT VK_RESULT VKAPI vkCreateComputePipeline(
1662 VK_DEVICE device,
1663 const VK_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo,
1664 VK_PIPELINE* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001665{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001666 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001667 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001668}
1669
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001670ICD_EXPORT VK_RESULT VKAPI vkStorePipeline(
1671 VK_PIPELINE pipeline,
David Pinedo0257fbf2015-02-02 18:02:40 -07001672 size_t* pDataSize,
1673 void* pData)
1674{
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 vkLoadPipeline(
1680 VK_DEVICE device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001681 size_t dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001682 const void* pData,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001683 VK_PIPELINE* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001684{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001685 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001686 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001687}
1688
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001689ICD_EXPORT VK_RESULT VKAPI vkLoadPipelineDerivative(
1690 VK_DEVICE device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001691 size_t dataSize,
1692 const void* pData,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001693 VK_PIPELINE basePipeline,
1694 VK_PIPELINE* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001695{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001696 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001697 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001698}
1699
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001700ICD_EXPORT VK_RESULT VKAPI vkCreateQueryPool(
1701 VK_DEVICE device,
1702 const VK_QUERY_POOL_CREATE_INFO* pCreateInfo,
1703 VK_QUERY_POOL* pQueryPool)
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 vkGetQueryPoolResults(
1710 VK_QUERY_POOL queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001711 uint32_t startQuery,
1712 uint32_t queryCount,
1713 size_t* pDataSize,
1714 void* pData)
1715{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001716 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001717 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001718}
1719
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001720ICD_EXPORT VK_RESULT VKAPI vkQueueAddMemReference(
1721 VK_QUEUE queue,
1722 VK_GPU_MEMORY mem)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001723{
1724 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001725 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001726}
1727
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001728ICD_EXPORT VK_RESULT VKAPI vkQueueRemoveMemReference(
1729 VK_QUEUE queue,
1730 VK_GPU_MEMORY mem)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001731{
1732 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001733 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001734}
1735
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001736ICD_EXPORT VK_RESULT VKAPI vkQueueWaitIdle(
1737 VK_QUEUE queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001738{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001739 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001740 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001741}
1742
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001743ICD_EXPORT VK_RESULT VKAPI vkQueueSubmit(
1744 VK_QUEUE queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001745 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001746 const VK_CMD_BUFFER* pCmdBuffers,
1747 VK_FENCE fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001748{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001749 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001750 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001751}
1752
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001753ICD_EXPORT VK_RESULT VKAPI vkOpenSharedSemaphore(
1754 VK_DEVICE device,
1755 const VK_SEMAPHORE_OPEN_INFO* pOpenInfo,
1756 VK_SEMAPHORE* pSemaphore)
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 vkCreateSemaphore(
1763 VK_DEVICE device,
1764 const VK_SEMAPHORE_CREATE_INFO* pCreateInfo,
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 vkQueueSignalSemaphore(
1772 VK_QUEUE queue,
1773 VK_SEMAPHORE semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001774{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001775 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001776 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001777}
1778
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001779ICD_EXPORT VK_RESULT VKAPI vkQueueWaitSemaphore(
1780 VK_QUEUE queue,
1781 VK_SEMAPHORE semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001782{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001783 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001784 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001785}
1786
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001787ICD_EXPORT VK_RESULT VKAPI vkCreateSampler(
1788 VK_DEVICE device,
1789 const VK_SAMPLER_CREATE_INFO* pCreateInfo,
1790 VK_SAMPLER* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001791{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001792 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001793 struct nulldrv_dev *dev = nulldrv_dev(device);
1794
1795 return nulldrv_sampler_create(dev, pCreateInfo,
1796 (struct nulldrv_sampler **) pSampler);
1797}
1798
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001799ICD_EXPORT VK_RESULT VKAPI vkCreateShader(
1800 VK_DEVICE device,
1801 const VK_SHADER_CREATE_INFO* pCreateInfo,
1802 VK_SHADER* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001803{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001804 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001805 struct nulldrv_dev *dev = nulldrv_dev(device);
1806
1807 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1808}
1809
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001810ICD_EXPORT VK_RESULT VKAPI vkCreateDynamicViewportState(
1811 VK_DEVICE device,
1812 const VK_DYNAMIC_VP_STATE_CREATE_INFO* pCreateInfo,
1813 VK_DYNAMIC_VP_STATE_OBJECT* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001814{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001815 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001816 struct nulldrv_dev *dev = nulldrv_dev(device);
1817
1818 return nulldrv_viewport_state_create(dev, pCreateInfo,
1819 (struct nulldrv_dynamic_vp **) pState);
1820}
1821
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001822ICD_EXPORT VK_RESULT VKAPI vkCreateDynamicRasterState(
1823 VK_DEVICE device,
1824 const VK_DYNAMIC_RS_STATE_CREATE_INFO* pCreateInfo,
1825 VK_DYNAMIC_RS_STATE_OBJECT* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001826{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001827 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001828 struct nulldrv_dev *dev = nulldrv_dev(device);
1829
1830 return nulldrv_raster_state_create(dev, pCreateInfo,
1831 (struct nulldrv_dynamic_rs **) pState);
1832}
1833
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001834ICD_EXPORT VK_RESULT VKAPI vkCreateDynamicColorBlendState(
1835 VK_DEVICE device,
1836 const VK_DYNAMIC_CB_STATE_CREATE_INFO* pCreateInfo,
1837 VK_DYNAMIC_CB_STATE_OBJECT* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001838{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001839 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001840 struct nulldrv_dev *dev = nulldrv_dev(device);
1841
1842 return nulldrv_blend_state_create(dev, pCreateInfo,
1843 (struct nulldrv_dynamic_cb **) pState);
1844}
1845
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001846ICD_EXPORT VK_RESULT VKAPI vkCreateDynamicDepthStencilState(
1847 VK_DEVICE device,
1848 const VK_DYNAMIC_DS_STATE_CREATE_INFO* pCreateInfo,
1849 VK_DYNAMIC_DS_STATE_OBJECT* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001850{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001851 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001852 struct nulldrv_dev *dev = nulldrv_dev(device);
1853
1854 return nulldrv_ds_state_create(dev, pCreateInfo,
1855 (struct nulldrv_dynamic_ds **) pState);
1856}
1857
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001858ICD_EXPORT VK_RESULT VKAPI vkCreateBufferView(
1859 VK_DEVICE device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001860 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001861 VK_BUFFER_VIEW* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001862{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001863 NULLDRV_LOG_FUNC;
1864 struct nulldrv_dev *dev = nulldrv_dev(device);
1865
1866 return nulldrv_buf_view_create(dev, pCreateInfo,
1867 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001868}
1869
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001870ICD_EXPORT VK_RESULT VKAPI vkCreateImageView(
1871 VK_DEVICE device,
1872 const VK_IMAGE_VIEW_CREATE_INFO* pCreateInfo,
1873 VK_IMAGE_VIEW* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001874{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001875 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001876 struct nulldrv_dev *dev = nulldrv_dev(device);
1877
1878 return nulldrv_img_view_create(dev, pCreateInfo,
1879 (struct nulldrv_img_view **) pView);
1880}
1881
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001882ICD_EXPORT VK_RESULT VKAPI vkCreateColorAttachmentView(
1883 VK_DEVICE device,
1884 const VK_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo,
1885 VK_COLOR_ATTACHMENT_VIEW* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001886{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001887 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001888 struct nulldrv_dev *dev = nulldrv_dev(device);
1889
1890 return nulldrv_rt_view_create(dev, pCreateInfo,
1891 (struct nulldrv_rt_view **) pView);
1892}
1893
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001894ICD_EXPORT VK_RESULT VKAPI vkCreateDepthStencilView(
1895 VK_DEVICE device,
1896 const VK_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo,
1897 VK_DEPTH_STENCIL_VIEW* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001898{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001899 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001900 struct nulldrv_dev *dev = nulldrv_dev(device);
1901
1902 return nulldrv_ds_view_create(dev, pCreateInfo,
1903 (struct nulldrv_ds_view **) pView);
1904
1905}
1906
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001907ICD_EXPORT VK_RESULT VKAPI vkCreateDescriptorSetLayout(
1908 VK_DEVICE device,
1909 const VK_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfo,
1910 VK_DESCRIPTOR_SET_LAYOUT* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001911{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001912 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001913 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001914
Chia-I Wu7732cb22015-03-26 15:27:55 +08001915 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001916 (struct nulldrv_desc_layout **) pSetLayout);
1917}
1918
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001919ICD_EXPORT VK_RESULT VKAPI vkCreateDescriptorSetLayoutChain(
1920 VK_DEVICE device,
Chia-I Wu7732cb22015-03-26 15:27:55 +08001921 uint32_t setLayoutArrayCount,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001922 const VK_DESCRIPTOR_SET_LAYOUT* pSetLayoutArray,
1923 VK_DESCRIPTOR_SET_LAYOUT_CHAIN* pLayoutChain)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001924{
1925 NULLDRV_LOG_FUNC;
1926 struct nulldrv_dev *dev = nulldrv_dev(device);
1927
1928 return nulldrv_desc_layout_chain_create(dev,
1929 setLayoutArrayCount, pSetLayoutArray,
1930 (struct nulldrv_desc_layout_chain **) pLayoutChain);
1931}
1932
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001933ICD_EXPORT VK_RESULT VKAPI vkBeginDescriptorPoolUpdate(
1934 VK_DEVICE device,
1935 VK_DESCRIPTOR_UPDATE_MODE updateMode)
David Pinedo0257fbf2015-02-02 18:02:40 -07001936{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001937 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001938 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001939}
1940
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001941ICD_EXPORT VK_RESULT VKAPI vkEndDescriptorPoolUpdate(
1942 VK_DEVICE device,
1943 VK_CMD_BUFFER cmd_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001944{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001945 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001946 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001947}
1948
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001949ICD_EXPORT VK_RESULT VKAPI vkCreateDescriptorPool(
1950 VK_DEVICE device,
1951 VK_DESCRIPTOR_POOL_USAGE poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07001952 uint32_t maxSets,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001953 const VK_DESCRIPTOR_POOL_CREATE_INFO* pCreateInfo,
1954 VK_DESCRIPTOR_POOL* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001955{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001956 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001957 struct nulldrv_dev *dev = nulldrv_dev(device);
1958
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08001959 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
1960 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07001961}
1962
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001963ICD_EXPORT VK_RESULT VKAPI vkResetDescriptorPool(
1964 VK_DESCRIPTOR_POOL descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001965{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001966 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001967 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001968}
1969
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001970ICD_EXPORT VK_RESULT VKAPI vkAllocDescriptorSets(
1971 VK_DESCRIPTOR_POOL descriptorPool,
1972 VK_DESCRIPTOR_SET_USAGE setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07001973 uint32_t count,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001974 const VK_DESCRIPTOR_SET_LAYOUT* pSetLayouts,
1975 VK_DESCRIPTOR_SET* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07001976 uint32_t* pCount)
1977{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001978 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08001979 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
1980 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001981 VK_RESULT ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001982 uint32_t i;
1983
1984 for (i = 0; i < count; i++) {
1985 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001986 nulldrv_desc_layout((VK_DESCRIPTOR_SET_LAYOUT) pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07001987
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08001988 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001989 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001990 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07001991 break;
1992 }
1993
1994 if (pCount)
1995 *pCount = i;
1996
1997 return ret;
1998}
1999
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002000ICD_EXPORT void VKAPI vkClearDescriptorSets(
2001 VK_DESCRIPTOR_POOL descriptorPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07002002 uint32_t count,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002003 const VK_DESCRIPTOR_SET* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002004{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002005 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002006}
2007
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002008ICD_EXPORT void VKAPI vkUpdateDescriptors(
2009 VK_DESCRIPTOR_SET descriptorSet,
Chia-I Wu7732cb22015-03-26 15:27:55 +08002010 uint32_t updateCount,
2011 const void** ppUpdateArray)
David Pinedo0257fbf2015-02-02 18:02:40 -07002012{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002013 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002014}
2015
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002016ICD_EXPORT VK_RESULT VKAPI vkCreateFramebuffer(
2017 VK_DEVICE device,
2018 const VK_FRAMEBUFFER_CREATE_INFO* info,
2019 VK_FRAMEBUFFER* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002020{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002021 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002022 struct nulldrv_dev *dev = nulldrv_dev(device);
2023
2024 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2025}
2026
2027
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002028ICD_EXPORT VK_RESULT VKAPI vkCreateRenderPass(
2029 VK_DEVICE device,
2030 const VK_RENDER_PASS_CREATE_INFO* info,
2031 VK_RENDER_PASS* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002032{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002033 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002034 struct nulldrv_dev *dev = nulldrv_dev(device);
2035
2036 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2037}
2038
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002039ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
2040 VK_CMD_BUFFER cmdBuffer,
2041 const VK_RENDER_PASS_BEGIN* pRenderPassBegin)
David Pinedo0257fbf2015-02-02 18:02:40 -07002042{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002043 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002044}
2045
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002046ICD_EXPORT void VKAPI vkCmdEndRenderPass(
2047 VK_CMD_BUFFER cmdBuffer,
2048 VK_RENDER_PASS renderPass)
David Pinedo0257fbf2015-02-02 18:02:40 -07002049{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002050 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002051}
Ian Elliottf93069f2015-02-19 14:26:19 -07002052
2053ICD_EXPORT void* xcbCreateWindow(
2054 uint16_t width,
2055 uint16_t height)
2056{
2057 static uint32_t window; // Kludge to the max
2058 NULLDRV_LOG_FUNC;
2059 return &window;
2060}
2061
2062// May not be needed, if we stub out stuf in tri.c
2063ICD_EXPORT void xcbDestroyWindow()
2064{
2065 NULLDRV_LOG_FUNC;
2066}
2067
2068ICD_EXPORT int xcbGetMessage(void *msg)
2069{
2070 NULLDRV_LOG_FUNC;
2071 return 0;
2072}
2073
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002074ICD_EXPORT VK_RESULT xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002075{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002076 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002077}