blob: 1a234f26553a67521da9df451c02c28fa296b32d [file] [log] [blame]
David Pinedo0257fbf2015-02-02 18:02:40 -07001/*
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002 * Vulkan null driver
David Pinedo0257fbf2015-02-02 18:02:40 -07003 *
4 * Copyright (C) 2015 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 */
25
26#include "nulldrv.h"
David Pinedo8e9cb3b2015-02-10 15:02:08 -070027#include <stdio.h>
David Pinedo0257fbf2015-02-02 18:02:40 -070028
David Pinedo8e9cb3b2015-02-10 15:02:08 -070029#if 0
30#define NULLDRV_LOG_FUNC \
31 do { \
32 fflush(stdout); \
33 fflush(stderr); \
34 printf("null driver: %s\n", __FUNCTION__); \
35 fflush(stdout); \
36 } while (0)
37#else
38 #define NULLDRV_LOG_FUNC do { } while (0)
39#endif
40
41// The null driver supports all WSI extenstions ... for now ...
David Pinedo0257fbf2015-02-02 18:02:40 -070042static const char * const nulldrv_gpu_exts[NULLDRV_EXT_COUNT] = {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060043 [NULLDRV_EXT_WSI_X11] = "VK_WSI_X11",
44 [NULLDRV_EXT_WSI_WINDOWS] = "VK_WSI_WINDOWS"
David Pinedo0257fbf2015-02-02 18:02:40 -070045};
46
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060047static struct nulldrv_base *nulldrv_base(VkBaseObject base)
David Pinedo0257fbf2015-02-02 18:02:40 -070048{
49 return (struct nulldrv_base *) base;
50}
51
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060052static VkResult nulldrv_base_get_info(struct nulldrv_base *base, int type,
David Pinedo0257fbf2015-02-02 18:02:40 -070053 size_t *size, void *data)
54{
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060055 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -070056 size_t s;
57 uint32_t *count;
58
59 switch (type) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060060 case VK_INFO_TYPE_MEMORY_REQUIREMENTS:
David Pinedo0257fbf2015-02-02 18:02:40 -070061 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060062 VkMemoryRequirements *mem_req = data;
63 s = sizeof(VkMemoryRequirements);
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:
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060079 s = sizeof(VkImageMemoryRequirements);
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:
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060086 s = sizeof(VkBufferMemoryRequirements);
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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600134static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600152static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600170static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600181 VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600214static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600233static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600239 VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600272static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalGpu gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700273{
274 return (struct nulldrv_gpu *) gpu;
275}
276
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600277static VkResult nulldrv_rt_view_create(struct nulldrv_dev *dev,
278 const VkColorAttachmentViewCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600293static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
294 const VkFenceCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600309static struct nulldrv_dev *nulldrv_dev(VkDevice 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600320static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600324 VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600329 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700330
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600331 *size = sizeof(VkMemoryRequirements);
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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600341 VkImageMemoryRequirements *img_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700342
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600343 *size = sizeof(VkImageMemoryRequirements);
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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600353 VkBufferMemoryRequirements *buf_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700354
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600355 *size = sizeof(VkBufferMemoryRequirements);
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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600369static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
370 const VkImageCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600399static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700400{
401 return (struct nulldrv_img *) image;
402}
403
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600404static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600427static VkResult nulldrv_ds_view_create(struct nulldrv_dev *dev,
428 const VkDepthStencilViewCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600448static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
449 const VkSamplerCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600464static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
465 const VkImageViewCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600486static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700487{
488 return mem->bo;
489}
490
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600491static struct nulldrv_mem *nulldrv_mem(VkGpuMemory 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600501static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600505 VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600510 VkMemoryRequirements *mem_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700511
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600512 *size = sizeof(VkMemoryRequirements);
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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600524 VkBufferMemoryRequirements *buf_req = data;
David Pinedo0257fbf2015-02-02 18:02:40 -0700525
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600526 *size = sizeof(VkBufferMemoryRequirements);
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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600540static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600561static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
562 const VkDescriptorSetLayoutCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600578static VkResult nulldrv_desc_layout_chain_create(struct nulldrv_dev *dev,
Chia-I Wu7732cb22015-03-26 15:27:55 +0800579 uint32_t setLayoutArrayCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600580 const VkDescriptorSetLayout *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600596static struct nulldrv_desc_layout *nulldrv_desc_layout(VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700597{
598 return (struct nulldrv_desc_layout *) layout;
599}
600
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600601static VkResult shader_create(struct nulldrv_dev *dev,
602 const VkShaderCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600617static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
618 const VkGraphicsPipelineCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600634static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev,
635 const VkDynamicVpStateCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600650static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev,
651 const VkDynamicRsStateCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600666static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev,
667 const VkDynamicCbStateCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600682static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev,
683 const VkDynamicDsStateCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600699static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
700 const VkCmdBufferCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600715static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
716 VkDescriptorPoolUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700717 uint32_t max_sets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600718 const VkDescriptorPoolCreateInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600736static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800737 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600738 VkDescriptorSetUsage 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600757static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600762static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
763 const VkFramebufferCreateInfo* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600779static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
780 const VkRenderPassCreateInfo* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600794static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700795{
796 return (struct nulldrv_buf *) buf;
797}
798
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600799static VkResult 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600823ICD_EXPORT VkResult VKAPI vkCreateBuffer(
824 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600825 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600826 VkBuffer* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600834ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
835 VkDevice device,
836 const VkCmdBufferCreateInfo* pCreateInfo,
837 VkCmdBuffer* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600846ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
847 VkCmdBuffer cmdBuffer,
848 const VkCmdBufferBeginInfo *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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600854ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
855 VkCmdBuffer 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -0600861ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
862 VkCmdBuffer 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600869 VkCmdBuffer cmdBuffer,
870 VkPipelineBindPoint 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600879 VkCmdBuffer cmdBuffer,
880 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700881 uint32_t startCounter,
882 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600883 VkBuffer srcBuffer,
884 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600890 VkCmdBuffer cmdBuffer,
891 VkPipelineBindPoint pipelineBindPoint,
David Pinedo0257fbf2015-02-02 18:02:40 -0700892 uint32_t startCounter,
893 uint32_t counterCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600894 VkBuffer destBuffer,
895 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600901 VkCmdBuffer 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600908 VkCmdBuffer 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600914 VkCmdBuffer cmdBuffer,
915 VkBuffer srcBuffer,
916 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700917 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600918 const VkBufferCopy* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600924 VkCmdBuffer cmdBuffer,
925 VkImage srcImage,
926 VkImageLayout srcImageLayout,
927 VkImage destImage,
928 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700929 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600930 const VkImageCopy* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600936 VkCmdBuffer cmdBuffer,
937 VkImage srcImage,
938 VkImageLayout srcImageLayout,
939 VkImage destImage,
940 VkImageLayout destImageLayout,
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600941 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600942 const VkImageBlit* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600948 VkCmdBuffer cmdBuffer,
949 VkBuffer srcBuffer,
950 VkImage destImage,
951 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700952 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600953 const VkBufferImageCopy* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600959 VkCmdBuffer cmdBuffer,
960 VkImage srcImage,
961 VkImageLayout srcImageLayout,
962 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700963 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600964 const VkBufferImageCopy* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600970 VkCmdBuffer cmdBuffer,
971 VkImage srcImage,
972 VkImageLayout srcImageLayout,
973 VkImage destImage,
974 VkImageLayout 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600980 VkCmdBuffer cmdBuffer,
981 VkBuffer destBuffer,
982 VkGpuSize destOffset,
983 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600990 VkCmdBuffer cmdBuffer,
991 VkBuffer destBuffer,
992 VkGpuSize destOffset,
993 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001000 VkCmdBuffer cmdBuffer,
1001 VkImage image,
1002 VkImageLayout imageLayout,
1003 VkClearColor color,
David Pinedo0257fbf2015-02-02 18:02:40 -07001004 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001005 const VkImageSubresourceRange* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001011 VkCmdBuffer cmdBuffer,
1012 VkImage image,
1013 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001014 float depth,
1015 uint32_t stencil,
1016 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001017 const VkImageSubresourceRange* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001023 VkCmdBuffer cmdBuffer,
1024 VkImage srcImage,
1025 VkImageLayout srcImageLayout,
1026 VkImage destImage,
1027 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -06001028 uint32_t regionCount,
1029 const VkImageResolve* pRegions)
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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001035 VkCmdBuffer cmdBuffer,
1036 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001037 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001038 VkFlags 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001044 VkCmdBuffer cmdBuffer,
1045 VkQueryPool 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001052 VkCmdBuffer cmdBuffer,
1053 VkQueryPool 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001061 VkCmdBuffer cmdBuffer,
1062 VkEvent event_,
1063 VkPipeEvent 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001069 VkCmdBuffer cmdBuffer,
1070 VkEvent event_,
1071 VkPipeEvent 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001077 VkCmdBuffer cmdBuffer,
1078 VkTimestampType timestampType,
1079 VkBuffer destBuffer,
1080 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001086 VkCmdBuffer cmdBuffer,
1087 VkPipelineBindPoint pipelineBindPoint,
1088 VkPipeline 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001094 VkCmdBuffer cmdBuffer,
1095 VkStateBindPoint stateBindPoint,
1096 VkDynamicStateObject 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001102 VkCmdBuffer cmdBuffer,
1103 VkPipelineBindPoint pipelineBindPoint,
1104 VkDescriptorSetLayoutChain layoutChain,
Chia-I Wu862c5572015-03-28 15:23:55 +08001105 uint32_t layoutChainSlot,
1106 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001107 const VkDescriptorSet* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001114 VkCmdBuffer cmdBuffer,
1115 VkBuffer buffer,
1116 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001123 VkCmdBuffer cmdBuffer,
1124 VkBuffer buffer,
1125 VkGpuSize offset,
1126 VkIndexType 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001132 VkCmdBuffer 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001142 VkCmdBuffer 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001153 VkCmdBuffer cmdBuffer,
1154 VkBuffer buffer,
1155 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001163 VkCmdBuffer cmdBuffer,
1164 VkBuffer buffer,
1165 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001173 VkCmdBuffer 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001182 VkCmdBuffer cmdBuffer,
1183 VkBuffer buffer,
1184 VkGpuSize 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001190 VkCmdBuffer cmdBuffer,
1191 const VkEventWaitInfo* 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(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001197 VkCmdBuffer cmdBuffer,
1198 const VkPipelineBarrier* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001203ICD_EXPORT VkResult VKAPI vkCreateDevice(
1204 VkPhysicalGpu gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001205 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001206 VkDevice* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001213ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1214 VkDevice 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001220ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1221 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001222 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001223 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001224 VkQueue* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001232ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1233 VkDevice 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001239ICD_EXPORT VkResult VKAPI vkDbgSetValidationLevel(
1240 VkDevice device,
1241 VkValidationLevel 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001247ICD_EXPORT VkResult VKAPI vkDbgSetMessageFilter(
1248 VkDevice 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001256ICD_EXPORT VkResult VKAPI vkDbgSetDeviceOption(
1257 VkDevice device,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001258 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001266ICD_EXPORT VkResult VKAPI vkCreateEvent(
1267 VkDevice device,
1268 const VkEventCreateInfo* pCreateInfo,
1269 VkEvent* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001275ICD_EXPORT VkResult VKAPI vkGetEventStatus(
1276 VkEvent 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001282ICD_EXPORT VkResult VKAPI vkSetEvent(
1283 VkEvent 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001289ICD_EXPORT VkResult VKAPI vkResetEvent(
1290 VkEvent 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001296ICD_EXPORT VkResult VKAPI vkCreateFence(
1297 VkDevice device,
1298 const VkFenceCreateInfo* pCreateInfo,
1299 VkFence* 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001308ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
1309 VkFence 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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001315ICD_EXPORT VkResult VKAPI vkResetFences(
1316 VkDevice device,
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001317 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001318 VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001319{
1320 NULLDRV_LOG_FUNC;
1321 return VK_SUCCESS;
1322}
1323
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001324ICD_EXPORT VkResult VKAPI vkWaitForFences(
1325 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001326 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001327 const VkFence* pFences,
David Pinedo0257fbf2015-02-02 18:02:40 -07001328 bool32_t waitAll,
1329 uint64_t timeout)
1330{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001331 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001332 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001333}
1334
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001335ICD_EXPORT VkResult VKAPI vkGetFormatInfo(
1336 VkDevice device,
1337 VkFormat format,
1338 VkFormatInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001339 size_t* pDataSize,
1340 void* pData)
1341{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001342 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001343 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001344}
1345
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001346ICD_EXPORT VkResult VKAPI vkGetGpuInfo(
1347 VkPhysicalGpu gpu_,
1348 VkPhysicalGpuInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001349 size_t* pDataSize,
1350 void* pData)
1351{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001352 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001353 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001354}
1355
Jon Ashburneb2728b2015-04-10 14:33:07 -06001356ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
1357 VkExtensionInfoType infoType,
1358 uint32_t extensionIndex,
1359 size_t* pDataSize,
1360 void* pData)
1361{
1362 uint32_t *count;
1363
1364 if (pDataSize == NULL)
1365 return VK_ERROR_INVALID_POINTER;
1366
1367 switch (infoType) {
1368 case VK_EXTENSION_INFO_TYPE_COUNT:
1369 *pDataSize = sizeof(uint32_t);
1370 if (pData == NULL)
1371 return VK_SUCCESS;
1372 count = (uint32_t *) pData;
1373 *count = 0;
1374 break;
1375 case VK_EXTENSION_INFO_TYPE_PROPERTIES:
1376 *pDataSize = 0;
1377 if (pData == NULL)
1378 return VK_SUCCESS;
1379 else
1380 return VK_ERROR_INVALID_EXTENSION;
1381 break;
1382 default:
1383 return VK_ERROR_INVALID_VALUE;
1384 };
1385
1386 return VK_SUCCESS;
1387}
1388
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001389ICD_EXPORT VkResult VKAPI vkGetExtensionSupport(
Jon Ashburneb2728b2015-04-10 14:33:07 -06001390 VkPhysicalGpu gpu_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001391 const char* pExtName)
1392{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001393 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001394 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001395}
1396
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001397ICD_EXPORT VkResult VKAPI vkGetMultiGpuCompatibility(
1398 VkPhysicalGpu gpu0_,
1399 VkPhysicalGpu gpu1_,
1400 VkGpuCompatibilityInfo* pInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001401{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001402 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001403 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001404}
1405
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001406ICD_EXPORT VkResult VKAPI vkOpenPeerImage(
1407 VkDevice device,
1408 const VkPeerImageOpenInfo* pOpenInfo,
1409 VkImage* pImage,
1410 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001411{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001412 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001413 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001414}
1415
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001416ICD_EXPORT VkResult VKAPI vkCreateImage(
1417 VkDevice device,
1418 const VkImageCreateInfo* pCreateInfo,
1419 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001420{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001421 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001422 struct nulldrv_dev *dev = nulldrv_dev(device);
1423
1424 return nulldrv_img_create(dev, pCreateInfo, false,
1425 (struct nulldrv_img **) pImage);
1426}
1427
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001428ICD_EXPORT VkResult VKAPI vkGetImageSubresourceInfo(
1429 VkImage image,
1430 const VkImageSubresource* pSubresource,
1431 VkSubresourceInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001432 size_t* pDataSize,
1433 void* pData)
1434{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001435 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001436 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001437
1438 switch (infoType) {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001439 case VK_INFO_TYPE_SUBRESOURCE_LAYOUT:
David Pinedo0257fbf2015-02-02 18:02:40 -07001440 {
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001441 VkSubresourceLayout *layout = (VkSubresourceLayout *) pData;
David Pinedo0257fbf2015-02-02 18:02:40 -07001442
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001443 *pDataSize = sizeof(VkSubresourceLayout);
David Pinedo0257fbf2015-02-02 18:02:40 -07001444
1445 if (pData == NULL)
1446 return ret;
1447 layout->offset = 0;
1448 layout->size = 1;
1449 layout->rowPitch = 4;
1450 layout->depthPitch = 4;
1451 }
1452 break;
1453 default:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001454 ret = VK_ERROR_INVALID_VALUE;
David Pinedo0257fbf2015-02-02 18:02:40 -07001455 break;
1456 }
1457
1458 return ret;
1459}
1460
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001461ICD_EXPORT VkResult VKAPI vkAllocMemory(
1462 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001463 const VkMemoryAllocInfo* pAllocInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001464 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001465{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001466 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001467 struct nulldrv_dev *dev = nulldrv_dev(device);
1468
1469 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1470}
1471
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001472ICD_EXPORT VkResult VKAPI vkFreeMemory(
1473 VkGpuMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001474{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001475 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001476 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001477}
1478
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001479ICD_EXPORT VkResult VKAPI vkSetMemoryPriority(
1480 VkGpuMemory mem_,
1481 VkMemoryPriority priority)
David Pinedo0257fbf2015-02-02 18:02:40 -07001482{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001483 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001484 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001485}
1486
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001487ICD_EXPORT VkResult VKAPI vkMapMemory(
1488 VkGpuMemory mem_,
1489 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001490 void** ppData)
1491{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001492 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001493 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1494 void *ptr = nulldrv_mem_map(mem, flags);
1495
1496 *ppData = ptr;
1497
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001498 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001499}
1500
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001501ICD_EXPORT VkResult VKAPI vkUnmapMemory(
1502 VkGpuMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001503{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001504 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001505 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001506}
1507
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001508ICD_EXPORT VkResult VKAPI vkPinSystemMemory(
1509 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001510 const void* pSysMem,
1511 size_t memSize,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001512 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001513{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001514 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001515 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001516}
1517
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001518ICD_EXPORT VkResult VKAPI vkOpenSharedMemory(
1519 VkDevice device,
1520 const VkMemoryOpenInfo* pOpenInfo,
1521 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001522{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001523 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001524 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001525}
1526
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001527ICD_EXPORT VkResult VKAPI vkOpenPeerMemory(
1528 VkDevice device,
1529 const VkPeerMemoryOpenInfo* pOpenInfo,
1530 VkGpuMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001531{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001532 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001533 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001534}
1535
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001536ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001537 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001538 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001539{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001540 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001541 struct nulldrv_instance *inst;
1542
1543 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001544 VK_DBG_OBJECT_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001545 if (!inst)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001546 return VK_ERROR_OUT_OF_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001547
1548 inst->obj.base.get_info = NULL;
1549
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001550 *pInstance = (VkInstance*)inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001551
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001552 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001553}
1554
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001555ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1556 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001557{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001558 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001559 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001560}
1561
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001562ICD_EXPORT VkResult VKAPI vkEnumerateGpus(
1563 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001564 uint32_t maxGpus,
1565 uint32_t* pGpuCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001566 VkPhysicalGpu* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001567{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001568 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001569 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001570 struct nulldrv_gpu *gpu;
1571 *pGpuCount = 1;
1572 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001573 if (ret == VK_SUCCESS)
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001574 pGpus[0] = (VkPhysicalGpu) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001575 return ret;
1576}
1577
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001578ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
1579 VkPhysicalGpu gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001580 size_t maxLayerCount,
1581 size_t maxStringSize,
1582 size_t* pOutLayerCount,
1583 char* const* pOutLayers,
1584 void* pReserved)
1585{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001586 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001587 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001588}
1589
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001590ICD_EXPORT VkResult VKAPI vkDbgRegisterMsgCallback(
1591 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001592 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback,
David Pinedo0257fbf2015-02-02 18:02:40 -07001593 void* pUserData)
1594{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001595 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001596 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001597}
1598
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001599ICD_EXPORT VkResult VKAPI vkDbgUnregisterMsgCallback(
1600 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001601 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
David Pinedo0257fbf2015-02-02 18:02:40 -07001602{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001603 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001604 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001605}
1606
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001607ICD_EXPORT VkResult VKAPI vkDbgSetGlobalOption(
1608 VkInstance instance,
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001609 VK_DBG_GLOBAL_OPTION dbgOption,
David Pinedo0257fbf2015-02-02 18:02:40 -07001610 size_t dataSize,
1611 const void* pData)
1612{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001613 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001614 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001615}
1616
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001617ICD_EXPORT VkResult VKAPI vkDestroyObject(
1618 VkObject object)
David Pinedo0257fbf2015-02-02 18:02:40 -07001619{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001620 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001621 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001622}
1623
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001624ICD_EXPORT VkResult VKAPI vkGetObjectInfo(
1625 VkBaseObject object,
1626 VkObjectInfoType infoType,
David Pinedo0257fbf2015-02-02 18:02:40 -07001627 size_t* pDataSize,
1628 void* pData)
1629{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001630 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001631 struct nulldrv_base *base = nulldrv_base(object);
1632
1633 return base->get_info(base, infoType, pDataSize, pData);
1634}
1635
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001636ICD_EXPORT VkResult VKAPI vkBindObjectMemory(
1637 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001638 uint32_t allocationIdx,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001639 VkGpuMemory mem_,
1640 VkGpuSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001641{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001642 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001643 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001644}
1645
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001646ICD_EXPORT VkResult VKAPI vkBindObjectMemoryRange(
1647 VkObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001648 uint32_t allocationIdx,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001649 VkGpuSize rangeOffset,
1650 VkGpuSize rangeSize,
1651 VkGpuMemory mem,
1652 VkGpuSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001653{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001654 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001655 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001656}
1657
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001658ICD_EXPORT VkResult VKAPI vkBindImageMemoryRange(
1659 VkImage image,
David Pinedo0257fbf2015-02-02 18:02:40 -07001660 uint32_t allocationIdx,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001661 const VkImageMemoryBindInfo* bindInfo,
1662 VkGpuMemory mem,
1663 VkGpuSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001664{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001665 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001666 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001667}
1668
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001669ICD_EXPORT VkResult VKAPI vkDbgSetObjectTag(
1670 VkBaseObject object,
David Pinedo0257fbf2015-02-02 18:02:40 -07001671 size_t tagSize,
1672 const void* pTag)
1673{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001674 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001675 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001676}
1677
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001678ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(
1679 VkDevice device,
1680 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1681 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001682{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001683 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001684 struct nulldrv_dev *dev = nulldrv_dev(device);
1685
1686 return graphics_pipeline_create(dev, pCreateInfo,
1687 (struct nulldrv_pipeline **) pPipeline);
1688}
1689
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001690ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelineDerivative(
1691 VkDevice device,
1692 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1693 VkPipeline basePipeline,
1694 VkPipeline* pPipeline)
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001695{
1696 NULLDRV_LOG_FUNC;
1697 struct nulldrv_dev *dev = nulldrv_dev(device);
1698
1699 return graphics_pipeline_create(dev, pCreateInfo,
1700 (struct nulldrv_pipeline **) pPipeline);
1701}
1702
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001703ICD_EXPORT VkResult VKAPI vkCreateComputePipeline(
1704 VkDevice device,
1705 const VkComputePipelineCreateInfo* pCreateInfo,
1706 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001707{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001708 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001709 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001710}
1711
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001712ICD_EXPORT VkResult VKAPI vkStorePipeline(
1713 VkPipeline pipeline,
David Pinedo0257fbf2015-02-02 18:02:40 -07001714 size_t* pDataSize,
1715 void* pData)
1716{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001717 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001718 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001719}
1720
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001721ICD_EXPORT VkResult VKAPI vkLoadPipeline(
1722 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001723 size_t dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001724 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001725 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001726{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001727 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001728 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001729}
1730
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001731ICD_EXPORT VkResult VKAPI vkLoadPipelineDerivative(
1732 VkDevice device,
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001733 size_t dataSize,
1734 const void* pData,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001735 VkPipeline basePipeline,
1736 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001737{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001738 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001739 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001740}
1741
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001742ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1743 VkDevice device,
1744 const VkQueryPoolCreateInfo* pCreateInfo,
1745 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001746{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001747 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001748 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001749}
1750
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001751ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
1752 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001753 uint32_t startQuery,
1754 uint32_t queryCount,
1755 size_t* pDataSize,
1756 void* pData)
1757{
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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001762ICD_EXPORT VkResult VKAPI vkQueueAddMemReference(
1763 VkQueue queue,
1764 VkGpuMemory mem)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001765{
1766 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001767 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001768}
1769
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001770ICD_EXPORT VkResult VKAPI vkQueueRemoveMemReference(
1771 VkQueue queue,
1772 VkGpuMemory mem)
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001773{
1774 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001775 return VK_SUCCESS;
Courtney Goeltzenleuchtercfedf362015-04-02 13:39:07 -06001776}
1777
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001778ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1779 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001780{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001781 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001782 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001783}
1784
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001785ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1786 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001787 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001788 const VkCmdBuffer* pCmdBuffers,
1789 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001790{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001791 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001792 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001793}
1794
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001795ICD_EXPORT VkResult VKAPI vkOpenSharedSemaphore(
1796 VkDevice device,
1797 const VkSemaphoreOpenInfo* pOpenInfo,
1798 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001799{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001800 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001801 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001802}
1803
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001804ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1805 VkDevice device,
1806 const VkSemaphoreCreateInfo* pCreateInfo,
1807 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001808{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001809 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001810 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001811}
1812
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001813ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1814 VkQueue queue,
1815 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001816{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001817 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001818 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001819}
1820
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001821ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1822 VkQueue queue,
1823 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001824{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001825 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001826 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001827}
1828
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001829ICD_EXPORT VkResult VKAPI vkCreateSampler(
1830 VkDevice device,
1831 const VkSamplerCreateInfo* pCreateInfo,
1832 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001833{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001834 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001835 struct nulldrv_dev *dev = nulldrv_dev(device);
1836
1837 return nulldrv_sampler_create(dev, pCreateInfo,
1838 (struct nulldrv_sampler **) pSampler);
1839}
1840
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001841ICD_EXPORT VkResult VKAPI vkCreateShader(
1842 VkDevice device,
1843 const VkShaderCreateInfo* pCreateInfo,
1844 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001845{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001846 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001847 struct nulldrv_dev *dev = nulldrv_dev(device);
1848
1849 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1850}
1851
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001852ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
1853 VkDevice device,
1854 const VkDynamicVpStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001855 VkDynamicVpState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001856{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001857 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001858 struct nulldrv_dev *dev = nulldrv_dev(device);
1859
1860 return nulldrv_viewport_state_create(dev, pCreateInfo,
1861 (struct nulldrv_dynamic_vp **) pState);
1862}
1863
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001864ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
1865 VkDevice device,
1866 const VkDynamicRsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001867 VkDynamicRsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001868{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001869 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001870 struct nulldrv_dev *dev = nulldrv_dev(device);
1871
1872 return nulldrv_raster_state_create(dev, pCreateInfo,
1873 (struct nulldrv_dynamic_rs **) pState);
1874}
1875
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001876ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
1877 VkDevice device,
1878 const VkDynamicCbStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001879 VkDynamicCbState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001880{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001881 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001882 struct nulldrv_dev *dev = nulldrv_dev(device);
1883
1884 return nulldrv_blend_state_create(dev, pCreateInfo,
1885 (struct nulldrv_dynamic_cb **) pState);
1886}
1887
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001888ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
1889 VkDevice device,
1890 const VkDynamicDsStateCreateInfo* pCreateInfo,
Courtney Goeltzenleuchterfcf855f2015-04-10 16:24:50 -06001891 VkDynamicDsState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07001892{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001893 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001894 struct nulldrv_dev *dev = nulldrv_dev(device);
1895
1896 return nulldrv_ds_state_create(dev, pCreateInfo,
1897 (struct nulldrv_dynamic_ds **) pState);
1898}
1899
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001900ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1901 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001902 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001903 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001904{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001905 NULLDRV_LOG_FUNC;
1906 struct nulldrv_dev *dev = nulldrv_dev(device);
1907
1908 return nulldrv_buf_view_create(dev, pCreateInfo,
1909 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001910}
1911
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001912ICD_EXPORT VkResult VKAPI vkCreateImageView(
1913 VkDevice device,
1914 const VkImageViewCreateInfo* pCreateInfo,
1915 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001916{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001917 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001918 struct nulldrv_dev *dev = nulldrv_dev(device);
1919
1920 return nulldrv_img_view_create(dev, pCreateInfo,
1921 (struct nulldrv_img_view **) pView);
1922}
1923
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001924ICD_EXPORT VkResult VKAPI vkCreateColorAttachmentView(
1925 VkDevice device,
1926 const VkColorAttachmentViewCreateInfo* pCreateInfo,
1927 VkColorAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001928{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001929 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001930 struct nulldrv_dev *dev = nulldrv_dev(device);
1931
1932 return nulldrv_rt_view_create(dev, pCreateInfo,
1933 (struct nulldrv_rt_view **) pView);
1934}
1935
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001936ICD_EXPORT VkResult VKAPI vkCreateDepthStencilView(
1937 VkDevice device,
1938 const VkDepthStencilViewCreateInfo* pCreateInfo,
1939 VkDepthStencilView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001940{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001941 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001942 struct nulldrv_dev *dev = nulldrv_dev(device);
1943
1944 return nulldrv_ds_view_create(dev, pCreateInfo,
1945 (struct nulldrv_ds_view **) pView);
1946
1947}
1948
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001949ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1950 VkDevice device,
1951 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1952 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001953{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001954 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001955 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001956
Chia-I Wu7732cb22015-03-26 15:27:55 +08001957 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001958 (struct nulldrv_desc_layout **) pSetLayout);
1959}
1960
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001961ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayoutChain(
1962 VkDevice device,
Chia-I Wu7732cb22015-03-26 15:27:55 +08001963 uint32_t setLayoutArrayCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001964 const VkDescriptorSetLayout* pSetLayoutArray,
1965 VkDescriptorSetLayoutChain* pLayoutChain)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001966{
1967 NULLDRV_LOG_FUNC;
1968 struct nulldrv_dev *dev = nulldrv_dev(device);
1969
1970 return nulldrv_desc_layout_chain_create(dev,
1971 setLayoutArrayCount, pSetLayoutArray,
1972 (struct nulldrv_desc_layout_chain **) pLayoutChain);
1973}
1974
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001975ICD_EXPORT VkResult VKAPI vkBeginDescriptorPoolUpdate(
1976 VkDevice device,
1977 VkDescriptorUpdateMode updateMode)
David Pinedo0257fbf2015-02-02 18:02:40 -07001978{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001979 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001980 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001981}
1982
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001983ICD_EXPORT VkResult VKAPI vkEndDescriptorPoolUpdate(
1984 VkDevice device,
1985 VkCmdBuffer cmd_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001986{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001987 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001988 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001989}
1990
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001991ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
1992 VkDevice device,
1993 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07001994 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001995 const VkDescriptorPoolCreateInfo* pCreateInfo,
1996 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001997{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001998 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001999 struct nulldrv_dev *dev = nulldrv_dev(device);
2000
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002001 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
2002 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002003}
2004
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002005ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
2006 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002007{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002008 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002009 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002010}
2011
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002012ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
2013 VkDescriptorPool descriptorPool,
2014 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002015 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002016 const VkDescriptorSetLayout* pSetLayouts,
2017 VkDescriptorSet* pDescriptorSets,
David Pinedo0257fbf2015-02-02 18:02:40 -07002018 uint32_t* pCount)
2019{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002020 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002021 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2022 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002023 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002024 uint32_t i;
2025
2026 for (i = 0; i < count; i++) {
2027 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002028 nulldrv_desc_layout((VkDescriptorSetLayout) pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002029
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002030 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002031 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002032 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002033 break;
2034 }
2035
2036 if (pCount)
2037 *pCount = i;
2038
2039 return ret;
2040}
2041
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002042ICD_EXPORT void VKAPI vkClearDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002043 VkDescriptorPool descriptorPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07002044 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002045 const VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002046{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002047 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002048}
2049
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002050ICD_EXPORT void VKAPI vkUpdateDescriptors(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002051 VkDescriptorSet descriptorSet,
Chia-I Wu7732cb22015-03-26 15:27:55 +08002052 uint32_t updateCount,
2053 const void** ppUpdateArray)
David Pinedo0257fbf2015-02-02 18:02:40 -07002054{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002055 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002056}
2057
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002058ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2059 VkDevice device,
2060 const VkFramebufferCreateInfo* info,
2061 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002062{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002063 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002064 struct nulldrv_dev *dev = nulldrv_dev(device);
2065
2066 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2067}
2068
2069
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002070ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2071 VkDevice device,
2072 const VkRenderPassCreateInfo* info,
2073 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002074{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002075 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002076 struct nulldrv_dev *dev = nulldrv_dev(device);
2077
2078 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2079}
2080
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002081ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002082 VkCmdBuffer cmdBuffer,
2083 const VkRenderPassBegin* pRenderPassBegin)
David Pinedo0257fbf2015-02-02 18:02:40 -07002084{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002085 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002086}
2087
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002088ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002089 VkCmdBuffer cmdBuffer,
2090 VkRenderPass renderPass)
David Pinedo0257fbf2015-02-02 18:02:40 -07002091{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002092 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002093}
Ian Elliottf93069f2015-02-19 14:26:19 -07002094
2095ICD_EXPORT void* xcbCreateWindow(
2096 uint16_t width,
2097 uint16_t height)
2098{
2099 static uint32_t window; // Kludge to the max
2100 NULLDRV_LOG_FUNC;
2101 return &window;
2102}
2103
2104// May not be needed, if we stub out stuf in tri.c
2105ICD_EXPORT void xcbDestroyWindow()
2106{
2107 NULLDRV_LOG_FUNC;
2108}
2109
2110ICD_EXPORT int xcbGetMessage(void *msg)
2111{
2112 NULLDRV_LOG_FUNC;
2113 return 0;
2114}
2115
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002116ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002117{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002118 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002119}