blob: 9111dcd47d0c44cbb39c5121d8c9b08fcb03017c [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 Elliott53bd3dc2015-07-06 14:29:31 -060043 [NULLDRV_EXT_WSI_SWAPCHAIN] = VK_WSI_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 Elliott53bd3dc2015-07-06 14:29:31 -060047 .extName = VK_WSI_SWAPCHAIN_EXTENSION_NAME,
48 .specVersion = VK_WSI_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 Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600129 const VkDeviceQueueCreateInfo *queues,
David Pinedo0257fbf2015-02-02 18:02:40 -0700130 uint32_t count)
131{
132 uint32_t i;
133
134 if (!count)
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600135 return VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700136
137 for (i = 0; i < count; i++) {
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600138 const VkDeviceQueueCreateInfo *q = &queues[i];
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600139 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700140
Tony Barbour29b12062015-07-13 13:37:24 -0600141 if (q->queueCount == 1 && !dev->queues[q->queueFamilyIndex]) {
142 ret = nulldrv_queue_create(dev, q->queueFamilyIndex,
143 &dev->queues[q->queueFamilyIndex]);
David Pinedo0257fbf2015-02-02 18:02:40 -0700144 }
145 else {
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600146 ret = VK_ERROR_INVALID_POINTER;
David Pinedo0257fbf2015-02-02 18:02:40 -0700147 }
148
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600149 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700150 return ret;
151 }
152 }
153
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600154 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700155}
156
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600157static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(
158 const struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600159 const char* extName)
David Pinedo0257fbf2015-02-02 18:02:40 -0700160{
161 enum nulldrv_ext_type type;
162
163 for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) {
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600164 if (strcmp(nulldrv_gpu_exts[type], extName) == 0)
David Pinedo0257fbf2015-02-02 18:02:40 -0700165 break;
166 }
167
168 assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID);
169
170 return type;
171}
172
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600173static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800174 struct nulldrv_desc_ooxx **ooxx_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700175{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800176 struct nulldrv_desc_ooxx *ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700177
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800178 ooxx = malloc(sizeof(*ooxx));
179 if (!ooxx)
Tony Barbour8205d902015-04-16 15:59:00 -0600180 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700181
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800182 memset(ooxx, 0, sizeof(*ooxx));
David Pinedo0257fbf2015-02-02 18:02:40 -0700183
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800184 ooxx->surface_desc_size = 0;
185 ooxx->sampler_desc_size = 0;
David Pinedo0257fbf2015-02-02 18:02:40 -0700186
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800187 *ooxx_ret = ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700188
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600189 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700190}
191
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600192static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600193 const VkDeviceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700194 struct nulldrv_dev **dev_ret)
195{
196 struct nulldrv_dev *dev;
197 uint32_t i;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600198 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -0700199
200 dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600201 VK_OBJECT_TYPE_DEVICE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700202 if (!dev)
Tony Barbour8205d902015-04-16 15:59:00 -0600203 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700204
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600205 for (i = 0; i < info->extensionCount; i++) {
206 const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(
207 gpu,
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -0600208 info->ppEnabledExtensionNames[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -0700209
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600210 if (ext == NULLDRV_EXT_INVALID)
211 return VK_ERROR_INVALID_EXTENSION;
David Pinedo0257fbf2015-02-02 18:02:40 -0700212
Courtney Goeltzenleuchtere023ff42015-06-01 15:10:03 -0600213 dev->exts[ext] = true;
214 }
David Pinedo0257fbf2015-02-02 18:02:40 -0700215
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800216 ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx);
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 ret = dev_create_queues(dev, info->pRequestedQueues,
222 info->queueRecordCount);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600223 if (ret != VK_SUCCESS) {
David Pinedo0257fbf2015-02-02 18:02:40 -0700224 return ret;
225 }
226
227 *dev_ret = dev;
228
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600229 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700230}
231
Tony Barbour8205d902015-04-16 15:59:00 -0600232static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalDevice gpu)
David Pinedo0257fbf2015-02-02 18:02:40 -0700233{
234 return (struct nulldrv_gpu *) gpu;
235}
236
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600237static VkResult nulldrv_rt_view_create(struct nulldrv_dev *dev,
Chia-I Wuc278df82015-07-07 11:50:03 +0800238 const VkAttachmentViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700239 struct nulldrv_rt_view **view_ret)
240{
241 struct nulldrv_rt_view *view;
242
243 view = (struct nulldrv_rt_view *) nulldrv_base_create(dev, sizeof(*view),
Chia-I Wuc278df82015-07-07 11:50:03 +0800244 VK_OBJECT_TYPE_ATTACHMENT_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700245 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600246 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700247
248 *view_ret = view;
249
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600250 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700251}
252
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600253static VkResult nulldrv_fence_create(struct nulldrv_dev *dev,
254 const VkFenceCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700255 struct nulldrv_fence **fence_ret)
256{
257 struct nulldrv_fence *fence;
258
259 fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600260 VK_OBJECT_TYPE_FENCE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700261 if (!fence)
Tony Barbour8205d902015-04-16 15:59:00 -0600262 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700263
264 *fence_ret = fence;
265
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600266 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700267}
268
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600269static struct nulldrv_dev *nulldrv_dev(VkDevice dev)
David Pinedo0257fbf2015-02-02 18:02:40 -0700270{
271 return (struct nulldrv_dev *) dev;
272}
273
274static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base)
275{
276 return (struct nulldrv_img *) base;
277}
278
279
Tony Barbour426b9052015-06-24 16:06:58 -0600280static VkResult img_get_memory_requirements(struct nulldrv_base *base,
281 VkMemoryRequirements *pRequirements)
David Pinedo0257fbf2015-02-02 18:02:40 -0700282{
283 struct nulldrv_img *img = nulldrv_img_from_base(base);
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600284 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700285
Tony Barbour426b9052015-06-24 16:06:58 -0600286 pRequirements->size = img->total_size;
287 pRequirements->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700288
289 return ret;
290}
291
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600292static VkResult nulldrv_img_create(struct nulldrv_dev *dev,
293 const VkImageCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700294 bool scanout,
295 struct nulldrv_img **img_ret)
296{
297 struct nulldrv_img *img;
298
299 img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600300 VK_OBJECT_TYPE_IMAGE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700301 if (!img)
Tony Barbour8205d902015-04-16 15:59:00 -0600302 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700303
304 img->type = info->imageType;
305 img->depth = info->extent.depth;
306 img->mip_levels = info->mipLevels;
307 img->array_size = info->arraySize;
308 img->usage = info->usage;
David Pinedo0257fbf2015-02-02 18:02:40 -0700309 img->samples = info->samples;
310
Tony Barbour426b9052015-06-24 16:06:58 -0600311 img->obj.base.get_memory_requirements = img_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700312
313 *img_ret = img;
314
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600315 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700316}
317
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600318static struct nulldrv_img *nulldrv_img(VkImage image)
David Pinedo0257fbf2015-02-02 18:02:40 -0700319{
Tony Barbourde4124d2015-07-03 10:33:54 -0600320 return *(struct nulldrv_img **) &image;
David Pinedo0257fbf2015-02-02 18:02:40 -0700321}
322
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600323static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600324 const VkMemoryAllocInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700325 struct nulldrv_mem **mem_ret)
326{
327 struct nulldrv_mem *mem;
328
329 mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600330 VK_OBJECT_TYPE_DEVICE_MEMORY);
David Pinedo0257fbf2015-02-02 18:02:40 -0700331 if (!mem)
Tony Barbour8205d902015-04-16 15:59:00 -0600332 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700333
Chia-I Wub5ed9e62015-03-05 14:26:54 -0700334 mem->bo = malloc(info->allocationSize);
David Pinedo0257fbf2015-02-02 18:02:40 -0700335 if (!mem->bo) {
Tony Barbour8205d902015-04-16 15:59:00 -0600336 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700337 }
338
339 mem->size = info->allocationSize;
340
341 *mem_ret = mem;
342
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600343 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700344}
345
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600346static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev,
347 const VkSamplerCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700348 struct nulldrv_sampler **sampler_ret)
349{
350 struct nulldrv_sampler *sampler;
351
352 sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600353 sizeof(*sampler), VK_OBJECT_TYPE_SAMPLER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700354 if (!sampler)
Tony Barbour8205d902015-04-16 15:59:00 -0600355 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700356
357 *sampler_ret = sampler;
358
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600359 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700360}
361
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600362static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev,
363 const VkImageViewCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700364 struct nulldrv_img_view **view_ret)
365{
366 struct nulldrv_img *img = nulldrv_img(info->image);
367 struct nulldrv_img_view *view;
David Pinedo0257fbf2015-02-02 18:02:40 -0700368
369 view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600370 VK_OBJECT_TYPE_IMAGE_VIEW);
David Pinedo0257fbf2015-02-02 18:02:40 -0700371 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600372 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700373
374 view->img = img;
David Pinedo0257fbf2015-02-02 18:02:40 -0700375
David Pinedo0257fbf2015-02-02 18:02:40 -0700376 view->cmd_len = 8;
377
378 *view_ret = view;
379
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600380 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700381}
382
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600383static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700384{
385 return mem->bo;
386}
387
Tony Barbour8205d902015-04-16 15:59:00 -0600388static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem)
David Pinedo0257fbf2015-02-02 18:02:40 -0700389{
Tony Barbourde4124d2015-07-03 10:33:54 -0600390 return *(struct nulldrv_mem **) &mem;
David Pinedo0257fbf2015-02-02 18:02:40 -0700391}
392
393static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base)
394{
395 return (struct nulldrv_buf *) base;
396}
397
Tony Barbour426b9052015-06-24 16:06:58 -0600398static VkResult buf_get_memory_requirements(struct nulldrv_base *base,
399 VkMemoryRequirements* pMemoryRequirements)
David Pinedo0257fbf2015-02-02 18:02:40 -0700400{
401 struct nulldrv_buf *buf = nulldrv_buf_from_base(base);
David Pinedo0257fbf2015-02-02 18:02:40 -0700402
Tony Barbour426b9052015-06-24 16:06:58 -0600403 if (pMemoryRequirements == NULL)
404 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700405
Tony Barbour426b9052015-06-24 16:06:58 -0600406 pMemoryRequirements->size = buf->size;
407 pMemoryRequirements->alignment = 4096;
David Pinedo0257fbf2015-02-02 18:02:40 -0700408
Tony Barbour426b9052015-06-24 16:06:58 -0600409 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700410}
411
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600412static VkResult nulldrv_buf_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600413 const VkBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700414 struct nulldrv_buf **buf_ret)
415{
416 struct nulldrv_buf *buf;
417
418 buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600419 VK_OBJECT_TYPE_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700420 if (!buf)
Tony Barbour8205d902015-04-16 15:59:00 -0600421 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700422
423 buf->size = info->size;
424 buf->usage = info->usage;
425
Tony Barbour426b9052015-06-24 16:06:58 -0600426 buf->obj.base.get_memory_requirements = buf_get_memory_requirements;
David Pinedo0257fbf2015-02-02 18:02:40 -0700427
428 *buf_ret = buf;
429
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600430 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700431}
432
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600433static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev,
434 const VkDescriptorSetLayoutCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700435 struct nulldrv_desc_layout **layout_ret)
436{
437 struct nulldrv_desc_layout *layout;
438
439 layout = (struct nulldrv_desc_layout *)
440 nulldrv_base_create(dev, sizeof(*layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600441 VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT);
David Pinedo0257fbf2015-02-02 18:02:40 -0700442 if (!layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600443 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700444
445 *layout_ret = layout;
446
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600447 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700448}
449
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500450static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev,
451 const VkPipelineLayoutCreateInfo* pCreateInfo,
452 struct nulldrv_pipeline_layout **pipeline_layout_ret)
Chia-I Wu7732cb22015-03-26 15:27:55 +0800453{
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500454 struct nulldrv_pipeline_layout *pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800455
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500456 pipeline_layout = (struct nulldrv_pipeline_layout *)
457 nulldrv_base_create(dev, sizeof(*pipeline_layout),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600458 VK_OBJECT_TYPE_PIPELINE_LAYOUT);
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500459 if (!pipeline_layout)
Tony Barbour8205d902015-04-16 15:59:00 -0600460 return VK_ERROR_OUT_OF_HOST_MEMORY;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800461
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500462 *pipeline_layout_ret = pipeline_layout;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800463
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600464 return VK_SUCCESS;
Chia-I Wu7732cb22015-03-26 15:27:55 +0800465}
466
Tony Barbour8db65372015-07-10 18:32:33 -0600467static struct nulldrv_desc_layout *nulldrv_desc_layout(const VkDescriptorSetLayout layout)
David Pinedo0257fbf2015-02-02 18:02:40 -0700468{
Tony Barbourde4124d2015-07-03 10:33:54 -0600469 return *(struct nulldrv_desc_layout **) &layout;
David Pinedo0257fbf2015-02-02 18:02:40 -0700470}
471
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600472static VkResult shader_create(struct nulldrv_dev *dev,
473 const VkShaderCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700474 struct nulldrv_shader **sh_ret)
475{
David Pinedo0257fbf2015-02-02 18:02:40 -0700476 struct nulldrv_shader *sh;
477
478 sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600479 VK_OBJECT_TYPE_SHADER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700480 if (!sh)
Tony Barbour8205d902015-04-16 15:59:00 -0600481 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700482
483 *sh_ret = sh;
484
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600485 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700486}
487
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600488static VkResult graphics_pipeline_create(struct nulldrv_dev *dev,
489 const VkGraphicsPipelineCreateInfo *info_,
David Pinedo0257fbf2015-02-02 18:02:40 -0700490 struct nulldrv_pipeline **pipeline_ret)
491{
492 struct nulldrv_pipeline *pipeline;
493
494 pipeline = (struct nulldrv_pipeline *)
495 nulldrv_base_create(dev, sizeof(*pipeline),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600496 VK_OBJECT_TYPE_PIPELINE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700497 if (!pipeline)
Tony Barbour8205d902015-04-16 15:59:00 -0600498 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700499
500 *pipeline_ret = pipeline;
501
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600502 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700503}
504
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600505static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev,
Tony Barbourde4124d2015-07-03 10:33:54 -0600506 const VkDynamicViewportStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700507 struct nulldrv_dynamic_vp **state_ret)
508{
509 struct nulldrv_dynamic_vp *state;
510
511 state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev,
Tony Barbour2a199c12015-07-09 17:31:46 -0600512 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_VIEWPORT_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700513 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600514 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700515
516 *state_ret = state;
517
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600518 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700519}
520
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600521static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev,
Tony Barbourde4124d2015-07-03 10:33:54 -0600522 const VkDynamicRasterStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700523 struct nulldrv_dynamic_rs **state_ret)
524{
525 struct nulldrv_dynamic_rs *state;
526
527 state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev,
Tony Barbour2a199c12015-07-09 17:31:46 -0600528 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_RASTER_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700529 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600530 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700531
532 *state_ret = state;
533
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600534 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700535}
536
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600537static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev,
Tony Barbourde4124d2015-07-03 10:33:54 -0600538 const VkDynamicColorBlendStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700539 struct nulldrv_dynamic_cb **state_ret)
540{
541 struct nulldrv_dynamic_cb *state;
542
543 state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev,
Tony Barbour2a199c12015-07-09 17:31:46 -0600544 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_COLOR_BLEND_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700545 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600546 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700547
548 *state_ret = state;
549
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600550 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700551}
552
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600553static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev,
Tony Barbourde4124d2015-07-03 10:33:54 -0600554 const VkDynamicDepthStencilStateCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700555 struct nulldrv_dynamic_ds **state_ret)
556{
557 struct nulldrv_dynamic_ds *state;
558
559 state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev,
Tony Barbour2a199c12015-07-09 17:31:46 -0600560 sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_DEPTH_STENCIL_STATE);
David Pinedo0257fbf2015-02-02 18:02:40 -0700561 if (!state)
Tony Barbour8205d902015-04-16 15:59:00 -0600562 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700563
564 *state_ret = state;
565
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600566 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700567}
568
569
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600570static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev,
571 const VkCmdBufferCreateInfo *info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700572 struct nulldrv_cmd **cmd_ret)
573{
David Pinedo0257fbf2015-02-02 18:02:40 -0700574 struct nulldrv_cmd *cmd;
575
David Pinedo0257fbf2015-02-02 18:02:40 -0700576 cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600577 VK_OBJECT_TYPE_COMMAND_BUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700578 if (!cmd)
Tony Barbour8205d902015-04-16 15:59:00 -0600579 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700580
581 *cmd_ret = cmd;
582
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600583 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700584}
585
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600586static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev,
587 VkDescriptorPoolUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700588 uint32_t max_sets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600589 const VkDescriptorPoolCreateInfo *info,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800590 struct nulldrv_desc_pool **pool_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -0700591{
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800592 struct nulldrv_desc_pool *pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700593
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800594 pool = (struct nulldrv_desc_pool *)
595 nulldrv_base_create(dev, sizeof(*pool),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600596 VK_OBJECT_TYPE_DESCRIPTOR_POOL);
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800597 if (!pool)
Tony Barbour8205d902015-04-16 15:59:00 -0600598 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700599
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800600 pool->dev = dev;
David Pinedo0257fbf2015-02-02 18:02:40 -0700601
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800602 *pool_ret = pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700603
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600604 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700605}
606
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600607static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev,
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800608 struct nulldrv_desc_pool *pool,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600609 VkDescriptorSetUsage usage,
David Pinedo0257fbf2015-02-02 18:02:40 -0700610 const struct nulldrv_desc_layout *layout,
611 struct nulldrv_desc_set **set_ret)
612{
613 struct nulldrv_desc_set *set;
614
615 set = (struct nulldrv_desc_set *)
616 nulldrv_base_create(dev, sizeof(*set),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600617 VK_OBJECT_TYPE_DESCRIPTOR_SET);
David Pinedo0257fbf2015-02-02 18:02:40 -0700618 if (!set)
Tony Barbour8205d902015-04-16 15:59:00 -0600619 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700620
Chia-I Wu8d24b3b2015-03-26 13:14:16 +0800621 set->ooxx = dev->desc_ooxx;
David Pinedo0257fbf2015-02-02 18:02:40 -0700622 set->layout = layout;
623 *set_ret = set;
624
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600625 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700626}
627
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600628static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool)
David Pinedo0257fbf2015-02-02 18:02:40 -0700629{
Tony Barbourde4124d2015-07-03 10:33:54 -0600630 return *(struct nulldrv_desc_pool **) &pool;
David Pinedo0257fbf2015-02-02 18:02:40 -0700631}
632
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600633static VkResult nulldrv_fb_create(struct nulldrv_dev *dev,
634 const VkFramebufferCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700635 struct nulldrv_framebuffer ** fb_ret)
636{
637
638 struct nulldrv_framebuffer *fb;
639 fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600640 VK_OBJECT_TYPE_FRAMEBUFFER);
David Pinedo0257fbf2015-02-02 18:02:40 -0700641 if (!fb)
Tony Barbour8205d902015-04-16 15:59:00 -0600642 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700643
644 *fb_ret = fb;
645
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600646 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700647
648}
649
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600650static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev,
651 const VkRenderPassCreateInfo* info,
David Pinedo0257fbf2015-02-02 18:02:40 -0700652 struct nulldrv_render_pass** rp_ret)
653{
654 struct nulldrv_render_pass *rp;
655 rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600656 VK_OBJECT_TYPE_RENDER_PASS);
David Pinedo0257fbf2015-02-02 18:02:40 -0700657 if (!rp)
Tony Barbour8205d902015-04-16 15:59:00 -0600658 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -0700659
660 *rp_ret = rp;
661
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600662 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700663}
664
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600665static struct nulldrv_buf *nulldrv_buf(VkBuffer buf)
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700666{
Tony Barbourde4124d2015-07-03 10:33:54 -0600667 return *(struct nulldrv_buf **) &buf;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700668}
669
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600670static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600671 const VkBufferViewCreateInfo *info,
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700672 struct nulldrv_buf_view **view_ret)
673{
674 struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
675 struct nulldrv_buf_view *view;
676
677 view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600678 VK_OBJECT_TYPE_BUFFER_VIEW);
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700679 if (!view)
Tony Barbour8205d902015-04-16 15:59:00 -0600680 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700681
682 view->buf = buf;
683
684 *view_ret = view;
685
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600686 return VK_SUCCESS;
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700687}
688
David Pinedo0257fbf2015-02-02 18:02:40 -0700689
690//*********************************************
691// Driver entry points
692//*********************************************
693
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600694ICD_EXPORT VkResult VKAPI vkCreateBuffer(
695 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -0600696 const VkBufferCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600697 VkBuffer* pBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700698{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700699 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700700 struct nulldrv_dev *dev = nulldrv_dev(device);
701
702 return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer);
703}
704
Tony Barbourde4124d2015-07-03 10:33:54 -0600705ICD_EXPORT VkResult VKAPI vkDestroyBuffer(
706 VkDevice device,
707 VkBuffer buffer)
708{
709 NULLDRV_LOG_FUNC;
710 return VK_SUCCESS;
711}
712
Cody Northropf02f9f82015-07-09 18:08:05 -0600713ICD_EXPORT VkResult VKAPI vkCreateCommandPool(
714 VkDevice device,
715 const VkCmdPoolCreateInfo* pCreateInfo,
716 VkCmdPool* pCmdPool)
717{
718 NULLDRV_LOG_FUNC;
719 return VK_SUCCESS;
720}
721
722ICD_EXPORT VkResult VKAPI vkDestroyCommandPool(
723 VkDevice device,
724 VkCmdPool cmdPool)
725{
726 NULLDRV_LOG_FUNC;
727 return VK_SUCCESS;
728}
729
730ICD_EXPORT VkResult VKAPI vkResetCommandPool(
731 VkDevice device,
732 VkCmdPool cmdPool,
733 VkCmdPoolResetFlags flags)
734{
735 NULLDRV_LOG_FUNC;
736 return VK_SUCCESS;
737}
738
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600739ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer(
740 VkDevice device,
741 const VkCmdBufferCreateInfo* pCreateInfo,
742 VkCmdBuffer* pCmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700743{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700744 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700745 struct nulldrv_dev *dev = nulldrv_dev(device);
746
747 return nulldrv_cmd_create(dev, pCreateInfo,
748 (struct nulldrv_cmd **) pCmdBuffer);
749}
750
Tony Barbourde4124d2015-07-03 10:33:54 -0600751ICD_EXPORT VkResult VKAPI vkDestroyCommandBuffer(
752 VkDevice device,
753 VkCmdBuffer cmdBuffer)
754{
755 NULLDRV_LOG_FUNC;
756 return VK_SUCCESS;
757}
758
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600759ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer(
760 VkCmdBuffer cmdBuffer,
761 const VkCmdBufferBeginInfo *info)
David Pinedo0257fbf2015-02-02 18:02:40 -0700762{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700763 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600764 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700765}
766
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600767ICD_EXPORT VkResult VKAPI vkEndCommandBuffer(
768 VkCmdBuffer cmdBuffer)
David Pinedo0257fbf2015-02-02 18:02:40 -0700769{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700770 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600771 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700772}
773
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600774ICD_EXPORT VkResult VKAPI vkResetCommandBuffer(
Cody Northropf02f9f82015-07-09 18:08:05 -0600775 VkCmdBuffer cmdBuffer,
776 VkCmdBufferResetFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -0700777{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700778 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600779 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -0700780}
781
Ian Elliott64a68e12015-04-16 11:57:46 -0600782static const VkFormat nulldrv_presentable_formats[] = {
783 VK_FORMAT_B8G8R8A8_UNORM,
784};
785
Jon Ashburnba4a1952015-06-16 12:44:51 -0600786#if 0
Ian Elliott64a68e12015-04-16 11:57:46 -0600787ICD_EXPORT VkResult VKAPI vkGetDisplayInfoWSI(
788 VkDisplayWSI display,
789 VkDisplayInfoTypeWSI infoType,
790 size_t* pDataSize,
791 void* pData)
792{
793 VkResult ret = VK_SUCCESS;
794
795 NULLDRV_LOG_FUNC;
796
797 if (!pDataSize)
798 return VK_ERROR_INVALID_POINTER;
799
800 switch (infoType) {
801 case VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_WSI:
802 {
803 VkDisplayFormatPropertiesWSI *dst = pData;
804 size_t size_ret;
805 uint32_t i;
806
807 size_ret = sizeof(*dst) * ARRAY_SIZE(nulldrv_presentable_formats);
808
809 if (dst && *pDataSize < size_ret)
810 return VK_ERROR_INVALID_VALUE;
811
812 *pDataSize = size_ret;
813 if (!dst)
814 return VK_SUCCESS;
815
816 for (i = 0; i < ARRAY_SIZE(nulldrv_presentable_formats); i++)
817 dst[i].swapChainFormat = nulldrv_presentable_formats[i];
818 }
819 break;
820 default:
821 ret = VK_ERROR_INVALID_VALUE;
822 break;
823 }
824
825 return ret;
826}
Jon Ashburnba4a1952015-06-16 12:44:51 -0600827#endif
Ian Elliott64a68e12015-04-16 11:57:46 -0600828
829ICD_EXPORT VkResult VKAPI vkCreateSwapChainWSI(
830 VkDevice device,
831 const VkSwapChainCreateInfoWSI* pCreateInfo,
832 VkSwapChainWSI* pSwapChain)
833{
834 NULLDRV_LOG_FUNC;
835 struct nulldrv_dev *dev = nulldrv_dev(device);
836 struct nulldrv_swap_chain *sc;
837
838 sc = (struct nulldrv_swap_chain *) nulldrv_base_create(dev, sizeof(*sc),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600839 VK_OBJECT_TYPE_SWAP_CHAIN_WSI);
Ian Elliott64a68e12015-04-16 11:57:46 -0600840 if (!sc) {
841 return VK_ERROR_OUT_OF_HOST_MEMORY;
842 }
843 sc->dev = dev;
844
Tony Barbour7910de72015-07-13 16:37:21 -0600845 *(VkSwapChainWSI **)pSwapChain = *(VkSwapChainWSI **)&sc;
Ian Elliott64a68e12015-04-16 11:57:46 -0600846
847 return VK_SUCCESS;
848}
849
850ICD_EXPORT VkResult VKAPI vkDestroySwapChainWSI(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600851 VkDevice device,
Ian Elliott64a68e12015-04-16 11:57:46 -0600852 VkSwapChainWSI swapChain)
853{
854 NULLDRV_LOG_FUNC;
Tony Barbour7910de72015-07-13 16:37:21 -0600855 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapChain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600856
857 free(sc);
858
859 return VK_SUCCESS;
860}
861
862ICD_EXPORT VkResult VKAPI vkGetSwapChainInfoWSI(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600863 VkDevice device,
Ian Elliott64a68e12015-04-16 11:57:46 -0600864 VkSwapChainWSI swapChain,
865 VkSwapChainInfoTypeWSI infoType,
866 size_t* pDataSize,
867 void* pData)
868{
869 NULLDRV_LOG_FUNC;
Tony Barbour7910de72015-07-13 16:37:21 -0600870 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapChain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600871 struct nulldrv_dev *dev = sc->dev;
872 VkResult ret = VK_SUCCESS;
873
874 if (!pDataSize)
875 return VK_ERROR_INVALID_POINTER;
876
877 switch (infoType) {
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600878 case VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI:
879 *pDataSize = (sizeof(VkSwapChainImagePropertiesWSI) * 2);
880 if (pData) {
881 VkSwapChainImagePropertiesWSI *images =
882 (VkSwapChainImagePropertiesWSI *) pData;
Ian Elliott64a68e12015-04-16 11:57:46 -0600883 uint32_t i;
884
Ian Elliott64a68e12015-04-16 11:57:46 -0600885 for (i = 0; i < 2; i++) {
886 struct nulldrv_img *img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600887
888 img = (struct nulldrv_img *) nulldrv_base_create(dev,
889 sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600890 VK_OBJECT_TYPE_IMAGE);
Ian Elliott64a68e12015-04-16 11:57:46 -0600891 if (!img)
892 return VK_ERROR_OUT_OF_HOST_MEMORY;
Tony Barbour7910de72015-07-13 16:37:21 -0600893 *(VkImage **) &images[i].image = *(VkImage **) &img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600894 }
895 }
896 break;
897 default:
898 ret = VK_ERROR_INVALID_VALUE;
899 break;
900 }
901
902 return ret;
903}
904
Tony Barbour7910de72015-07-13 16:37:21 -0600905ICD_EXPORT VkResult VKAPI vkAcquireNextImageWSI(
906 VkDevice device,
907 VkSwapChainWSI swapChain,
908 uint64_t timeout,
909 VkSemaphore semaphore,
910 uint32_t* pImageIndex)
911{
912 NULLDRV_LOG_FUNC;
913
914 return VK_SUCCESS;
915}
916
917ICD_EXPORT VkResult VKAPI vkGetSurfaceInfoWSI(
918 VkDevice device,
919 const VkSurfaceDescriptionWSI* pSurfaceDescription,
920 VkSurfaceInfoTypeWSI infoType,
921 size_t* pDataSize,
922 void* pData)
923{
924 NULLDRV_LOG_FUNC;
925
926 return VK_SUCCESS;
927}
928
929ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportWSI(
930 VkPhysicalDevice physicalDevice,
931 uint32_t queueFamilyIndex,
932 const VkSurfaceDescriptionWSI* pSurfaceDescription,
933 VkBool32* pSupported)
934{
935 NULLDRV_LOG_FUNC;
936
937 return VK_SUCCESS;
938}
939
Ian Elliott64a68e12015-04-16 11:57:46 -0600940ICD_EXPORT VkResult VKAPI vkQueuePresentWSI(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600941 VkQueue queue_,
942 VkPresentInfoWSI* pPresentInfo)
Ian Elliott64a68e12015-04-16 11:57:46 -0600943{
944 NULLDRV_LOG_FUNC;
945
946 return VK_SUCCESS;
947}
948
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600949ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600950 VkCmdBuffer cmdBuffer,
951 VkBuffer srcBuffer,
952 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700953 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600954 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700955{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700956 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700957}
958
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600959ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600960 VkCmdBuffer cmdBuffer,
961 VkImage srcImage,
962 VkImageLayout srcImageLayout,
963 VkImage destImage,
964 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700965 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600966 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700967{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700968 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700969}
970
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600971ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600972 VkCmdBuffer cmdBuffer,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500973 VkImage srcImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600974 VkImageLayout srcImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500975 VkImage destImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600976 VkImageLayout destImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500977 uint32_t regionCount,
978 const VkImageBlit* pRegions,
979 VkTexFilter filter)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600980{
981 NULLDRV_LOG_FUNC;
982}
983
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600984ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600985 VkCmdBuffer cmdBuffer,
986 VkBuffer srcBuffer,
987 VkImage destImage,
988 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700989 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600990 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700991{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700992 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700993}
994
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600995ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600996 VkCmdBuffer cmdBuffer,
997 VkImage srcImage,
998 VkImageLayout srcImageLayout,
999 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001000 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001001 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001002{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001003 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001004}
1005
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001006ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001007 VkCmdBuffer cmdBuffer,
1008 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001009 VkDeviceSize destOffset,
1010 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001011 const uint32_t* pData)
1012{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001013 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001014}
1015
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001016ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001017 VkCmdBuffer cmdBuffer,
1018 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001019 VkDeviceSize destOffset,
1020 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001021 uint32_t data)
1022{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001023 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001024}
1025
Ian Elliotte924ab22015-07-08 13:24:30 -06001026ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage(
1027 VkCmdBuffer cmdBuffer,
1028 VkImage image,
1029 VkImageLayout imageLayout,
1030 float depth,
1031 uint32_t stencil,
1032 uint32_t rangeCount,
1033 const VkImageSubresourceRange* pRanges)
1034{
1035 NULLDRV_LOG_FUNC;
1036}
1037
1038ICD_EXPORT void VKAPI vkCmdClearColorAttachment(
1039 VkCmdBuffer cmdBuffer,
1040 uint32_t colorAttachment,
1041 VkImageLayout imageLayout,
1042 const VkClearColorValue *pColor,
1043 uint32_t rectCount,
1044 const VkRect3D *pRects)
1045{
1046 NULLDRV_LOG_FUNC;
1047}
1048
1049ICD_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
1050 VkCmdBuffer cmdBuffer,
1051 VkImageAspectFlags imageAspectMask,
1052 VkImageLayout imageLayout,
1053 float depth,
1054 uint32_t stencil,
1055 uint32_t rectCount,
1056 const VkRect3D *pRects)
1057{
1058 NULLDRV_LOG_FUNC;
1059}
1060
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001061ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -06001062 VkCmdBuffer cmdBuffer,
1063 VkImage image,
1064 VkImageLayout imageLayout,
Chris Forbese3105972015-06-24 14:34:53 +12001065 const VkClearColorValue *pColor,
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -06001066 uint32_t rangeCount,
1067 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001068{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001069 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001070}
1071
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001072ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001073 VkCmdBuffer cmdBuffer,
1074 VkImage image,
1075 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001076 float depth,
1077 uint32_t stencil,
1078 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001079 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001080{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001081 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001082}
1083
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001084ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001085 VkCmdBuffer cmdBuffer,
1086 VkImage srcImage,
1087 VkImageLayout srcImageLayout,
1088 VkImage destImage,
1089 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -06001090 uint32_t regionCount,
1091 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001092{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001093 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001094}
1095
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001096ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001097 VkCmdBuffer cmdBuffer,
1098 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001099 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001100 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001101{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001102 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001103}
1104
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001105ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001106 VkCmdBuffer cmdBuffer,
1107 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001108 uint32_t slot)
1109{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001110 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001111}
1112
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001113ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001114 VkCmdBuffer cmdBuffer,
1115 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001116 uint32_t startQuery,
1117 uint32_t queryCount)
1118{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001119 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001120}
1121
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001122ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001123 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001124 VkEvent event_,
1125 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001126{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001127 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001128}
1129
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001130ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001131 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001132 VkEvent event_,
1133 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001134{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001135 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001136}
1137
Ian Elliott63f1edb2015-04-16 18:10:19 -06001138ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1139 VkCmdBuffer cmdBuffer,
1140 VkQueryPool queryPool,
1141 uint32_t startQuery,
1142 uint32_t queryCount,
1143 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001144 VkDeviceSize destOffset,
1145 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001146 VkFlags flags)
1147{
1148 NULLDRV_LOG_FUNC;
1149}
1150
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001151ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001152 VkCmdBuffer cmdBuffer,
1153 VkTimestampType timestampType,
1154 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001155 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001156{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001157 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001158}
1159
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001160ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001161 VkCmdBuffer cmdBuffer,
Tony Barbourde4124d2015-07-03 10:33:54 -06001162 VkPipelineBindPoint pipelineBindPoint,
1163 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001164{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001165 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001166}
1167
Tony Barbourde4124d2015-07-03 10:33:54 -06001168ICD_EXPORT void VKAPI vkCmdBindDynamicViewportState(
1169 VkCmdBuffer cmdBuffer,
1170 VkDynamicViewportState state)
1171{
1172 NULLDRV_LOG_FUNC;
1173}
1174
1175ICD_EXPORT void VKAPI vkCmdBindDynamicRasterState(
1176 VkCmdBuffer cmdBuffer,
1177 VkDynamicRasterState state)
1178{
1179 NULLDRV_LOG_FUNC;
1180}
1181
1182ICD_EXPORT void VKAPI vkCmdBindDynamicColorBlendState(
1183 VkCmdBuffer cmdBuffer,
1184 VkDynamicColorBlendState state)
1185{
1186 NULLDRV_LOG_FUNC;
1187}
1188
1189ICD_EXPORT void VKAPI vkCmdBindDynamicDepthStencilState(
1190 VkCmdBuffer cmdBuffer,
1191 VkDynamicDepthStencilState state)
David Pinedo0257fbf2015-02-02 18:02:40 -07001192{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001193 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001194}
1195
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001196ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001197 VkCmdBuffer cmdBuffer,
1198 VkPipelineBindPoint pipelineBindPoint,
Mark Lobodzinskia65c4632015-06-15 13:21:21 -06001199 VkPipelineLayout layout,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001200 uint32_t firstSet,
1201 uint32_t setCount,
1202 const VkDescriptorSet* pDescriptorSets,
1203 uint32_t dynamicOffsetCount,
1204 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001205{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001206 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001207}
1208
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001209ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1210 VkCmdBuffer cmdBuffer,
1211 uint32_t startBinding,
1212 uint32_t bindingCount,
1213 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001214 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001215{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001216 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001217}
1218
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001219ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001220 VkCmdBuffer cmdBuffer,
1221 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001222 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001223 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001224{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001225 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001226}
1227
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001228ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001229 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001230 uint32_t firstVertex,
1231 uint32_t vertexCount,
1232 uint32_t firstInstance,
1233 uint32_t instanceCount)
1234{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001235 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001236}
1237
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001238ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001239 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001240 uint32_t firstIndex,
1241 uint32_t indexCount,
1242 int32_t vertexOffset,
1243 uint32_t firstInstance,
1244 uint32_t instanceCount)
1245{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001246 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001247}
1248
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001249ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001250 VkCmdBuffer cmdBuffer,
1251 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001252 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001253 uint32_t count,
1254 uint32_t stride)
1255{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001256 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001257}
1258
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001259ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001260 VkCmdBuffer cmdBuffer,
1261 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001262 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001263 uint32_t count,
1264 uint32_t stride)
1265{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001266 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001267}
1268
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001269ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001270 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001271 uint32_t x,
1272 uint32_t y,
1273 uint32_t z)
1274{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001275 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001276}
1277
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001278ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001279 VkCmdBuffer cmdBuffer,
1280 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001281 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001282{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001283 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001284}
1285
Tony Barbour8205d902015-04-16 15:59:00 -06001286void VKAPI vkCmdWaitEvents(
1287 VkCmdBuffer cmdBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001288 uint32_t eventCount,
1289 const VkEvent* pEvents,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001290 VkPipelineStageFlags sourceStageMask,
1291 VkPipelineStageFlags destStageMask,
Tony Barbour8205d902015-04-16 15:59:00 -06001292 uint32_t memBarrierCount,
Courtney Goeltzenleuchterd9ba3422015-07-12 12:58:58 -06001293 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001294{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001295 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001296}
1297
Tony Barbour8205d902015-04-16 15:59:00 -06001298void VKAPI vkCmdPipelineBarrier(
1299 VkCmdBuffer cmdBuffer,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001300 VkPipelineStageFlags srcStageMask,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001301 VkPipelineStageFlags destStageMask,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001302 VkBool32 byRegion,
Tony Barbour8205d902015-04-16 15:59:00 -06001303 uint32_t memBarrierCount,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001304 const void* const* ppMemBarriers)
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}
1308
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001309ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001310 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001311 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001312 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001313{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001314 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001315 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1316 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1317}
1318
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001319ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1320 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001321{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001322 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001323 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001324}
1325
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001326ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1327 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001328 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001329 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001330 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001331{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001332 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001333 struct nulldrv_dev *dev = nulldrv_dev(device);
Mike Stroyan230e6252015-04-17 12:36:38 -06001334 *pQueue = (VkQueue) dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001335 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001336}
1337
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001338ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1339 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001340{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001341 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001342 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001343}
1344
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001345ICD_EXPORT VkResult VKAPI vkCreateEvent(
1346 VkDevice device,
1347 const VkEventCreateInfo* pCreateInfo,
1348 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001349{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001350 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001351 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001352}
1353
Tony Barbourde4124d2015-07-03 10:33:54 -06001354ICD_EXPORT VkResult VKAPI vkDestroyEvent(
1355 VkDevice device,
1356 VkEvent event)
1357{
1358 NULLDRV_LOG_FUNC;
1359 return VK_SUCCESS;
1360}
1361
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001362ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001363 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001364 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001365{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001366 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001367 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001368}
1369
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001370ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001371 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001372 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001373{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001374 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001375 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001376}
1377
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001378ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001379 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001380 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001381{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001382 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001383 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001384}
1385
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001386ICD_EXPORT VkResult VKAPI vkCreateFence(
1387 VkDevice device,
1388 const VkFenceCreateInfo* pCreateInfo,
1389 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001390{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001391 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001392 struct nulldrv_dev *dev = nulldrv_dev(device);
1393
1394 return nulldrv_fence_create(dev, pCreateInfo,
1395 (struct nulldrv_fence **) pFence);
1396}
1397
Tony Barbourde4124d2015-07-03 10:33:54 -06001398ICD_EXPORT VkResult VKAPI vkDestroyFence(
1399 VkDevice device,
1400 VkFence fence)
1401{
1402 NULLDRV_LOG_FUNC;
1403 return VK_SUCCESS;
1404}
1405
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001406ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001407 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001408 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001409{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001410 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001411 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001412}
1413
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001414ICD_EXPORT VkResult VKAPI vkResetFences(
Courtney Goeltzenleuchterf2e33ad2015-06-18 17:28:20 -06001415 VkDevice device,
1416 uint32_t fenceCount,
1417 const VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001418{
1419 NULLDRV_LOG_FUNC;
1420 return VK_SUCCESS;
1421}
1422
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001423ICD_EXPORT VkResult VKAPI vkWaitForFences(
1424 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001425 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001426 const VkFence* pFences,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001427 VkBool32 waitAll,
David Pinedo0257fbf2015-02-02 18:02:40 -07001428 uint64_t timeout)
1429{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001430 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001431 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001432}
1433
Tony Barbour426b9052015-06-24 16:06:58 -06001434ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
1435 VkPhysicalDevice gpu_,
1436 VkPhysicalDeviceProperties* pProperties)
David Pinedo0257fbf2015-02-02 18:02:40 -07001437{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001438 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001439 VkResult ret = VK_SUCCESS;
1440
Tony Barbour426b9052015-06-24 16:06:58 -06001441 pProperties->apiVersion = VK_API_VERSION;
1442 pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's
1443 pProperties->vendorId = 0;
1444 pProperties->deviceId = 0;
1445 pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1446 strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
Ian Elliott64a68e12015-04-16 11:57:46 -06001447
1448 return ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001449}
1450
Chris Forbesd7576302015-06-21 22:55:02 +12001451ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
1452 VkPhysicalDevice physicalDevice,
1453 VkPhysicalDeviceFeatures* pFeatures)
1454{
1455 NULLDRV_LOG_FUNC;
1456 VkResult ret = VK_SUCCESS;
1457
1458 /* TODO: fill out features */
1459 memset(pFeatures, 0, sizeof(*pFeatures));
1460
1461 return ret;
1462}
1463
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -06001464ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties(
Chris Forbesd7576302015-06-21 22:55:02 +12001465 VkPhysicalDevice physicalDevice,
1466 VkFormat format,
1467 VkFormatProperties* pFormatInfo)
1468{
1469 NULLDRV_LOG_FUNC;
1470 VkResult ret = VK_SUCCESS;
1471
1472 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1473 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
1474
1475 return ret;
1476}
1477
1478ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits(
1479 VkPhysicalDevice physicalDevice,
1480 VkPhysicalDeviceLimits* pLimits)
1481{
1482 NULLDRV_LOG_FUNC;
1483 VkResult ret = VK_SUCCESS;
1484
1485 /* TODO: fill out limits */
1486 memset(pLimits, 0, sizeof(*pLimits));
1487
1488 return ret;
1489}
1490
Tony Barbour426b9052015-06-24 16:06:58 -06001491ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueCount(
1492 VkPhysicalDevice gpu_,
1493 uint32_t* pCount)
David Pinedo0257fbf2015-02-02 18:02:40 -07001494{
Tony Barbour426b9052015-06-24 16:06:58 -06001495 *pCount = 1;
1496 return VK_SUCCESS;
1497}
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001498
Tony Barbour426b9052015-06-24 16:06:58 -06001499ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties(
1500 VkPhysicalDevice gpu_,
1501 uint32_t count,
1502 VkPhysicalDeviceQueueProperties* pProperties)
1503 {
1504 pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
1505 pProperties->queueCount = 1;
Tony Barbour426b9052015-06-24 16:06:58 -06001506 pProperties->supportsTimestamps = false;
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001507
Tony Barbour426b9052015-06-24 16:06:58 -06001508 return VK_SUCCESS;
1509}
1510
Ian Elliotte924ab22015-07-08 13:24:30 -06001511ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
1512 VkPhysicalDevice gpu_,
1513 VkPhysicalDeviceMemoryProperties* pProperties)
1514{
1515 // TODO: Fill in with real data
1516 return VK_SUCCESS;
1517}
1518
1519ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties(
1520 VkPhysicalDevice physicalDevice,
1521 uint32_t* pCount,
1522 VkLayerProperties* pProperties)
1523{
1524 // TODO: Fill in with real data
1525 return VK_SUCCESS;
1526}
1527
Tony Barbour426b9052015-06-24 16:06:58 -06001528ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001529 const char* pLayerName,
1530 uint32_t* pCount,
1531 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001532{
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001533 uint32_t copy_size;
Tony Barbour426b9052015-06-24 16:06:58 -06001534
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001535 if (pCount == NULL) {
1536 return VK_ERROR_INVALID_POINTER;
1537 }
Tony Barbour426b9052015-06-24 16:06:58 -06001538
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001539 if (pProperties == NULL) {
1540 *pCount = NULLDRV_EXT_COUNT;
1541 return VK_SUCCESS;
1542 }
Tony Barbour426b9052015-06-24 16:06:58 -06001543
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001544 copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT;
1545 memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties));
1546 *pCount = copy_size;
1547 if (copy_size < NULLDRV_EXT_COUNT) {
1548 return VK_INCOMPLETE;
1549 }
Tony Barbour426b9052015-06-24 16:06:58 -06001550 return VK_SUCCESS;
1551}
Ian Elliotte924ab22015-07-08 13:24:30 -06001552ICD_EXPORT VkResult VKAPI vkGetGlobalLayerProperties(
1553 uint32_t* pCount,
1554 VkLayerProperties* pProperties)
1555{
1556 // TODO: Fill in with real data
1557 return VK_SUCCESS;
1558}
Tony Barbour426b9052015-06-24 16:06:58 -06001559
1560VkResult VKAPI vkGetPhysicalDeviceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001561 VkPhysicalDevice physicalDevice,
1562 const char* pLayerName,
1563 uint32_t* pCount,
1564 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001565{
Tony Barbour426b9052015-06-24 16:06:58 -06001566
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001567 if (pCount == NULL) {
1568 return VK_ERROR_INVALID_POINTER;
1569 }
1570
Tony Barbour426b9052015-06-24 16:06:58 -06001571 *pCount = 0;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001572
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001573 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001574}
1575
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001576ICD_EXPORT VkResult VKAPI vkCreateImage(
1577 VkDevice device,
1578 const VkImageCreateInfo* pCreateInfo,
1579 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001580{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001581 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001582 struct nulldrv_dev *dev = nulldrv_dev(device);
1583
1584 return nulldrv_img_create(dev, pCreateInfo, false,
1585 (struct nulldrv_img **) pImage);
1586}
1587
Tony Barbourde4124d2015-07-03 10:33:54 -06001588ICD_EXPORT VkResult VKAPI vkDestroyImage(
1589 VkDevice device,
1590 VkImage image)
1591{
1592 NULLDRV_LOG_FUNC;
1593 return VK_SUCCESS;
1594}
1595
Tony Barbour426b9052015-06-24 16:06:58 -06001596ICD_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(
Mike Stroyan230e6252015-04-17 12:36:38 -06001597 VkDevice device,
1598 VkImage image,
1599 const VkImageSubresource* pSubresource,
Tony Barbour426b9052015-06-24 16:06:58 -06001600 VkSubresourceLayout* pLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001601{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001602 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001603
Tony Barbour426b9052015-06-24 16:06:58 -06001604 pLayout->offset = 0;
1605 pLayout->size = 1;
1606 pLayout->rowPitch = 4;
1607 pLayout->depthPitch = 4;
David Pinedo0257fbf2015-02-02 18:02:40 -07001608
Tony Barbour426b9052015-06-24 16:06:58 -06001609 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001610}
1611
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001612ICD_EXPORT VkResult VKAPI vkAllocMemory(
1613 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001614 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001615 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001616{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001617 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001618 struct nulldrv_dev *dev = nulldrv_dev(device);
1619
1620 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1621}
1622
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001623ICD_EXPORT VkResult VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001624 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001625 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001626{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001627 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001628 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001629}
1630
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001631ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001632 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001633 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001634 VkDeviceSize offset,
1635 VkDeviceSize size,
1636 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001637 void** ppData)
1638{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001639 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001640 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1641 void *ptr = nulldrv_mem_map(mem, flags);
1642
1643 *ppData = ptr;
1644
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001645 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001646}
1647
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001648ICD_EXPORT VkResult VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001649 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001650 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001651{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001652 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001653 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001654}
1655
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001656ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001657 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001658 uint32_t memRangeCount,
1659 const VkMappedMemoryRange* pMemRanges)
1660{
1661 NULLDRV_LOG_FUNC;
1662 return VK_SUCCESS;
1663}
1664
1665ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1666 VkDevice device,
1667 uint32_t memRangeCount,
1668 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001669{
1670 NULLDRV_LOG_FUNC;
1671 return VK_SUCCESS;
1672}
1673
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001674ICD_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(
1675 VkDevice device,
1676 VkDeviceMemory memory,
1677 VkDeviceSize* pCommittedMemoryInBytes)
1678{
1679 return VK_SUCCESS;
1680}
1681
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001682ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001683 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001684 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001685{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001686 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001687 struct nulldrv_instance *inst;
1688
1689 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001690 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001691 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001692 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001693
Tony Barbour426b9052015-06-24 16:06:58 -06001694 inst->obj.base.get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -07001695
Mike Stroyan230e6252015-04-17 12:36:38 -06001696 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001697
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001698 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001699}
1700
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001701ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1702 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001703{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001704 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001705 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001706}
1707
Tony Barbour8205d902015-04-16 15:59:00 -06001708ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001709 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001710 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001711 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001712{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001713 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001714 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001715 struct nulldrv_gpu *gpu;
1716 *pGpuCount = 1;
1717 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001718 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001719 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001720 return ret;
1721}
1722
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001723ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001724 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001725 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001726 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001727 char* const* pOutLayers,
1728 void* pReserved)
1729{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001730 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001731 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001732}
1733
Tony Barbourde4124d2015-07-03 10:33:54 -06001734ICD_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(
1735 VkDevice device,
1736 VkBuffer buffer,
1737 VkMemoryRequirements* pMemoryRequirements)
1738{
1739 NULLDRV_LOG_FUNC;
1740 struct nulldrv_base *base = nulldrv_base((void*)buffer.handle);
1741
1742 return base->get_memory_requirements(base, pMemoryRequirements);
1743}
1744
1745ICD_EXPORT VkResult VKAPI vkGetImageMemoryRequirements(
1746 VkDevice device,
1747 VkImage image,
1748 VkMemoryRequirements* pMemoryRequirements)
1749{
1750 NULLDRV_LOG_FUNC;
1751 struct nulldrv_base *base = nulldrv_base((void*)image.handle);
1752
1753 return base->get_memory_requirements(base, pMemoryRequirements);
1754}
1755
1756ICD_EXPORT VkResult VKAPI vkBindBufferMemory(
1757 VkDevice device,
1758 VkBuffer buffer,
1759 VkDeviceMemory mem_,
1760 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001761{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001762 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001763 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001764}
1765
Tony Barbourde4124d2015-07-03 10:33:54 -06001766ICD_EXPORT VkResult VKAPI vkBindImageMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001767 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001768 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001769 VkDeviceMemory mem_,
1770 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001771{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001772 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001773 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001774}
1775
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001776ICD_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(
1777 VkDevice device,
1778 VkImage image,
1779 uint32_t* pNumRequirements,
1780 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1781{
1782 NULLDRV_LOG_FUNC;
1783 return VK_SUCCESS;
1784}
1785
1786ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(
1787 VkPhysicalDevice physicalDevice,
1788 VkFormat format,
1789 VkImageType type,
1790 uint32_t samples,
1791 VkImageUsageFlags usage,
1792 VkImageTiling tiling,
1793 uint32_t* pNumProperties,
1794 VkSparseImageFormatProperties* pProperties)
1795{
1796 NULLDRV_LOG_FUNC;
1797 return VK_SUCCESS;
1798}
1799
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001800ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001801 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001802 VkBuffer buffer,
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001803 uint32_t numBindings,
1804 const VkSparseMemoryBindInfo* pBindInfo)
1805{
1806 NULLDRV_LOG_FUNC;
1807 return VK_SUCCESS;
1808}
1809
1810ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(
1811 VkQueue queue,
1812 VkImage image,
1813 uint32_t numBindings,
1814 const VkSparseMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001815{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001816 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001817 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001818}
1819
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001820ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001821 VkQueue queue,
1822 VkImage image,
1823 uint32_t numBindings,
1824 const VkSparseImageMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001825{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001826 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001827 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001828}
Jon Ashburn0e249962015-07-10 09:41:15 -07001829ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
1830 VkDevice device,
1831 const VkPipelineCacheCreateInfo* pCreateInfo,
1832 VkPipelineCache* pPipelineCache)
1833{
David Pinedo0257fbf2015-02-02 18:02:40 -07001834
Jon Ashburn0e249962015-07-10 09:41:15 -07001835 NULLDRV_LOG_FUNC;
1836 return VK_SUCCESS;
1837}
1838
Tony Barbourde4124d2015-07-03 10:33:54 -06001839ICD_EXPORT VkResult VKAPI vkDestroyPipeline(
1840 VkDevice device,
1841 VkPipeline pipeline)
1842{
1843 NULLDRV_LOG_FUNC;
1844 return VK_SUCCESS;
1845}
1846
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06001847VkResult VKAPI vkDestroyPipelineCache(
1848 VkDevice device,
1849 VkPipelineCache pipelineCache)
Jon Ashburn0e249962015-07-10 09:41:15 -07001850{
1851 NULLDRV_LOG_FUNC;
1852 return VK_SUCCESS;
1853}
1854
1855ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize(
1856 VkDevice device,
1857 VkPipelineCache pipelineCache)
1858{
1859 NULLDRV_LOG_FUNC;
1860 return VK_ERROR_UNAVAILABLE;
1861}
1862
1863ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
1864 VkDevice device,
1865 VkPipelineCache pipelineCache,
1866 void* pData)
1867{
1868 NULLDRV_LOG_FUNC;
1869 return VK_ERROR_UNAVAILABLE;
1870}
1871
1872ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
1873 VkDevice device,
1874 VkPipelineCache destCache,
1875 uint32_t srcCacheCount,
1876 const VkPipelineCache* pSrcCaches)
1877{
1878 NULLDRV_LOG_FUNC;
1879 return VK_ERROR_UNAVAILABLE;
1880}
1881ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001882 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001883 VkPipelineCache pipelineCache,
1884 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001885 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1886 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001887{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001888 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001889 struct nulldrv_dev *dev = nulldrv_dev(device);
1890
1891 return graphics_pipeline_create(dev, pCreateInfo,
1892 (struct nulldrv_pipeline **) pPipeline);
1893}
1894
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001895
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001896
Jon Ashburn0e249962015-07-10 09:41:15 -07001897ICD_EXPORT VkResult VKAPI vkCreateComputePipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001898 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001899 VkPipelineCache pipelineCache,
1900 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001901 const VkComputePipelineCreateInfo* pCreateInfo,
1902 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001903{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001904 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001905 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001906}
1907
David Pinedo0257fbf2015-02-02 18:02:40 -07001908
David Pinedo0257fbf2015-02-02 18:02:40 -07001909
Jon Ashburn0e249962015-07-10 09:41:15 -07001910
David Pinedo0257fbf2015-02-02 18:02:40 -07001911
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001912ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1913 VkDevice device,
1914 const VkQueryPoolCreateInfo* pCreateInfo,
1915 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001916{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001917 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001918 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001919}
1920
Tony Barbourde4124d2015-07-03 10:33:54 -06001921ICD_EXPORT VkResult VKAPI vkDestroyQueryPool(
1922 VkDevice device,
1923 VkQueryPool queryPoool)
1924{
1925 NULLDRV_LOG_FUNC;
1926 return VK_SUCCESS;
1927}
1928
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001929ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001930 VkDevice device,
1931 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001932 uint32_t startQuery,
1933 uint32_t queryCount,
1934 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001935 void* pData,
1936 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001937{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001938 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001939 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001940}
1941
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001942ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1943 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001944{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001945 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001946 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001947}
1948
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001949ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1950 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001951 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001952 const VkCmdBuffer* pCmdBuffers,
1953 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001954{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001955 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001956 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001957}
1958
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001959ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1960 VkDevice device,
1961 const VkSemaphoreCreateInfo* pCreateInfo,
1962 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001963{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001964 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001965 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001966}
1967
Tony Barbourde4124d2015-07-03 10:33:54 -06001968ICD_EXPORT VkResult VKAPI vkDestroySemaphore(
1969 VkDevice device,
1970 VkSemaphore semaphore)
1971{
1972 NULLDRV_LOG_FUNC;
1973 return VK_SUCCESS;
1974}
1975
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001976ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1977 VkQueue queue,
1978 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001979{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001980 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001981 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001982}
1983
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001984ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1985 VkQueue queue,
1986 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001987{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001988 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001989 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001990}
1991
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001992ICD_EXPORT VkResult VKAPI vkCreateSampler(
1993 VkDevice device,
1994 const VkSamplerCreateInfo* pCreateInfo,
1995 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001996{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001997 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001998 struct nulldrv_dev *dev = nulldrv_dev(device);
1999
2000 return nulldrv_sampler_create(dev, pCreateInfo,
2001 (struct nulldrv_sampler **) pSampler);
2002}
2003
Tony Barbourde4124d2015-07-03 10:33:54 -06002004ICD_EXPORT VkResult VKAPI vkDestroySampler(
2005 VkDevice device,
2006 VkSampler sampler)
2007{
2008 NULLDRV_LOG_FUNC;
2009 return VK_SUCCESS;
2010}
2011
Ian Elliotte924ab22015-07-08 13:24:30 -06002012ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
2013 VkDevice device,
2014 const VkShaderModuleCreateInfo* pCreateInfo,
2015 VkShaderModule* pShaderModule)
2016{
2017 // TODO: Fill in with real data
Tony Barbourde4124d2015-07-03 10:33:54 -06002018 NULLDRV_LOG_FUNC;
2019 return VK_SUCCESS;
2020}
2021
2022ICD_EXPORT VkResult VKAPI vkDestroyShaderModule(
2023 VkDevice device,
2024 VkShaderModule shaderModule)
2025{
2026 // TODO: Fill in with real data
2027 NULLDRV_LOG_FUNC;
Ian Elliotte924ab22015-07-08 13:24:30 -06002028 return VK_SUCCESS;
2029}
2030
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002031ICD_EXPORT VkResult VKAPI vkCreateShader(
2032 VkDevice device,
2033 const VkShaderCreateInfo* pCreateInfo,
2034 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07002035{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002036 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002037 struct nulldrv_dev *dev = nulldrv_dev(device);
2038
2039 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
2040}
2041
Tony Barbourde4124d2015-07-03 10:33:54 -06002042ICD_EXPORT VkResult VKAPI vkDestroyShader(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002043 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002044 VkShader shader)
2045{
2046 NULLDRV_LOG_FUNC;
2047 return VK_SUCCESS;
2048}
2049
2050ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
2051 VkDevice device,
2052 const VkDynamicViewportStateCreateInfo* pCreateInfo,
2053 VkDynamicViewportState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002054{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002055 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002056 struct nulldrv_dev *dev = nulldrv_dev(device);
2057
2058 return nulldrv_viewport_state_create(dev, pCreateInfo,
2059 (struct nulldrv_dynamic_vp **) pState);
2060}
2061
Tony Barbourde4124d2015-07-03 10:33:54 -06002062ICD_EXPORT VkResult VKAPI vkDestroyDynamicViewportState(
2063 VkDevice device,
2064 VkDynamicViewportState dynamicViewportState)
2065{
2066 NULLDRV_LOG_FUNC;
2067 return VK_SUCCESS;
2068}
2069
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002070ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
2071 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002072 const VkDynamicRasterStateCreateInfo* pCreateInfo,
2073 VkDynamicRasterState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002074{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002075 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002076 struct nulldrv_dev *dev = nulldrv_dev(device);
2077
2078 return nulldrv_raster_state_create(dev, pCreateInfo,
2079 (struct nulldrv_dynamic_rs **) pState);
2080}
2081
Tony Barbourde4124d2015-07-03 10:33:54 -06002082ICD_EXPORT VkResult VKAPI vkDestroyDynamicRasterState(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002083 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002084 VkDynamicRasterState dynamicRasterState)
2085{
2086 NULLDRV_LOG_FUNC;
2087 return VK_SUCCESS;
2088}
2089
2090ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
2091 VkDevice device,
2092 const VkDynamicColorBlendStateCreateInfo* pCreateInfo,
2093 VkDynamicColorBlendState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002094{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002095 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002096 struct nulldrv_dev *dev = nulldrv_dev(device);
2097
2098 return nulldrv_blend_state_create(dev, pCreateInfo,
2099 (struct nulldrv_dynamic_cb **) pState);
2100}
2101
Tony Barbourde4124d2015-07-03 10:33:54 -06002102ICD_EXPORT VkResult VKAPI vkDestroyDynamicColorBlendState(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002103 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002104 VkDynamicColorBlendState dynamicColorBlendState)
2105{
2106 NULLDRV_LOG_FUNC;
2107 return VK_SUCCESS;
2108}
2109
2110ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
2111 VkDevice device,
2112 const VkDynamicDepthStencilStateCreateInfo* pCreateInfo,
2113 VkDynamicDepthStencilState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002114{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002115 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002116 struct nulldrv_dev *dev = nulldrv_dev(device);
2117
2118 return nulldrv_ds_state_create(dev, pCreateInfo,
2119 (struct nulldrv_dynamic_ds **) pState);
2120}
2121
Tony Barbourde4124d2015-07-03 10:33:54 -06002122ICD_EXPORT VkResult VKAPI vkDestroyDynamicDepthStencilState(
2123 VkDevice device,
2124 VkDynamicDepthStencilState dynamicDepthStencilState)
2125{
2126 NULLDRV_LOG_FUNC;
2127 return VK_SUCCESS;
2128}
2129
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002130ICD_EXPORT VkResult VKAPI vkCreateBufferView(
2131 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06002132 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002133 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002134{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002135 NULLDRV_LOG_FUNC;
2136 struct nulldrv_dev *dev = nulldrv_dev(device);
2137
2138 return nulldrv_buf_view_create(dev, pCreateInfo,
2139 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07002140}
2141
Tony Barbourde4124d2015-07-03 10:33:54 -06002142ICD_EXPORT VkResult VKAPI vkDestroyBufferView(
2143 VkDevice device,
2144 VkBufferView bufferView)
2145{
2146 NULLDRV_LOG_FUNC;
2147 return VK_SUCCESS;
2148}
2149
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002150ICD_EXPORT VkResult VKAPI vkCreateImageView(
2151 VkDevice device,
2152 const VkImageViewCreateInfo* pCreateInfo,
2153 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002154{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002155 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002156 struct nulldrv_dev *dev = nulldrv_dev(device);
2157
2158 return nulldrv_img_view_create(dev, pCreateInfo,
2159 (struct nulldrv_img_view **) pView);
2160}
2161
Tony Barbourde4124d2015-07-03 10:33:54 -06002162ICD_EXPORT VkResult VKAPI vkDestroyImageView(
2163 VkDevice device,
2164 VkImageView imageView)
2165{
2166 NULLDRV_LOG_FUNC;
2167 return VK_SUCCESS;
2168}
2169
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06002170ICD_EXPORT VkResult VKAPI vkCreateAttachmentView(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002171 VkDevice device,
Chia-I Wuc278df82015-07-07 11:50:03 +08002172 const VkAttachmentViewCreateInfo* pCreateInfo,
2173 VkAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002174{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002175 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002176 struct nulldrv_dev *dev = nulldrv_dev(device);
2177
2178 return nulldrv_rt_view_create(dev, pCreateInfo,
2179 (struct nulldrv_rt_view **) pView);
2180}
2181
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06002182ICD_EXPORT VkResult VKAPI vkDestroyAttachmentView(
Tony Barbourde4124d2015-07-03 10:33:54 -06002183 VkDevice device,
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06002184 VkAttachmentView attachmentView)
Tony Barbourde4124d2015-07-03 10:33:54 -06002185{
2186 NULLDRV_LOG_FUNC;
2187 return VK_SUCCESS;
2188}
2189
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002190ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
2191 VkDevice device,
2192 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
2193 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07002194{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002195 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002196 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07002197
Chia-I Wu7732cb22015-03-26 15:27:55 +08002198 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07002199 (struct nulldrv_desc_layout **) pSetLayout);
2200}
2201
Tony Barbourde4124d2015-07-03 10:33:54 -06002202ICD_EXPORT VkResult VKAPI vkDestroyDescriptorSetLayout(
2203 VkDevice device,
2204 VkDescriptorSetLayout descriptorSetLayout)
2205{
2206 NULLDRV_LOG_FUNC;
2207 return VK_SUCCESS;
2208}
2209
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002210ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
2211 VkDevice device,
2212 const VkPipelineLayoutCreateInfo* pCreateInfo,
2213 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08002214{
2215 NULLDRV_LOG_FUNC;
2216 struct nulldrv_dev *dev = nulldrv_dev(device);
2217
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002218 return nulldrv_pipeline_layout_create(dev,
2219 pCreateInfo,
2220 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08002221}
2222
Tony Barbourde4124d2015-07-03 10:33:54 -06002223ICD_EXPORT VkResult VKAPI vkDestroyPipelineLayout(
2224 VkDevice device,
2225 VkPipelineLayout pipelineLayout)
2226{
2227 NULLDRV_LOG_FUNC;
2228 return VK_SUCCESS;
2229}
2230
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002231ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
2232 VkDevice device,
2233 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002234 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002235 const VkDescriptorPoolCreateInfo* pCreateInfo,
2236 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002237{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002238 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002239 struct nulldrv_dev *dev = nulldrv_dev(device);
2240
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002241 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
2242 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002243}
2244
Tony Barbourde4124d2015-07-03 10:33:54 -06002245ICD_EXPORT VkResult VKAPI vkDestroyDescriptorPool(
2246 VkDevice device,
2247 VkDescriptorPool descriptorPool)
2248{
2249 NULLDRV_LOG_FUNC;
2250 return VK_SUCCESS;
2251}
2252
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002253ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002254 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002255 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002256{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002257 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002258 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002259}
2260
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002261ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002262 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002263 VkDescriptorPool descriptorPool,
2264 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002265 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002266 const VkDescriptorSetLayout* pSetLayouts,
Cody Northropc8aa4a52015-08-03 12:47:29 -06002267 VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002268{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002269 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002270 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2271 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002272 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002273 uint32_t i;
2274
2275 for (i = 0; i < count; i++) {
2276 const struct nulldrv_desc_layout *layout =
Tony Barbour8db65372015-07-10 18:32:33 -06002277 nulldrv_desc_layout(pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002278
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002279 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002280 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002281 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002282 break;
2283 }
2284
David Pinedo0257fbf2015-02-02 18:02:40 -07002285 return ret;
2286}
2287
Tony Barbourb857d312015-07-10 10:50:45 -06002288ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
2289 VkDevice device,
2290 VkDescriptorPool descriptorPool,
2291 uint32_t count,
2292 const VkDescriptorSet* pDescriptorSets)
2293{
2294 NULLDRV_LOG_FUNC;
2295 return VK_SUCCESS;
2296}
2297
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002298ICD_EXPORT VkResult VKAPI vkUpdateDescriptorSets(
2299 VkDevice device,
2300 uint32_t writeCount,
2301 const VkWriteDescriptorSet* pDescriptorWrites,
2302 uint32_t copyCount,
2303 const VkCopyDescriptorSet* pDescriptorCopies)
David Pinedo0257fbf2015-02-02 18:02:40 -07002304{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002305 NULLDRV_LOG_FUNC;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002306 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002307}
2308
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002309ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2310 VkDevice device,
2311 const VkFramebufferCreateInfo* info,
2312 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002313{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002314 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002315 struct nulldrv_dev *dev = nulldrv_dev(device);
2316
2317 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2318}
2319
Tony Barbourde4124d2015-07-03 10:33:54 -06002320ICD_EXPORT VkResult VKAPI vkDestroyFramebuffer(
2321 VkDevice device,
2322 VkFramebuffer framebuffer)
2323{
2324 NULLDRV_LOG_FUNC;
2325 return VK_SUCCESS;
2326}
David Pinedo0257fbf2015-02-02 18:02:40 -07002327
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002328ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2329 VkDevice device,
2330 const VkRenderPassCreateInfo* info,
2331 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002332{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002333 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002334 struct nulldrv_dev *dev = nulldrv_dev(device);
2335
2336 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2337}
2338
Tony Barbourde4124d2015-07-03 10:33:54 -06002339ICD_EXPORT VkResult VKAPI vkDestroyRenderPass(
2340 VkDevice device,
2341 VkRenderPass renderPass)
2342{
2343 NULLDRV_LOG_FUNC;
2344 return VK_SUCCESS;
2345}
2346
Courtney Goeltzenleuchtera375b622015-07-27 14:04:01 -06002347ICD_EXPORT void VKAPI vkCmdPushConstants(
2348 VkCmdBuffer cmdBuffer,
2349 VkPipelineLayout layout,
2350 VkShaderStageFlags stageFlags,
2351 uint32_t start,
2352 uint32_t length,
2353 const void* values)
2354{
2355 /* TODO: Implement */
2356}
2357
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002358ICD_EXPORT VkResult VKAPI vkGetRenderAreaGranularity(
2359 VkDevice device,
2360 VkRenderPass renderPass,
2361 VkExtent2D* pGranularity)
2362{
2363 pGranularity->height = 1;
2364 pGranularity->width = 1;
2365
2366 return VK_SUCCESS;
2367}
2368
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002369ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Chia-I Wuc278df82015-07-07 11:50:03 +08002370 VkCmdBuffer cmdBuffer,
2371 const VkRenderPassBeginInfo* pRenderPassBegin,
2372 VkRenderPassContents contents)
2373{
2374 NULLDRV_LOG_FUNC;
2375}
2376
2377ICD_EXPORT void VKAPI vkCmdNextSubpass(
2378 VkCmdBuffer cmdBuffer,
2379 VkRenderPassContents contents)
David Pinedo0257fbf2015-02-02 18:02:40 -07002380{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002381 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002382}
2383
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002384ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08002385 VkCmdBuffer cmdBuffer)
2386{
2387 NULLDRV_LOG_FUNC;
2388}
2389
2390ICD_EXPORT void VKAPI vkCmdExecuteCommands(
2391 VkCmdBuffer cmdBuffer,
2392 uint32_t cmdBuffersCount,
2393 const VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -07002394{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002395 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002396}
Ian Elliottf93069f2015-02-19 14:26:19 -07002397
2398ICD_EXPORT void* xcbCreateWindow(
2399 uint16_t width,
2400 uint16_t height)
2401{
2402 static uint32_t window; // Kludge to the max
2403 NULLDRV_LOG_FUNC;
2404 return &window;
2405}
2406
2407// May not be needed, if we stub out stuf in tri.c
2408ICD_EXPORT void xcbDestroyWindow()
2409{
2410 NULLDRV_LOG_FUNC;
2411}
2412
2413ICD_EXPORT int xcbGetMessage(void *msg)
2414{
2415 NULLDRV_LOG_FUNC;
2416 return 0;
2417}
2418
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002419ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002420{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002421 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002422}
David Pinedo07494fd2015-07-24 10:54:41 -06002423
2424ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties(
2425 VkPhysicalDevice physicalDevice,
2426 VkFormat format,
2427 VkImageType type,
2428 VkImageTiling tiling,
2429 VkImageUsageFlags usage,
2430 VkImageFormatProperties* pImageFormatProperties)
2431{
2432 return VK_ERROR_UNAVAILABLE;
2433}