blob: 56b677b9547d5844ea6fe26e2b1179353374e52f [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,
Courtney Goeltzenleuchterdfd53f52015-10-15 16:58:44 -0600216 info->requestedQueueCount);
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;
Courtney Goeltzenleuchter2ebc2342015-10-21 17:57:31 -0600285 img->array_size = info->arrayLayers;
David Pinedo0257fbf2015-02-02 18:02:40 -0700286 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,
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600484 const VkCmdBufferAllocInfo *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;
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600488 uint32_t num_allocated = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700489
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600490 for (uint32_t i = 0; i < info->count; i++) {
491 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
492 VK_OBJECT_TYPE_COMMAND_BUFFER);
493 if (!cmd) {
494 for (uint32_t j = 0; j < num_allocated; j++) {
495 free(cmd_ret[j]);
496 }
497 return VK_ERROR_OUT_OF_HOST_MEMORY;
498 }
499 num_allocated++;
500 cmd_ret[i] = cmd;
501 }
David Pinedo0257fbf2015-02-02 18:02:40 -0700502
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600503 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700504}
505
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600506static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600507 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800508 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700509{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800510 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700511
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800512 pool = (struct nulldrv_desc_pool *)
513 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600514 VK_OBJECT_TYPE_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800515 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600516 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700517
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800518 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700519
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800520 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700521
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600522 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700523}
524
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600525static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800526 struct nulldrv_desc_pool *pool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700527 const struct nulldrv_desc_layout *layout,
528 struct nulldrv_desc_set **set_ret)
529{
530 struct nulldrv_desc_set *set;
531
532 set = (struct nulldrv_desc_set *)
533 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600534 VK_OBJECT_TYPE_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700535 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600536 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700537
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800538 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700539 set->layout = layout;
540 *set_ret = set;
541
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600542 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700543}
544
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600545static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700546{
Tony Barbourde4124d2015-07-03 10:33:54 -0600547 return *(struct nulldrv_desc_pool **) &pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700548}
549
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600550static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
551 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700552 struct nulldrv_framebuffer ** fb_ret)
553{
554
555 struct nulldrv_framebuffer *fb;
556 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600557 VK_OBJECT_TYPE_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700558 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600559 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700560
561 *fb_ret = fb;
562
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600563 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700564
565}
566
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600567static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
568 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700569 struct nulldrv_render_pass** rp_ret)
570{
571 struct nulldrv_render_pass *rp;
572 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600573 VK_OBJECT_TYPE_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700574 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600575 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700576
577 *rp_ret = rp;
578
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600579 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700580}
581
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600582static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700583{
Tony Barbourde4124d2015-07-03 10:33:54 -0600584 return *(struct nulldrv_buf **) &buf;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700585}
586
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600587static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600588 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700589 struct nulldrv_buf_view **view_ret)
590{
591 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
592 struct nulldrv_buf_view *view;
593
594 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600595 VK_OBJECT_TYPE_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700596 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600597 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700598
599 view->buf = buf;
600
601 *view_ret = view;
602
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600603 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700604}
605
David Pinedo0257fbf2015-02-02 18:02:40 -0700606
607//*********************************************
608// Driver entry points
609//*********************************************
610
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600611ICD_EXPORT VkResult VKAPI vkCreateBuffer(
612 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600613 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600614 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700615{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700616 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700617 struct nulldrv_dev *dev = nulldrv_dev(device);
618
619 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
620}
621
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600622ICD_EXPORT void VKAPI vkDestroyBuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -0600623 VkDevice device,
624 VkBuffer buffer)
625{
626 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -0600627}
628
Cody Northropf02f9f82015-07-09 18:08:05 -0600629ICD_EXPORT VkResult VKAPI vkCreateCommandPool(
630 VkDevice device,
631 const VkCmdPoolCreateInfo* pCreateInfo,
632 VkCmdPool* pCmdPool)
633{
634 NULLDRV_LOG_FUNC;
635 return VK_SUCCESS;
636}
637
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600638ICD_EXPORT void VKAPI vkDestroyCommandPool(
Cody Northropf02f9f82015-07-09 18:08:05 -0600639 VkDevice device,
640 VkCmdPool cmdPool)
641{
642 NULLDRV_LOG_FUNC;
Cody Northropf02f9f82015-07-09 18:08:05 -0600643}
644
645ICD_EXPORT VkResult VKAPI vkResetCommandPool(
646 VkDevice device,
647 VkCmdPool cmdPool,
648 VkCmdPoolResetFlags flags)
649{
650 NULLDRV_LOG_FUNC;
651 return VK_SUCCESS;
652}
653
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600654ICD_EXPORT VkResult VKAPI vkAllocCommandBuffers(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600655 VkDevice device,
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600656 const VkCmdBufferAllocInfo* pAllocInfo,
657 VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -0700658{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700659 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700660 struct nulldrv_dev *dev = nulldrv_dev(device);
661
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600662 return nulldrv_cmd_create(dev, pAllocInfo,
663 (struct nulldrv_cmd **) pCmdBuffers);
David Pinedo0257fbf2015-02-02 18:02:40 -0700664}
665
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600666ICD_EXPORT void VKAPI vkFreeCommandBuffers(
Tony Barbourde4124d2015-07-03 10:33:54 -0600667 VkDevice device,
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600668 VkCmdPool cmdPool,
669 uint32_t count,
670 const VkCmdBuffer* pCmdBuffers)
Tony Barbourde4124d2015-07-03 10:33:54 -0600671{
672 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600673 for (uint32_t i = 0; i < count; i++) {
674 free(pCmdBuffers[i]);
675 }
Tony Barbourde4124d2015-07-03 10:33:54 -0600676}
677
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600678ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
679 VkCmdBuffer cmdBuffer,
680 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700681{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700682 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600683 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700684}
685
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600686ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
687 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700688{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700689 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600690 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700691}
692
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600693ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
Cody Northropf02f9f82015-07-09 18:08:05 -0600694 VkCmdBuffer cmdBuffer,
695 VkCmdBufferResetFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700696{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700697 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600698 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700699}
700
Ian Elliott64a68e12015-04-16 11:57:46 -0600701static const VkFormat nulldrv_presentable_formats[] = {
702 VK_FORMAT_B8G8R8A8_UNORM,
703};
704
Jon Ashburnba4a1952015-06-16 12:44:51 -0600705#if 0
Ian Elliott338dedb2015-08-21 15:09:33 -0600706ICD_EXPORT VkResult VKAPI vkGetDisplayInfoKHR(
707 VkDisplayKHR display,
708 VkDisplayInfoTypeKHR infoType,
Ian Elliott64a68e12015-04-16 11:57:46 -0600709 size_t* pDataSize,
710 void* pData)
711{
712 VkResult ret = VK_SUCCESS;
713
714 NULLDRV_LOG_FUNC;
715
716 if (!pDataSize)
717 return VK_ERROR_INVALID_POINTER;
718
719 switch (infoType) {
Ian Elliott338dedb2015-08-21 15:09:33 -0600720 case VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_KHR:
Ian Elliott64a68e12015-04-16 11:57:46 -0600721 {
Ian Elliott338dedb2015-08-21 15:09:33 -0600722 VkDisplayFormatPropertiesKHR *dst = pData;
Ian Elliott64a68e12015-04-16 11:57:46 -0600723 size_t size_ret;
724 uint32_t i;
725
726 size_ret = sizeof(*dst) * ARRAY_SIZE(nulldrv_presentable_formats);
727
728 if (dst && *pDataSize < size_ret)
729 return VK_ERROR_INVALID_VALUE;
730
731 *pDataSize = size_ret;
732 if (!dst)
733 return VK_SUCCESS;
734
735 for (i = 0; i < ARRAY_SIZE(nulldrv_presentable_formats); i++)
Ian Elliott338dedb2015-08-21 15:09:33 -0600736 dst[i].swapchainFormat = nulldrv_presentable_formats[i];
Ian Elliott64a68e12015-04-16 11:57:46 -0600737 }
738 break;
739 default:
740 ret = VK_ERROR_INVALID_VALUE;
741 break;
742 }
743
744 return ret;
745}
Jon Ashburnba4a1952015-06-16 12:44:51 -0600746#endif
Ian Elliott64a68e12015-04-16 11:57:46 -0600747
Ian Elliott338dedb2015-08-21 15:09:33 -0600748ICD_EXPORT VkResult VKAPI vkCreateSwapchainKHR(
Ian Elliott64a68e12015-04-16 11:57:46 -0600749 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600750 const VkSwapchainCreateInfoKHR* pCreateInfo,
751 VkSwapchainKHR* pSwapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600752{
753 NULLDRV_LOG_FUNC;
754 struct nulldrv_dev *dev = nulldrv_dev(device);
755 struct nulldrv_swap_chain *sc;
756
757 sc = (struct nulldrv_swap_chain *) nulldrv_base_create(dev, sizeof(*sc),
Ian Elliott338dedb2015-08-21 15:09:33 -0600758 VK_OBJECT_TYPE_SWAPCHAIN_KHR);
Ian Elliott64a68e12015-04-16 11:57:46 -0600759 if (!sc) {
760 return VK_ERROR_OUT_OF_HOST_MEMORY;
761 }
762 sc->dev = dev;
763
Ian Elliott338dedb2015-08-21 15:09:33 -0600764 *(VkSwapchainKHR **)pSwapchain = *(VkSwapchainKHR **)&sc;
Ian Elliott64a68e12015-04-16 11:57:46 -0600765
766 return VK_SUCCESS;
767}
768
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -0600769ICD_EXPORT VkResult VKAPI vkDestroySwapchainKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600770 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600771 VkSwapchainKHR swapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600772{
773 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600774 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600775
776 free(sc);
777
778 return VK_SUCCESS;
779}
780
Ian Elliott338dedb2015-08-21 15:09:33 -0600781ICD_EXPORT VkResult VKAPI vkGetSwapchainImagesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600782 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600783 VkSwapchainKHR swapchain,
Ian Elliott3333bb42015-08-10 13:56:08 -0600784 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600785 VkImage* pSwapchainImages)
Ian Elliott64a68e12015-04-16 11:57:46 -0600786{
787 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600788 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600789 struct nulldrv_dev *dev = sc->dev;
790 VkResult ret = VK_SUCCESS;
791
Ian Elliott3333bb42015-08-10 13:56:08 -0600792 *pCount = 2;
Ian Elliott338dedb2015-08-21 15:09:33 -0600793 if (pSwapchainImages) {
Ian Elliott3333bb42015-08-10 13:56:08 -0600794 uint32_t i;
795 for (i = 0; i < 2; i++) {
Ian Elliott64a68e12015-04-16 11:57:46 -0600796 struct nulldrv_img *img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600797
798 img = (struct nulldrv_img *) nulldrv_base_create(dev,
799 sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600800 VK_OBJECT_TYPE_IMAGE);
Ian Elliott64a68e12015-04-16 11:57:46 -0600801 if (!img)
802 return VK_ERROR_OUT_OF_HOST_MEMORY;
Ian Elliott338dedb2015-08-21 15:09:33 -0600803 pSwapchainImages[i].handle = (uint64_t) &img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600804 }
Ian Elliott64a68e12015-04-16 11:57:46 -0600805 }
806
807 return ret;
808}
809
Ian Elliott338dedb2015-08-21 15:09:33 -0600810ICD_EXPORT VkResult VKAPI vkAcquireNextImageKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600811 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600812 VkSwapchainKHR swapchain,
Tony Barbour7910de72015-07-13 16:37:21 -0600813 uint64_t timeout,
814 VkSemaphore semaphore,
815 uint32_t* pImageIndex)
816{
817 NULLDRV_LOG_FUNC;
818
819 return VK_SUCCESS;
820}
821
Ian Elliott338dedb2015-08-21 15:09:33 -0600822VkResult VKAPI vkGetSurfacePropertiesKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600823 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600824 const VkSurfaceDescriptionKHR* pSurfaceDescription,
825 VkSurfacePropertiesKHR* pSurfaceProperties)
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 vkGetSurfaceFormatsKHR(
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 VkSurfaceFormatKHR* pSurfaceFormats)
Ian Elliott3333bb42015-08-10 13:56:08 -0600837{
838 NULLDRV_LOG_FUNC;
839
840 return VK_SUCCESS;
841}
842
Ian Elliott338dedb2015-08-21 15:09:33 -0600843VkResult VKAPI vkGetSurfacePresentModesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600844 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600845 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600846 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600847 VkPresentModeKHR* pPresentModes)
Tony Barbour7910de72015-07-13 16:37:21 -0600848{
849 NULLDRV_LOG_FUNC;
850
851 return VK_SUCCESS;
852}
853
Ian Elliott338dedb2015-08-21 15:09:33 -0600854ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600855 VkPhysicalDevice physicalDevice,
856 uint32_t queueFamilyIndex,
Ian Elliott338dedb2015-08-21 15:09:33 -0600857 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Tony Barbour7910de72015-07-13 16:37:21 -0600858 VkBool32* pSupported)
859{
860 NULLDRV_LOG_FUNC;
861
862 return VK_SUCCESS;
863}
864
Ian Elliott338dedb2015-08-21 15:09:33 -0600865ICD_EXPORT VkResult VKAPI vkQueuePresentKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600866 VkQueue queue_,
Ian Elliott338dedb2015-08-21 15:09:33 -0600867 VkPresentInfoKHR* pPresentInfo)
Ian Elliott64a68e12015-04-16 11:57:46 -0600868{
869 NULLDRV_LOG_FUNC;
870
871 return VK_SUCCESS;
872}
873
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600874ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600875 VkCmdBuffer cmdBuffer,
876 VkBuffer srcBuffer,
877 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700878 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600879 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700880{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700881 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700882}
883
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600884ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600885 VkCmdBuffer cmdBuffer,
886 VkImage srcImage,
887 VkImageLayout srcImageLayout,
888 VkImage destImage,
889 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700890 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600891 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700892{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700893 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700894}
895
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600896ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600897 VkCmdBuffer cmdBuffer,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500898 VkImage srcImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600899 VkImageLayout srcImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500900 VkImage destImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600901 VkImageLayout destImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500902 uint32_t regionCount,
903 const VkImageBlit* pRegions,
904 VkTexFilter filter)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600905{
906 NULLDRV_LOG_FUNC;
907}
908
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600909ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600910 VkCmdBuffer cmdBuffer,
911 VkBuffer srcBuffer,
912 VkImage destImage,
913 VkImageLayout destImageLayout,
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 vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600921 VkCmdBuffer cmdBuffer,
922 VkImage srcImage,
923 VkImageLayout srcImageLayout,
924 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700925 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600926 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700927{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700928 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700929}
930
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600931ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600932 VkCmdBuffer cmdBuffer,
933 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600934 VkDeviceSize destOffset,
935 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700936 const uint32_t* pData)
937{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700938 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700939}
940
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600941ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600942 VkCmdBuffer cmdBuffer,
943 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600944 VkDeviceSize destOffset,
945 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700946 uint32_t data)
947{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700948 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700949}
950
Ian Elliotte924ab22015-07-08 13:24:30 -0600951ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage(
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600952 VkCmdBuffer cmdBuffer,
953 VkImage image,
954 VkImageLayout imageLayout,
955 const VkClearDepthStencilValue* pDepthStencil,
Ian Elliotte924ab22015-07-08 13:24:30 -0600956 uint32_t rangeCount,
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600957 const VkImageSubresourceRange* pRanges)
Ian Elliotte924ab22015-07-08 13:24:30 -0600958{
959 NULLDRV_LOG_FUNC;
960}
961
Courtney Goeltzenleuchter9feb0732015-10-15 16:51:05 -0600962ICD_EXPORT void VKAPI vkCmdClearAttachments(
963 VkCmdBuffer cmdBuffer,
964 uint32_t attachmentCount,
965 const VkClearAttachment* pAttachments,
966 uint32_t rectCount,
Courtney Goeltzenleuchtera12e2912015-10-15 18:22:08 -0600967 const VkClearRect* pRects)
Ian Elliotte924ab22015-07-08 13:24:30 -0600968{
969 NULLDRV_LOG_FUNC;
970}
971
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600972ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600973 VkCmdBuffer cmdBuffer,
974 VkImage image,
975 VkImageLayout imageLayout,
Chris Forbese3105972015-06-24 14:34:53 +1200976 const VkClearColorValue *pColor,
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600977 uint32_t rangeCount,
978 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700979{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700980 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700981}
982
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600983ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600984 VkCmdBuffer cmdBuffer,
985 VkImage image,
986 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700987 float depth,
988 uint32_t stencil,
989 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600990 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700991{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700992 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700993}
994
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600995ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600996 VkCmdBuffer cmdBuffer,
997 VkImage srcImage,
998 VkImageLayout srcImageLayout,
999 VkImage destImage,
1000 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -06001001 uint32_t regionCount,
1002 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001003{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001004 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001005}
1006
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001007ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001008 VkCmdBuffer cmdBuffer,
1009 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001010 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001011 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001012{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001013 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001014}
1015
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001016ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001017 VkCmdBuffer cmdBuffer,
1018 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001019 uint32_t slot)
1020{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001021 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001022}
1023
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001024ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001025 VkCmdBuffer cmdBuffer,
1026 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001027 uint32_t startQuery,
1028 uint32_t queryCount)
1029{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001030 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001031}
1032
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001033ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001034 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001035 VkEvent event_,
1036 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001037{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001038 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001039}
1040
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001041ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001042 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001043 VkEvent event_,
1044 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001045{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001046 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001047}
1048
Ian Elliott63f1edb2015-04-16 18:10:19 -06001049ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1050 VkCmdBuffer cmdBuffer,
1051 VkQueryPool queryPool,
1052 uint32_t startQuery,
1053 uint32_t queryCount,
1054 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001055 VkDeviceSize destOffset,
1056 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001057 VkFlags flags)
1058{
1059 NULLDRV_LOG_FUNC;
1060}
1061
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001062ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001063 VkCmdBuffer cmdBuffer,
1064 VkTimestampType timestampType,
1065 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001066 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001067{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001068 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001069}
1070
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001071ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001072 VkCmdBuffer cmdBuffer,
Tony Barbourde4124d2015-07-03 10:33:54 -06001073 VkPipelineBindPoint pipelineBindPoint,
1074 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001075{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001076 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001077}
1078
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001079ICD_EXPORT void VKAPI vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports)
1080{
1081 NULLDRV_LOG_FUNC;
1082}
1083
1084ICD_EXPORT void VKAPI vkCmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors)
Tony Barbourde4124d2015-07-03 10:33:54 -06001085{
1086 NULLDRV_LOG_FUNC;
1087}
1088
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001089ICD_EXPORT void VKAPI vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth)
Cody Northropf5bd2252015-08-17 11:10:49 -06001090{
1091 NULLDRV_LOG_FUNC;
1092}
1093
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001094ICD_EXPORT void VKAPI vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias)
Tony Barbourde4124d2015-07-03 10:33:54 -06001095{
1096 NULLDRV_LOG_FUNC;
1097}
1098
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001099ICD_EXPORT void VKAPI vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4])
Tony Barbourde4124d2015-07-03 10:33:54 -06001100{
1101 NULLDRV_LOG_FUNC;
1102}
1103
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001104ICD_EXPORT void VKAPI vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds)
Cody Northrop2605cb02015-08-18 15:21:16 -06001105{
1106 NULLDRV_LOG_FUNC;
1107}
1108
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001109ICD_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask)
1110{
1111 NULLDRV_LOG_FUNC;
1112}
1113
1114ICD_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask)
1115{
1116 NULLDRV_LOG_FUNC;
1117}
1118
1119ICD_EXPORT void VKAPI vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference)
David Pinedo0257fbf2015-02-02 18:02:40 -07001120{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001121 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001122}
1123
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001124ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001125 VkCmdBuffer cmdBuffer,
1126 VkPipelineBindPoint pipelineBindPoint,
Mark Lobodzinskia65c4632015-06-15 13:21:21 -06001127 VkPipelineLayout layout,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001128 uint32_t firstSet,
1129 uint32_t setCount,
1130 const VkDescriptorSet* pDescriptorSets,
1131 uint32_t dynamicOffsetCount,
1132 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001133{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001134 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001135}
1136
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001137ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1138 VkCmdBuffer cmdBuffer,
1139 uint32_t startBinding,
1140 uint32_t bindingCount,
1141 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001142 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001143{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001144 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001145}
1146
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001147ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001148 VkCmdBuffer cmdBuffer,
1149 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001150 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001151 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001152{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001153 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001154}
1155
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001156ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001157 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001158 uint32_t vertexCount,
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001159 uint32_t instanceCount,
1160 uint32_t firstVertex,
1161 uint32_t firstInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001162{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001163 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001164}
1165
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001166ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001167 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001168 uint32_t indexCount,
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001169 uint32_t instanceCount,
1170 uint32_t firstIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001171 int32_t vertexOffset,
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001172 uint32_t firstInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001173{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001174 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001175}
1176
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001177ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001178 VkCmdBuffer cmdBuffer,
1179 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001180 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001181 uint32_t count,
1182 uint32_t stride)
1183{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001184 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001185}
1186
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001187ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001188 VkCmdBuffer cmdBuffer,
1189 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001190 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001191 uint32_t count,
1192 uint32_t stride)
1193{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001194 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001195}
1196
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001197ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001198 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001199 uint32_t x,
1200 uint32_t y,
1201 uint32_t z)
1202{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001203 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001204}
1205
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001206ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001207 VkCmdBuffer cmdBuffer,
1208 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001209 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001210{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001211 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001212}
1213
Tony Barbour8205d902015-04-16 15:59:00 -06001214void VKAPI vkCmdWaitEvents(
1215 VkCmdBuffer cmdBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001216 uint32_t eventCount,
1217 const VkEvent* pEvents,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001218 VkPipelineStageFlags sourceStageMask,
1219 VkPipelineStageFlags destStageMask,
Tony Barbour8205d902015-04-16 15:59:00 -06001220 uint32_t memBarrierCount,
Courtney Goeltzenleuchterd9ba3422015-07-12 12:58:58 -06001221 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001222{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001223 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001224}
1225
Tony Barbour8205d902015-04-16 15:59:00 -06001226void VKAPI vkCmdPipelineBarrier(
1227 VkCmdBuffer cmdBuffer,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001228 VkPipelineStageFlags srcStageMask,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001229 VkPipelineStageFlags destStageMask,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001230 VkBool32 byRegion,
Tony Barbour8205d902015-04-16 15:59:00 -06001231 uint32_t memBarrierCount,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001232 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001233{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001234 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001235}
1236
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001237ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001238 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001239 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001240 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001241{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001242 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001243 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1244 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1245}
1246
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001247ICD_EXPORT void VKAPI vkDestroyDevice(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001248 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001249{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001250 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001251}
1252
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001253ICD_EXPORT void VKAPI vkGetDeviceQueue(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001254 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001255 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001256 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001257 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001258{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001259 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001260 struct nulldrv_dev *dev = nulldrv_dev(device);
Mike Stroyan230e6252015-04-17 12:36:38 -06001261 *pQueue = (VkQueue) dev->queues[0];
David Pinedo0257fbf2015-02-02 18:02:40 -07001262}
1263
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001264ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1265 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001266{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001267 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001268 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001269}
1270
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001271ICD_EXPORT VkResult VKAPI vkCreateEvent(
1272 VkDevice device,
1273 const VkEventCreateInfo* pCreateInfo,
1274 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001275{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001276 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001277 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001278}
1279
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001280ICD_EXPORT void VKAPI vkDestroyEvent(
Tony Barbourde4124d2015-07-03 10:33:54 -06001281 VkDevice device,
1282 VkEvent event)
1283{
1284 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001285}
1286
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001287ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001288 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001289 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001290{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001291 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001292 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001293}
1294
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001295ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001296 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001297 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001298{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001299 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001300 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001301}
1302
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001303ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001304 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001305 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001306{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001307 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001308 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001309}
1310
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001311ICD_EXPORT VkResult VKAPI vkCreateFence(
1312 VkDevice device,
1313 const VkFenceCreateInfo* pCreateInfo,
1314 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001315{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001316 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001317 struct nulldrv_dev *dev = nulldrv_dev(device);
1318
1319 return nulldrv_fence_create(dev, pCreateInfo,
1320 (struct nulldrv_fence **) pFence);
1321}
1322
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001323ICD_EXPORT void VKAPI vkDestroyFence(
Tony Barbourde4124d2015-07-03 10:33:54 -06001324 VkDevice device,
1325 VkFence fence)
1326{
1327 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001328}
1329
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001330ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001331 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001332 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001333{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001334 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001335 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001336}
1337
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001338ICD_EXPORT VkResult VKAPI vkResetFences(
Courtney Goeltzenleuchterf2e33ad2015-06-18 17:28:20 -06001339 VkDevice device,
1340 uint32_t fenceCount,
1341 const VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001342{
1343 NULLDRV_LOG_FUNC;
1344 return VK_SUCCESS;
1345}
1346
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001347ICD_EXPORT VkResult VKAPI vkWaitForFences(
1348 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001349 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001350 const VkFence* pFences,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001351 VkBool32 waitAll,
David Pinedo0257fbf2015-02-02 18:02:40 -07001352 uint64_t timeout)
1353{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001354 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001355 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001356}
1357
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001358ICD_EXPORT void VKAPI vkGetPhysicalDeviceProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001359 VkPhysicalDevice gpu_,
1360 VkPhysicalDeviceProperties* pProperties)
David Pinedo0257fbf2015-02-02 18:02:40 -07001361{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001362 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001363
Tony Barbour426b9052015-06-24 16:06:58 -06001364 pProperties->apiVersion = VK_API_VERSION;
1365 pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's
1366 pProperties->vendorId = 0;
1367 pProperties->deviceId = 0;
1368 pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1369 strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
Ian Elliott64a68e12015-04-16 11:57:46 -06001370
Mark Lobodzinski7dae6862015-09-07 12:56:17 -06001371 /* TODO: fill out limits */
1372 memset(&pProperties->limits, 0, sizeof(VkPhysicalDeviceLimits));
1373 memset(&pProperties->sparseProperties, 0, sizeof(VkPhysicalDeviceSparseProperties));
David Pinedo0257fbf2015-02-02 18:02:40 -07001374}
1375
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001376ICD_EXPORT void VKAPI vkGetPhysicalDeviceFeatures(
Chris Forbesd7576302015-06-21 22:55:02 +12001377 VkPhysicalDevice physicalDevice,
1378 VkPhysicalDeviceFeatures* pFeatures)
1379{
1380 NULLDRV_LOG_FUNC;
Chris Forbesd7576302015-06-21 22:55:02 +12001381
1382 /* TODO: fill out features */
1383 memset(pFeatures, 0, sizeof(*pFeatures));
Chris Forbesd7576302015-06-21 22:55:02 +12001384}
1385
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001386ICD_EXPORT void VKAPI vkGetPhysicalDeviceFormatProperties(
Chris Forbesd7576302015-06-21 22:55:02 +12001387 VkPhysicalDevice physicalDevice,
1388 VkFormat format,
1389 VkFormatProperties* pFormatInfo)
1390{
1391 NULLDRV_LOG_FUNC;
Chris Forbesd7576302015-06-21 22:55:02 +12001392
1393 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1394 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
Mark Lobodzinski4b36dd42015-09-03 15:21:52 -06001395 pFormatInfo->bufferFeatures = 0;
Chris Forbesd7576302015-06-21 22:55:02 +12001396}
1397
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001398ICD_EXPORT void VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001399 VkPhysicalDevice gpu_,
Cody Northropef72e2a2015-08-03 17:04:53 -06001400 uint32_t* pCount,
1401 VkQueueFamilyProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001402 {
Cody Northropef72e2a2015-08-03 17:04:53 -06001403 if (pProperties == NULL) {
1404 *pCount = 1;
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001405 return;
Cody Northropef72e2a2015-08-03 17:04:53 -06001406 }
Tony Barbour426b9052015-06-24 16:06:58 -06001407 pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
1408 pProperties->queueCount = 1;
Courtney Goeltzenleuchter68535a62015-10-19 16:03:32 -06001409 pProperties->timestampValidBits = 0;
Tony Barbour426b9052015-06-24 16:06:58 -06001410}
1411
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001412ICD_EXPORT void VKAPI vkGetPhysicalDeviceMemoryProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001413 VkPhysicalDevice gpu_,
1414 VkPhysicalDeviceMemoryProperties* pProperties)
1415{
1416 // TODO: Fill in with real data
Ian Elliotte924ab22015-07-08 13:24:30 -06001417}
1418
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001419ICD_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001420 VkPhysicalDevice physicalDevice,
1421 uint32_t* pCount,
1422 VkLayerProperties* pProperties)
1423{
1424 // TODO: Fill in with real data
1425 return VK_SUCCESS;
1426}
1427
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001428ICD_EXPORT VkResult VKAPI vkEnumerateInstanceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001429 const char* pLayerName,
1430 uint32_t* pCount,
1431 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001432{
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001433 uint32_t copy_size;
Tony Barbour426b9052015-06-24 16:06:58 -06001434
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001435 if (pProperties == NULL) {
1436 *pCount = NULLDRV_EXT_COUNT;
1437 return VK_SUCCESS;
1438 }
Tony Barbour426b9052015-06-24 16:06:58 -06001439
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001440 copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT;
1441 memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties));
1442 *pCount = copy_size;
1443 if (copy_size < NULLDRV_EXT_COUNT) {
1444 return VK_INCOMPLETE;
1445 }
Tony Barbour426b9052015-06-24 16:06:58 -06001446 return VK_SUCCESS;
1447}
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001448ICD_EXPORT VkResult VKAPI vkEnumerateInstanceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001449 uint32_t* pCount,
1450 VkLayerProperties* pProperties)
1451{
1452 // TODO: Fill in with real data
1453 return VK_SUCCESS;
1454}
Tony Barbour426b9052015-06-24 16:06:58 -06001455
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001456VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001457 VkPhysicalDevice physicalDevice,
1458 const char* pLayerName,
1459 uint32_t* pCount,
1460 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001461{
Tony Barbour426b9052015-06-24 16:06:58 -06001462
Tony Barbour426b9052015-06-24 16:06:58 -06001463 *pCount = 0;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001464
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001465 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001466}
1467
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001468ICD_EXPORT VkResult VKAPI vkCreateImage(
1469 VkDevice device,
1470 const VkImageCreateInfo* pCreateInfo,
1471 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001472{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001473 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001474 struct nulldrv_dev *dev = nulldrv_dev(device);
1475
1476 return nulldrv_img_create(dev, pCreateInfo, false,
1477 (struct nulldrv_img **) pImage);
1478}
1479
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001480ICD_EXPORT void VKAPI vkDestroyImage(
Tony Barbourde4124d2015-07-03 10:33:54 -06001481 VkDevice device,
1482 VkImage image)
1483{
1484 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001485}
1486
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001487ICD_EXPORT void VKAPI vkGetImageSubresourceLayout(
Mike Stroyan230e6252015-04-17 12:36:38 -06001488 VkDevice device,
1489 VkImage image,
1490 const VkImageSubresource* pSubresource,
Tony Barbour426b9052015-06-24 16:06:58 -06001491 VkSubresourceLayout* pLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001492{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001493 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001494
Tony Barbour426b9052015-06-24 16:06:58 -06001495 pLayout->offset = 0;
1496 pLayout->size = 1;
1497 pLayout->rowPitch = 4;
1498 pLayout->depthPitch = 4;
David Pinedo0257fbf2015-02-02 18:02:40 -07001499}
1500
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001501ICD_EXPORT VkResult VKAPI vkAllocMemory(
1502 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001503 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001504 VkDeviceMemory* pMem)
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 struct nulldrv_dev *dev = nulldrv_dev(device);
1508
1509 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1510}
1511
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001512ICD_EXPORT void VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001513 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001514 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001515{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001516 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001517}
1518
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001519ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001520 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001521 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001522 VkDeviceSize offset,
1523 VkDeviceSize size,
1524 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001525 void** ppData)
1526{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001527 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001528 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1529 void *ptr = nulldrv_mem_map(mem, flags);
1530
1531 *ppData = ptr;
1532
Courtney Goeltzenleuchterac544f32015-09-14 18:01:17 -06001533 return (ptr) ? VK_SUCCESS : VK_ERROR_MEMORY_MAP_FAILED;
David Pinedo0257fbf2015-02-02 18:02:40 -07001534}
1535
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001536ICD_EXPORT void VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001537 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001538 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001539{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001540 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001541}
1542
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001543ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001544 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001545 uint32_t memRangeCount,
1546 const VkMappedMemoryRange* pMemRanges)
1547{
1548 NULLDRV_LOG_FUNC;
1549 return VK_SUCCESS;
1550}
1551
1552ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1553 VkDevice device,
1554 uint32_t memRangeCount,
1555 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001556{
1557 NULLDRV_LOG_FUNC;
1558 return VK_SUCCESS;
1559}
1560
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001561ICD_EXPORT void VKAPI vkGetDeviceMemoryCommitment(
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001562 VkDevice device,
1563 VkDeviceMemory memory,
1564 VkDeviceSize* pCommittedMemoryInBytes)
1565{
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001566}
1567
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001568ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001569 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001570 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001571{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001572 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001573 struct nulldrv_instance *inst;
1574
1575 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001576 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001577 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001578 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001579
Tony Barbour426b9052015-06-24 16:06:58 -06001580 inst->obj.base.get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -07001581
Mike Stroyan230e6252015-04-17 12:36:38 -06001582 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001583
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001584 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001585}
1586
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001587ICD_EXPORT void VKAPI vkDestroyInstance(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001588 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001589{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001590 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001591}
1592
Tony Barbour8205d902015-04-16 15:59:00 -06001593ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001594 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001595 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001596 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001597{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001598 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001599 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001600 struct nulldrv_gpu *gpu;
1601 *pGpuCount = 1;
1602 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001603 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001604 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001605 return ret;
1606}
1607
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001608ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001609 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001610 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001611 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001612 char* const* pOutLayers,
1613 void* pReserved)
1614{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001615 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001616 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001617}
1618
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001619ICD_EXPORT void VKAPI vkGetBufferMemoryRequirements(
Tony Barbourde4124d2015-07-03 10:33:54 -06001620 VkDevice device,
1621 VkBuffer buffer,
1622 VkMemoryRequirements* pMemoryRequirements)
1623{
1624 NULLDRV_LOG_FUNC;
1625 struct nulldrv_base *base = nulldrv_base((void*)buffer.handle);
1626
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001627 base->get_memory_requirements(base, pMemoryRequirements);
Tony Barbourde4124d2015-07-03 10:33:54 -06001628}
1629
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001630ICD_EXPORT void VKAPI vkGetImageMemoryRequirements(
Tony Barbourde4124d2015-07-03 10:33:54 -06001631 VkDevice device,
1632 VkImage image,
1633 VkMemoryRequirements* pMemoryRequirements)
1634{
1635 NULLDRV_LOG_FUNC;
1636 struct nulldrv_base *base = nulldrv_base((void*)image.handle);
1637
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001638 base->get_memory_requirements(base, pMemoryRequirements);
Tony Barbourde4124d2015-07-03 10:33:54 -06001639}
1640
1641ICD_EXPORT VkResult VKAPI vkBindBufferMemory(
1642 VkDevice device,
1643 VkBuffer buffer,
1644 VkDeviceMemory mem_,
1645 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001646{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001647 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001648 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001649}
1650
Tony Barbourde4124d2015-07-03 10:33:54 -06001651ICD_EXPORT VkResult VKAPI vkBindImageMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001652 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001653 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001654 VkDeviceMemory mem_,
1655 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001656{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001657 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001658 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001659}
1660
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001661ICD_EXPORT void VKAPI vkGetImageSparseMemoryRequirements(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001662 VkDevice device,
1663 VkImage image,
1664 uint32_t* pNumRequirements,
1665 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1666{
1667 NULLDRV_LOG_FUNC;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001668}
1669
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001670ICD_EXPORT void VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001671 VkPhysicalDevice physicalDevice,
1672 VkFormat format,
1673 VkImageType type,
1674 uint32_t samples,
1675 VkImageUsageFlags usage,
1676 VkImageTiling tiling,
1677 uint32_t* pNumProperties,
1678 VkSparseImageFormatProperties* pProperties)
1679{
1680 NULLDRV_LOG_FUNC;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001681}
1682
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001683ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001684 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001685 VkBuffer buffer,
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001686 uint32_t numBindings,
1687 const VkSparseMemoryBindInfo* pBindInfo)
1688{
1689 NULLDRV_LOG_FUNC;
1690 return VK_SUCCESS;
1691}
1692
1693ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(
1694 VkQueue queue,
1695 VkImage image,
1696 uint32_t numBindings,
1697 const VkSparseMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001698{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001699 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001700 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001701}
1702
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001703ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001704 VkQueue queue,
1705 VkImage image,
1706 uint32_t numBindings,
1707 const VkSparseImageMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001708{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001709 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001710 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001711}
Jon Ashburn0e249962015-07-10 09:41:15 -07001712ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
1713 VkDevice device,
1714 const VkPipelineCacheCreateInfo* pCreateInfo,
1715 VkPipelineCache* pPipelineCache)
1716{
David Pinedo0257fbf2015-02-02 18:02:40 -07001717
Jon Ashburn0e249962015-07-10 09:41:15 -07001718 NULLDRV_LOG_FUNC;
1719 return VK_SUCCESS;
1720}
1721
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001722ICD_EXPORT void VKAPI vkDestroyPipeline(
Tony Barbourde4124d2015-07-03 10:33:54 -06001723 VkDevice device,
1724 VkPipeline pipeline)
1725{
1726 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001727}
1728
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001729void VKAPI vkDestroyPipelineCache(
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06001730 VkDevice device,
1731 VkPipelineCache pipelineCache)
Jon Ashburn0e249962015-07-10 09:41:15 -07001732{
1733 NULLDRV_LOG_FUNC;
Jon Ashburn0e249962015-07-10 09:41:15 -07001734}
1735
1736ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize(
1737 VkDevice device,
1738 VkPipelineCache pipelineCache)
1739{
1740 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001741 return 0;
Jon Ashburn0e249962015-07-10 09:41:15 -07001742}
1743
1744ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
1745 VkDevice device,
1746 VkPipelineCache pipelineCache,
Courtney Goeltzenleuchter0ed02cf2015-10-16 09:58:26 -06001747 size_t dataSize,
Jon Ashburn0e249962015-07-10 09:41:15 -07001748 void* pData)
1749{
1750 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001751 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001752}
1753
1754ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
1755 VkDevice device,
1756 VkPipelineCache destCache,
1757 uint32_t srcCacheCount,
1758 const VkPipelineCache* pSrcCaches)
1759{
1760 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001761 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001762}
1763ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001764 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001765 VkPipelineCache pipelineCache,
1766 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001767 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1768 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001769{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001770 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001771 struct nulldrv_dev *dev = nulldrv_dev(device);
1772
1773 return graphics_pipeline_create(dev, pCreateInfo,
1774 (struct nulldrv_pipeline **) pPipeline);
1775}
1776
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001777
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001778
Jon Ashburn0e249962015-07-10 09:41:15 -07001779ICD_EXPORT VkResult VKAPI vkCreateComputePipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001780 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001781 VkPipelineCache pipelineCache,
1782 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001783 const VkComputePipelineCreateInfo* pCreateInfo,
1784 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001785{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001786 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001787 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001788}
1789
David Pinedo0257fbf2015-02-02 18:02:40 -07001790
David Pinedo0257fbf2015-02-02 18:02:40 -07001791
Jon Ashburn0e249962015-07-10 09:41:15 -07001792
David Pinedo0257fbf2015-02-02 18:02:40 -07001793
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001794ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1795 VkDevice device,
1796 const VkQueryPoolCreateInfo* pCreateInfo,
1797 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001798{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001799 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001800 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001801}
1802
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001803ICD_EXPORT void VKAPI vkDestroyQueryPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06001804 VkDevice device,
1805 VkQueryPool queryPoool)
1806{
1807 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001808}
1809
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001810ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001811 VkDevice device,
1812 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001813 uint32_t startQuery,
1814 uint32_t queryCount,
1815 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001816 void* pData,
1817 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001818{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001819 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001820 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001821}
1822
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001823ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1824 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001825{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001826 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001827 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001828}
1829
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001830ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1831 VkQueue queue_,
Courtney Goeltzenleuchter3ec31622015-10-20 18:04:07 -06001832 uint32_t submitCount,
1833 const VkSubmitInfo* pSubmitInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001834 VkFence fence_)
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 vkCreateSemaphore(
1841 VkDevice device,
1842 const VkSemaphoreCreateInfo* pCreateInfo,
1843 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001844{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001845 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001846 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001847}
1848
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001849ICD_EXPORT void VKAPI vkDestroySemaphore(
Tony Barbourde4124d2015-07-03 10:33:54 -06001850 VkDevice device,
1851 VkSemaphore semaphore)
1852{
1853 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001854}
1855
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001856ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1857 VkQueue queue,
1858 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001859{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001860 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001861 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001862}
1863
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001864ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1865 VkQueue queue,
1866 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001867{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001868 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001869 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001870}
1871
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001872ICD_EXPORT VkResult VKAPI vkCreateSampler(
1873 VkDevice device,
1874 const VkSamplerCreateInfo* pCreateInfo,
1875 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001876{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001877 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001878 struct nulldrv_dev *dev = nulldrv_dev(device);
1879
1880 return nulldrv_sampler_create(dev, pCreateInfo,
1881 (struct nulldrv_sampler **) pSampler);
1882}
1883
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001884ICD_EXPORT void VKAPI vkDestroySampler(
Tony Barbourde4124d2015-07-03 10:33:54 -06001885 VkDevice device,
1886 VkSampler sampler)
1887{
1888 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001889}
1890
Ian Elliotte924ab22015-07-08 13:24:30 -06001891ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
1892 VkDevice device,
1893 const VkShaderModuleCreateInfo* pCreateInfo,
1894 VkShaderModule* pShaderModule)
1895{
1896 // TODO: Fill in with real data
Tony Barbourde4124d2015-07-03 10:33:54 -06001897 NULLDRV_LOG_FUNC;
1898 return VK_SUCCESS;
1899}
1900
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001901ICD_EXPORT void VKAPI vkDestroyShaderModule(
Tony Barbourde4124d2015-07-03 10:33:54 -06001902 VkDevice device,
1903 VkShaderModule shaderModule)
1904{
1905 // TODO: Fill in with real data
1906 NULLDRV_LOG_FUNC;
Ian Elliotte924ab22015-07-08 13:24:30 -06001907}
1908
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001909ICD_EXPORT VkResult VKAPI vkCreateShader(
1910 VkDevice device,
1911 const VkShaderCreateInfo* pCreateInfo,
1912 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001913{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001914 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001915 struct nulldrv_dev *dev = nulldrv_dev(device);
1916
1917 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1918}
1919
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001920ICD_EXPORT void VKAPI vkDestroyShader(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001921 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001922 VkShader shader)
1923{
1924 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001925}
1926
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001927ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1928 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001929 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001930 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001931{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001932 NULLDRV_LOG_FUNC;
1933 struct nulldrv_dev *dev = nulldrv_dev(device);
1934
1935 return nulldrv_buf_view_create(dev, pCreateInfo,
1936 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001937}
1938
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001939ICD_EXPORT void VKAPI vkDestroyBufferView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001940 VkDevice device,
1941 VkBufferView bufferView)
1942{
1943 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001944}
1945
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001946ICD_EXPORT VkResult VKAPI vkCreateImageView(
1947 VkDevice device,
1948 const VkImageViewCreateInfo* pCreateInfo,
1949 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001950{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001951 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001952 struct nulldrv_dev *dev = nulldrv_dev(device);
1953
1954 return nulldrv_img_view_create(dev, pCreateInfo,
1955 (struct nulldrv_img_view **) pView);
1956}
1957
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001958ICD_EXPORT void VKAPI vkDestroyImageView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001959 VkDevice device,
1960 VkImageView imageView)
1961{
1962 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001963}
1964
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001965ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1966 VkDevice device,
1967 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1968 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001969{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001970 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001971 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001972
Chia-I Wu7732cb22015-03-26 15:27:55 +08001973 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001974 (struct nulldrv_desc_layout **) pSetLayout);
1975}
1976
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001977ICD_EXPORT void VKAPI vkDestroyDescriptorSetLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06001978 VkDevice device,
1979 VkDescriptorSetLayout descriptorSetLayout)
1980{
1981 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001982}
1983
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001984ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
1985 VkDevice device,
1986 const VkPipelineLayoutCreateInfo* pCreateInfo,
1987 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001988{
1989 NULLDRV_LOG_FUNC;
1990 struct nulldrv_dev *dev = nulldrv_dev(device);
1991
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001992 return nulldrv_pipeline_layout_create(dev,
1993 pCreateInfo,
1994 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08001995}
1996
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001997ICD_EXPORT void VKAPI vkDestroyPipelineLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06001998 VkDevice device,
1999 VkPipelineLayout pipelineLayout)
2000{
2001 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002002}
2003
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002004ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002005 VkDevice device,
2006 const VkDescriptorPoolCreateInfo* pCreateInfo,
2007 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002008{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002009 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002010 struct nulldrv_dev *dev = nulldrv_dev(device);
2011
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002012 return nulldrv_desc_pool_create(dev, pCreateInfo,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002013 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002014}
2015
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002016ICD_EXPORT void VKAPI vkDestroyDescriptorPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06002017 VkDevice device,
2018 VkDescriptorPool descriptorPool)
2019{
2020 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002021}
2022
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002023ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002024 VkDevice device,
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06002025 VkDescriptorPool descriptorPool,
2026 VkDescriptorPoolResetFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07002027{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002028 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002029 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002030}
2031
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002032ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002033 VkDevice device,
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06002034 const VkDescriptorSetAllocInfo* pAllocInfo,
2035 VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002036{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002037 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06002038 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(pAllocInfo->descriptorPool);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002039 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002040 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002041 uint32_t i;
2042
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06002043 for (i = 0; i < pAllocInfo->count; i++) {
David Pinedo0257fbf2015-02-02 18:02:40 -07002044 const struct nulldrv_desc_layout *layout =
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06002045 nulldrv_desc_layout(pAllocInfo->pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002046
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -06002047 ret = nulldrv_desc_set_create(dev, pool, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002048 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002049 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002050 break;
2051 }
2052
David Pinedo0257fbf2015-02-02 18:02:40 -07002053 return ret;
2054}
2055
Tony Barbourb857d312015-07-10 10:50:45 -06002056ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
2057 VkDevice device,
2058 VkDescriptorPool descriptorPool,
2059 uint32_t count,
2060 const VkDescriptorSet* pDescriptorSets)
2061{
2062 NULLDRV_LOG_FUNC;
2063 return VK_SUCCESS;
2064}
2065
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002066ICD_EXPORT void VKAPI vkUpdateDescriptorSets(
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002067 VkDevice device,
2068 uint32_t writeCount,
2069 const VkWriteDescriptorSet* pDescriptorWrites,
2070 uint32_t copyCount,
2071 const VkCopyDescriptorSet* pDescriptorCopies)
David Pinedo0257fbf2015-02-02 18:02:40 -07002072{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002073 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002074}
2075
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002076ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2077 VkDevice device,
2078 const VkFramebufferCreateInfo* info,
2079 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002080{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002081 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002082 struct nulldrv_dev *dev = nulldrv_dev(device);
2083
2084 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2085}
2086
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002087ICD_EXPORT void VKAPI vkDestroyFramebuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -06002088 VkDevice device,
2089 VkFramebuffer framebuffer)
2090{
2091 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002092}
David Pinedo0257fbf2015-02-02 18:02:40 -07002093
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002094ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2095 VkDevice device,
2096 const VkRenderPassCreateInfo* info,
2097 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002098{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002099 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002100 struct nulldrv_dev *dev = nulldrv_dev(device);
2101
2102 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2103}
2104
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002105ICD_EXPORT void VKAPI vkDestroyRenderPass(
Tony Barbourde4124d2015-07-03 10:33:54 -06002106 VkDevice device,
2107 VkRenderPass renderPass)
2108{
2109 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002110}
2111
Courtney Goeltzenleuchtera375b622015-07-27 14:04:01 -06002112ICD_EXPORT void VKAPI vkCmdPushConstants(
2113 VkCmdBuffer cmdBuffer,
2114 VkPipelineLayout layout,
2115 VkShaderStageFlags stageFlags,
2116 uint32_t start,
2117 uint32_t length,
2118 const void* values)
2119{
2120 /* TODO: Implement */
2121}
2122
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06002123ICD_EXPORT void VKAPI vkGetRenderAreaGranularity(
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002124 VkDevice device,
2125 VkRenderPass renderPass,
2126 VkExtent2D* pGranularity)
2127{
2128 pGranularity->height = 1;
2129 pGranularity->width = 1;
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002130}
2131
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002132ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Chia-I Wuc278df82015-07-07 11:50:03 +08002133 VkCmdBuffer cmdBuffer,
2134 const VkRenderPassBeginInfo* pRenderPassBegin,
2135 VkRenderPassContents contents)
2136{
2137 NULLDRV_LOG_FUNC;
2138}
2139
2140ICD_EXPORT void VKAPI vkCmdNextSubpass(
2141 VkCmdBuffer cmdBuffer,
2142 VkRenderPassContents contents)
David Pinedo0257fbf2015-02-02 18:02:40 -07002143{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002144 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002145}
2146
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002147ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08002148 VkCmdBuffer cmdBuffer)
2149{
2150 NULLDRV_LOG_FUNC;
2151}
2152
2153ICD_EXPORT void VKAPI vkCmdExecuteCommands(
2154 VkCmdBuffer cmdBuffer,
2155 uint32_t cmdBuffersCount,
2156 const VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -07002157{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002158 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002159}
Ian Elliottf93069f2015-02-19 14:26:19 -07002160
2161ICD_EXPORT void* xcbCreateWindow(
2162 uint16_t width,
2163 uint16_t height)
2164{
2165 static uint32_t window; // Kludge to the max
2166 NULLDRV_LOG_FUNC;
2167 return &window;
2168}
2169
2170// May not be needed, if we stub out stuf in tri.c
2171ICD_EXPORT void xcbDestroyWindow()
2172{
2173 NULLDRV_LOG_FUNC;
2174}
2175
2176ICD_EXPORT int xcbGetMessage(void *msg)
2177{
2178 NULLDRV_LOG_FUNC;
2179 return 0;
2180}
2181
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002182ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002183{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002184 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002185}
David Pinedo07494fd2015-07-24 10:54:41 -06002186
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06002187ICD_EXPORT void VKAPI vkGetPhysicalDeviceImageFormatProperties(
David Pinedo07494fd2015-07-24 10:54:41 -06002188 VkPhysicalDevice physicalDevice,
2189 VkFormat format,
2190 VkImageType type,
2191 VkImageTiling tiling,
2192 VkImageUsageFlags usage,
Courtney Goeltzenleuchter06d94a52015-09-17 11:21:14 -06002193 VkImageCreateFlags flags,
David Pinedo07494fd2015-07-24 10:54:41 -06002194 VkImageFormatProperties* pImageFormatProperties)
2195{
David Pinedo07494fd2015-07-24 10:54:41 -06002196}