blob: 8dc8dc4323b5cd193dba1394202b1faac35f64a2 [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 Goeltzenleuchter382489d2015-04-10 08:34:15 -06001242ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1243 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];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001251 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001252}
1253
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001254ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1255 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001256{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001257 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001258 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001259}
1260
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001261ICD_EXPORT VkResult VKAPI vkCreateEvent(
1262 VkDevice device,
1263 const VkEventCreateInfo* pCreateInfo,
1264 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001265{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001266 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001267 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001268}
1269
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001270ICD_EXPORT void VKAPI vkDestroyEvent(
Tony Barbourde4124d2015-07-03 10:33:54 -06001271 VkDevice device,
1272 VkEvent event)
1273{
1274 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001275}
1276
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001277ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001278 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001279 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001280{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001281 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001282 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001283}
1284
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001285ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001286 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001287 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001288{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001289 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001290 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001291}
1292
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001293ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001294 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001295 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001296{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001297 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001298 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001299}
1300
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001301ICD_EXPORT VkResult VKAPI vkCreateFence(
1302 VkDevice device,
1303 const VkFenceCreateInfo* pCreateInfo,
1304 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001305{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001306 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001307 struct nulldrv_dev *dev = nulldrv_dev(device);
1308
1309 return nulldrv_fence_create(dev, pCreateInfo,
1310 (struct nulldrv_fence **) pFence);
1311}
1312
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001313ICD_EXPORT void VKAPI vkDestroyFence(
Tony Barbourde4124d2015-07-03 10:33:54 -06001314 VkDevice device,
1315 VkFence fence)
1316{
1317 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001318}
1319
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001320ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001321 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001322 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001323{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001324 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001325 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001326}
1327
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001328ICD_EXPORT VkResult VKAPI vkResetFences(
Courtney Goeltzenleuchterf2e33ad2015-06-18 17:28:20 -06001329 VkDevice device,
1330 uint32_t fenceCount,
1331 const VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001332{
1333 NULLDRV_LOG_FUNC;
1334 return VK_SUCCESS;
1335}
1336
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001337ICD_EXPORT VkResult VKAPI vkWaitForFences(
1338 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001339 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001340 const VkFence* pFences,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001341 VkBool32 waitAll,
David Pinedo0257fbf2015-02-02 18:02:40 -07001342 uint64_t timeout)
1343{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001344 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001345 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001346}
1347
Tony Barbour426b9052015-06-24 16:06:58 -06001348ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
1349 VkPhysicalDevice gpu_,
1350 VkPhysicalDeviceProperties* pProperties)
David Pinedo0257fbf2015-02-02 18:02:40 -07001351{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001352 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001353 VkResult ret = VK_SUCCESS;
1354
Tony Barbour426b9052015-06-24 16:06:58 -06001355 pProperties->apiVersion = VK_API_VERSION;
1356 pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's
1357 pProperties->vendorId = 0;
1358 pProperties->deviceId = 0;
1359 pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1360 strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
Ian Elliott64a68e12015-04-16 11:57:46 -06001361
Mark Lobodzinski7dae6862015-09-07 12:56:17 -06001362 /* TODO: fill out limits */
1363 memset(&pProperties->limits, 0, sizeof(VkPhysicalDeviceLimits));
1364 memset(&pProperties->sparseProperties, 0, sizeof(VkPhysicalDeviceSparseProperties));
Ian Elliott64a68e12015-04-16 11:57:46 -06001365 return ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001366}
1367
Chris Forbesd7576302015-06-21 22:55:02 +12001368ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
1369 VkPhysicalDevice physicalDevice,
1370 VkPhysicalDeviceFeatures* pFeatures)
1371{
1372 NULLDRV_LOG_FUNC;
1373 VkResult ret = VK_SUCCESS;
1374
1375 /* TODO: fill out features */
1376 memset(pFeatures, 0, sizeof(*pFeatures));
1377
1378 return ret;
1379}
1380
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -06001381ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties(
Chris Forbesd7576302015-06-21 22:55:02 +12001382 VkPhysicalDevice physicalDevice,
1383 VkFormat format,
1384 VkFormatProperties* pFormatInfo)
1385{
1386 NULLDRV_LOG_FUNC;
1387 VkResult ret = VK_SUCCESS;
1388
1389 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1390 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
Mark Lobodzinski4b36dd42015-09-03 15:21:52 -06001391 pFormatInfo->bufferFeatures = 0;
Chris Forbesd7576302015-06-21 22:55:02 +12001392
1393 return ret;
1394}
1395
Cody Northropef72e2a2015-08-03 17:04:53 -06001396ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001397 VkPhysicalDevice gpu_,
Cody Northropef72e2a2015-08-03 17:04:53 -06001398 uint32_t* pCount,
1399 VkQueueFamilyProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001400 {
Cody Northropef72e2a2015-08-03 17:04:53 -06001401 if (pProperties == NULL) {
1402 *pCount = 1;
1403 return VK_SUCCESS;
1404 }
Tony Barbour426b9052015-06-24 16:06:58 -06001405 pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
1406 pProperties->queueCount = 1;
Courtney Goeltzenleuchter68535a62015-10-19 16:03:32 -06001407 pProperties->timestampValidBits = 0;
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001408
Tony Barbour426b9052015-06-24 16:06:58 -06001409 return VK_SUCCESS;
1410}
1411
Ian Elliotte924ab22015-07-08 13:24:30 -06001412ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
1413 VkPhysicalDevice gpu_,
1414 VkPhysicalDeviceMemoryProperties* pProperties)
1415{
1416 // TODO: Fill in with real data
1417 return VK_SUCCESS;
1418}
1419
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001420ICD_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001421 VkPhysicalDevice physicalDevice,
1422 uint32_t* pCount,
1423 VkLayerProperties* pProperties)
1424{
1425 // TODO: Fill in with real data
1426 return VK_SUCCESS;
1427}
1428
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001429ICD_EXPORT VkResult VKAPI vkEnumerateInstanceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001430 const char* pLayerName,
1431 uint32_t* pCount,
1432 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001433{
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001434 uint32_t copy_size;
Tony Barbour426b9052015-06-24 16:06:58 -06001435
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001436 if (pProperties == NULL) {
1437 *pCount = NULLDRV_EXT_COUNT;
1438 return VK_SUCCESS;
1439 }
Tony Barbour426b9052015-06-24 16:06:58 -06001440
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001441 copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT;
1442 memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties));
1443 *pCount = copy_size;
1444 if (copy_size < NULLDRV_EXT_COUNT) {
1445 return VK_INCOMPLETE;
1446 }
Tony Barbour426b9052015-06-24 16:06:58 -06001447 return VK_SUCCESS;
1448}
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001449ICD_EXPORT VkResult VKAPI vkEnumerateInstanceLayerProperties(
Ian Elliotte924ab22015-07-08 13:24:30 -06001450 uint32_t* pCount,
1451 VkLayerProperties* pProperties)
1452{
1453 // TODO: Fill in with real data
1454 return VK_SUCCESS;
1455}
Tony Barbour426b9052015-06-24 16:06:58 -06001456
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -06001457VkResult VKAPI vkEnumerateDeviceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001458 VkPhysicalDevice physicalDevice,
1459 const char* pLayerName,
1460 uint32_t* pCount,
1461 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001462{
Tony Barbour426b9052015-06-24 16:06:58 -06001463
Tony Barbour426b9052015-06-24 16:06:58 -06001464 *pCount = 0;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001465
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001466 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001467}
1468
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001469ICD_EXPORT VkResult VKAPI vkCreateImage(
1470 VkDevice device,
1471 const VkImageCreateInfo* pCreateInfo,
1472 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001473{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001474 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001475 struct nulldrv_dev *dev = nulldrv_dev(device);
1476
1477 return nulldrv_img_create(dev, pCreateInfo, false,
1478 (struct nulldrv_img **) pImage);
1479}
1480
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001481ICD_EXPORT void VKAPI vkDestroyImage(
Tony Barbourde4124d2015-07-03 10:33:54 -06001482 VkDevice device,
1483 VkImage image)
1484{
1485 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001486}
1487
Tony Barbour426b9052015-06-24 16:06:58 -06001488ICD_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(
Mike Stroyan230e6252015-04-17 12:36:38 -06001489 VkDevice device,
1490 VkImage image,
1491 const VkImageSubresource* pSubresource,
Tony Barbour426b9052015-06-24 16:06:58 -06001492 VkSubresourceLayout* pLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001493{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001494 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001495
Tony Barbour426b9052015-06-24 16:06:58 -06001496 pLayout->offset = 0;
1497 pLayout->size = 1;
1498 pLayout->rowPitch = 4;
1499 pLayout->depthPitch = 4;
David Pinedo0257fbf2015-02-02 18:02:40 -07001500
Tony Barbour426b9052015-06-24 16:06:58 -06001501 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001502}
1503
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001504ICD_EXPORT VkResult VKAPI vkAllocMemory(
1505 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001506 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001507 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001508{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001509 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001510 struct nulldrv_dev *dev = nulldrv_dev(device);
1511
1512 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1513}
1514
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001515ICD_EXPORT void VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001516 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001517 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001518{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001519 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001520}
1521
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001522ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001523 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001524 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001525 VkDeviceSize offset,
1526 VkDeviceSize size,
1527 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001528 void** ppData)
1529{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001530 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001531 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1532 void *ptr = nulldrv_mem_map(mem, flags);
1533
1534 *ppData = ptr;
1535
Courtney Goeltzenleuchterac544f32015-09-14 18:01:17 -06001536 return (ptr) ? VK_SUCCESS : VK_ERROR_MEMORY_MAP_FAILED;
David Pinedo0257fbf2015-02-02 18:02:40 -07001537}
1538
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001539ICD_EXPORT void VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001540 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001541 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001542{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001543 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001544}
1545
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001546ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001547 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001548 uint32_t memRangeCount,
1549 const VkMappedMemoryRange* pMemRanges)
1550{
1551 NULLDRV_LOG_FUNC;
1552 return VK_SUCCESS;
1553}
1554
1555ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1556 VkDevice device,
1557 uint32_t memRangeCount,
1558 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001559{
1560 NULLDRV_LOG_FUNC;
1561 return VK_SUCCESS;
1562}
1563
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001564ICD_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(
1565 VkDevice device,
1566 VkDeviceMemory memory,
1567 VkDeviceSize* pCommittedMemoryInBytes)
1568{
1569 return VK_SUCCESS;
1570}
1571
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001572ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001573 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001574 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001575{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001576 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001577 struct nulldrv_instance *inst;
1578
1579 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001580 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001581 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001582 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001583
Tony Barbour426b9052015-06-24 16:06:58 -06001584 inst->obj.base.get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -07001585
Mike Stroyan230e6252015-04-17 12:36:38 -06001586 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001587
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001588 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001589}
1590
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001591ICD_EXPORT void VKAPI vkDestroyInstance(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001592 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001593{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001594 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001595}
1596
Tony Barbour8205d902015-04-16 15:59:00 -06001597ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001598 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001599 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001600 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001601{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001602 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001603 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001604 struct nulldrv_gpu *gpu;
1605 *pGpuCount = 1;
1606 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001607 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001608 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001609 return ret;
1610}
1611
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001612ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001613 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001614 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001615 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001616 char* const* pOutLayers,
1617 void* pReserved)
1618{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001619 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001620 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001621}
1622
Tony Barbourde4124d2015-07-03 10:33:54 -06001623ICD_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(
1624 VkDevice device,
1625 VkBuffer buffer,
1626 VkMemoryRequirements* pMemoryRequirements)
1627{
1628 NULLDRV_LOG_FUNC;
1629 struct nulldrv_base *base = nulldrv_base((void*)buffer.handle);
1630
1631 return base->get_memory_requirements(base, pMemoryRequirements);
1632}
1633
1634ICD_EXPORT VkResult VKAPI vkGetImageMemoryRequirements(
1635 VkDevice device,
1636 VkImage image,
1637 VkMemoryRequirements* pMemoryRequirements)
1638{
1639 NULLDRV_LOG_FUNC;
1640 struct nulldrv_base *base = nulldrv_base((void*)image.handle);
1641
1642 return base->get_memory_requirements(base, pMemoryRequirements);
1643}
1644
1645ICD_EXPORT VkResult VKAPI vkBindBufferMemory(
1646 VkDevice device,
1647 VkBuffer buffer,
1648 VkDeviceMemory mem_,
1649 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001650{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001651 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001652 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001653}
1654
Tony Barbourde4124d2015-07-03 10:33:54 -06001655ICD_EXPORT VkResult VKAPI vkBindImageMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001656 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001657 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001658 VkDeviceMemory mem_,
1659 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001660{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001661 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001662 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001663}
1664
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001665ICD_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(
1666 VkDevice device,
1667 VkImage image,
1668 uint32_t* pNumRequirements,
1669 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1670{
1671 NULLDRV_LOG_FUNC;
1672 return VK_SUCCESS;
1673}
1674
1675ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(
1676 VkPhysicalDevice physicalDevice,
1677 VkFormat format,
1678 VkImageType type,
1679 uint32_t samples,
1680 VkImageUsageFlags usage,
1681 VkImageTiling tiling,
1682 uint32_t* pNumProperties,
1683 VkSparseImageFormatProperties* pProperties)
1684{
1685 NULLDRV_LOG_FUNC;
1686 return VK_SUCCESS;
1687}
1688
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001689ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001690 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001691 VkBuffer buffer,
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001692 uint32_t numBindings,
1693 const VkSparseMemoryBindInfo* pBindInfo)
1694{
1695 NULLDRV_LOG_FUNC;
1696 return VK_SUCCESS;
1697}
1698
1699ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(
1700 VkQueue queue,
1701 VkImage image,
1702 uint32_t numBindings,
1703 const VkSparseMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001704{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001705 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001706 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001707}
1708
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001709ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001710 VkQueue queue,
1711 VkImage image,
1712 uint32_t numBindings,
1713 const VkSparseImageMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001714{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001715 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001716 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001717}
Jon Ashburn0e249962015-07-10 09:41:15 -07001718ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
1719 VkDevice device,
1720 const VkPipelineCacheCreateInfo* pCreateInfo,
1721 VkPipelineCache* pPipelineCache)
1722{
David Pinedo0257fbf2015-02-02 18:02:40 -07001723
Jon Ashburn0e249962015-07-10 09:41:15 -07001724 NULLDRV_LOG_FUNC;
1725 return VK_SUCCESS;
1726}
1727
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001728ICD_EXPORT void VKAPI vkDestroyPipeline(
Tony Barbourde4124d2015-07-03 10:33:54 -06001729 VkDevice device,
1730 VkPipeline pipeline)
1731{
1732 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001733}
1734
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001735void VKAPI vkDestroyPipelineCache(
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06001736 VkDevice device,
1737 VkPipelineCache pipelineCache)
Jon Ashburn0e249962015-07-10 09:41:15 -07001738{
1739 NULLDRV_LOG_FUNC;
Jon Ashburn0e249962015-07-10 09:41:15 -07001740}
1741
1742ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize(
1743 VkDevice device,
1744 VkPipelineCache pipelineCache)
1745{
1746 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001747 return 0;
Jon Ashburn0e249962015-07-10 09:41:15 -07001748}
1749
1750ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
1751 VkDevice device,
1752 VkPipelineCache pipelineCache,
Courtney Goeltzenleuchter0ed02cf2015-10-16 09:58:26 -06001753 size_t dataSize,
Jon Ashburn0e249962015-07-10 09:41:15 -07001754 void* pData)
1755{
1756 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001757 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001758}
1759
1760ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
1761 VkDevice device,
1762 VkPipelineCache destCache,
1763 uint32_t srcCacheCount,
1764 const VkPipelineCache* pSrcCaches)
1765{
1766 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06001767 return VK_ERROR_INITIALIZATION_FAILED;
Jon Ashburn0e249962015-07-10 09:41:15 -07001768}
1769ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001770 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001771 VkPipelineCache pipelineCache,
1772 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001773 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1774 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001775{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001776 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001777 struct nulldrv_dev *dev = nulldrv_dev(device);
1778
1779 return graphics_pipeline_create(dev, pCreateInfo,
1780 (struct nulldrv_pipeline **) pPipeline);
1781}
1782
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001783
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001784
Jon Ashburn0e249962015-07-10 09:41:15 -07001785ICD_EXPORT VkResult VKAPI vkCreateComputePipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001786 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001787 VkPipelineCache pipelineCache,
1788 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001789 const VkComputePipelineCreateInfo* pCreateInfo,
1790 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001791{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001792 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001793 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001794}
1795
David Pinedo0257fbf2015-02-02 18:02:40 -07001796
David Pinedo0257fbf2015-02-02 18:02:40 -07001797
Jon Ashburn0e249962015-07-10 09:41:15 -07001798
David Pinedo0257fbf2015-02-02 18:02:40 -07001799
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001800ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1801 VkDevice device,
1802 const VkQueryPoolCreateInfo* pCreateInfo,
1803 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001804{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001805 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001806 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001807}
1808
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001809ICD_EXPORT void VKAPI vkDestroyQueryPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06001810 VkDevice device,
1811 VkQueryPool queryPoool)
1812{
1813 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001814}
1815
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001816ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001817 VkDevice device,
1818 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001819 uint32_t startQuery,
1820 uint32_t queryCount,
1821 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001822 void* pData,
1823 VkQueryResultFlags flags)
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 vkQueueWaitIdle(
1830 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001831{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001832 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001833 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001834}
1835
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001836ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1837 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001838 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001839 const VkCmdBuffer* pCmdBuffers,
1840 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001841{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001842 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001843 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001844}
1845
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001846ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1847 VkDevice device,
1848 const VkSemaphoreCreateInfo* pCreateInfo,
1849 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001850{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001851 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001852 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001853}
1854
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001855ICD_EXPORT void VKAPI vkDestroySemaphore(
Tony Barbourde4124d2015-07-03 10:33:54 -06001856 VkDevice device,
1857 VkSemaphore semaphore)
1858{
1859 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001860}
1861
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001862ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1863 VkQueue queue,
1864 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001865{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001866 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001867 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001868}
1869
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001870ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1871 VkQueue queue,
1872 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001873{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001874 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001875 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001876}
1877
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001878ICD_EXPORT VkResult VKAPI vkCreateSampler(
1879 VkDevice device,
1880 const VkSamplerCreateInfo* pCreateInfo,
1881 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001882{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001883 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001884 struct nulldrv_dev *dev = nulldrv_dev(device);
1885
1886 return nulldrv_sampler_create(dev, pCreateInfo,
1887 (struct nulldrv_sampler **) pSampler);
1888}
1889
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001890ICD_EXPORT void VKAPI vkDestroySampler(
Tony Barbourde4124d2015-07-03 10:33:54 -06001891 VkDevice device,
1892 VkSampler sampler)
1893{
1894 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001895}
1896
Ian Elliotte924ab22015-07-08 13:24:30 -06001897ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
1898 VkDevice device,
1899 const VkShaderModuleCreateInfo* pCreateInfo,
1900 VkShaderModule* pShaderModule)
1901{
1902 // TODO: Fill in with real data
Tony Barbourde4124d2015-07-03 10:33:54 -06001903 NULLDRV_LOG_FUNC;
1904 return VK_SUCCESS;
1905}
1906
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001907ICD_EXPORT void VKAPI vkDestroyShaderModule(
Tony Barbourde4124d2015-07-03 10:33:54 -06001908 VkDevice device,
1909 VkShaderModule shaderModule)
1910{
1911 // TODO: Fill in with real data
1912 NULLDRV_LOG_FUNC;
Ian Elliotte924ab22015-07-08 13:24:30 -06001913}
1914
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001915ICD_EXPORT VkResult VKAPI vkCreateShader(
1916 VkDevice device,
1917 const VkShaderCreateInfo* pCreateInfo,
1918 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07001919{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001920 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001921 struct nulldrv_dev *dev = nulldrv_dev(device);
1922
1923 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
1924}
1925
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001926ICD_EXPORT void VKAPI vkDestroyShader(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001927 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001928 VkShader shader)
1929{
1930 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001931}
1932
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001933ICD_EXPORT VkResult VKAPI vkCreateBufferView(
1934 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001935 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001936 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001937{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001938 NULLDRV_LOG_FUNC;
1939 struct nulldrv_dev *dev = nulldrv_dev(device);
1940
1941 return nulldrv_buf_view_create(dev, pCreateInfo,
1942 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07001943}
1944
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001945ICD_EXPORT void VKAPI vkDestroyBufferView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001946 VkDevice device,
1947 VkBufferView bufferView)
1948{
1949 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001950}
1951
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001952ICD_EXPORT VkResult VKAPI vkCreateImageView(
1953 VkDevice device,
1954 const VkImageViewCreateInfo* pCreateInfo,
1955 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07001956{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001957 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001958 struct nulldrv_dev *dev = nulldrv_dev(device);
1959
1960 return nulldrv_img_view_create(dev, pCreateInfo,
1961 (struct nulldrv_img_view **) pView);
1962}
1963
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001964ICD_EXPORT void VKAPI vkDestroyImageView(
Tony Barbourde4124d2015-07-03 10:33:54 -06001965 VkDevice device,
1966 VkImageView imageView)
1967{
1968 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001969}
1970
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001971ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
1972 VkDevice device,
1973 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
1974 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001975{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001976 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001977 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07001978
Chia-I Wu7732cb22015-03-26 15:27:55 +08001979 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07001980 (struct nulldrv_desc_layout **) pSetLayout);
1981}
1982
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06001983ICD_EXPORT void VKAPI vkDestroyDescriptorSetLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06001984 VkDevice device,
1985 VkDescriptorSetLayout descriptorSetLayout)
1986{
1987 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06001988}
1989
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001990ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
1991 VkDevice device,
1992 const VkPipelineLayoutCreateInfo* pCreateInfo,
1993 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08001994{
1995 NULLDRV_LOG_FUNC;
1996 struct nulldrv_dev *dev = nulldrv_dev(device);
1997
Mark Lobodzinski556f7212015-04-17 14:11:39 -05001998 return nulldrv_pipeline_layout_create(dev,
1999 pCreateInfo,
2000 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08002001}
2002
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002003ICD_EXPORT void VKAPI vkDestroyPipelineLayout(
Tony Barbourde4124d2015-07-03 10:33:54 -06002004 VkDevice device,
2005 VkPipelineLayout pipelineLayout)
2006{
2007 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002008}
2009
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002010ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002011 VkDevice device,
2012 const VkDescriptorPoolCreateInfo* pCreateInfo,
2013 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002014{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002015 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002016 struct nulldrv_dev *dev = nulldrv_dev(device);
2017
Courtney Goeltzenleuchterd9e966a2015-09-16 16:12:45 -06002018 return nulldrv_desc_pool_create(dev, pCreateInfo,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002019 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002020}
2021
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002022ICD_EXPORT void VKAPI vkDestroyDescriptorPool(
Tony Barbourde4124d2015-07-03 10:33:54 -06002023 VkDevice device,
2024 VkDescriptorPool descriptorPool)
2025{
2026 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002027}
2028
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002029ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002030 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002031 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002032{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002033 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002034 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002035}
2036
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002037ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002038 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002039 VkDescriptorPool descriptorPool,
2040 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002041 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002042 const VkDescriptorSetLayout* pSetLayouts,
Cody Northropc8aa4a52015-08-03 12:47:29 -06002043 VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002044{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002045 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002046 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2047 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002048 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002049 uint32_t i;
2050
2051 for (i = 0; i < count; i++) {
2052 const struct nulldrv_desc_layout *layout =
Tony Barbour8db65372015-07-10 18:32:33 -06002053 nulldrv_desc_layout(pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002054
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002055 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002056 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002057 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002058 break;
2059 }
2060
David Pinedo0257fbf2015-02-02 18:02:40 -07002061 return ret;
2062}
2063
Tony Barbourb857d312015-07-10 10:50:45 -06002064ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
2065 VkDevice device,
2066 VkDescriptorPool descriptorPool,
2067 uint32_t count,
2068 const VkDescriptorSet* pDescriptorSets)
2069{
2070 NULLDRV_LOG_FUNC;
2071 return VK_SUCCESS;
2072}
2073
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002074ICD_EXPORT void VKAPI vkUpdateDescriptorSets(
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002075 VkDevice device,
2076 uint32_t writeCount,
2077 const VkWriteDescriptorSet* pDescriptorWrites,
2078 uint32_t copyCount,
2079 const VkCopyDescriptorSet* pDescriptorCopies)
David Pinedo0257fbf2015-02-02 18:02:40 -07002080{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002081 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002082}
2083
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002084ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2085 VkDevice device,
2086 const VkFramebufferCreateInfo* info,
2087 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002088{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002089 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002090 struct nulldrv_dev *dev = nulldrv_dev(device);
2091
2092 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2093}
2094
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002095ICD_EXPORT void VKAPI vkDestroyFramebuffer(
Tony Barbourde4124d2015-07-03 10:33:54 -06002096 VkDevice device,
2097 VkFramebuffer framebuffer)
2098{
2099 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002100}
David Pinedo0257fbf2015-02-02 18:02:40 -07002101
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002102ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2103 VkDevice device,
2104 const VkRenderPassCreateInfo* info,
2105 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002106{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002107 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002108 struct nulldrv_dev *dev = nulldrv_dev(device);
2109
2110 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2111}
2112
Mark Lobodzinski67b42b72015-09-07 13:59:43 -06002113ICD_EXPORT void VKAPI vkDestroyRenderPass(
Tony Barbourde4124d2015-07-03 10:33:54 -06002114 VkDevice device,
2115 VkRenderPass renderPass)
2116{
2117 NULLDRV_LOG_FUNC;
Tony Barbourde4124d2015-07-03 10:33:54 -06002118}
2119
Courtney Goeltzenleuchtera375b622015-07-27 14:04:01 -06002120ICD_EXPORT void VKAPI vkCmdPushConstants(
2121 VkCmdBuffer cmdBuffer,
2122 VkPipelineLayout layout,
2123 VkShaderStageFlags stageFlags,
2124 uint32_t start,
2125 uint32_t length,
2126 const void* values)
2127{
2128 /* TODO: Implement */
2129}
2130
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002131ICD_EXPORT VkResult VKAPI vkGetRenderAreaGranularity(
2132 VkDevice device,
2133 VkRenderPass renderPass,
2134 VkExtent2D* pGranularity)
2135{
2136 pGranularity->height = 1;
2137 pGranularity->width = 1;
2138
2139 return VK_SUCCESS;
2140}
2141
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002142ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Chia-I Wuc278df82015-07-07 11:50:03 +08002143 VkCmdBuffer cmdBuffer,
2144 const VkRenderPassBeginInfo* pRenderPassBegin,
2145 VkRenderPassContents contents)
2146{
2147 NULLDRV_LOG_FUNC;
2148}
2149
2150ICD_EXPORT void VKAPI vkCmdNextSubpass(
2151 VkCmdBuffer cmdBuffer,
2152 VkRenderPassContents contents)
David Pinedo0257fbf2015-02-02 18:02:40 -07002153{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002154 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002155}
2156
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002157ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08002158 VkCmdBuffer cmdBuffer)
2159{
2160 NULLDRV_LOG_FUNC;
2161}
2162
2163ICD_EXPORT void VKAPI vkCmdExecuteCommands(
2164 VkCmdBuffer cmdBuffer,
2165 uint32_t cmdBuffersCount,
2166 const VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -07002167{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002168 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002169}
Ian Elliottf93069f2015-02-19 14:26:19 -07002170
2171ICD_EXPORT void* xcbCreateWindow(
2172 uint16_t width,
2173 uint16_t height)
2174{
2175 static uint32_t window; // Kludge to the max
2176 NULLDRV_LOG_FUNC;
2177 return &window;
2178}
2179
2180// May not be needed, if we stub out stuf in tri.c
2181ICD_EXPORT void xcbDestroyWindow()
2182{
2183 NULLDRV_LOG_FUNC;
2184}
2185
2186ICD_EXPORT int xcbGetMessage(void *msg)
2187{
2188 NULLDRV_LOG_FUNC;
2189 return 0;
2190}
2191
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002192ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002193{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002194 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002195}
David Pinedo07494fd2015-07-24 10:54:41 -06002196
2197ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties(
2198 VkPhysicalDevice physicalDevice,
2199 VkFormat format,
2200 VkImageType type,
2201 VkImageTiling tiling,
2202 VkImageUsageFlags usage,
Courtney Goeltzenleuchter06d94a52015-09-17 11:21:14 -06002203 VkImageCreateFlags flags,
David Pinedo07494fd2015-07-24 10:54:41 -06002204 VkImageFormatProperties* pImageFormatProperties)
2205{
Courtney Goeltzenleuchter08854b22015-09-10 11:23:57 -06002206 return VK_ERROR_INITIALIZATION_FAILED;
David Pinedo07494fd2015-07-24 10:54:41 -06002207}