blob: 2f082472b2ba3e6f69bce069dfbe0be7e63d4cf9 [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;
285 img->array_size = info->arraySize;
286 img->usage = info->usage;
David Pinedo0257fbf2015-02-02 18:02:40 -0700287 img->samples = info->samples;
288
Tony Barbour426b9052015-06-24 16:06:58 -0600289 img->obj.base.get_memory_requirements = img_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700290
291 *img_ret = img;
292
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600293 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700294}
295
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600296static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700297{
Tony Barbourde4124d2015-07-03 10:33:54 -0600298 return *(struct nulldrv_img **) &image;
David Pinedo0257fbf2015-02-02 18:02:40 -0700299}
300
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600301static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600302 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700303 struct nulldrv_mem **mem_ret)
304{
305 struct nulldrv_mem *mem;
306
307 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600308 VK_OBJECT_TYPE_DEVICE_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700309 if (!mem)
Tony Barbour8205d902015-04-16 15:59:00 -0600310 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700311
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700312 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700313 if (!mem->bo) {
Tony Barbour8205d902015-04-16 15:59:00 -0600314 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700315 }
316
317 mem->size = info->allocationSize;
318
319 *mem_ret = mem;
320
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600321 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700322}
323
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600324static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
325 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700326 struct nulldrv_sampler **sampler_ret)
327{
328 struct nulldrv_sampler *sampler;
329
330 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600331 sizeof(*sampler), VK_OBJECT_TYPE_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700332 if (!sampler)
Tony Barbour8205d902015-04-16 15:59:00 -0600333 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700334
335 *sampler_ret = sampler;
336
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600337 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700338}
339
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600340static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
341 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700342 struct nulldrv_img_view **view_ret)
343{
344 struct nulldrv_img *img = nulldrv_img(info->image);
345 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700346
347 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600348 VK_OBJECT_TYPE_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700349 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600350 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700351
352 view->img = img;
David Pinedo0257fbf2015-02-02 18:02:40 -0700353
David Pinedo0257fbf2015-02-02 18:02:40 -0700354 view->cmd_len = 8;
355
356 *view_ret = view;
357
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600358 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700359}
360
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600361static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700362{
363 return mem->bo;
364}
365
Tony Barbour8205d902015-04-16 15:59:00 -0600366static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700367{
Tony Barbourde4124d2015-07-03 10:33:54 -0600368 return *(struct nulldrv_mem **) &mem;
David Pinedo0257fbf2015-02-02 18:02:40 -0700369}
370
371static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
372{
373 return (struct nulldrv_buf *) base;
374}
375
Tony Barbour426b9052015-06-24 16:06:58 -0600376static VkResult buf_get_memory_requirements(struct nulldrv_base *base,
377 VkMemoryRequirements* pMemoryRequirements)
David Pinedo0257fbf2015-02-02 18:02:40 -0700378{
379 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
David Pinedo0257fbf2015-02-02 18:02:40 -0700380
Tony Barbour426b9052015-06-24 16:06:58 -0600381 if (pMemoryRequirements == NULL)
382 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700383
Tony Barbour426b9052015-06-24 16:06:58 -0600384 pMemoryRequirements->size = buf->size;
385 pMemoryRequirements->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700386
Tony Barbour426b9052015-06-24 16:06:58 -0600387 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700388}
389
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600390static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600391 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700392 struct nulldrv_buf **buf_ret)
393{
394 struct nulldrv_buf *buf;
395
396 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600397 VK_OBJECT_TYPE_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700398 if (!buf)
Tony Barbour8205d902015-04-16 15:59:00 -0600399 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700400
401 buf->size = info->size;
402 buf->usage = info->usage;
403
Tony Barbour426b9052015-06-24 16:06:58 -0600404 buf->obj.base.get_memory_requirements = buf_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700405
406 *buf_ret = buf;
407
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600408 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700409}
410
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600411static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
412 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700413 struct nulldrv_desc_layout **layout_ret)
414{
415 struct nulldrv_desc_layout *layout;
416
417 layout = (struct nulldrv_desc_layout *)
418 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600419 VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700420 if (!layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600421 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700422
423 *layout_ret = layout;
424
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600425 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700426}
427
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500428static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev,
429 const VkPipelineLayoutCreateInfo* pCreateInfo,
430 struct nulldrv_pipeline_layout **pipeline_layout_ret)
Chia-I Wu7732cb22015-03-26 15:27:55 +0800431{
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500432 struct nulldrv_pipeline_layout *pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800433
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500434 pipeline_layout = (struct nulldrv_pipeline_layout *)
435 nulldrv_base_create(dev, sizeof(*pipeline_layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600436 VK_OBJECT_TYPE_PIPELINE_LAYOUT);
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500437 if (!pipeline_layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600438 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800439
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500440 *pipeline_layout_ret = pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800441
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600442 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800443}
444
Tony Barbour8db65372015-07-10 18:32:33 -0600445static struct nulldrv_desc_layout *nulldrv_desc_layout(const VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700446{
Tony Barbourde4124d2015-07-03 10:33:54 -0600447 return *(struct nulldrv_desc_layout **) &layout;
David Pinedo0257fbf2015-02-02 18:02:40 -0700448}
449
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600450static VkResult shader_create(struct nulldrv_dev *dev,
451 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700452 struct nulldrv_shader **sh_ret)
453{
David Pinedo0257fbf2015-02-02 18:02:40 -0700454 struct nulldrv_shader *sh;
455
456 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600457 VK_OBJECT_TYPE_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700458 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600459 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700460
461 *sh_ret = sh;
462
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600463 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700464}
465
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600466static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
467 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700468 struct nulldrv_pipeline **pipeline_ret)
469{
470 struct nulldrv_pipeline *pipeline;
471
472 pipeline = (struct nulldrv_pipeline *)
473 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600474 VK_OBJECT_TYPE_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700475 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600476 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700477
478 *pipeline_ret = pipeline;
479
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600480 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700481}
482
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600483static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
484 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700485 struct nulldrv_cmd **cmd_ret)
486{
David Pinedo0257fbf2015-02-02 18:02:40 -0700487 struct nulldrv_cmd *cmd;
488
David Pinedo0257fbf2015-02-02 18:02:40 -0700489 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600490 VK_OBJECT_TYPE_COMMAND_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700491 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600492 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700493
494 *cmd_ret = cmd;
495
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600496 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700497}
498
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600499static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600500 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800501 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700502{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800503 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700504
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800505 pool = (struct nulldrv_desc_pool *)
506 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600507 VK_OBJECT_TYPE_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800508 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600509 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700510
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800511 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700512
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800513 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700514
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600515 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700516}
517
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600518static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800519 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600520 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700521 const struct nulldrv_desc_layout *layout,
522 struct nulldrv_desc_set **set_ret)
523{
524 struct nulldrv_desc_set *set;
525
526 set = (struct nulldrv_desc_set *)
527 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600528 VK_OBJECT_TYPE_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700529 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600530 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700531
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800532 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700533 set->layout = layout;
534 *set_ret = set;
535
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600536 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700537}
538
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600539static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700540{
Tony Barbourde4124d2015-07-03 10:33:54 -0600541 return *(struct nulldrv_desc_pool **) &pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700542}
543
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600544static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
545 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700546 struct nulldrv_framebuffer ** fb_ret)
547{
548
549 struct nulldrv_framebuffer *fb;
550 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600551 VK_OBJECT_TYPE_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700552 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600553 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700554
555 *fb_ret = fb;
556
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600557 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700558
559}
560
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600561static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
562 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700563 struct nulldrv_render_pass** rp_ret)
564{
565 struct nulldrv_render_pass *rp;
566 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600567 VK_OBJECT_TYPE_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700568 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600569 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700570
571 *rp_ret = rp;
572
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600573 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700574}
575
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600576static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700577{
Tony Barbourde4124d2015-07-03 10:33:54 -0600578 return *(struct nulldrv_buf **) &buf;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700579}
580
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600581static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600582 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700583 struct nulldrv_buf_view **view_ret)
584{
585 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
586 struct nulldrv_buf_view *view;
587
588 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600589 VK_OBJECT_TYPE_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700590 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600591 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700592
593 view->buf = buf;
594
595 *view_ret = view;
596
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600597 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700598}
599
David Pinedo0257fbf2015-02-02 18:02:40 -0700600
601//*********************************************
602// Driver entry points
603//*********************************************
604
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600605ICD_EXPORT VkResult VKAPI vkCreateBuffer(
606 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600607 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600608 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700609{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700610 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700611 struct nulldrv_dev *dev = nulldrv_dev(device);
612
613 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
614}
615
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600616ICD_EXPORT void VKAPI vkDestroyBuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -0600617 VkDevice device,
618 VkBuffer buffer)
619{
620 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -0600621}
622
Cody Northropf02f9f82015-07-09 18:08:05 -0600623ICD_EXPORT VkResult VKAPI vkCreateCommandPool(
624 VkDevice device,
625 const VkCmdPoolCreateInfo* pCreateInfo,
626 VkCmdPool* pCmdPool)
627{
628 NULLDRV_LOG_FUNC;
629 return VK_SUCCESS;
630}
631
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600632ICD_EXPORT void VKAPI vkDestroyCommandPool(
Cody Northropf02f9f82015-07-09 18:08:05 -0600633 VkDevice device,
634 VkCmdPool cmdPool)
635{
636 NULLDRV_LOG_FUNC;
Cody Northropf02f9f82015-07-09 18:08:05 -0600637}
638
639ICD_EXPORT VkResult VKAPI vkResetCommandPool(
640 VkDevice device,
641 VkCmdPool cmdPool,
642 VkCmdPoolResetFlags flags)
643{
644 NULLDRV_LOG_FUNC;
645 return VK_SUCCESS;
646}
647
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600648ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
649 VkDevice device,
650 const VkCmdBufferCreateInfo* pCreateInfo,
651 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700652{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700653 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700654 struct nulldrv_dev *dev = nulldrv_dev(device);
655
656 return nulldrv_cmd_create(dev, pCreateInfo,
657 (struct nulldrv_cmd **) pCmdBuffer);
658}
659
Mark Lobodzinski67b42b72015-09-07 13:59:43 -0600660ICD_EXPORT void VKAPI vkDestroyCommandBuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -0600661 VkDevice device,
662 VkCmdBuffer cmdBuffer)
663{
664 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -0600665}
666
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600667ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
668 VkCmdBuffer cmdBuffer,
669 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700670{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700671 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600672 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700673}
674
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600675ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
676 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700677{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700678 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600679 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700680}
681
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600682ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
Cody Northropf02f9f82015-07-09 18:08:05 -0600683 VkCmdBuffer cmdBuffer,
684 VkCmdBufferResetFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700685{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700686 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600687 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700688}
689
Ian Elliott64a68e12015-04-16 11:57:46 -0600690static const VkFormat nulldrv_presentable_formats[] = {
691 VK_FORMAT_B8G8R8A8_UNORM,
692};
693
Jon Ashburnba4a1952015-06-16 12:44:51 -0600694#if 0
Ian Elliott338dedb2015-08-21 15:09:33 -0600695ICD_EXPORT VkResult VKAPI vkGetDisplayInfoKHR(
696 VkDisplayKHR display,
697 VkDisplayInfoTypeKHR infoType,
Ian Elliott64a68e12015-04-16 11:57:46 -0600698 size_t* pDataSize,
699 void* pData)
700{
701 VkResult ret = VK_SUCCESS;
702
703 NULLDRV_LOG_FUNC;
704
705 if (!pDataSize)
706 return VK_ERROR_INVALID_POINTER;
707
708 switch (infoType) {
Ian Elliott338dedb2015-08-21 15:09:33 -0600709 case VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_KHR:
Ian Elliott64a68e12015-04-16 11:57:46 -0600710 {
Ian Elliott338dedb2015-08-21 15:09:33 -0600711 VkDisplayFormatPropertiesKHR *dst = pData;
Ian Elliott64a68e12015-04-16 11:57:46 -0600712 size_t size_ret;
713 uint32_t i;
714
715 size_ret = sizeof(*dst) * ARRAY_SIZE(nulldrv_presentable_formats);
716
717 if (dst && *pDataSize < size_ret)
718 return VK_ERROR_INVALID_VALUE;
719
720 *pDataSize = size_ret;
721 if (!dst)
722 return VK_SUCCESS;
723
724 for (i = 0; i < ARRAY_SIZE(nulldrv_presentable_formats); i++)
Ian Elliott338dedb2015-08-21 15:09:33 -0600725 dst[i].swapchainFormat = nulldrv_presentable_formats[i];
Ian Elliott64a68e12015-04-16 11:57:46 -0600726 }
727 break;
728 default:
729 ret = VK_ERROR_INVALID_VALUE;
730 break;
731 }
732
733 return ret;
734}
Jon Ashburnba4a1952015-06-16 12:44:51 -0600735#endif
Ian Elliott64a68e12015-04-16 11:57:46 -0600736
Ian Elliott338dedb2015-08-21 15:09:33 -0600737ICD_EXPORT VkResult VKAPI vkCreateSwapchainKHR(
Ian Elliott64a68e12015-04-16 11:57:46 -0600738 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600739 const VkSwapchainCreateInfoKHR* pCreateInfo,
740 VkSwapchainKHR* pSwapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600741{
742 NULLDRV_LOG_FUNC;
743 struct nulldrv_dev *dev = nulldrv_dev(device);
744 struct nulldrv_swap_chain *sc;
745
746 sc = (struct nulldrv_swap_chain *) nulldrv_base_create(dev, sizeof(*sc),
Ian Elliott338dedb2015-08-21 15:09:33 -0600747 VK_OBJECT_TYPE_SWAPCHAIN_KHR);
Ian Elliott64a68e12015-04-16 11:57:46 -0600748 if (!sc) {
749 return VK_ERROR_OUT_OF_HOST_MEMORY;
750 }
751 sc->dev = dev;
752
Ian Elliott338dedb2015-08-21 15:09:33 -0600753 *(VkSwapchainKHR **)pSwapchain = *(VkSwapchainKHR **)&sc;
Ian Elliott64a68e12015-04-16 11:57:46 -0600754
755 return VK_SUCCESS;
756}
757
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -0600758ICD_EXPORT VkResult VKAPI vkDestroySwapchainKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600759 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600760 VkSwapchainKHR swapchain)
Ian Elliott64a68e12015-04-16 11:57:46 -0600761{
762 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600763 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600764
765 free(sc);
766
767 return VK_SUCCESS;
768}
769
Ian Elliott338dedb2015-08-21 15:09:33 -0600770ICD_EXPORT VkResult VKAPI vkGetSwapchainImagesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600771 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600772 VkSwapchainKHR swapchain,
Ian Elliott3333bb42015-08-10 13:56:08 -0600773 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600774 VkImage* pSwapchainImages)
Ian Elliott64a68e12015-04-16 11:57:46 -0600775{
776 NULLDRV_LOG_FUNC;
Ian Elliott338dedb2015-08-21 15:09:33 -0600777 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapchain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600778 struct nulldrv_dev *dev = sc->dev;
779 VkResult ret = VK_SUCCESS;
780
Ian Elliott3333bb42015-08-10 13:56:08 -0600781 *pCount = 2;
Ian Elliott338dedb2015-08-21 15:09:33 -0600782 if (pSwapchainImages) {
Ian Elliott3333bb42015-08-10 13:56:08 -0600783 uint32_t i;
784 for (i = 0; i < 2; i++) {
Ian Elliott64a68e12015-04-16 11:57:46 -0600785 struct nulldrv_img *img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600786
787 img = (struct nulldrv_img *) nulldrv_base_create(dev,
788 sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600789 VK_OBJECT_TYPE_IMAGE);
Ian Elliott64a68e12015-04-16 11:57:46 -0600790 if (!img)
791 return VK_ERROR_OUT_OF_HOST_MEMORY;
Ian Elliott338dedb2015-08-21 15:09:33 -0600792 pSwapchainImages[i].handle = (uint64_t) &img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600793 }
Ian Elliott64a68e12015-04-16 11:57:46 -0600794 }
795
796 return ret;
797}
798
Ian Elliott338dedb2015-08-21 15:09:33 -0600799ICD_EXPORT VkResult VKAPI vkAcquireNextImageKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600800 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600801 VkSwapchainKHR swapchain,
Tony Barbour7910de72015-07-13 16:37:21 -0600802 uint64_t timeout,
803 VkSemaphore semaphore,
804 uint32_t* pImageIndex)
805{
806 NULLDRV_LOG_FUNC;
807
808 return VK_SUCCESS;
809}
810
Ian Elliott338dedb2015-08-21 15:09:33 -0600811VkResult VKAPI vkGetSurfacePropertiesKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600812 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600813 const VkSurfaceDescriptionKHR* pSurfaceDescription,
814 VkSurfacePropertiesKHR* pSurfaceProperties)
Ian Elliott3333bb42015-08-10 13:56:08 -0600815{
816 NULLDRV_LOG_FUNC;
817
818 return VK_SUCCESS;
819}
820
Ian Elliott338dedb2015-08-21 15:09:33 -0600821VkResult VKAPI vkGetSurfaceFormatsKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600822 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600823 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600824 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600825 VkSurfaceFormatKHR* pSurfaceFormats)
Ian Elliott3333bb42015-08-10 13:56:08 -0600826{
827 NULLDRV_LOG_FUNC;
828
829 return VK_SUCCESS;
830}
831
Ian Elliott338dedb2015-08-21 15:09:33 -0600832VkResult VKAPI vkGetSurfacePresentModesKHR(
Ian Elliott3333bb42015-08-10 13:56:08 -0600833 VkDevice device,
Ian Elliott338dedb2015-08-21 15:09:33 -0600834 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600835 uint32_t* pCount,
Ian Elliott338dedb2015-08-21 15:09:33 -0600836 VkPresentModeKHR* pPresentModes)
Tony Barbour7910de72015-07-13 16:37:21 -0600837{
838 NULLDRV_LOG_FUNC;
839
840 return VK_SUCCESS;
841}
842
Ian Elliott338dedb2015-08-21 15:09:33 -0600843ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportKHR(
Tony Barbour7910de72015-07-13 16:37:21 -0600844 VkPhysicalDevice physicalDevice,
845 uint32_t queueFamilyIndex,
Ian Elliott338dedb2015-08-21 15:09:33 -0600846 const VkSurfaceDescriptionKHR* pSurfaceDescription,
Tony Barbour7910de72015-07-13 16:37:21 -0600847 VkBool32* pSupported)
848{
849 NULLDRV_LOG_FUNC;
850
851 return VK_SUCCESS;
852}
853
Ian Elliott338dedb2015-08-21 15:09:33 -0600854ICD_EXPORT VkResult VKAPI vkQueuePresentKHR(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600855 VkQueue queue_,
Ian Elliott338dedb2015-08-21 15:09:33 -0600856 VkPresentInfoKHR* pPresentInfo)
Ian Elliott64a68e12015-04-16 11:57:46 -0600857{
858 NULLDRV_LOG_FUNC;
859
860 return VK_SUCCESS;
861}
862
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600863ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600864 VkCmdBuffer cmdBuffer,
865 VkBuffer srcBuffer,
866 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700867 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600868 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700869{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700870 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700871}
872
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600873ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600874 VkCmdBuffer cmdBuffer,
875 VkImage srcImage,
876 VkImageLayout srcImageLayout,
877 VkImage destImage,
878 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700879 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600880 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700881{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700882 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700883}
884
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600885ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600886 VkCmdBuffer cmdBuffer,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500887 VkImage srcImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600888 VkImageLayout srcImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500889 VkImage destImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600890 VkImageLayout destImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500891 uint32_t regionCount,
892 const VkImageBlit* pRegions,
893 VkTexFilter filter)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600894{
895 NULLDRV_LOG_FUNC;
896}
897
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600898ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600899 VkCmdBuffer cmdBuffer,
900 VkBuffer srcBuffer,
901 VkImage destImage,
902 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700903 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600904 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700905{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700906 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700907}
908
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600909ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600910 VkCmdBuffer cmdBuffer,
911 VkImage srcImage,
912 VkImageLayout srcImageLayout,
913 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700914 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600915 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700916{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700917 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700918}
919
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600920ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600921 VkCmdBuffer cmdBuffer,
922 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600923 VkDeviceSize destOffset,
924 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700925 const uint32_t* pData)
926{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700927 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700928}
929
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600930ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600931 VkCmdBuffer cmdBuffer,
932 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -0600933 VkDeviceSize destOffset,
934 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -0700935 uint32_t data)
936{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700937 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700938}
939
Ian Elliotte924ab22015-07-08 13:24:30 -0600940ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage(
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600941 VkCmdBuffer cmdBuffer,
942 VkImage image,
943 VkImageLayout imageLayout,
944 const VkClearDepthStencilValue* pDepthStencil,
Ian Elliotte924ab22015-07-08 13:24:30 -0600945 uint32_t rangeCount,
Courtney Goeltzenleuchter315ad992015-09-15 18:03:22 -0600946 const VkImageSubresourceRange* pRanges)
Ian Elliotte924ab22015-07-08 13:24:30 -0600947{
948 NULLDRV_LOG_FUNC;
949}
950
Courtney Goeltzenleuchter9feb0732015-10-15 16:51:05 -0600951ICD_EXPORT void VKAPI vkCmdClearAttachments(
952 VkCmdBuffer cmdBuffer,
953 uint32_t attachmentCount,
954 const VkClearAttachment* pAttachments,
955 uint32_t rectCount,
956 const VkRect3D* pRects)
Ian Elliotte924ab22015-07-08 13:24:30 -0600957{
958 NULLDRV_LOG_FUNC;
959}
960
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600961ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600962 VkCmdBuffer cmdBuffer,
963 VkImage image,
964 VkImageLayout imageLayout,
Chris Forbese3105972015-06-24 14:34:53 +1200965 const VkClearColorValue *pColor,
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -0600966 uint32_t rangeCount,
967 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700968{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700969 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700970}
971
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600972ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600973 VkCmdBuffer cmdBuffer,
974 VkImage image,
975 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700976 float depth,
977 uint32_t stencil,
978 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600979 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -0700980{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700981 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700982}
983
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600984ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600985 VkCmdBuffer cmdBuffer,
986 VkImage srcImage,
987 VkImageLayout srcImageLayout,
988 VkImage destImage,
989 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -0600990 uint32_t regionCount,
991 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700992{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700993 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700994}
995
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600996ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600997 VkCmdBuffer cmdBuffer,
998 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -0700999 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001000 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001001{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001002 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001003}
1004
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001005ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001006 VkCmdBuffer cmdBuffer,
1007 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001008 uint32_t slot)
1009{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001010 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001011}
1012
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001013ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001014 VkCmdBuffer cmdBuffer,
1015 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001016 uint32_t startQuery,
1017 uint32_t queryCount)
1018{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001019 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001020}
1021
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001022ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001023 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001024 VkEvent event_,
1025 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001026{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001027 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001028}
1029
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001030ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001031 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001032 VkEvent event_,
1033 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001034{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001035 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001036}
1037
Ian Elliott63f1edb2015-04-16 18:10:19 -06001038ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1039 VkCmdBuffer cmdBuffer,
1040 VkQueryPool queryPool,
1041 uint32_t startQuery,
1042 uint32_t queryCount,
1043 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001044 VkDeviceSize destOffset,
1045 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001046 VkFlags flags)
1047{
1048 NULLDRV_LOG_FUNC;
1049}
1050
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001051ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001052 VkCmdBuffer cmdBuffer,
1053 VkTimestampType timestampType,
1054 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001055 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001056{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001057 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001058}
1059
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001060ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001061 VkCmdBuffer cmdBuffer,
Tony Barbourde4124d2015-07-03 10:33:54 -06001062 VkPipelineBindPoint pipelineBindPoint,
1063 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001064{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001065 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001066}
1067
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -06001068ICD_EXPORT void VKAPI vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports)
1069{
1070 NULLDRV_LOG_FUNC;
1071}
1072
1073ICD_EXPORT void VKAPI vkCmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors)
Tony Barbourde4124d2015-07-03 10:33:54 -06001074{
1075 NULLDRV_LOG_FUNC;
1076}
1077
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001078ICD_EXPORT void VKAPI vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth)
Cody Northropf5bd2252015-08-17 11:10:49 -06001079{
1080 NULLDRV_LOG_FUNC;
1081}
1082
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001083ICD_EXPORT void VKAPI vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias)
Tony Barbourde4124d2015-07-03 10:33:54 -06001084{
1085 NULLDRV_LOG_FUNC;
1086}
1087
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001088ICD_EXPORT void VKAPI vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4])
Tony Barbourde4124d2015-07-03 10:33:54 -06001089{
1090 NULLDRV_LOG_FUNC;
1091}
1092
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001093ICD_EXPORT void VKAPI vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds)
Cody Northrop2605cb02015-08-18 15:21:16 -06001094{
1095 NULLDRV_LOG_FUNC;
1096}
1097
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -06001098ICD_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask)
1099{
1100 NULLDRV_LOG_FUNC;
1101}
1102
1103ICD_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask)
1104{
1105 NULLDRV_LOG_FUNC;
1106}
1107
1108ICD_EXPORT void VKAPI vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference)
David Pinedo0257fbf2015-02-02 18:02:40 -07001109{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001110 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001111}
1112
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001113ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001114 VkCmdBuffer cmdBuffer,
1115 VkPipelineBindPoint pipelineBindPoint,
Mark Lobodzinskia65c4632015-06-15 13:21:21 -06001116 VkPipelineLayout layout,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001117 uint32_t firstSet,
1118 uint32_t setCount,
1119 const VkDescriptorSet* pDescriptorSets,
1120 uint32_t dynamicOffsetCount,
1121 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001122{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001123 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001124}
1125
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001126ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1127 VkCmdBuffer cmdBuffer,
1128 uint32_t startBinding,
1129 uint32_t bindingCount,
1130 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001131 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001132{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001133 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001134}
1135
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001136ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001137 VkCmdBuffer cmdBuffer,
1138 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001139 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001140 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001141{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001142 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001143}
1144
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001145ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001146 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001147 uint32_t vertexCount,
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001148 uint32_t instanceCount,
1149 uint32_t firstVertex,
1150 uint32_t firstInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001151{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001152 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001153}
1154
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001155ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001156 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001157 uint32_t indexCount,
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001158 uint32_t instanceCount,
1159 uint32_t firstIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001160 int32_t vertexOffset,
Courtney Goeltzenleuchter4ff11cc2015-09-23 12:31:50 -06001161 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 vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001167 VkCmdBuffer cmdBuffer,
1168 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001169 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001170 uint32_t count,
1171 uint32_t stride)
1172{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001173 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001174}
1175
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001176ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001177 VkCmdBuffer cmdBuffer,
1178 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001179 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001180 uint32_t count,
1181 uint32_t stride)
1182{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001183 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001184}
1185
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001186ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001187 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001188 uint32_t x,
1189 uint32_t y,
1190 uint32_t z)
1191{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001192 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001193}
1194
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001195ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001196 VkCmdBuffer cmdBuffer,
1197 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001198 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001199{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001200 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001201}
1202
Tony Barbour8205d902015-04-16 15:59:00 -06001203void VKAPI vkCmdWaitEvents(
1204 VkCmdBuffer cmdBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001205 uint32_t eventCount,
1206 const VkEvent* pEvents,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001207 VkPipelineStageFlags sourceStageMask,
1208 VkPipelineStageFlags destStageMask,
Tony Barbour8205d902015-04-16 15:59:00 -06001209 uint32_t memBarrierCount,
Courtney Goeltzenleuchterd9ba3422015-07-12 12:58:58 -06001210 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001211{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001212 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001213}
1214
Tony Barbour8205d902015-04-16 15:59:00 -06001215void VKAPI vkCmdPipelineBarrier(
1216 VkCmdBuffer cmdBuffer,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001217 VkPipelineStageFlags srcStageMask,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001218 VkPipelineStageFlags destStageMask,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001219 VkBool32 byRegion,
Tony Barbour8205d902015-04-16 15:59:00 -06001220 uint32_t memBarrierCount,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -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
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001226ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001227 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001228 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001229 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001230{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001231 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001232 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1233 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1234}
1235
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001236ICD_EXPORT void VKAPI vkDestroyDevice(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001237 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001238{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001239 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001240}
1241
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001242ICD_EXPORT void VKAPI vkGetDeviceQueue(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001243 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001244 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001245 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001246 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001247{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001248 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001249 struct nulldrv_dev *dev = nulldrv_dev(device);
Mike Stroyan230e6252015-04-17 12:36:38 -06001250 *pQueue = (VkQueue) dev->queues[0];
David Pinedo0257fbf2015-02-02 18:02:40 -07001251}
1252
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001253ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1254 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001255{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001256 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001257 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001258}
1259
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001260ICD_EXPORT VkResult VKAPI vkCreateEvent(
1261 VkDevice device,
1262 const VkEventCreateInfo* pCreateInfo,
1263 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001264{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001265 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001266 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001267}
1268
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001269ICD_EXPORT void VKAPI vkDestroyEvent(
Tony Barbourde4124d2015-07-03 10:33:54 -06001270 VkDevice device,
1271 VkEvent event)
1272{
1273 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001274}
1275
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001276ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001277 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001278 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001279{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001280 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001281 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001282}
1283
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001284ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001285 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001286 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001287{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001288 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001289 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001290}
1291
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001292ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001293 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001294 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001295{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001296 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001297 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001298}
1299
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001300ICD_EXPORT VkResult VKAPI vkCreateFence(
1301 VkDevice device,
1302 const VkFenceCreateInfo* pCreateInfo,
1303 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001304{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001305 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001306 struct nulldrv_dev *dev = nulldrv_dev(device);
1307
1308 return nulldrv_fence_create(dev, pCreateInfo,
1309 (struct nulldrv_fence **) pFence);
1310}
1311
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001312ICD_EXPORT void VKAPI vkDestroyFence(
Tony Barbourde4124d2015-07-03 10:33:54 -06001313 VkDevice device,
1314 VkFence fence)
1315{
1316 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001317}
1318
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001319ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001320 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001321 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001322{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001323 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001324 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001325}
1326
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001327ICD_EXPORT VkResult VKAPI vkResetFences(
Courtney Goeltzenleuchterf2e33ad2015-06-18 17:28:20 -06001328 VkDevice device,
1329 uint32_t fenceCount,
1330 const VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001331{
1332 NULLDRV_LOG_FUNC;
1333 return VK_SUCCESS;
1334}
1335
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001336ICD_EXPORT VkResult VKAPI vkWaitForFences(
1337 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001338 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001339 const VkFence* pFences,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001340 VkBool32 waitAll,
David Pinedo0257fbf2015-02-02 18:02:40 -07001341 uint64_t timeout)
1342{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001343 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001344 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001345}
1346
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001347ICD_EXPORT void VKAPI vkGetPhysicalDeviceProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001348 VkPhysicalDevice gpu_,
1349 VkPhysicalDeviceProperties* pProperties)
David Pinedo0257fbf2015-02-02 18:02:40 -07001350{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001351 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001352
Tony Barbour426b9052015-06-24 16:06:58 -06001353 pProperties->apiVersion = VK_API_VERSION;
1354 pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's
1355 pProperties->vendorId = 0;
1356 pProperties->deviceId = 0;
1357 pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1358 strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
Ian Elliott64a68e12015-04-16 11:57:46 -06001359
Mark Lobodzinski7dae6862015-09-07 12:56:17 -06001360 /* TODO: fill out limits */
1361 memset(&pProperties->limits, 0, sizeof(VkPhysicalDeviceLimits));
1362 memset(&pProperties->sparseProperties, 0, sizeof(VkPhysicalDeviceSparseProperties));
David Pinedo0257fbf2015-02-02 18:02:40 -07001363}
1364
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001365ICD_EXPORT void VKAPI vkGetPhysicalDeviceFeatures(
Chris Forbesd7576302015-06-21 22:55:02 +12001366 VkPhysicalDevice physicalDevice,
1367 VkPhysicalDeviceFeatures* pFeatures)
1368{
1369 NULLDRV_LOG_FUNC;
Chris Forbesd7576302015-06-21 22:55:02 +12001370
1371 /* TODO: fill out features */
1372 memset(pFeatures, 0, sizeof(*pFeatures));
Chris Forbesd7576302015-06-21 22:55:02 +12001373}
1374
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001375ICD_EXPORT void VKAPI vkGetPhysicalDeviceFormatProperties(
Chris Forbesd7576302015-06-21 22:55:02 +12001376 VkPhysicalDevice physicalDevice,
1377 VkFormat format,
1378 VkFormatProperties* pFormatInfo)
1379{
1380 NULLDRV_LOG_FUNC;
Chris Forbesd7576302015-06-21 22:55:02 +12001381
1382 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1383 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
Mark Lobodzinski4b36dd42015-09-03 15:21:52 -06001384 pFormatInfo->bufferFeatures = 0;
Chris Forbesd7576302015-06-21 22:55:02 +12001385}
1386
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001387ICD_EXPORT void VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001388 VkPhysicalDevice gpu_,
Cody Northropef72e2a2015-08-03 17:04:53 -06001389 uint32_t* pCount,
1390 VkQueueFamilyProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001391 {
Cody Northropef72e2a2015-08-03 17:04:53 -06001392 if (pProperties == NULL) {
1393 *pCount = 1;
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001394 return;
Cody Northropef72e2a2015-08-03 17:04:53 -06001395 }
Tony Barbour426b9052015-06-24 16:06:58 -06001396 pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
1397 pProperties->queueCount = 1;
Courtney Goeltzenleuchter68535a62015-10-19 16:03:32 -06001398 pProperties->timestampValidBits = 0;
Tony Barbour426b9052015-06-24 16:06:58 -06001399}
1400
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001401ICD_EXPORT void VKAPI vkGetPhysicalDeviceMemoryProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001402 VkPhysicalDevice gpu_,
1403 VkPhysicalDeviceMemoryProperties* pProperties)
1404{
1405 // TODO: Fill in with real data
Ian Elliotte924ab22015-07-08 13:24:30 -06001406}
1407
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001408ICD_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001409 VkPhysicalDevice physicalDevice,
1410 uint32_t* pCount,
1411 VkLayerProperties* pProperties)
1412{
1413 // TODO: Fill in with real data
1414 return VK_SUCCESS;
1415}
1416
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001417ICD_EXPORT VkResult VKAPI vkEnumerateInstanceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001418 const char* pLayerName,
1419 uint32_t* pCount,
1420 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001421{
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001422 uint32_t copy_size;
Tony Barbour426b9052015-06-24 16:06:58 -06001423
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001424 if (pProperties == NULL) {
1425 *pCount = NULLDRV_EXT_COUNT;
1426 return VK_SUCCESS;
1427 }
Tony Barbour426b9052015-06-24 16:06:58 -06001428
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001429 copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT;
1430 memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties));
1431 *pCount = copy_size;
1432 if (copy_size < NULLDRV_EXT_COUNT) {
1433 return VK_INCOMPLETE;
1434 }
Tony Barbour426b9052015-06-24 16:06:58 -06001435 return VK_SUCCESS;
1436}
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001437ICD_EXPORT VkResult VKAPI vkEnumerateInstanceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001438 uint32_t* pCount,
1439 VkLayerProperties* pProperties)
1440{
1441 // TODO: Fill in with real data
1442 return VK_SUCCESS;
1443}
Tony Barbour426b9052015-06-24 16:06:58 -06001444
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001445VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001446 VkPhysicalDevice physicalDevice,
1447 const char* pLayerName,
1448 uint32_t* pCount,
1449 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001450{
Tony Barbour426b9052015-06-24 16:06:58 -06001451
Tony Barbour426b9052015-06-24 16:06:58 -06001452 *pCount = 0;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001453
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001454 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001455}
1456
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001457ICD_EXPORT VkResult VKAPI vkCreateImage(
1458 VkDevice device,
1459 const VkImageCreateInfo* pCreateInfo,
1460 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001461{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001462 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001463 struct nulldrv_dev *dev = nulldrv_dev(device);
1464
1465 return nulldrv_img_create(dev, pCreateInfo, false,
1466 (struct nulldrv_img **) pImage);
1467}
1468
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001469ICD_EXPORT void VKAPI vkDestroyImage(
Tony Barbourde4124d2015-07-03 10:33:54 -06001470 VkDevice device,
1471 VkImage image)
1472{
1473 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001474}
1475
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001476ICD_EXPORT void VKAPI vkGetImageSubresourceLayout(
Mike Stroyan230e6252015-04-17 12:36:38 -06001477 VkDevice device,
1478 VkImage image,
1479 const VkImageSubresource* pSubresource,
Tony Barbour426b9052015-06-24 16:06:58 -06001480 VkSubresourceLayout* pLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001481{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001482 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001483
Tony Barbour426b9052015-06-24 16:06:58 -06001484 pLayout->offset = 0;
1485 pLayout->size = 1;
1486 pLayout->rowPitch = 4;
1487 pLayout->depthPitch = 4;
David Pinedo0257fbf2015-02-02 18:02:40 -07001488}
1489
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001490ICD_EXPORT VkResult VKAPI vkAllocMemory(
1491 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001492 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001493 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001494{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001495 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001496 struct nulldrv_dev *dev = nulldrv_dev(device);
1497
1498 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1499}
1500
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001501ICD_EXPORT void VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001502 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001503 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001504{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001505 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001506}
1507
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001508ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001509 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001510 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001511 VkDeviceSize offset,
1512 VkDeviceSize size,
1513 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001514 void** ppData)
1515{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001516 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001517 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1518 void *ptr = nulldrv_mem_map(mem, flags);
1519
1520 *ppData = ptr;
1521
Courtney Goeltzenleuchterac544f32015-09-14 18:01:17 -06001522 return (ptr) ? VK_SUCCESS : VK_ERROR_MEMORY_MAP_FAILED;
David Pinedo0257fbf2015-02-02 18:02:40 -07001523}
1524
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001525ICD_EXPORT void VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001526 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001527 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001528{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001529 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001530}
1531
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001532ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001533 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001534 uint32_t memRangeCount,
1535 const VkMappedMemoryRange* pMemRanges)
1536{
1537 NULLDRV_LOG_FUNC;
1538 return VK_SUCCESS;
1539}
1540
1541ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1542 VkDevice device,
1543 uint32_t memRangeCount,
1544 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001545{
1546 NULLDRV_LOG_FUNC;
1547 return VK_SUCCESS;
1548}
1549
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001550ICD_EXPORT void VKAPI vkGetDeviceMemoryCommitment(
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001551 VkDevice device,
1552 VkDeviceMemory memory,
1553 VkDeviceSize* pCommittedMemoryInBytes)
1554{
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001555}
1556
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001557ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001558 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001559 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001560{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001561 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001562 struct nulldrv_instance *inst;
1563
1564 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001565 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001566 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001567 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001568
Tony Barbour426b9052015-06-24 16:06:58 -06001569 inst->obj.base.get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -07001570
Mike Stroyan230e6252015-04-17 12:36:38 -06001571 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001572
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001573 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001574}
1575
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001576ICD_EXPORT void VKAPI vkDestroyInstance(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001577 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001578{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001579 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001580}
1581
Tony Barbour8205d902015-04-16 15:59:00 -06001582ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001583 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001584 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001585 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001586{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001587 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001588 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001589 struct nulldrv_gpu *gpu;
1590 *pGpuCount = 1;
1591 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001592 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001593 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001594 return ret;
1595}
1596
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001597ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001598 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001599 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001600 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001601 char* const* pOutLayers,
1602 void* pReserved)
1603{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001604 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001605 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001606}
1607
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001608ICD_EXPORT void VKAPI vkGetBufferMemoryRequirements(
Tony Barbourde4124d2015-07-03 10:33:54 -06001609 VkDevice device,
1610 VkBuffer buffer,
1611 VkMemoryRequirements* pMemoryRequirements)
1612{
1613 NULLDRV_LOG_FUNC;
1614 struct nulldrv_base *base = nulldrv_base((void*)buffer.handle);
1615
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001616 base->get_memory_requirements(base, pMemoryRequirements);
Tony Barbourde4124d2015-07-03 10:33:54 -06001617}
1618
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001619ICD_EXPORT void VKAPI vkGetImageMemoryRequirements(
Tony Barbourde4124d2015-07-03 10:33:54 -06001620 VkDevice device,
1621 VkImage image,
1622 VkMemoryRequirements* pMemoryRequirements)
1623{
1624 NULLDRV_LOG_FUNC;
1625 struct nulldrv_base *base = nulldrv_base((void*)image.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
1630ICD_EXPORT VkResult VKAPI vkBindBufferMemory(
1631 VkDevice device,
1632 VkBuffer buffer,
1633 VkDeviceMemory mem_,
1634 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001635{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001636 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001637 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001638}
1639
Tony Barbourde4124d2015-07-03 10:33:54 -06001640ICD_EXPORT VkResult VKAPI vkBindImageMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001641 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001642 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001643 VkDeviceMemory mem_,
1644 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001645{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001646 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001647 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001648}
1649
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001650ICD_EXPORT void VKAPI vkGetImageSparseMemoryRequirements(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001651 VkDevice device,
1652 VkImage image,
1653 uint32_t* pNumRequirements,
1654 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1655{
1656 NULLDRV_LOG_FUNC;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001657}
1658
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06001659ICD_EXPORT void VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001660 VkPhysicalDevice physicalDevice,
1661 VkFormat format,
1662 VkImageType type,
1663 uint32_t samples,
1664 VkImageUsageFlags usage,
1665 VkImageTiling tiling,
1666 uint32_t* pNumProperties,
1667 VkSparseImageFormatProperties* pProperties)
1668{
1669 NULLDRV_LOG_FUNC;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001670}
1671
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001672ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001673 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001674 VkBuffer buffer,
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001675 uint32_t numBindings,
1676 const VkSparseMemoryBindInfo* pBindInfo)
1677{
1678 NULLDRV_LOG_FUNC;
1679 return VK_SUCCESS;
1680}
1681
1682ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(
1683 VkQueue queue,
1684 VkImage image,
1685 uint32_t numBindings,
1686 const VkSparseMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001687{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001688 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001689 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001690}
1691
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001692ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001693 VkQueue queue,
1694 VkImage image,
1695 uint32_t numBindings,
1696 const VkSparseImageMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001697{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001698 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001699 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001700}
Jon Ashburn0e249962015-07-10 09:41:15 -07001701ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
1702 VkDevice device,
1703 const VkPipelineCacheCreateInfo* pCreateInfo,
1704 VkPipelineCache* pPipelineCache)
1705{
David Pinedo0257fbf2015-02-02 18:02:40 -07001706
Jon Ashburn0e249962015-07-10 09:41:15 -07001707 NULLDRV_LOG_FUNC;
1708 return VK_SUCCESS;
1709}
1710
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001711ICD_EXPORT void VKAPI vkDestroyPipeline(
Tony Barbourde4124d2015-07-03 10:33:54 -06001712 VkDevice device,
1713 VkPipeline pipeline)
1714{
1715 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001716}
1717
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001718void VKAPI vkDestroyPipelineCache(
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06001719 VkDevice device,
1720 VkPipelineCache pipelineCache)
Jon Ashburn0e249962015-07-10 09:41:15 -07001721{
1722 NULLDRV_LOG_FUNC;
Jon Ashburn0e249962015-07-10 09:41:15 -07001723}
1724
1725ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize(
1726 VkDevice device,
1727 VkPipelineCache pipelineCache)
1728{
1729 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001730 return 0;
Jon Ashburn0e249962015-07-10 09:41:15 -07001731}
1732
1733ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
1734 VkDevice device,
1735 VkPipelineCache pipelineCache,
Courtney Goeltzenleuchter0ed02cf2015-10-16 09:58:26 -06001736 size_t dataSize,
Jon Ashburn0e249962015-07-10 09:41:15 -07001737 void* pData)
1738{
1739 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001740 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001741}
1742
1743ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
1744 VkDevice device,
1745 VkPipelineCache destCache,
1746 uint32_t srcCacheCount,
1747 const VkPipelineCache* pSrcCaches)
1748{
1749 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001750 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001751}
1752ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001753 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001754 VkPipelineCache pipelineCache,
1755 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001756 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1757 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001758{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001759 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001760 struct nulldrv_dev *dev = nulldrv_dev(device);
1761
1762 return graphics_pipeline_create(dev, pCreateInfo,
1763 (struct nulldrv_pipeline **) pPipeline);
1764}
1765
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001766
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001767
Jon Ashburn0e249962015-07-10 09:41:15 -07001768ICD_EXPORT VkResult VKAPI vkCreateComputePipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001769 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001770 VkPipelineCache pipelineCache,
1771 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001772 const VkComputePipelineCreateInfo* pCreateInfo,
1773 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001774{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001775 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001776 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001777}
1778
David Pinedo0257fbf2015-02-02 18:02:40 -07001779
David Pinedo0257fbf2015-02-02 18:02:40 -07001780
Jon Ashburn0e249962015-07-10 09:41:15 -07001781
David Pinedo0257fbf2015-02-02 18:02:40 -07001782
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001783ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1784 VkDevice device,
1785 const VkQueryPoolCreateInfo* pCreateInfo,
1786 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001787{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001788 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001789 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001790}
1791
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001792ICD_EXPORT void VKAPI vkDestroyQueryPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06001793 VkDevice device,
1794 VkQueryPool queryPoool)
1795{
1796 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001797}
1798
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001799ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001800 VkDevice device,
1801 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001802 uint32_t startQuery,
1803 uint32_t queryCount,
1804 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001805 void* pData,
1806 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001807{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001808 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001809 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001810}
1811
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001812ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1813 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001814{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001815 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001816 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001817}
1818
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001819ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1820 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001821 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001822 const VkCmdBuffer* pCmdBuffers,
1823 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001824{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001825 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001826 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001827}
1828
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001829ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1830 VkDevice device,
1831 const VkSemaphoreCreateInfo* pCreateInfo,
1832 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001833{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001834 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001835 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001836}
1837
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001838ICD_EXPORT void VKAPI vkDestroySemaphore(
Tony Barbourde4124d2015-07-03 10:33:54 -06001839 VkDevice device,
1840 VkSemaphore semaphore)
1841{
1842 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001843}
1844
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001845ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1846 VkQueue queue,
1847 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001848{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001849 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001850 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001851}
1852
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001853ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1854 VkQueue queue,
1855 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001856{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001857 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001858 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001859}
1860
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001861ICD_EXPORT VkResult VKAPI vkCreateSampler(
1862 VkDevice device,
1863 const VkSamplerCreateInfo* pCreateInfo,
1864 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001865{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001866 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001867 struct nulldrv_dev *dev = nulldrv_dev(device);
1868
1869 return nulldrv_sampler_create(dev, pCreateInfo,
1870 (struct nulldrv_sampler **) pSampler);
1871}
1872
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001873ICD_EXPORT void VKAPI vkDestroySampler(
Tony Barbourde4124d2015-07-03 10:33:54 -06001874 VkDevice device,
1875 VkSampler sampler)
1876{
1877 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001878}
1879
Ian Elliotte924ab22015-07-08 13:24:30 -06001880ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
1881 VkDevice device,
1882 const VkShaderModuleCreateInfo* pCreateInfo,
1883 VkShaderModule* pShaderModule)
1884{
1885 // TODO: Fill in with real data
Tony Barbourde4124d2015-07-03 10:33:54 -06001886 NULLDRV_LOG_FUNC;
1887 return VK_SUCCESS;
1888}
1889
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001890ICD_EXPORT void VKAPI vkDestroyShaderModule(
Tony Barbourde4124d2015-07-03 10:33:54 -06001891 VkDevice device,
1892 VkShaderModule shaderModule)
1893{
1894 // TODO: Fill in with real data
1895 NULLDRV_LOG_FUNC;
Ian Elliotte924ab22015-07-08 13:24:30 -06001896}
1897
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001898ICD_EXPORT VkResult VKAPI vkCreateShader(
1899 VkDevice device,
1900 const VkShaderCreateInfo* pCreateInfo,
1901 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001902{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001903 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001904 struct nulldrv_dev *dev = nulldrv_dev(device);
1905
1906 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1907}
1908
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001909ICD_EXPORT void VKAPI vkDestroyShader(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001910 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001911 VkShader shader)
1912{
1913 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001914}
1915
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001916ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1917 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001918 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001919 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001920{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001921 NULLDRV_LOG_FUNC;
1922 struct nulldrv_dev *dev = nulldrv_dev(device);
1923
1924 return nulldrv_buf_view_create(dev, pCreateInfo,
1925 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001926}
1927
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001928ICD_EXPORT void VKAPI vkDestroyBufferView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001929 VkDevice device,
1930 VkBufferView bufferView)
1931{
1932 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001933}
1934
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001935ICD_EXPORT VkResult VKAPI vkCreateImageView(
1936 VkDevice device,
1937 const VkImageViewCreateInfo* pCreateInfo,
1938 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001939{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001940 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001941 struct nulldrv_dev *dev = nulldrv_dev(device);
1942
1943 return nulldrv_img_view_create(dev, pCreateInfo,
1944 (struct nulldrv_img_view **) pView);
1945}
1946
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001947ICD_EXPORT void VKAPI vkDestroyImageView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001948 VkDevice device,
1949 VkImageView imageView)
1950{
1951 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001952}
1953
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001954ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1955 VkDevice device,
1956 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1957 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001958{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001959 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001960 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001961
Chia-I Wu7732cb22015-03-26 15:27:55 +08001962 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001963 (struct nulldrv_desc_layout **) pSetLayout);
1964}
1965
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001966ICD_EXPORT void VKAPI vkDestroyDescriptorSetLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06001967 VkDevice device,
1968 VkDescriptorSetLayout descriptorSetLayout)
1969{
1970 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001971}
1972
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001973ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
1974 VkDevice device,
1975 const VkPipelineLayoutCreateInfo* pCreateInfo,
1976 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001977{
1978 NULLDRV_LOG_FUNC;
1979 struct nulldrv_dev *dev = nulldrv_dev(device);
1980
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001981 return nulldrv_pipeline_layout_create(dev,
1982 pCreateInfo,
1983 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08001984}
1985
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001986ICD_EXPORT void VKAPI vkDestroyPipelineLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06001987 VkDevice device,
1988 VkPipelineLayout pipelineLayout)
1989{
1990 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001991}
1992
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001993ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06001994 VkDevice device,
1995 const VkDescriptorPoolCreateInfo* pCreateInfo,
1996 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001997{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001998 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001999 struct nulldrv_dev *dev = nulldrv_dev(device);
2000
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002001 return nulldrv_desc_pool_create(dev, pCreateInfo,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002002 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002003}
2004
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002005ICD_EXPORT void VKAPI vkDestroyDescriptorPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06002006 VkDevice device,
2007 VkDescriptorPool descriptorPool)
2008{
2009 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002010}
2011
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002012ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002013 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002014 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002015{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002016 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002017 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002018}
2019
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002020ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002021 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002022 VkDescriptorPool descriptorPool,
2023 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002024 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002025 const VkDescriptorSetLayout* pSetLayouts,
Cody Northropc8aa4a52015-08-03 12:47:29 -06002026 VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002027{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002028 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002029 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2030 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002031 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002032 uint32_t i;
2033
2034 for (i = 0; i < count; i++) {
2035 const struct nulldrv_desc_layout *layout =
Tony Barbour8db65372015-07-10 18:32:33 -06002036 nulldrv_desc_layout(pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002037
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002038 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002039 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002040 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002041 break;
2042 }
2043
David Pinedo0257fbf2015-02-02 18:02:40 -07002044 return ret;
2045}
2046
Tony Barbourb857d312015-07-10 10:50:45 -06002047ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
2048 VkDevice device,
2049 VkDescriptorPool descriptorPool,
2050 uint32_t count,
2051 const VkDescriptorSet* pDescriptorSets)
2052{
2053 NULLDRV_LOG_FUNC;
2054 return VK_SUCCESS;
2055}
2056
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002057ICD_EXPORT void VKAPI vkUpdateDescriptorSets(
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002058 VkDevice device,
2059 uint32_t writeCount,
2060 const VkWriteDescriptorSet* pDescriptorWrites,
2061 uint32_t copyCount,
2062 const VkCopyDescriptorSet* pDescriptorCopies)
David Pinedo0257fbf2015-02-02 18:02:40 -07002063{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002064 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002065}
2066
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002067ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2068 VkDevice device,
2069 const VkFramebufferCreateInfo* info,
2070 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002071{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002072 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002073 struct nulldrv_dev *dev = nulldrv_dev(device);
2074
2075 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2076}
2077
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002078ICD_EXPORT void VKAPI vkDestroyFramebuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -06002079 VkDevice device,
2080 VkFramebuffer framebuffer)
2081{
2082 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002083}
David Pinedo0257fbf2015-02-02 18:02:40 -07002084
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002085ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2086 VkDevice device,
2087 const VkRenderPassCreateInfo* info,
2088 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002089{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002090 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002091 struct nulldrv_dev *dev = nulldrv_dev(device);
2092
2093 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2094}
2095
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002096ICD_EXPORT void VKAPI vkDestroyRenderPass(
Tony Barbourde4124d2015-07-03 10:33:54 -06002097 VkDevice device,
2098 VkRenderPass renderPass)
2099{
2100 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002101}
2102
Courtney Goeltzenleuchtera375b622015-07-27 14:04:01 -06002103ICD_EXPORT void VKAPI vkCmdPushConstants(
2104 VkCmdBuffer cmdBuffer,
2105 VkPipelineLayout layout,
2106 VkShaderStageFlags stageFlags,
2107 uint32_t start,
2108 uint32_t length,
2109 const void* values)
2110{
2111 /* TODO: Implement */
2112}
2113
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06002114ICD_EXPORT void VKAPI vkGetRenderAreaGranularity(
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002115 VkDevice device,
2116 VkRenderPass renderPass,
2117 VkExtent2D* pGranularity)
2118{
2119 pGranularity->height = 1;
2120 pGranularity->width = 1;
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002121}
2122
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002123ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Chia-I Wuc278df82015-07-07 11:50:03 +08002124 VkCmdBuffer cmdBuffer,
2125 const VkRenderPassBeginInfo* pRenderPassBegin,
2126 VkRenderPassContents contents)
2127{
2128 NULLDRV_LOG_FUNC;
2129}
2130
2131ICD_EXPORT void VKAPI vkCmdNextSubpass(
2132 VkCmdBuffer cmdBuffer,
2133 VkRenderPassContents contents)
David Pinedo0257fbf2015-02-02 18:02:40 -07002134{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002135 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002136}
2137
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002138ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08002139 VkCmdBuffer cmdBuffer)
2140{
2141 NULLDRV_LOG_FUNC;
2142}
2143
2144ICD_EXPORT void VKAPI vkCmdExecuteCommands(
2145 VkCmdBuffer cmdBuffer,
2146 uint32_t cmdBuffersCount,
2147 const VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -07002148{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002149 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002150}
Ian Elliottf93069f2015-02-19 14:26:19 -07002151
2152ICD_EXPORT void* xcbCreateWindow(
2153 uint16_t width,
2154 uint16_t height)
2155{
2156 static uint32_t window; // Kludge to the max
2157 NULLDRV_LOG_FUNC;
2158 return &window;
2159}
2160
2161// May not be needed, if we stub out stuf in tri.c
2162ICD_EXPORT void xcbDestroyWindow()
2163{
2164 NULLDRV_LOG_FUNC;
2165}
2166
2167ICD_EXPORT int xcbGetMessage(void *msg)
2168{
2169 NULLDRV_LOG_FUNC;
2170 return 0;
2171}
2172
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002173ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002174{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002175 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002176}
David Pinedo07494fd2015-07-24 10:54:41 -06002177
Courtney Goeltzenleuchter01d2ae12015-10-20 16:40:38 -06002178ICD_EXPORT void VKAPI vkGetPhysicalDeviceImageFormatProperties(
David Pinedo07494fd2015-07-24 10:54:41 -06002179 VkPhysicalDevice physicalDevice,
2180 VkFormat format,
2181 VkImageType type,
2182 VkImageTiling tiling,
2183 VkImageUsageFlags usage,
Courtney Goeltzenleuchter06d94a52015-09-17 11:21:14 -06002184 VkImageCreateFlags flags,
David Pinedo07494fd2015-07-24 10:54:41 -06002185 VkImageFormatProperties* pImageFormatProperties)
2186{
David Pinedo07494fd2015-07-24 10:54:41 -06002187}