blob: 828c42726d198e22b6112ba09a27cadf04dc5d71 [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] = {
Ian Elliott338dedb2015-08-21 15:09:33 -060043 [NULLDRV_EXT_KHR_SWAPCHAIN] = VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME,
David Pinedo0257fbf2015-02-02 18:02:40 -070044};
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -060045static const VkExtensionProperties intel_gpu_exts[NULLDRV_EXT_COUNT] = {
46 {
Ian Elliott338dedb2015-08-21 15:09:33 -060047 .extName = VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME,
David Pinedob0833bd2015-09-04 15:33:22 -060048 .specVersion = VK_EXT_KHR_SWAPCHAIN_REVISION,
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -060049 }
50};
David Pinedo0257fbf2015-02-02 18:02:40 -070051
Tony Barbourde4124d2015-07-03 10:33:54 -060052static struct nulldrv_base *nulldrv_base(void* base)
David Pinedo0257fbf2015-02-02 18:02:40 -070053{
54 return (struct nulldrv_base *) base;
55}
56
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060057static struct nulldrv_base *nulldrv_base_create(
58 struct nulldrv_dev *dev,
59 size_t obj_size,
Tony Barbourde4124d2015-07-03 10:33:54 -060060 VkDbgObjectType type)
David Pinedo0257fbf2015-02-02 18:02:40 -070061{
62 struct nulldrv_base *base;
63
64 if (!obj_size)
65 obj_size = sizeof(*base);
66
67 assert(obj_size >= sizeof(*base));
68
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -060069 base = (struct nulldrv_base*)malloc(obj_size);
David Pinedo0257fbf2015-02-02 18:02:40 -070070 if (!base)
71 return NULL;
72
73 memset(base, 0, obj_size);
74
75 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
Tony Barbourde4124d2015-07-03 10:33:54 -060076 set_loader_magic_value(base);
David Pinedo0257fbf2015-02-02 18:02:40 -070077
78 if (dev == NULL) {
79 /*
80 * dev is NULL when we are creating the base device object
81 * Set dev now so that debug setup happens correctly
82 */
83 dev = (struct nulldrv_dev *) base;
84 }
85
86
Tony Barbour426b9052015-06-24 16:06:58 -060087 base->get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -070088
89 return base;
90}
91
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060092static VkResult nulldrv_gpu_add(int devid, const char *primary_node,
David Pinedo0257fbf2015-02-02 18:02:40 -070093 const char *render_node, struct nulldrv_gpu **gpu_ret)
94{
95 struct nulldrv_gpu *gpu;
96
Chia-I Wu493a1752015-02-22 14:40:25 +080097 gpu = malloc(sizeof(*gpu));
David Pinedo0257fbf2015-02-02 18:02:40 -070098 if (!gpu)
Tony Barbour8205d902015-04-16 15:59:00 -060099 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700100 memset(gpu, 0, sizeof(*gpu));
Mark Lobodzinski97dcd042015-04-16 08:52:00 -0500101
David Pinedo0257fbf2015-02-02 18:02:40 -0700102 // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
Tony Barbourde4124d2015-07-03 10:33:54 -0600103 set_loader_magic_value(gpu);
David Pinedo0257fbf2015-02-02 18:02:40 -0700104
105 *gpu_ret = gpu;
106
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600107 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700108}
109
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600110static VkResult nulldrv_queue_create(struct nulldrv_dev *dev,
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700111 uint32_t node_index,
David Pinedo0257fbf2015-02-02 18:02:40 -0700112 struct nulldrv_queue **queue_ret)
113{
114 struct nulldrv_queue *queue;
115
116 queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600117 VK_OBJECT_TYPE_QUEUE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700118 if (!queue)
Tony Barbour8205d902015-04-16 15:59:00 -0600119 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700120
121 queue->dev = dev;
122
123 *queue_ret = queue;
124
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600125 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700126}
127
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600128static VkResult dev_create_queues(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterea975642015-09-16 16:23:55 -0600129 const VkDeviceQueueCreateInfo *queues,
130 uint32_t count)
David Pinedo0257fbf2015-02-02 18:02:40 -0700131{
132 uint32_t i;
133
David Pinedo0257fbf2015-02-02 18:02:40 -0700134 for (i = 0; i < count; i++) {
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600135 const VkDeviceQueueCreateInfo *q = &queues[i];
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600136 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700137
Tony Barbour29b12062015-07-13 13:37:24 -0600138 if (q->queueCount == 1 && !dev->queues[q->queueFamilyIndex]) {
139 ret = nulldrv_queue_create(dev, q->queueFamilyIndex,
140 &dev->queues[q->queueFamilyIndex]);
David Pinedo0257fbf2015-02-02 18:02:40 -0700141 }
David Pinedo0257fbf2015-02-02 18:02:40 -0700142
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600143 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700144 return ret;
145 }
146 }
147
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600148 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700149}
150
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600151static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(
152 const struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600153 const char* extName)
David Pinedo0257fbf2015-02-02 18:02:40 -0700154{
155 enum nulldrv_ext_type type;
156
157 for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) {
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600158 if (strcmp(nulldrv_gpu_exts[type], extName) == 0)
David Pinedo0257fbf2015-02-02 18:02:40 -0700159 break;
160 }
161
162 assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID);
163
164 return type;
165}
166
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600167static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800168 struct nulldrv_desc_ooxx **ooxx_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700169{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800170 struct nulldrv_desc_ooxx *ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700171
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800172 ooxx = malloc(sizeof(*ooxx));
173 if (!ooxx)
Tony Barbour8205d902015-04-16 15:59:00 -0600174 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700175
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800176 memset(ooxx, 0, sizeof(*ooxx));
David Pinedo0257fbf2015-02-02 18:02:40 -0700177
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800178 ooxx->surface_desc_size = 0;
179 ooxx->sampler_desc_size = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700180
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800181 *ooxx_ret = ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700182
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600183 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700184}
185
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600186static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600187 const VkDeviceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700188 struct nulldrv_dev **dev_ret)
189{
190 struct nulldrv_dev *dev;
191 uint32_t i;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600192 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -0700193
194 dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600195 VK_OBJECT_TYPE_DEVICE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700196 if (!dev)
Tony Barbour8205d902015-04-16 15:59:00 -0600197 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700198
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600199 for (i = 0; i < info->extensionCount; i++) {
200 const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(
201 gpu,
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600202 info->ppEnabledExtensionNames[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -0700203
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600204 if (ext == NULLDRV_EXT_INVALID)
Courtney Goeltzenleuchterac544f32015-09-14 18:01:17 -0600205 return VK_ERROR_EXTENSION_NOT_PRESENT;
David Pinedo0257fbf2015-02-02 18:02:40 -0700206
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600207 dev->exts[ext] = true;
208 }
David Pinedo0257fbf2015-02-02 18:02:40 -0700209
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800210 ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600211 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700212 return ret;
213 }
214
215 ret = dev_create_queues(dev, info->pRequestedQueues,
216 info->queueRecordCount);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600217 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700218 return ret;
219 }
220
221 *dev_ret = dev;
222
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600223 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700224}
225
Tony Barbour8205d902015-04-16 15:59:00 -0600226static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalDevice gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700227{
228 return (struct nulldrv_gpu *) gpu;
229}
230
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600231static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
232 const VkFenceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700233 struct nulldrv_fence **fence_ret)
234{
235 struct nulldrv_fence *fence;
236
237 fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600238 VK_OBJECT_TYPE_FENCE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700239 if (!fence)
Tony Barbour8205d902015-04-16 15:59:00 -0600240 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700241
242 *fence_ret = fence;
243
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600244 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700245}
246
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600247static struct nulldrv_dev *nulldrv_dev(VkDevice dev)
David Pinedo0257fbf2015-02-02 18:02:40 -0700248{
249 return (struct nulldrv_dev *) dev;
250}
251
252static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base)
253{
254 return (struct nulldrv_img *) base;
255}
256
257
Tony Barbour426b9052015-06-24 16:06:58 -0600258static VkResult img_get_memory_requirements(struct nulldrv_base *base,
259 VkMemoryRequirements *pRequirements)
David Pinedo0257fbf2015-02-02 18:02:40 -0700260{
261 struct nulldrv_img *img = nulldrv_img_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600262 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700263
Tony Barbour426b9052015-06-24 16:06:58 -0600264 pRequirements->size = img->total_size;
265 pRequirements->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700266
267 return ret;
268}
269
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600270static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
271 const VkImageCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700272 bool scanout,
273 struct nulldrv_img **img_ret)
274{
275 struct nulldrv_img *img;
276
277 img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600278 VK_OBJECT_TYPE_IMAGE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700279 if (!img)
Tony Barbour8205d902015-04-16 15:59:00 -0600280 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700281
282 img->type = info->imageType;
283 img->depth = info->extent.depth;
284 img->mip_levels = info->mipLevels;
285 img->array_size = info->arraySize;
286 img->usage = info->usage;
David Pinedo0257fbf2015-02-02 18:02:40 -0700287 img->samples = info->samples;
288
Tony Barbour426b9052015-06-24 16:06:58 -0600289 img->obj.base.get_memory_requirements = img_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700290
291 *img_ret = img;
292
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600293 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700294}
295
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600296static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700297{
Tony Barbourde4124d2015-07-03 10:33:54 -0600298 return *(struct nulldrv_img **) &image;
David Pinedo0257fbf2015-02-02 18:02:40 -0700299}
300
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600301static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600302 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700303 struct nulldrv_mem **mem_ret)
304{
305 struct nulldrv_mem *mem;
306
307 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600308 VK_OBJECT_TYPE_DEVICE_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700309 if (!mem)
Tony Barbour8205d902015-04-16 15:59:00 -0600310 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700311
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700312 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700313 if (!mem->bo) {
Tony Barbour8205d902015-04-16 15:59:00 -0600314 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700315 }
316
317 mem->size = info->allocationSize;
318
319 *mem_ret = mem;
320
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600321 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700322}
323
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600324static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
325 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700326 struct nulldrv_sampler **sampler_ret)
327{
328 struct nulldrv_sampler *sampler;
329
330 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600331 sizeof(*sampler), VK_OBJECT_TYPE_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700332 if (!sampler)
Tony Barbour8205d902015-04-16 15:59:00 -0600333 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700334
335 *sampler_ret = sampler;
336
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600337 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700338}
339
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600340static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
341 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700342 struct nulldrv_img_view **view_ret)
343{
344 struct nulldrv_img *img = nulldrv_img(info->image);
345 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700346
347 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600348 VK_OBJECT_TYPE_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700349 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600350 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700351
352 view->img = img;
David Pinedo0257fbf2015-02-02 18:02:40 -0700353
David Pinedo0257fbf2015-02-02 18:02:40 -0700354 view->cmd_len = 8;
355
356 *view_ret = view;
357
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600358 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700359}
360
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600361static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700362{
363 return mem->bo;
364}
365
Tony Barbour8205d902015-04-16 15:59:00 -0600366static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700367{
Tony Barbourde4124d2015-07-03 10:33:54 -0600368 return *(struct nulldrv_mem **) &mem;
David Pinedo0257fbf2015-02-02 18:02:40 -0700369}
370
371static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
372{
373 return (struct nulldrv_buf *) base;
374}
375
Tony Barbour426b9052015-06-24 16:06:58 -0600376static VkResult buf_get_memory_requirements(struct nulldrv_base *base,
377 VkMemoryRequirements* pMemoryRequirements)
David Pinedo0257fbf2015-02-02 18:02:40 -0700378{
379 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
David Pinedo0257fbf2015-02-02 18:02:40 -0700380
Tony Barbour426b9052015-06-24 16:06:58 -0600381 if (pMemoryRequirements == NULL)
382 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700383
Tony Barbour426b9052015-06-24 16:06:58 -0600384 pMemoryRequirements->size = buf->size;
385 pMemoryRequirements->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700386
Tony Barbour426b9052015-06-24 16:06:58 -0600387 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700388}
389
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600390static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600391 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700392 struct nulldrv_buf **buf_ret)
393{
394 struct nulldrv_buf *buf;
395
396 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600397 VK_OBJECT_TYPE_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700398 if (!buf)
Tony Barbour8205d902015-04-16 15:59:00 -0600399 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700400
401 buf->size = info->size;
402 buf->usage = info->usage;
403
Tony Barbour426b9052015-06-24 16:06:58 -0600404 buf->obj.base.get_memory_requirements = buf_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700405
406 *buf_ret = buf;
407
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600408 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700409}
410
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600411static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
412 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700413 struct nulldrv_desc_layout **layout_ret)
414{
415 struct nulldrv_desc_layout *layout;
416
417 layout = (struct nulldrv_desc_layout *)
418 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600419 VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700420 if (!layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600421 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700422
423 *layout_ret = layout;
424
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600425 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700426}
427
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500428static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev,
429 const VkPipelineLayoutCreateInfo* pCreateInfo,
430 struct nulldrv_pipeline_layout **pipeline_layout_ret)
Chia-I Wu7732cb22015-03-26 15:27:55 +0800431{
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500432 struct nulldrv_pipeline_layout *pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800433
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500434 pipeline_layout = (struct nulldrv_pipeline_layout *)
435 nulldrv_base_create(dev, sizeof(*pipeline_layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600436 VK_OBJECT_TYPE_PIPELINE_LAYOUT);
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500437 if (!pipeline_layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600438 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800439
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500440 *pipeline_layout_ret = pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800441
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600442 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800443}
444
Tony Barbour8db65372015-07-10 18:32:33 -0600445static struct nulldrv_desc_layout *nulldrv_desc_layout(const VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700446{
Tony Barbourde4124d2015-07-03 10:33:54 -0600447 return *(struct nulldrv_desc_layout **) &layout;
David Pinedo0257fbf2015-02-02 18:02:40 -0700448}
449
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600450static VkResult shader_create(struct nulldrv_dev *dev,
451 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700452 struct nulldrv_shader **sh_ret)
453{
David Pinedo0257fbf2015-02-02 18:02:40 -0700454 struct nulldrv_shader *sh;
455
456 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600457 VK_OBJECT_TYPE_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700458 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600459 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700460
461 *sh_ret = sh;
462
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600463 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700464}
465
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600466static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
467 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700468 struct nulldrv_pipeline **pipeline_ret)
469{
470 struct nulldrv_pipeline *pipeline;
471
472 pipeline = (struct nulldrv_pipeline *)
473 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600474 VK_OBJECT_TYPE_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700475 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600476 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700477
478 *pipeline_ret = pipeline;
479
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600480 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700481}
482
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600483static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
484 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700485 struct nulldrv_cmd **cmd_ret)
486{
David Pinedo0257fbf2015-02-02 18:02:40 -0700487 struct nulldrv_cmd *cmd;
488
David Pinedo0257fbf2015-02-02 18:02:40 -0700489 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600490 VK_OBJECT_TYPE_COMMAND_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700491 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600492 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700493
494 *cmd_ret = cmd;
495
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600496 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700497}
498
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600499static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600500 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800501 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700502{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800503 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700504
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800505 pool = (struct nulldrv_desc_pool *)
506 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600507 VK_OBJECT_TYPE_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800508 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600509 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700510
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800511 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700512
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800513 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700514
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600515 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700516}
517
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600518static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800519 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600520 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700521 const struct nulldrv_desc_layout *layout,
522 struct nulldrv_desc_set **set_ret)
523{
524 struct nulldrv_desc_set *set;
525
526 set = (struct nulldrv_desc_set *)
527 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600528 VK_OBJECT_TYPE_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700529 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600530 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700531
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800532 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700533 set->layout = layout;
534 *set_ret = set;
535
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600536 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700537}
538
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600539static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700540{
Tony Barbourde4124d2015-07-03 10:33:54 -0600541 return *(struct nulldrv_desc_pool **) &pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700542}
543
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600544static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
545 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700546 struct nulldrv_framebuffer ** fb_ret)
547{
548
549 struct nulldrv_framebuffer *fb;
550 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600551 VK_OBJECT_TYPE_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700552 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600553 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700554
555 *fb_ret = fb;
556
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600557 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700558
559}
560
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600561static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
562 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700563 struct nulldrv_render_pass** rp_ret)
564{
565 struct nulldrv_render_pass *rp;
566 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600567 VK_OBJECT_TYPE_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700568 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600569 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700570
571 *rp_ret = rp;
572
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600573 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700574}
575
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600576static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700577{
Tony Barbourde4124d2015-07-03 10:33:54 -0600578 return *(struct nulldrv_buf **) &buf;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700579}
580
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600581static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600582 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700583 struct nulldrv_buf_view **view_ret)
584{
585 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
586 struct nulldrv_buf_view *view;
587
588 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600589 VK_OBJECT_TYPE_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700590 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600591 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700592
593 view->buf = buf;
594
595 *view_ret = view;
596
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600597 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700598}
599
David Pinedo0257fbf2015-02-02 18:02:40 -0700600
601//*********************************************
602// Driver entry points
603//*********************************************
604
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600605ICD_EXPORT VkResult VKAPI vkCreateBuffer(
606 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600607 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600608 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700609{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700610 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700611 struct nulldrv_dev *dev = nulldrv_dev(device);
612
613 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
614}
615
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600616ICD_EXPORT void VKAPI vkDestroyBuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -0600617 VkDevice device,
618 VkBuffer buffer)
619{
620 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -0600621}
622
Cody Northropf02f9f82015-07-09 18:08:05 -0600623ICD_EXPORT VkResult VKAPI vkCreateCommandPool(
624 VkDevice device,
625 const VkCmdPoolCreateInfo* pCreateInfo,
626 VkCmdPool* pCmdPool)
627{
628 NULLDRV_LOG_FUNC;
629 return VK_SUCCESS;
630}
631
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600632ICD_EXPORT void VKAPI vkDestroyCommandPool(
Cody Northropf02f9f82015-07-09 18:08:05 -0600633 VkDevice device,
634 VkCmdPool cmdPool)
635{
636 NULLDRV_LOG_FUNC;
Cody Northropf02f9f82015-07-09 18:08:05 -0600637}
638
639ICD_EXPORT VkResult VKAPI vkResetCommandPool(
640 VkDevice device,
641 VkCmdPool cmdPool,
642 VkCmdPoolResetFlags flags)
643{
644 NULLDRV_LOG_FUNC;
645 return VK_SUCCESS;
646}
647
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600648ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
649 VkDevice device,
650 const VkCmdBufferCreateInfo* pCreateInfo,
651 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700652{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700653 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700654 struct nulldrv_dev *dev = nulldrv_dev(device);
655
656 return nulldrv_cmd_create(dev, pCreateInfo,
657 (struct nulldrv_cmd **) pCmdBuffer);
658}
659
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600660ICD_EXPORT void VKAPI vkDestroyCommandBuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -0600661 VkDevice device,
662 VkCmdBuffer cmdBuffer)
663{
664 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -0600665}
666
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600667ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
668 VkCmdBuffer cmdBuffer,
669 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700670{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700671 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600672 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700673}
674
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600675ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
676 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700677{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700678 NULLDRV_LOG_FUNC;
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 -0600682ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
Cody Northropf02f9f82015-07-09 18:08:05 -0600683 VkCmdBuffer cmdBuffer,
684 VkCmdBufferResetFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700685{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700686 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600687 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700688}
689
Ian Elliott64a68e12015-04-16 11:57:46 -0600690static const VkFormat nulldrv_presentable_formats[] = {
691 VK_FORMAT_B8G8R8A8_UNORM,
692};
693
Jon Ashburnba4a1952015-06-16 12:44:51 -0600694#if 0
Ian Elliott338dedb2015-08-21 15:09:33 -0600695ICD_EXPORT VkResult VKAPI vkGetDisplayInfoKHR(
696 VkDisplayKHR display,
697 VkDisplayInfoTypeKHR infoType,
Ian Elliott64a68e12015-04-16 11:57:46 -0600698 size_t* pDataSize,
699 void* pData)
700{
701 VkResult ret = VK_SUCCESS;
702
703 NULLDRV_LOG_FUNC;
704
705 if (!pDataSize)
706 return VK_ERROR_INVALID_POINTER;
707
708 switch (infoType) {
Ian Elliott338dedb2015-08-21 15:09:33 -0600709 case VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_KHR:
Ian Elliott64a68e12015-04-16 11:57:46 -0600710 {
Ian Elliott338dedb2015-08-21 15:09:33 -0600711 VkDisplayFormatPropertiesKHR *dst = pData;
Ian Elliott64a68e12015-04-16 11:57:46 -0600712 size_t size_ret;
713 uint32_t i;
714
715 size_ret = sizeof(*dst) * ARRAY_SIZE(nulldrv_presentable_formats);
716
717 if (dst && *pDataSize < size_ret)
718 return VK_ERROR_INVALID_VALUE;
719
720 *pDataSize = size_ret;
721 if (!dst)
722 return VK_SUCCESS;
723
724 for (i = 0; i < ARRAY_SIZE(nulldrv_presentable_formats); i++)
Ian Elliott338dedb2015-08-21 15:09:33 -0600725 dst[i].swapchainFormat = nulldrv_presentable_formats[i];
Ian Elliott64a68e12015-04-16 11:57:46 -0600726 }
727 break;
728 default:
729 ret = VK_ERROR_INVALID_VALUE;
730 break;
731 }
732
733 return ret;
734}
Jon Ashburnba4a1952015-06-16 12:44:51 -0600735#endif
Ian Elliott64a68e12015-04-16 11:57:46 -0600736
Ian Elliott338dedb2015-08-21 15:09:33 -0600737ICD_EXPORT VkResult VKAPI vkCreateSwapchainKHR(
Ian Elliott64a68e12015-04-16 11:57:46 -0600738 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600739 const VkSwapchainCreateInfoKHR* pCreateInfo,
740 VkSwapchainKHR* pSwapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600741{
742 NULLDRV_LOG_FUNC;
743 struct nulldrv_dev *dev = nulldrv_dev(device);
744 struct nulldrv_swap_chain *sc;
745
746 sc = (struct nulldrv_swap_chain *) nulldrv_base_create(dev, sizeof(*sc),
Ian Elliott338dedb2015-08-21 15:09:33 -0600747 VK_OBJECT_TYPE_SWAPCHAIN_KHR);
Ian Elliott64a68e12015-04-16 11:57:46 -0600748 if (!sc) {
749 return VK_ERROR_OUT_OF_HOST_MEMORY;
750 }
751 sc->dev = dev;
752
Ian Elliott338dedb2015-08-21 15:09:33 -0600753 *(VkSwapchainKHR **)pSwapchain = *(VkSwapchainKHR **)&sc;
Ian Elliott64a68e12015-04-16 11:57:46 -0600754
755 return VK_SUCCESS;
756}
757
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -0600758ICD_EXPORT VkResult VKAPI vkDestroySwapchainKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600759 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600760 VkSwapchainKHR swapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600761{
762 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600763 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600764
765 free(sc);
766
767 return VK_SUCCESS;
768}
769
Ian Elliott338dedb2015-08-21 15:09:33 -0600770ICD_EXPORT VkResult VKAPI vkGetSwapchainImagesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600771 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600772 VkSwapchainKHR swapchain,
Ian Elliott3333bb42015-08-10 13:56:08 -0600773 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600774 VkImage* pSwapchainImages)
Ian Elliott64a68e12015-04-16 11:57:46 -0600775{
776 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600777 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600778 struct nulldrv_dev *dev = sc->dev;
779 VkResult ret = VK_SUCCESS;
780
Ian Elliott3333bb42015-08-10 13:56:08 -0600781 *pCount = 2;
Ian Elliott338dedb2015-08-21 15:09:33 -0600782 if (pSwapchainImages) {
Ian Elliott3333bb42015-08-10 13:56:08 -0600783 uint32_t i;
784 for (i = 0; i < 2; i++) {
Ian Elliott64a68e12015-04-16 11:57:46 -0600785 struct nulldrv_img *img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600786
787 img = (struct nulldrv_img *) nulldrv_base_create(dev,
788 sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600789 VK_OBJECT_TYPE_IMAGE);
Ian Elliott64a68e12015-04-16 11:57:46 -0600790 if (!img)
791 return VK_ERROR_OUT_OF_HOST_MEMORY;
Ian Elliott338dedb2015-08-21 15:09:33 -0600792 pSwapchainImages[i].handle = (uint64_t) &img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600793 }
Ian Elliott64a68e12015-04-16 11:57:46 -0600794 }
795
796 return ret;
797}
798
Ian Elliott338dedb2015-08-21 15:09:33 -0600799ICD_EXPORT VkResult VKAPI vkAcquireNextImageKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600800 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600801 VkSwapchainKHR swapchain,
Tony Barbour7910de72015-07-13 16:37:21 -0600802 uint64_t timeout,
803 VkSemaphore semaphore,
804 uint32_t* pImageIndex)
805{
806 NULLDRV_LOG_FUNC;
807
808 return VK_SUCCESS;
809}
810
Ian Elliott338dedb2015-08-21 15:09:33 -0600811VkResult VKAPI vkGetSurfacePropertiesKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600812 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600813 const VkSurfaceDescriptionKHR* pSurfaceDescription,
814 VkSurfacePropertiesKHR* pSurfaceProperties)
Ian Elliott3333bb42015-08-10 13:56:08 -0600815{
816 NULLDRV_LOG_FUNC;
817
818 return VK_SUCCESS;
819}
820
Ian Elliott338dedb2015-08-21 15:09:33 -0600821VkResult VKAPI vkGetSurfaceFormatsKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600822 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600823 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600824 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600825 VkSurfaceFormatKHR* pSurfaceFormats)
Ian Elliott3333bb42015-08-10 13:56:08 -0600826{
827 NULLDRV_LOG_FUNC;
828
829 return VK_SUCCESS;
830}
831
Ian Elliott338dedb2015-08-21 15:09:33 -0600832VkResult VKAPI vkGetSurfacePresentModesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600833 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600834 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600835 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600836 VkPresentModeKHR* pPresentModes)
Tony Barbour7910de72015-07-13 16:37:21 -0600837{
838 NULLDRV_LOG_FUNC;
839
840 return VK_SUCCESS;
841}
842
Ian Elliott338dedb2015-08-21 15:09:33 -0600843ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600844 VkPhysicalDevice physicalDevice,
845 uint32_t queueFamilyIndex,
Ian Elliott338dedb2015-08-21 15:09:33 -0600846 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Tony Barbour7910de72015-07-13 16:37:21 -0600847 VkBool32* pSupported)
848{
849 NULLDRV_LOG_FUNC;
850
851 return VK_SUCCESS;
852}
853
Ian Elliott338dedb2015-08-21 15:09:33 -0600854ICD_EXPORT VkResult VKAPI vkQueuePresentKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600855 VkQueue queue_,
Ian Elliott338dedb2015-08-21 15:09:33 -0600856 VkPresentInfoKHR* pPresentInfo)
Ian Elliott64a68e12015-04-16 11:57:46 -0600857{
858 NULLDRV_LOG_FUNC;
859
860 return VK_SUCCESS;
861}
862
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600863ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600864 VkCmdBuffer cmdBuffer,
865 VkBuffer srcBuffer,
866 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700867 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600868 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700869{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700870 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700871}
872
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600873ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600874 VkCmdBuffer cmdBuffer,
875 VkImage srcImage,
876 VkImageLayout srcImageLayout,
877 VkImage destImage,
878 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700879 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600880 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700881{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700882 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700883}
884
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600885ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600886 VkCmdBuffer cmdBuffer,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500887 VkImage srcImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600888 VkImageLayout srcImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500889 VkImage destImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600890 VkImageLayout destImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500891 uint32_t regionCount,
892 const VkImageBlit* pRegions,
893 VkTexFilter filter)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600894{
895 NULLDRV_LOG_FUNC;
896}
897
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600898ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600899 VkCmdBuffer cmdBuffer,
900 VkBuffer srcBuffer,
901 VkImage destImage,
902 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700903 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600904 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700905{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700906 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700907}
908
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600909ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600910 VkCmdBuffer cmdBuffer,
911 VkImage srcImage,
912 VkImageLayout srcImageLayout,
913 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700914 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600915 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700916{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700917 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700918}
919
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600920ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600921 VkCmdBuffer cmdBuffer,
922 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600923 VkDeviceSize destOffset,
924 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700925 const uint32_t* pData)
926{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700927 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700928}
929
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600930ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600931 VkCmdBuffer cmdBuffer,
932 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600933 VkDeviceSize destOffset,
934 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700935 uint32_t data)
936{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700937 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700938}
939
Ian Elliotte924ab22015-07-08 13:24:30 -0600940ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage(
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600941 VkCmdBuffer cmdBuffer,
942 VkImage image,
943 VkImageLayout imageLayout,
944 const VkClearDepthStencilValue* pDepthStencil,
Ian Elliotte924ab22015-07-08 13:24:30 -0600945 uint32_t rangeCount,
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600946 const VkImageSubresourceRange* pRanges)
Ian Elliotte924ab22015-07-08 13:24:30 -0600947{
948 NULLDRV_LOG_FUNC;
949}
950
951ICD_EXPORT void VKAPI vkCmdClearColorAttachment(
952 VkCmdBuffer cmdBuffer,
953 uint32_t colorAttachment,
954 VkImageLayout imageLayout,
955 const VkClearColorValue *pColor,
956 uint32_t rectCount,
957 const VkRect3D *pRects)
958{
959 NULLDRV_LOG_FUNC;
960}
961
962ICD_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
963 VkCmdBuffer cmdBuffer,
964 VkImageAspectFlags imageAspectMask,
965 VkImageLayout imageLayout,
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600966 const VkClearDepthStencilValue* pDepthStencil,
Ian Elliotte924ab22015-07-08 13:24:30 -0600967 uint32_t rectCount,
968 const VkRect3D *pRects)
969{
970 NULLDRV_LOG_FUNC;
971}
972
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600973ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600974 VkCmdBuffer cmdBuffer,
975 VkImage image,
976 VkImageLayout imageLayout,
Chris Forbese3105972015-06-24 14:34:53 +1200977 const VkClearColorValue *pColor,
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600978 uint32_t rangeCount,
979 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700980{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700981 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700982}
983
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600984ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600985 VkCmdBuffer cmdBuffer,
986 VkImage image,
987 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700988 float depth,
989 uint32_t stencil,
990 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600991 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700992{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700993 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700994}
995
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600996ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600997 VkCmdBuffer cmdBuffer,
998 VkImage srcImage,
999 VkImageLayout srcImageLayout,
1000 VkImage destImage,
1001 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -06001002 uint32_t regionCount,
1003 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001004{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001005 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001006}
1007
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001008ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001009 VkCmdBuffer cmdBuffer,
1010 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001011 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001012 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001013{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001014 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001015}
1016
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001017ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001018 VkCmdBuffer cmdBuffer,
1019 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001020 uint32_t slot)
1021{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001022 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001023}
1024
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001025ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001026 VkCmdBuffer cmdBuffer,
1027 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001028 uint32_t startQuery,
1029 uint32_t queryCount)
1030{
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 vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001035 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001036 VkEvent event_,
1037 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001038{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001039 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001040}
1041
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001042ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001043 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001044 VkEvent event_,
1045 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001046{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001047 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001048}
1049
Ian Elliott63f1edb2015-04-16 18:10:19 -06001050ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1051 VkCmdBuffer cmdBuffer,
1052 VkQueryPool queryPool,
1053 uint32_t startQuery,
1054 uint32_t queryCount,
1055 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001056 VkDeviceSize destOffset,
1057 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001058 VkFlags flags)
1059{
1060 NULLDRV_LOG_FUNC;
1061}
1062
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001063ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001064 VkCmdBuffer cmdBuffer,
1065 VkTimestampType timestampType,
1066 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001067 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001068{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001069 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001070}
1071
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001072ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001073 VkCmdBuffer cmdBuffer,
Tony Barbourde4124d2015-07-03 10:33:54 -06001074 VkPipelineBindPoint pipelineBindPoint,
1075 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001076{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001077 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001078}
1079
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001080ICD_EXPORT void VKAPI vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports)
1081{
1082 NULLDRV_LOG_FUNC;
1083}
1084
1085ICD_EXPORT void VKAPI vkCmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors)
Tony Barbourde4124d2015-07-03 10:33:54 -06001086{
1087 NULLDRV_LOG_FUNC;
1088}
1089
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001090ICD_EXPORT void VKAPI vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth)
Cody Northropf5bd2252015-08-17 11:10:49 -06001091{
1092 NULLDRV_LOG_FUNC;
1093}
1094
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001095ICD_EXPORT void VKAPI vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias)
Tony Barbourde4124d2015-07-03 10:33:54 -06001096{
1097 NULLDRV_LOG_FUNC;
1098}
1099
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001100ICD_EXPORT void VKAPI vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4])
Tony Barbourde4124d2015-07-03 10:33:54 -06001101{
1102 NULLDRV_LOG_FUNC;
1103}
1104
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001105ICD_EXPORT void VKAPI vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds)
Cody Northrop2605cb02015-08-18 15:21:16 -06001106{
1107 NULLDRV_LOG_FUNC;
1108}
1109
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001110ICD_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask)
1111{
1112 NULLDRV_LOG_FUNC;
1113}
1114
1115ICD_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask)
1116{
1117 NULLDRV_LOG_FUNC;
1118}
1119
1120ICD_EXPORT void VKAPI vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference)
David Pinedo0257fbf2015-02-02 18:02:40 -07001121{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001122 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001123}
1124
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001125ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001126 VkCmdBuffer cmdBuffer,
1127 VkPipelineBindPoint pipelineBindPoint,
Mark Lobodzinskia65c4632015-06-15 13:21:21 -06001128 VkPipelineLayout layout,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001129 uint32_t firstSet,
1130 uint32_t setCount,
1131 const VkDescriptorSet* pDescriptorSets,
1132 uint32_t dynamicOffsetCount,
1133 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001134{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001135 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001136}
1137
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001138ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1139 VkCmdBuffer cmdBuffer,
1140 uint32_t startBinding,
1141 uint32_t bindingCount,
1142 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001143 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001144{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001145 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001146}
1147
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001148ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001149 VkCmdBuffer cmdBuffer,
1150 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001151 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001152 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001153{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001154 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001155}
1156
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001157ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001158 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001159 uint32_t firstVertex,
1160 uint32_t vertexCount,
1161 uint32_t firstInstance,
1162 uint32_t instanceCount)
1163{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001164 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001165}
1166
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001167ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001168 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001169 uint32_t firstIndex,
1170 uint32_t indexCount,
1171 int32_t vertexOffset,
1172 uint32_t firstInstance,
1173 uint32_t instanceCount)
1174{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001175 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001176}
1177
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001178ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001179 VkCmdBuffer cmdBuffer,
1180 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001181 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001182 uint32_t count,
1183 uint32_t stride)
1184{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001185 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001186}
1187
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001188ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001189 VkCmdBuffer cmdBuffer,
1190 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001191 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001192 uint32_t count,
1193 uint32_t stride)
1194{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001195 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001196}
1197
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001198ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001199 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001200 uint32_t x,
1201 uint32_t y,
1202 uint32_t z)
1203{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001204 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001205}
1206
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001207ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001208 VkCmdBuffer cmdBuffer,
1209 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001210 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001211{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001212 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001213}
1214
Tony Barbour8205d902015-04-16 15:59:00 -06001215void VKAPI vkCmdWaitEvents(
1216 VkCmdBuffer cmdBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001217 uint32_t eventCount,
1218 const VkEvent* pEvents,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001219 VkPipelineStageFlags sourceStageMask,
1220 VkPipelineStageFlags destStageMask,
Tony Barbour8205d902015-04-16 15:59:00 -06001221 uint32_t memBarrierCount,
Courtney Goeltzenleuchterd9ba3422015-07-12 12:58:58 -06001222 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001223{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001224 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001225}
1226
Tony Barbour8205d902015-04-16 15:59:00 -06001227void VKAPI vkCmdPipelineBarrier(
1228 VkCmdBuffer cmdBuffer,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001229 VkPipelineStageFlags srcStageMask,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001230 VkPipelineStageFlags destStageMask,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001231 VkBool32 byRegion,
Tony Barbour8205d902015-04-16 15:59:00 -06001232 uint32_t memBarrierCount,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001233 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001234{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001235 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001236}
1237
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001238ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001239 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001240 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001241 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001242{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001243 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001244 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1245 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1246}
1247
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001248ICD_EXPORT void VKAPI vkDestroyDevice(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001249 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001250{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001251 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001252}
1253
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001254ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1255 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001256 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001257 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001258 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001259{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001260 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001261 struct nulldrv_dev *dev = nulldrv_dev(device);
Mike Stroyan230e6252015-04-17 12:36:38 -06001262 *pQueue = (VkQueue) dev->queues[0];
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 vkDeviceWaitIdle(
1267 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001268{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001269 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001270 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001271}
1272
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001273ICD_EXPORT VkResult VKAPI vkCreateEvent(
1274 VkDevice device,
1275 const VkEventCreateInfo* pCreateInfo,
1276 VkEvent* pEvent)
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
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001282ICD_EXPORT void VKAPI vkDestroyEvent(
Tony Barbourde4124d2015-07-03 10:33:54 -06001283 VkDevice device,
1284 VkEvent event)
1285{
1286 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001287}
1288
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001289ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001290 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001291 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001292{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001293 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001294 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001295}
1296
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001297ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001298 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001299 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001300{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001301 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001302 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001303}
1304
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001305ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001306 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001307 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001308{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001309 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001310 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001311}
1312
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001313ICD_EXPORT VkResult VKAPI vkCreateFence(
1314 VkDevice device,
1315 const VkFenceCreateInfo* pCreateInfo,
1316 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001317{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001318 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001319 struct nulldrv_dev *dev = nulldrv_dev(device);
1320
1321 return nulldrv_fence_create(dev, pCreateInfo,
1322 (struct nulldrv_fence **) pFence);
1323}
1324
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001325ICD_EXPORT void VKAPI vkDestroyFence(
Tony Barbourde4124d2015-07-03 10:33:54 -06001326 VkDevice device,
1327 VkFence fence)
1328{
1329 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001330}
1331
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001332ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001333 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001334 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001335{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001336 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001337 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001338}
1339
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001340ICD_EXPORT VkResult VKAPI vkResetFences(
Courtney Goeltzenleuchterf2e33ad2015-06-18 17:28:20 -06001341 VkDevice device,
1342 uint32_t fenceCount,
1343 const VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001344{
1345 NULLDRV_LOG_FUNC;
1346 return VK_SUCCESS;
1347}
1348
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001349ICD_EXPORT VkResult VKAPI vkWaitForFences(
1350 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001351 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001352 const VkFence* pFences,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001353 VkBool32 waitAll,
David Pinedo0257fbf2015-02-02 18:02:40 -07001354 uint64_t timeout)
1355{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001356 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001357 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001358}
1359
Tony Barbour426b9052015-06-24 16:06:58 -06001360ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
1361 VkPhysicalDevice gpu_,
1362 VkPhysicalDeviceProperties* pProperties)
David Pinedo0257fbf2015-02-02 18:02:40 -07001363{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001364 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001365 VkResult ret = VK_SUCCESS;
1366
Tony Barbour426b9052015-06-24 16:06:58 -06001367 pProperties->apiVersion = VK_API_VERSION;
1368 pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's
1369 pProperties->vendorId = 0;
1370 pProperties->deviceId = 0;
1371 pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1372 strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
Ian Elliott64a68e12015-04-16 11:57:46 -06001373
Mark Lobodzinski7dae6862015-09-07 12:56:17 -06001374 /* TODO: fill out limits */
1375 memset(&pProperties->limits, 0, sizeof(VkPhysicalDeviceLimits));
1376 memset(&pProperties->sparseProperties, 0, sizeof(VkPhysicalDeviceSparseProperties));
Ian Elliott64a68e12015-04-16 11:57:46 -06001377 return ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001378}
1379
Chris Forbesd7576302015-06-21 22:55:02 +12001380ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
1381 VkPhysicalDevice physicalDevice,
1382 VkPhysicalDeviceFeatures* pFeatures)
1383{
1384 NULLDRV_LOG_FUNC;
1385 VkResult ret = VK_SUCCESS;
1386
1387 /* TODO: fill out features */
1388 memset(pFeatures, 0, sizeof(*pFeatures));
1389
1390 return ret;
1391}
1392
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -06001393ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties(
Chris Forbesd7576302015-06-21 22:55:02 +12001394 VkPhysicalDevice physicalDevice,
1395 VkFormat format,
1396 VkFormatProperties* pFormatInfo)
1397{
1398 NULLDRV_LOG_FUNC;
1399 VkResult ret = VK_SUCCESS;
1400
1401 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1402 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
Mark Lobodzinski4b36dd42015-09-03 15:21:52 -06001403 pFormatInfo->bufferFeatures = 0;
Chris Forbesd7576302015-06-21 22:55:02 +12001404
1405 return ret;
1406}
1407
Cody Northropef72e2a2015-08-03 17:04:53 -06001408ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001409 VkPhysicalDevice gpu_,
Cody Northropef72e2a2015-08-03 17:04:53 -06001410 uint32_t* pCount,
1411 VkQueueFamilyProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001412 {
Cody Northropef72e2a2015-08-03 17:04:53 -06001413 if (pProperties == NULL) {
1414 *pCount = 1;
1415 return VK_SUCCESS;
1416 }
Tony Barbour426b9052015-06-24 16:06:58 -06001417 pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
1418 pProperties->queueCount = 1;
Tony Barbour426b9052015-06-24 16:06:58 -06001419 pProperties->supportsTimestamps = false;
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001420
Tony Barbour426b9052015-06-24 16:06:58 -06001421 return VK_SUCCESS;
1422}
1423
Ian Elliotte924ab22015-07-08 13:24:30 -06001424ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
1425 VkPhysicalDevice gpu_,
1426 VkPhysicalDeviceMemoryProperties* pProperties)
1427{
1428 // TODO: Fill in with real data
1429 return VK_SUCCESS;
1430}
1431
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001432ICD_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001433 VkPhysicalDevice physicalDevice,
1434 uint32_t* pCount,
1435 VkLayerProperties* pProperties)
1436{
1437 // TODO: Fill in with real data
1438 return VK_SUCCESS;
1439}
1440
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001441ICD_EXPORT VkResult VKAPI vkEnumerateInstanceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001442 const char* pLayerName,
1443 uint32_t* pCount,
1444 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001445{
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001446 uint32_t copy_size;
Tony Barbour426b9052015-06-24 16:06:58 -06001447
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001448 if (pProperties == NULL) {
1449 *pCount = NULLDRV_EXT_COUNT;
1450 return VK_SUCCESS;
1451 }
Tony Barbour426b9052015-06-24 16:06:58 -06001452
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001453 copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT;
1454 memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties));
1455 *pCount = copy_size;
1456 if (copy_size < NULLDRV_EXT_COUNT) {
1457 return VK_INCOMPLETE;
1458 }
Tony Barbour426b9052015-06-24 16:06:58 -06001459 return VK_SUCCESS;
1460}
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001461ICD_EXPORT VkResult VKAPI vkEnumerateInstanceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001462 uint32_t* pCount,
1463 VkLayerProperties* pProperties)
1464{
1465 // TODO: Fill in with real data
1466 return VK_SUCCESS;
1467}
Tony Barbour426b9052015-06-24 16:06:58 -06001468
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001469VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001470 VkPhysicalDevice physicalDevice,
1471 const char* pLayerName,
1472 uint32_t* pCount,
1473 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001474{
Tony Barbour426b9052015-06-24 16:06:58 -06001475
Tony Barbour426b9052015-06-24 16:06:58 -06001476 *pCount = 0;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001477
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001478 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001479}
1480
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001481ICD_EXPORT VkResult VKAPI vkCreateImage(
1482 VkDevice device,
1483 const VkImageCreateInfo* pCreateInfo,
1484 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001485{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001486 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001487 struct nulldrv_dev *dev = nulldrv_dev(device);
1488
1489 return nulldrv_img_create(dev, pCreateInfo, false,
1490 (struct nulldrv_img **) pImage);
1491}
1492
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001493ICD_EXPORT void VKAPI vkDestroyImage(
Tony Barbourde4124d2015-07-03 10:33:54 -06001494 VkDevice device,
1495 VkImage image)
1496{
1497 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001498}
1499
Tony Barbour426b9052015-06-24 16:06:58 -06001500ICD_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(
Mike Stroyan230e6252015-04-17 12:36:38 -06001501 VkDevice device,
1502 VkImage image,
1503 const VkImageSubresource* pSubresource,
Tony Barbour426b9052015-06-24 16:06:58 -06001504 VkSubresourceLayout* pLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001505{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001506 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001507
Tony Barbour426b9052015-06-24 16:06:58 -06001508 pLayout->offset = 0;
1509 pLayout->size = 1;
1510 pLayout->rowPitch = 4;
1511 pLayout->depthPitch = 4;
David Pinedo0257fbf2015-02-02 18:02:40 -07001512
Tony Barbour426b9052015-06-24 16:06:58 -06001513 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001514}
1515
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001516ICD_EXPORT VkResult VKAPI vkAllocMemory(
1517 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001518 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001519 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001520{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001521 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001522 struct nulldrv_dev *dev = nulldrv_dev(device);
1523
1524 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1525}
1526
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001527ICD_EXPORT void VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001528 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001529 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001530{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001531 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001532}
1533
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001534ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001535 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001536 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001537 VkDeviceSize offset,
1538 VkDeviceSize size,
1539 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001540 void** ppData)
1541{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001542 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001543 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1544 void *ptr = nulldrv_mem_map(mem, flags);
1545
1546 *ppData = ptr;
1547
Courtney Goeltzenleuchterac544f32015-09-14 18:01:17 -06001548 return (ptr) ? VK_SUCCESS : VK_ERROR_MEMORY_MAP_FAILED;
David Pinedo0257fbf2015-02-02 18:02:40 -07001549}
1550
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001551ICD_EXPORT void VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001552 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001553 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001554{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001555 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001556}
1557
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001558ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001559 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001560 uint32_t memRangeCount,
1561 const VkMappedMemoryRange* pMemRanges)
1562{
1563 NULLDRV_LOG_FUNC;
1564 return VK_SUCCESS;
1565}
1566
1567ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1568 VkDevice device,
1569 uint32_t memRangeCount,
1570 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001571{
1572 NULLDRV_LOG_FUNC;
1573 return VK_SUCCESS;
1574}
1575
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001576ICD_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(
1577 VkDevice device,
1578 VkDeviceMemory memory,
1579 VkDeviceSize* pCommittedMemoryInBytes)
1580{
1581 return VK_SUCCESS;
1582}
1583
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001584ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001585 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001586 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001587{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001588 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001589 struct nulldrv_instance *inst;
1590
1591 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001592 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001593 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001594 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001595
Tony Barbour426b9052015-06-24 16:06:58 -06001596 inst->obj.base.get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -07001597
Mike Stroyan230e6252015-04-17 12:36:38 -06001598 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001599
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001600 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001601}
1602
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001603ICD_EXPORT void VKAPI vkDestroyInstance(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001604 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001605{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001606 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001607}
1608
Tony Barbour8205d902015-04-16 15:59:00 -06001609ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001610 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001611 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001612 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001613{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001614 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001615 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001616 struct nulldrv_gpu *gpu;
1617 *pGpuCount = 1;
1618 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001619 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001620 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001621 return ret;
1622}
1623
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001624ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001625 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001626 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001627 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001628 char* const* pOutLayers,
1629 void* pReserved)
1630{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001631 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001632 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001633}
1634
Tony Barbourde4124d2015-07-03 10:33:54 -06001635ICD_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(
1636 VkDevice device,
1637 VkBuffer buffer,
1638 VkMemoryRequirements* pMemoryRequirements)
1639{
1640 NULLDRV_LOG_FUNC;
1641 struct nulldrv_base *base = nulldrv_base((void*)buffer.handle);
1642
1643 return base->get_memory_requirements(base, pMemoryRequirements);
1644}
1645
1646ICD_EXPORT VkResult VKAPI vkGetImageMemoryRequirements(
1647 VkDevice device,
1648 VkImage image,
1649 VkMemoryRequirements* pMemoryRequirements)
1650{
1651 NULLDRV_LOG_FUNC;
1652 struct nulldrv_base *base = nulldrv_base((void*)image.handle);
1653
1654 return base->get_memory_requirements(base, pMemoryRequirements);
1655}
1656
1657ICD_EXPORT VkResult VKAPI vkBindBufferMemory(
1658 VkDevice device,
1659 VkBuffer buffer,
1660 VkDeviceMemory mem_,
1661 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001662{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001663 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001664 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001665}
1666
Tony Barbourde4124d2015-07-03 10:33:54 -06001667ICD_EXPORT VkResult VKAPI vkBindImageMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001668 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001669 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001670 VkDeviceMemory mem_,
1671 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001672{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001673 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001674 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001675}
1676
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001677ICD_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(
1678 VkDevice device,
1679 VkImage image,
1680 uint32_t* pNumRequirements,
1681 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1682{
1683 NULLDRV_LOG_FUNC;
1684 return VK_SUCCESS;
1685}
1686
1687ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(
1688 VkPhysicalDevice physicalDevice,
1689 VkFormat format,
1690 VkImageType type,
1691 uint32_t samples,
1692 VkImageUsageFlags usage,
1693 VkImageTiling tiling,
1694 uint32_t* pNumProperties,
1695 VkSparseImageFormatProperties* pProperties)
1696{
1697 NULLDRV_LOG_FUNC;
1698 return VK_SUCCESS;
1699}
1700
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001701ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001702 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001703 VkBuffer buffer,
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001704 uint32_t numBindings,
1705 const VkSparseMemoryBindInfo* pBindInfo)
1706{
1707 NULLDRV_LOG_FUNC;
1708 return VK_SUCCESS;
1709}
1710
1711ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(
1712 VkQueue queue,
1713 VkImage image,
1714 uint32_t numBindings,
1715 const VkSparseMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001716{
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
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001721ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001722 VkQueue queue,
1723 VkImage image,
1724 uint32_t numBindings,
1725 const VkSparseImageMemoryBindInfo* pBindInfo)
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}
Jon Ashburn0e249962015-07-10 09:41:15 -07001730ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
1731 VkDevice device,
1732 const VkPipelineCacheCreateInfo* pCreateInfo,
1733 VkPipelineCache* pPipelineCache)
1734{
David Pinedo0257fbf2015-02-02 18:02:40 -07001735
Jon Ashburn0e249962015-07-10 09:41:15 -07001736 NULLDRV_LOG_FUNC;
1737 return VK_SUCCESS;
1738}
1739
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001740ICD_EXPORT void VKAPI vkDestroyPipeline(
Tony Barbourde4124d2015-07-03 10:33:54 -06001741 VkDevice device,
1742 VkPipeline pipeline)
1743{
1744 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001745}
1746
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001747void VKAPI vkDestroyPipelineCache(
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06001748 VkDevice device,
1749 VkPipelineCache pipelineCache)
Jon Ashburn0e249962015-07-10 09:41:15 -07001750{
1751 NULLDRV_LOG_FUNC;
Jon Ashburn0e249962015-07-10 09:41:15 -07001752}
1753
1754ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize(
1755 VkDevice device,
1756 VkPipelineCache pipelineCache)
1757{
1758 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001759 return 0;
Jon Ashburn0e249962015-07-10 09:41:15 -07001760}
1761
1762ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
1763 VkDevice device,
1764 VkPipelineCache pipelineCache,
1765 void* pData)
1766{
1767 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001768 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001769}
1770
1771ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
1772 VkDevice device,
1773 VkPipelineCache destCache,
1774 uint32_t srcCacheCount,
1775 const VkPipelineCache* pSrcCaches)
1776{
1777 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001778 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001779}
1780ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001781 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001782 VkPipelineCache pipelineCache,
1783 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001784 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1785 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001786{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001787 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001788 struct nulldrv_dev *dev = nulldrv_dev(device);
1789
1790 return graphics_pipeline_create(dev, pCreateInfo,
1791 (struct nulldrv_pipeline **) pPipeline);
1792}
1793
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001794
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001795
Jon Ashburn0e249962015-07-10 09:41:15 -07001796ICD_EXPORT VkResult VKAPI vkCreateComputePipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001797 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001798 VkPipelineCache pipelineCache,
1799 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001800 const VkComputePipelineCreateInfo* pCreateInfo,
1801 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001802{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001803 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001804 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001805}
1806
David Pinedo0257fbf2015-02-02 18:02:40 -07001807
David Pinedo0257fbf2015-02-02 18:02:40 -07001808
Jon Ashburn0e249962015-07-10 09:41:15 -07001809
David Pinedo0257fbf2015-02-02 18:02:40 -07001810
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001811ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1812 VkDevice device,
1813 const VkQueryPoolCreateInfo* pCreateInfo,
1814 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001815{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001816 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001817 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001818}
1819
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001820ICD_EXPORT void VKAPI vkDestroyQueryPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06001821 VkDevice device,
1822 VkQueryPool queryPoool)
1823{
1824 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001825}
1826
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001827ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001828 VkDevice device,
1829 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001830 uint32_t startQuery,
1831 uint32_t queryCount,
1832 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001833 void* pData,
1834 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001835{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001836 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001837 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001838}
1839
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001840ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1841 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001842{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001843 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001844 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001845}
1846
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001847ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1848 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001849 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001850 const VkCmdBuffer* pCmdBuffers,
1851 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001852{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001853 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001854 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001855}
1856
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001857ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1858 VkDevice device,
1859 const VkSemaphoreCreateInfo* pCreateInfo,
1860 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001861{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001862 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001863 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001864}
1865
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001866ICD_EXPORT void VKAPI vkDestroySemaphore(
Tony Barbourde4124d2015-07-03 10:33:54 -06001867 VkDevice device,
1868 VkSemaphore semaphore)
1869{
1870 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001871}
1872
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001873ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1874 VkQueue queue,
1875 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001876{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001877 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001878 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001879}
1880
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001881ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1882 VkQueue queue,
1883 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001884{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001885 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001886 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001887}
1888
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001889ICD_EXPORT VkResult VKAPI vkCreateSampler(
1890 VkDevice device,
1891 const VkSamplerCreateInfo* pCreateInfo,
1892 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001893{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001894 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001895 struct nulldrv_dev *dev = nulldrv_dev(device);
1896
1897 return nulldrv_sampler_create(dev, pCreateInfo,
1898 (struct nulldrv_sampler **) pSampler);
1899}
1900
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001901ICD_EXPORT void VKAPI vkDestroySampler(
Tony Barbourde4124d2015-07-03 10:33:54 -06001902 VkDevice device,
1903 VkSampler sampler)
1904{
1905 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001906}
1907
Ian Elliotte924ab22015-07-08 13:24:30 -06001908ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
1909 VkDevice device,
1910 const VkShaderModuleCreateInfo* pCreateInfo,
1911 VkShaderModule* pShaderModule)
1912{
1913 // TODO: Fill in with real data
Tony Barbourde4124d2015-07-03 10:33:54 -06001914 NULLDRV_LOG_FUNC;
1915 return VK_SUCCESS;
1916}
1917
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001918ICD_EXPORT void VKAPI vkDestroyShaderModule(
Tony Barbourde4124d2015-07-03 10:33:54 -06001919 VkDevice device,
1920 VkShaderModule shaderModule)
1921{
1922 // TODO: Fill in with real data
1923 NULLDRV_LOG_FUNC;
Ian Elliotte924ab22015-07-08 13:24:30 -06001924}
1925
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001926ICD_EXPORT VkResult VKAPI vkCreateShader(
1927 VkDevice device,
1928 const VkShaderCreateInfo* pCreateInfo,
1929 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001930{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001931 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001932 struct nulldrv_dev *dev = nulldrv_dev(device);
1933
1934 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1935}
1936
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001937ICD_EXPORT void VKAPI vkDestroyShader(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001938 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001939 VkShader shader)
1940{
1941 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001942}
1943
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001944ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1945 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001946 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001947 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001948{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001949 NULLDRV_LOG_FUNC;
1950 struct nulldrv_dev *dev = nulldrv_dev(device);
1951
1952 return nulldrv_buf_view_create(dev, pCreateInfo,
1953 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001954}
1955
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001956ICD_EXPORT void VKAPI vkDestroyBufferView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001957 VkDevice device,
1958 VkBufferView bufferView)
1959{
1960 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001961}
1962
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001963ICD_EXPORT VkResult VKAPI vkCreateImageView(
1964 VkDevice device,
1965 const VkImageViewCreateInfo* pCreateInfo,
1966 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001967{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001968 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001969 struct nulldrv_dev *dev = nulldrv_dev(device);
1970
1971 return nulldrv_img_view_create(dev, pCreateInfo,
1972 (struct nulldrv_img_view **) pView);
1973}
1974
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001975ICD_EXPORT void VKAPI vkDestroyImageView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001976 VkDevice device,
1977 VkImageView imageView)
1978{
1979 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001980}
1981
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001982ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1983 VkDevice device,
1984 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1985 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001986{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001987 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001988 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001989
Chia-I Wu7732cb22015-03-26 15:27:55 +08001990 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001991 (struct nulldrv_desc_layout **) pSetLayout);
1992}
1993
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001994ICD_EXPORT void VKAPI vkDestroyDescriptorSetLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06001995 VkDevice device,
1996 VkDescriptorSetLayout descriptorSetLayout)
1997{
1998 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001999}
2000
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002001ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
2002 VkDevice device,
2003 const VkPipelineLayoutCreateInfo* pCreateInfo,
2004 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08002005{
2006 NULLDRV_LOG_FUNC;
2007 struct nulldrv_dev *dev = nulldrv_dev(device);
2008
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002009 return nulldrv_pipeline_layout_create(dev,
2010 pCreateInfo,
2011 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08002012}
2013
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002014ICD_EXPORT void VKAPI vkDestroyPipelineLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06002015 VkDevice device,
2016 VkPipelineLayout pipelineLayout)
2017{
2018 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002019}
2020
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002021ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002022 VkDevice device,
2023 const VkDescriptorPoolCreateInfo* pCreateInfo,
2024 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002025{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002026 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002027 struct nulldrv_dev *dev = nulldrv_dev(device);
2028
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002029 return nulldrv_desc_pool_create(dev, pCreateInfo,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002030 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002031}
2032
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002033ICD_EXPORT void VKAPI vkDestroyDescriptorPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06002034 VkDevice device,
2035 VkDescriptorPool descriptorPool)
2036{
2037 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002038}
2039
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002040ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002041 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002042 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002043{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002044 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002045 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002046}
2047
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002048ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002049 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002050 VkDescriptorPool descriptorPool,
2051 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002052 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002053 const VkDescriptorSetLayout* pSetLayouts,
Cody Northropc8aa4a52015-08-03 12:47:29 -06002054 VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002055{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002056 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002057 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2058 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002059 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002060 uint32_t i;
2061
2062 for (i = 0; i < count; i++) {
2063 const struct nulldrv_desc_layout *layout =
Tony Barbour8db65372015-07-10 18:32:33 -06002064 nulldrv_desc_layout(pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002065
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002066 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002067 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002068 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002069 break;
2070 }
2071
David Pinedo0257fbf2015-02-02 18:02:40 -07002072 return ret;
2073}
2074
Tony Barbourb857d312015-07-10 10:50:45 -06002075ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
2076 VkDevice device,
2077 VkDescriptorPool descriptorPool,
2078 uint32_t count,
2079 const VkDescriptorSet* pDescriptorSets)
2080{
2081 NULLDRV_LOG_FUNC;
2082 return VK_SUCCESS;
2083}
2084
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002085ICD_EXPORT void VKAPI vkUpdateDescriptorSets(
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002086 VkDevice device,
2087 uint32_t writeCount,
2088 const VkWriteDescriptorSet* pDescriptorWrites,
2089 uint32_t copyCount,
2090 const VkCopyDescriptorSet* pDescriptorCopies)
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}
2094
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002095ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2096 VkDevice device,
2097 const VkFramebufferCreateInfo* info,
2098 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002099{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002100 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002101 struct nulldrv_dev *dev = nulldrv_dev(device);
2102
2103 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2104}
2105
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002106ICD_EXPORT void VKAPI vkDestroyFramebuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -06002107 VkDevice device,
2108 VkFramebuffer framebuffer)
2109{
2110 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002111}
David Pinedo0257fbf2015-02-02 18:02:40 -07002112
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002113ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2114 VkDevice device,
2115 const VkRenderPassCreateInfo* info,
2116 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002117{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002118 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002119 struct nulldrv_dev *dev = nulldrv_dev(device);
2120
2121 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2122}
2123
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002124ICD_EXPORT void VKAPI vkDestroyRenderPass(
Tony Barbourde4124d2015-07-03 10:33:54 -06002125 VkDevice device,
2126 VkRenderPass renderPass)
2127{
2128 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002129}
2130
Courtney Goeltzenleuchtera375b622015-07-27 14:04:01 -06002131ICD_EXPORT void VKAPI vkCmdPushConstants(
2132 VkCmdBuffer cmdBuffer,
2133 VkPipelineLayout layout,
2134 VkShaderStageFlags stageFlags,
2135 uint32_t start,
2136 uint32_t length,
2137 const void* values)
2138{
2139 /* TODO: Implement */
2140}
2141
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002142ICD_EXPORT VkResult VKAPI vkGetRenderAreaGranularity(
2143 VkDevice device,
2144 VkRenderPass renderPass,
2145 VkExtent2D* pGranularity)
2146{
2147 pGranularity->height = 1;
2148 pGranularity->width = 1;
2149
2150 return VK_SUCCESS;
2151}
2152
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002153ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Chia-I Wuc278df82015-07-07 11:50:03 +08002154 VkCmdBuffer cmdBuffer,
2155 const VkRenderPassBeginInfo* pRenderPassBegin,
2156 VkRenderPassContents contents)
2157{
2158 NULLDRV_LOG_FUNC;
2159}
2160
2161ICD_EXPORT void VKAPI vkCmdNextSubpass(
2162 VkCmdBuffer cmdBuffer,
2163 VkRenderPassContents contents)
David Pinedo0257fbf2015-02-02 18:02:40 -07002164{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002165 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002166}
2167
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002168ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08002169 VkCmdBuffer cmdBuffer)
2170{
2171 NULLDRV_LOG_FUNC;
2172}
2173
2174ICD_EXPORT void VKAPI vkCmdExecuteCommands(
2175 VkCmdBuffer cmdBuffer,
2176 uint32_t cmdBuffersCount,
2177 const VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -07002178{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002179 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002180}
Ian Elliottf93069f2015-02-19 14:26:19 -07002181
2182ICD_EXPORT void* xcbCreateWindow(
2183 uint16_t width,
2184 uint16_t height)
2185{
2186 static uint32_t window; // Kludge to the max
2187 NULLDRV_LOG_FUNC;
2188 return &window;
2189}
2190
2191// May not be needed, if we stub out stuf in tri.c
2192ICD_EXPORT void xcbDestroyWindow()
2193{
2194 NULLDRV_LOG_FUNC;
2195}
2196
2197ICD_EXPORT int xcbGetMessage(void *msg)
2198{
2199 NULLDRV_LOG_FUNC;
2200 return 0;
2201}
2202
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002203ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002204{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002205 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002206}
David Pinedo07494fd2015-07-24 10:54:41 -06002207
2208ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties(
2209 VkPhysicalDevice physicalDevice,
2210 VkFormat format,
2211 VkImageType type,
2212 VkImageTiling tiling,
2213 VkImageUsageFlags usage,
Courtney Goeltzenleuchter06d94a52015-09-17 11:21:14 -06002214 VkImageCreateFlags flags,
David Pinedo07494fd2015-07-24 10:54:41 -06002215 VkImageFormatProperties* pImageFormatProperties)
2216{
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06002217 return VK_ERROR_INITIALIZATION_FAILED;
David Pinedo07494fd2015-07-24 10:54:41 -06002218}