blob: da35982ee1a34d7f768cfb1c8b60d7fd71a5efe8 [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
Ian Elliott3333bb42015-08-10 13:56:08 -0600862ICD_EXPORT VkResult VKAPI vkGetSwapChainImagesWSI(
863 VkDevice device,
864 VkSwapChainWSI swapChain,
865 uint32_t* pCount,
866 VkImage* pSwapChainImages)
Ian Elliott64a68e12015-04-16 11:57:46 -0600867{
868 NULLDRV_LOG_FUNC;
Tony Barbour7910de72015-07-13 16:37:21 -0600869 struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapChain;
Ian Elliott64a68e12015-04-16 11:57:46 -0600870 struct nulldrv_dev *dev = sc->dev;
871 VkResult ret = VK_SUCCESS;
872
Ian Elliott3333bb42015-08-10 13:56:08 -0600873 *pCount = 2;
874 if (pSwapChainImages) {
875 uint32_t i;
876 for (i = 0; i < 2; i++) {
Ian Elliott64a68e12015-04-16 11:57:46 -0600877 struct nulldrv_img *img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600878
879 img = (struct nulldrv_img *) nulldrv_base_create(dev,
880 sizeof(*img),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600881 VK_OBJECT_TYPE_IMAGE);
Ian Elliott64a68e12015-04-16 11:57:46 -0600882 if (!img)
883 return VK_ERROR_OUT_OF_HOST_MEMORY;
Ian Elliott3333bb42015-08-10 13:56:08 -0600884 pSwapChainImages[i].handle = (uint64_t) &img;
Ian Elliott64a68e12015-04-16 11:57:46 -0600885 }
Ian Elliott64a68e12015-04-16 11:57:46 -0600886 }
887
888 return ret;
889}
890
Tony Barbour7910de72015-07-13 16:37:21 -0600891ICD_EXPORT VkResult VKAPI vkAcquireNextImageWSI(
892 VkDevice device,
893 VkSwapChainWSI swapChain,
894 uint64_t timeout,
895 VkSemaphore semaphore,
896 uint32_t* pImageIndex)
897{
898 NULLDRV_LOG_FUNC;
899
900 return VK_SUCCESS;
901}
902
Ian Elliott3333bb42015-08-10 13:56:08 -0600903VkResult VKAPI vkGetSurfacePropertiesWSI(
Tony Barbour7910de72015-07-13 16:37:21 -0600904 VkDevice device,
905 const VkSurfaceDescriptionWSI* pSurfaceDescription,
Ian Elliott3333bb42015-08-10 13:56:08 -0600906 VkSurfacePropertiesWSI* pSurfaceProperties)
907{
908 NULLDRV_LOG_FUNC;
909
910 return VK_SUCCESS;
911}
912
913VkResult VKAPI vkGetSurfaceFormatsWSI(
914 VkDevice device,
915 const VkSurfaceDescriptionWSI* pSurfaceDescription,
916 uint32_t* pCount,
917 VkSurfaceFormatWSI* pSurfaceFormats)
918{
919 NULLDRV_LOG_FUNC;
920
921 return VK_SUCCESS;
922}
923
924VkResult VKAPI vkGetSurfacePresentModesWSI(
925 VkDevice device,
926 const VkSurfaceDescriptionWSI* pSurfaceDescription,
927 uint32_t* pCount,
928 VkPresentModeWSI* pPresentModes)
Tony Barbour7910de72015-07-13 16:37:21 -0600929{
930 NULLDRV_LOG_FUNC;
931
932 return VK_SUCCESS;
933}
934
935ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportWSI(
936 VkPhysicalDevice physicalDevice,
937 uint32_t queueFamilyIndex,
938 const VkSurfaceDescriptionWSI* pSurfaceDescription,
939 VkBool32* pSupported)
940{
941 NULLDRV_LOG_FUNC;
942
943 return VK_SUCCESS;
944}
945
Ian Elliott64a68e12015-04-16 11:57:46 -0600946ICD_EXPORT VkResult VKAPI vkQueuePresentWSI(
Ian Elliott53bd3dc2015-07-06 14:29:31 -0600947 VkQueue queue_,
948 VkPresentInfoWSI* pPresentInfo)
Ian Elliott64a68e12015-04-16 11:57:46 -0600949{
950 NULLDRV_LOG_FUNC;
951
952 return VK_SUCCESS;
953}
954
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600955ICD_EXPORT void VKAPI vkCmdCopyBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600956 VkCmdBuffer cmdBuffer,
957 VkBuffer srcBuffer,
958 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -0700959 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600960 const VkBufferCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700961{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700962 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700963}
964
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600965ICD_EXPORT void VKAPI vkCmdCopyImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600966 VkCmdBuffer cmdBuffer,
967 VkImage srcImage,
968 VkImageLayout srcImageLayout,
969 VkImage destImage,
970 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700971 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600972 const VkImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700973{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700974 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700975}
976
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600977ICD_EXPORT void VKAPI vkCmdBlitImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600978 VkCmdBuffer cmdBuffer,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500979 VkImage srcImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600980 VkImageLayout srcImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500981 VkImage destImage,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600982 VkImageLayout destImageLayout,
Mark Lobodzinski20f68592015-05-22 14:43:25 -0500983 uint32_t regionCount,
984 const VkImageBlit* pRegions,
985 VkTexFilter filter)
Courtney Goeltzenleuchterb787a1e2015-03-08 17:02:18 -0600986{
987 NULLDRV_LOG_FUNC;
988}
989
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600990ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600991 VkCmdBuffer cmdBuffer,
992 VkBuffer srcBuffer,
993 VkImage destImage,
994 VkImageLayout destImageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -0700995 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600996 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -0700997{
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700998 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -0700999}
1000
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001001ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001002 VkCmdBuffer cmdBuffer,
1003 VkImage srcImage,
1004 VkImageLayout srcImageLayout,
1005 VkBuffer destBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001006 uint32_t regionCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001007 const VkBufferImageCopy* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001008{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001009 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001010}
1011
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001012ICD_EXPORT void VKAPI vkCmdUpdateBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001013 VkCmdBuffer cmdBuffer,
1014 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001015 VkDeviceSize destOffset,
1016 VkDeviceSize dataSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001017 const uint32_t* pData)
1018{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001019 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001020}
1021
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001022ICD_EXPORT void VKAPI vkCmdFillBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001023 VkCmdBuffer cmdBuffer,
1024 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001025 VkDeviceSize destOffset,
1026 VkDeviceSize fillSize,
David Pinedo0257fbf2015-02-02 18:02:40 -07001027 uint32_t data)
1028{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001029 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001030}
1031
Ian Elliotte924ab22015-07-08 13:24:30 -06001032ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage(
1033 VkCmdBuffer cmdBuffer,
1034 VkImage image,
1035 VkImageLayout imageLayout,
1036 float depth,
1037 uint32_t stencil,
1038 uint32_t rangeCount,
1039 const VkImageSubresourceRange* pRanges)
1040{
1041 NULLDRV_LOG_FUNC;
1042}
1043
1044ICD_EXPORT void VKAPI vkCmdClearColorAttachment(
1045 VkCmdBuffer cmdBuffer,
1046 uint32_t colorAttachment,
1047 VkImageLayout imageLayout,
1048 const VkClearColorValue *pColor,
1049 uint32_t rectCount,
1050 const VkRect3D *pRects)
1051{
1052 NULLDRV_LOG_FUNC;
1053}
1054
1055ICD_EXPORT void VKAPI vkCmdClearDepthStencilAttachment(
1056 VkCmdBuffer cmdBuffer,
1057 VkImageAspectFlags imageAspectMask,
1058 VkImageLayout imageLayout,
1059 float depth,
1060 uint32_t stencil,
1061 uint32_t rectCount,
1062 const VkRect3D *pRects)
1063{
1064 NULLDRV_LOG_FUNC;
1065}
1066
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001067ICD_EXPORT void VKAPI vkCmdClearColorImage(
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -06001068 VkCmdBuffer cmdBuffer,
1069 VkImage image,
1070 VkImageLayout imageLayout,
Chris Forbese3105972015-06-24 14:34:53 +12001071 const VkClearColorValue *pColor,
Courtney Goeltzenleuchterda4a99e2015-04-23 17:49:22 -06001072 uint32_t rangeCount,
1073 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001074{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001075 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001076}
1077
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001078ICD_EXPORT void VKAPI vkCmdClearDepthStencil(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001079 VkCmdBuffer cmdBuffer,
1080 VkImage image,
1081 VkImageLayout imageLayout,
David Pinedo0257fbf2015-02-02 18:02:40 -07001082 float depth,
1083 uint32_t stencil,
1084 uint32_t rangeCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001085 const VkImageSubresourceRange* pRanges)
David Pinedo0257fbf2015-02-02 18:02:40 -07001086{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001087 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001088}
1089
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001090ICD_EXPORT void VKAPI vkCmdResolveImage(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001091 VkCmdBuffer cmdBuffer,
1092 VkImage srcImage,
1093 VkImageLayout srcImageLayout,
1094 VkImage destImage,
1095 VkImageLayout destImageLayout,
Tony Barbour11f74372015-04-13 15:02:52 -06001096 uint32_t regionCount,
1097 const VkImageResolve* pRegions)
David Pinedo0257fbf2015-02-02 18:02:40 -07001098{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001099 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001100}
1101
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001102ICD_EXPORT void VKAPI vkCmdBeginQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001103 VkCmdBuffer cmdBuffer,
1104 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001105 uint32_t slot,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001106 VkFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001107{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001108 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001109}
1110
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001111ICD_EXPORT void VKAPI vkCmdEndQuery(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001112 VkCmdBuffer cmdBuffer,
1113 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001114 uint32_t slot)
1115{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001116 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001117}
1118
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001119ICD_EXPORT void VKAPI vkCmdResetQueryPool(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001120 VkCmdBuffer cmdBuffer,
1121 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001122 uint32_t startQuery,
1123 uint32_t queryCount)
1124{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001125 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001126}
1127
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001128ICD_EXPORT void VKAPI vkCmdSetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001129 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001130 VkEvent event_,
1131 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001132{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001133 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001134}
1135
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001136ICD_EXPORT void VKAPI vkCmdResetEvent(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001137 VkCmdBuffer cmdBuffer,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001138 VkEvent event_,
1139 VkPipelineStageFlags stageMask)
David Pinedo0257fbf2015-02-02 18:02:40 -07001140{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001141 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001142}
1143
Ian Elliott63f1edb2015-04-16 18:10:19 -06001144ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults(
1145 VkCmdBuffer cmdBuffer,
1146 VkQueryPool queryPool,
1147 uint32_t startQuery,
1148 uint32_t queryCount,
1149 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001150 VkDeviceSize destOffset,
1151 VkDeviceSize destStride,
Ian Elliott63f1edb2015-04-16 18:10:19 -06001152 VkFlags flags)
1153{
1154 NULLDRV_LOG_FUNC;
1155}
1156
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001157ICD_EXPORT void VKAPI vkCmdWriteTimestamp(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001158 VkCmdBuffer cmdBuffer,
1159 VkTimestampType timestampType,
1160 VkBuffer destBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001161 VkDeviceSize destOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001162{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001163 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001164}
1165
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001166ICD_EXPORT void VKAPI vkCmdBindPipeline(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001167 VkCmdBuffer cmdBuffer,
Tony Barbourde4124d2015-07-03 10:33:54 -06001168 VkPipelineBindPoint pipelineBindPoint,
1169 VkPipeline pipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001170{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001171 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001172}
1173
Tony Barbourde4124d2015-07-03 10:33:54 -06001174ICD_EXPORT void VKAPI vkCmdBindDynamicViewportState(
1175 VkCmdBuffer cmdBuffer,
1176 VkDynamicViewportState state)
1177{
1178 NULLDRV_LOG_FUNC;
1179}
1180
1181ICD_EXPORT void VKAPI vkCmdBindDynamicRasterState(
1182 VkCmdBuffer cmdBuffer,
1183 VkDynamicRasterState state)
1184{
1185 NULLDRV_LOG_FUNC;
1186}
1187
1188ICD_EXPORT void VKAPI vkCmdBindDynamicColorBlendState(
1189 VkCmdBuffer cmdBuffer,
1190 VkDynamicColorBlendState state)
1191{
1192 NULLDRV_LOG_FUNC;
1193}
1194
1195ICD_EXPORT void VKAPI vkCmdBindDynamicDepthStencilState(
1196 VkCmdBuffer cmdBuffer,
1197 VkDynamicDepthStencilState state)
David Pinedo0257fbf2015-02-02 18:02:40 -07001198{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001199 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001200}
1201
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001202ICD_EXPORT void VKAPI vkCmdBindDescriptorSets(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001203 VkCmdBuffer cmdBuffer,
1204 VkPipelineBindPoint pipelineBindPoint,
Mark Lobodzinskia65c4632015-06-15 13:21:21 -06001205 VkPipelineLayout layout,
Cody Northrop1a01b1d2015-04-16 13:41:56 -06001206 uint32_t firstSet,
1207 uint32_t setCount,
1208 const VkDescriptorSet* pDescriptorSets,
1209 uint32_t dynamicOffsetCount,
1210 const uint32_t* pDynamicOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001211{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001212 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001213}
1214
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -06001215ICD_EXPORT void VKAPI vkCmdBindVertexBuffers(
1216 VkCmdBuffer cmdBuffer,
1217 uint32_t startBinding,
1218 uint32_t bindingCount,
1219 const VkBuffer* pBuffers,
Tony Barbour8205d902015-04-16 15:59:00 -06001220 const VkDeviceSize* pOffsets)
David Pinedo0257fbf2015-02-02 18:02:40 -07001221{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001222 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001223}
1224
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001225ICD_EXPORT void VKAPI vkCmdBindIndexBuffer(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001226 VkCmdBuffer cmdBuffer,
1227 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001228 VkDeviceSize offset,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001229 VkIndexType indexType)
David Pinedo0257fbf2015-02-02 18:02:40 -07001230{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001231 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001232}
1233
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001234ICD_EXPORT void VKAPI vkCmdDraw(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001235 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001236 uint32_t firstVertex,
1237 uint32_t vertexCount,
1238 uint32_t firstInstance,
1239 uint32_t instanceCount)
1240{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001241 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001242}
1243
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001244ICD_EXPORT void VKAPI vkCmdDrawIndexed(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001245 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001246 uint32_t firstIndex,
1247 uint32_t indexCount,
1248 int32_t vertexOffset,
1249 uint32_t firstInstance,
1250 uint32_t instanceCount)
1251{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001252 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001253}
1254
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001255ICD_EXPORT void VKAPI vkCmdDrawIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001256 VkCmdBuffer cmdBuffer,
1257 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001258 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001259 uint32_t count,
1260 uint32_t stride)
1261{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001262 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001263}
1264
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001265ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001266 VkCmdBuffer cmdBuffer,
1267 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001268 VkDeviceSize offset,
David Pinedo0257fbf2015-02-02 18:02:40 -07001269 uint32_t count,
1270 uint32_t stride)
1271{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001272 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001273}
1274
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001275ICD_EXPORT void VKAPI vkCmdDispatch(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001276 VkCmdBuffer cmdBuffer,
David Pinedo0257fbf2015-02-02 18:02:40 -07001277 uint32_t x,
1278 uint32_t y,
1279 uint32_t z)
1280{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001281 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001282}
1283
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001284ICD_EXPORT void VKAPI vkCmdDispatchIndirect(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001285 VkCmdBuffer cmdBuffer,
1286 VkBuffer buffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001287 VkDeviceSize offset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001288{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001289 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001290}
1291
Tony Barbour8205d902015-04-16 15:59:00 -06001292void VKAPI vkCmdWaitEvents(
1293 VkCmdBuffer cmdBuffer,
Tony Barbour8205d902015-04-16 15:59:00 -06001294 uint32_t eventCount,
1295 const VkEvent* pEvents,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001296 VkPipelineStageFlags sourceStageMask,
1297 VkPipelineStageFlags destStageMask,
Tony Barbour8205d902015-04-16 15:59:00 -06001298 uint32_t memBarrierCount,
Courtney Goeltzenleuchterd9ba3422015-07-12 12:58:58 -06001299 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001300{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001301 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001302}
1303
Tony Barbour8205d902015-04-16 15:59:00 -06001304void VKAPI vkCmdPipelineBarrier(
1305 VkCmdBuffer cmdBuffer,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001306 VkPipelineStageFlags srcStageMask,
Tony Barbourc2e987e2015-06-29 16:20:35 -06001307 VkPipelineStageFlags destStageMask,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001308 VkBool32 byRegion,
Tony Barbour8205d902015-04-16 15:59:00 -06001309 uint32_t memBarrierCount,
Courtney Goeltzenleuchter82b348f2015-07-12 13:07:46 -06001310 const void* const* ppMemBarriers)
David Pinedo0257fbf2015-02-02 18:02:40 -07001311{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001312 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001313}
1314
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001315ICD_EXPORT VkResult VKAPI vkCreateDevice(
Tony Barbour8205d902015-04-16 15:59:00 -06001316 VkPhysicalDevice gpu_,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001317 const VkDeviceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001318 VkDevice* pDevice)
David Pinedo0257fbf2015-02-02 18:02:40 -07001319{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001320 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001321 struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_);
1322 return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice);
1323}
1324
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001325ICD_EXPORT VkResult VKAPI vkDestroyDevice(
1326 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001327{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001328 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001329 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001330}
1331
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001332ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
1333 VkDevice device,
Courtney Goeltzenleuchterf3168062015-03-05 18:09:39 -07001334 uint32_t queueNodeIndex,
David Pinedo0257fbf2015-02-02 18:02:40 -07001335 uint32_t queueIndex,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001336 VkQueue* pQueue)
David Pinedo0257fbf2015-02-02 18:02:40 -07001337{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001338 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001339 struct nulldrv_dev *dev = nulldrv_dev(device);
Mike Stroyan230e6252015-04-17 12:36:38 -06001340 *pQueue = (VkQueue) dev->queues[0];
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001341 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001342}
1343
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001344ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle(
1345 VkDevice device)
David Pinedo0257fbf2015-02-02 18:02:40 -07001346{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001347 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001348 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001349}
1350
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001351ICD_EXPORT VkResult VKAPI vkCreateEvent(
1352 VkDevice device,
1353 const VkEventCreateInfo* pCreateInfo,
1354 VkEvent* pEvent)
David Pinedo0257fbf2015-02-02 18:02:40 -07001355{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001356 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001357 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001358}
1359
Tony Barbourde4124d2015-07-03 10:33:54 -06001360ICD_EXPORT VkResult VKAPI vkDestroyEvent(
1361 VkDevice device,
1362 VkEvent event)
1363{
1364 NULLDRV_LOG_FUNC;
1365 return VK_SUCCESS;
1366}
1367
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001368ICD_EXPORT VkResult VKAPI vkGetEventStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001369 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001370 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001371{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001372 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001373 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001374}
1375
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001376ICD_EXPORT VkResult VKAPI vkSetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001377 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001378 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001379{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001380 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001381 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001382}
1383
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001384ICD_EXPORT VkResult VKAPI vkResetEvent(
Mike Stroyan230e6252015-04-17 12:36:38 -06001385 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001386 VkEvent event_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001387{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001388 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001389 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001390}
1391
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001392ICD_EXPORT VkResult VKAPI vkCreateFence(
1393 VkDevice device,
1394 const VkFenceCreateInfo* pCreateInfo,
1395 VkFence* pFence)
David Pinedo0257fbf2015-02-02 18:02:40 -07001396{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001397 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001398 struct nulldrv_dev *dev = nulldrv_dev(device);
1399
1400 return nulldrv_fence_create(dev, pCreateInfo,
1401 (struct nulldrv_fence **) pFence);
1402}
1403
Tony Barbourde4124d2015-07-03 10:33:54 -06001404ICD_EXPORT VkResult VKAPI vkDestroyFence(
1405 VkDevice device,
1406 VkFence fence)
1407{
1408 NULLDRV_LOG_FUNC;
1409 return VK_SUCCESS;
1410}
1411
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001412ICD_EXPORT VkResult VKAPI vkGetFenceStatus(
Mike Stroyan230e6252015-04-17 12:36:38 -06001413 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001414 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001415{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001416 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001417 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001418}
1419
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001420ICD_EXPORT VkResult VKAPI vkResetFences(
Courtney Goeltzenleuchterf2e33ad2015-06-18 17:28:20 -06001421 VkDevice device,
1422 uint32_t fenceCount,
1423 const VkFence* pFences)
Courtney Goeltzenleuchter1042b472015-04-14 19:07:06 -06001424{
1425 NULLDRV_LOG_FUNC;
1426 return VK_SUCCESS;
1427}
1428
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001429ICD_EXPORT VkResult VKAPI vkWaitForFences(
1430 VkDevice device,
David Pinedo0257fbf2015-02-02 18:02:40 -07001431 uint32_t fenceCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001432 const VkFence* pFences,
Courtney Goeltzenleuchter1f41f542015-07-09 11:44:38 -06001433 VkBool32 waitAll,
David Pinedo0257fbf2015-02-02 18:02:40 -07001434 uint64_t timeout)
1435{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001436 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001437 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001438}
1439
Tony Barbour426b9052015-06-24 16:06:58 -06001440ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
1441 VkPhysicalDevice gpu_,
1442 VkPhysicalDeviceProperties* pProperties)
David Pinedo0257fbf2015-02-02 18:02:40 -07001443{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001444 NULLDRV_LOG_FUNC;
Ian Elliott64a68e12015-04-16 11:57:46 -06001445 VkResult ret = VK_SUCCESS;
1446
Tony Barbour426b9052015-06-24 16:06:58 -06001447 pProperties->apiVersion = VK_API_VERSION;
1448 pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's
1449 pProperties->vendorId = 0;
1450 pProperties->deviceId = 0;
1451 pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
1452 strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
Ian Elliott64a68e12015-04-16 11:57:46 -06001453
1454 return ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001455}
1456
Chris Forbesd7576302015-06-21 22:55:02 +12001457ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures(
1458 VkPhysicalDevice physicalDevice,
1459 VkPhysicalDeviceFeatures* pFeatures)
1460{
1461 NULLDRV_LOG_FUNC;
1462 VkResult ret = VK_SUCCESS;
1463
1464 /* TODO: fill out features */
1465 memset(pFeatures, 0, sizeof(*pFeatures));
1466
1467 return ret;
1468}
1469
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -06001470ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties(
Chris Forbesd7576302015-06-21 22:55:02 +12001471 VkPhysicalDevice physicalDevice,
1472 VkFormat format,
1473 VkFormatProperties* pFormatInfo)
1474{
1475 NULLDRV_LOG_FUNC;
1476 VkResult ret = VK_SUCCESS;
1477
1478 pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
1479 pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures;
1480
1481 return ret;
1482}
1483
1484ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits(
1485 VkPhysicalDevice physicalDevice,
1486 VkPhysicalDeviceLimits* pLimits)
1487{
1488 NULLDRV_LOG_FUNC;
1489 VkResult ret = VK_SUCCESS;
1490
1491 /* TODO: fill out limits */
1492 memset(pLimits, 0, sizeof(*pLimits));
1493
1494 return ret;
1495}
1496
Cody Northropef72e2a2015-08-03 17:04:53 -06001497ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
Tony Barbour426b9052015-06-24 16:06:58 -06001498 VkPhysicalDevice gpu_,
Cody Northropef72e2a2015-08-03 17:04:53 -06001499 uint32_t* pCount,
1500 VkQueueFamilyProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001501 {
Cody Northropef72e2a2015-08-03 17:04:53 -06001502 if (pProperties == NULL) {
1503 *pCount = 1;
1504 return VK_SUCCESS;
1505 }
Tony Barbour426b9052015-06-24 16:06:58 -06001506 pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT;
1507 pProperties->queueCount = 1;
Tony Barbour426b9052015-06-24 16:06:58 -06001508 pProperties->supportsTimestamps = false;
Tobin Ehlis0ef6ec52015-04-16 12:51:37 -06001509
Tony Barbour426b9052015-06-24 16:06:58 -06001510 return VK_SUCCESS;
1511}
1512
Ian Elliotte924ab22015-07-08 13:24:30 -06001513ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
1514 VkPhysicalDevice gpu_,
1515 VkPhysicalDeviceMemoryProperties* pProperties)
1516{
1517 // TODO: Fill in with real data
1518 return VK_SUCCESS;
1519}
1520
1521ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties(
1522 VkPhysicalDevice physicalDevice,
1523 uint32_t* pCount,
1524 VkLayerProperties* pProperties)
1525{
1526 // TODO: Fill in with real data
1527 return VK_SUCCESS;
1528}
1529
Tony Barbour426b9052015-06-24 16:06:58 -06001530ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001531 const char* pLayerName,
1532 uint32_t* pCount,
1533 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001534{
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001535 uint32_t copy_size;
Tony Barbour426b9052015-06-24 16:06:58 -06001536
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001537 if (pCount == NULL) {
1538 return VK_ERROR_INVALID_POINTER;
1539 }
Tony Barbour426b9052015-06-24 16:06:58 -06001540
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001541 if (pProperties == NULL) {
1542 *pCount = NULLDRV_EXT_COUNT;
1543 return VK_SUCCESS;
1544 }
Tony Barbour426b9052015-06-24 16:06:58 -06001545
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001546 copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT;
1547 memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties));
1548 *pCount = copy_size;
1549 if (copy_size < NULLDRV_EXT_COUNT) {
1550 return VK_INCOMPLETE;
1551 }
Tony Barbour426b9052015-06-24 16:06:58 -06001552 return VK_SUCCESS;
1553}
Ian Elliotte924ab22015-07-08 13:24:30 -06001554ICD_EXPORT VkResult VKAPI vkGetGlobalLayerProperties(
1555 uint32_t* pCount,
1556 VkLayerProperties* pProperties)
1557{
1558 // TODO: Fill in with real data
1559 return VK_SUCCESS;
1560}
Tony Barbour426b9052015-06-24 16:06:58 -06001561
1562VkResult VKAPI vkGetPhysicalDeviceExtensionProperties(
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001563 VkPhysicalDevice physicalDevice,
1564 const char* pLayerName,
1565 uint32_t* pCount,
1566 VkExtensionProperties* pProperties)
Tony Barbour426b9052015-06-24 16:06:58 -06001567{
Tony Barbour426b9052015-06-24 16:06:58 -06001568
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001569 if (pCount == NULL) {
1570 return VK_ERROR_INVALID_POINTER;
1571 }
1572
Tony Barbour426b9052015-06-24 16:06:58 -06001573 *pCount = 0;
Courtney Goeltzenleuchter18061cd2015-06-29 15:39:26 -06001574
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001575 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001576}
1577
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001578ICD_EXPORT VkResult VKAPI vkCreateImage(
1579 VkDevice device,
1580 const VkImageCreateInfo* pCreateInfo,
1581 VkImage* pImage)
David Pinedo0257fbf2015-02-02 18:02:40 -07001582{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001583 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001584 struct nulldrv_dev *dev = nulldrv_dev(device);
1585
1586 return nulldrv_img_create(dev, pCreateInfo, false,
1587 (struct nulldrv_img **) pImage);
1588}
1589
Tony Barbourde4124d2015-07-03 10:33:54 -06001590ICD_EXPORT VkResult VKAPI vkDestroyImage(
1591 VkDevice device,
1592 VkImage image)
1593{
1594 NULLDRV_LOG_FUNC;
1595 return VK_SUCCESS;
1596}
1597
Tony Barbour426b9052015-06-24 16:06:58 -06001598ICD_EXPORT VkResult VKAPI vkGetImageSubresourceLayout(
Mike Stroyan230e6252015-04-17 12:36:38 -06001599 VkDevice device,
1600 VkImage image,
1601 const VkImageSubresource* pSubresource,
Tony Barbour426b9052015-06-24 16:06:58 -06001602 VkSubresourceLayout* pLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07001603{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001604 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001605
Tony Barbour426b9052015-06-24 16:06:58 -06001606 pLayout->offset = 0;
1607 pLayout->size = 1;
1608 pLayout->rowPitch = 4;
1609 pLayout->depthPitch = 4;
David Pinedo0257fbf2015-02-02 18:02:40 -07001610
Tony Barbour426b9052015-06-24 16:06:58 -06001611 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001612}
1613
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001614ICD_EXPORT VkResult VKAPI vkAllocMemory(
1615 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001616 const VkMemoryAllocInfo* pAllocInfo,
Tony Barbour8205d902015-04-16 15:59:00 -06001617 VkDeviceMemory* pMem)
David Pinedo0257fbf2015-02-02 18:02:40 -07001618{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001619 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001620 struct nulldrv_dev *dev = nulldrv_dev(device);
1621
1622 return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem);
1623}
1624
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001625ICD_EXPORT VkResult VKAPI vkFreeMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001626 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001627 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001628{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001629 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001630 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001631}
1632
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001633ICD_EXPORT VkResult VKAPI vkMapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001634 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001635 VkDeviceMemory mem_,
Tony Barbour3e3420a2015-04-16 19:09:28 -06001636 VkDeviceSize offset,
1637 VkDeviceSize size,
1638 VkFlags flags,
David Pinedo0257fbf2015-02-02 18:02:40 -07001639 void** ppData)
1640{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001641 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001642 struct nulldrv_mem *mem = nulldrv_mem(mem_);
1643 void *ptr = nulldrv_mem_map(mem, flags);
1644
1645 *ppData = ptr;
1646
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001647 return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
David Pinedo0257fbf2015-02-02 18:02:40 -07001648}
1649
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001650ICD_EXPORT VkResult VKAPI vkUnmapMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001651 VkDevice device,
Tony Barbour8205d902015-04-16 15:59:00 -06001652 VkDeviceMemory mem_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001653{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001654 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001655 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001656}
1657
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001658ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges(
Mike Stroyan230e6252015-04-17 12:36:38 -06001659 VkDevice device,
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -06001660 uint32_t memRangeCount,
1661 const VkMappedMemoryRange* pMemRanges)
1662{
1663 NULLDRV_LOG_FUNC;
1664 return VK_SUCCESS;
1665}
1666
1667ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(
1668 VkDevice device,
1669 uint32_t memRangeCount,
1670 const VkMappedMemoryRange* pMemRanges)
Ian Elliott07de9232015-04-17 10:04:00 -06001671{
1672 NULLDRV_LOG_FUNC;
1673 return VK_SUCCESS;
1674}
1675
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -06001676ICD_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(
1677 VkDevice device,
1678 VkDeviceMemory memory,
1679 VkDeviceSize* pCommittedMemoryInBytes)
1680{
1681 return VK_SUCCESS;
1682}
1683
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001684ICD_EXPORT VkResult VKAPI vkCreateInstance(
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06001685 const VkInstanceCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001686 VkInstance* pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001687{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001688 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001689 struct nulldrv_instance *inst;
1690
1691 inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst),
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -06001692 VK_OBJECT_TYPE_INSTANCE);
David Pinedo0257fbf2015-02-02 18:02:40 -07001693 if (!inst)
Tony Barbour8205d902015-04-16 15:59:00 -06001694 return VK_ERROR_OUT_OF_HOST_MEMORY;
David Pinedo0257fbf2015-02-02 18:02:40 -07001695
Tony Barbour426b9052015-06-24 16:06:58 -06001696 inst->obj.base.get_memory_requirements = NULL;
David Pinedo0257fbf2015-02-02 18:02:40 -07001697
Mike Stroyan230e6252015-04-17 12:36:38 -06001698 *pInstance = (VkInstance) inst;
David Pinedo0257fbf2015-02-02 18:02:40 -07001699
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001700 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001701}
1702
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001703ICD_EXPORT VkResult VKAPI vkDestroyInstance(
1704 VkInstance pInstance)
David Pinedo0257fbf2015-02-02 18:02:40 -07001705{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001706 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001707 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001708}
1709
Tony Barbour8205d902015-04-16 15:59:00 -06001710ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001711 VkInstance instance,
David Pinedo0257fbf2015-02-02 18:02:40 -07001712 uint32_t* pGpuCount,
Tony Barbour8205d902015-04-16 15:59:00 -06001713 VkPhysicalDevice* pGpus)
David Pinedo0257fbf2015-02-02 18:02:40 -07001714{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001715 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001716 VkResult ret;
David Pinedo0257fbf2015-02-02 18:02:40 -07001717 struct nulldrv_gpu *gpu;
1718 *pGpuCount = 1;
1719 ret = nulldrv_gpu_add(0, 0, 0, &gpu);
David Pinedof6768452015-04-21 14:44:02 -06001720 if (ret == VK_SUCCESS && pGpus)
Tony Barbour8205d902015-04-16 15:59:00 -06001721 pGpus[0] = (VkPhysicalDevice) gpu;
David Pinedo0257fbf2015-02-02 18:02:40 -07001722 return ret;
1723}
1724
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001725ICD_EXPORT VkResult VKAPI vkEnumerateLayers(
Tony Barbour8205d902015-04-16 15:59:00 -06001726 VkPhysicalDevice gpu,
David Pinedo0257fbf2015-02-02 18:02:40 -07001727 size_t maxStringSize,
Courtney Goeltzenleuchterbb1f3602015-04-20 11:04:54 -06001728 size_t* pLayerCount,
David Pinedo0257fbf2015-02-02 18:02:40 -07001729 char* const* pOutLayers,
1730 void* pReserved)
1731{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001732 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001733 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001734}
1735
Tony Barbourde4124d2015-07-03 10:33:54 -06001736ICD_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(
1737 VkDevice device,
1738 VkBuffer buffer,
1739 VkMemoryRequirements* pMemoryRequirements)
1740{
1741 NULLDRV_LOG_FUNC;
1742 struct nulldrv_base *base = nulldrv_base((void*)buffer.handle);
1743
1744 return base->get_memory_requirements(base, pMemoryRequirements);
1745}
1746
1747ICD_EXPORT VkResult VKAPI vkGetImageMemoryRequirements(
1748 VkDevice device,
1749 VkImage image,
1750 VkMemoryRequirements* pMemoryRequirements)
1751{
1752 NULLDRV_LOG_FUNC;
1753 struct nulldrv_base *base = nulldrv_base((void*)image.handle);
1754
1755 return base->get_memory_requirements(base, pMemoryRequirements);
1756}
1757
1758ICD_EXPORT VkResult VKAPI vkBindBufferMemory(
1759 VkDevice device,
1760 VkBuffer buffer,
1761 VkDeviceMemory mem_,
1762 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001763{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001764 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001765 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001766}
1767
Tony Barbourde4124d2015-07-03 10:33:54 -06001768ICD_EXPORT VkResult VKAPI vkBindImageMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001769 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06001770 VkImage image,
Tony Barbour8205d902015-04-16 15:59:00 -06001771 VkDeviceMemory mem_,
1772 VkDeviceSize memOffset)
David Pinedo0257fbf2015-02-02 18:02:40 -07001773{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001774 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001775 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001776}
1777
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001778ICD_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements(
1779 VkDevice device,
1780 VkImage image,
1781 uint32_t* pNumRequirements,
1782 VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
1783{
1784 NULLDRV_LOG_FUNC;
1785 return VK_SUCCESS;
1786}
1787
1788ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties(
1789 VkPhysicalDevice physicalDevice,
1790 VkFormat format,
1791 VkImageType type,
1792 uint32_t samples,
1793 VkImageUsageFlags usage,
1794 VkImageTiling tiling,
1795 uint32_t* pNumProperties,
1796 VkSparseImageFormatProperties* pProperties)
1797{
1798 NULLDRV_LOG_FUNC;
1799 return VK_SUCCESS;
1800}
1801
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001802ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory(
Mike Stroyan230e6252015-04-17 12:36:38 -06001803 VkQueue queue,
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001804 VkBuffer buffer,
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001805 uint32_t numBindings,
1806 const VkSparseMemoryBindInfo* pBindInfo)
1807{
1808 NULLDRV_LOG_FUNC;
1809 return VK_SUCCESS;
1810}
1811
1812ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory(
1813 VkQueue queue,
1814 VkImage image,
1815 uint32_t numBindings,
1816 const VkSparseMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001817{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001818 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001819 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001820}
1821
Mark Lobodzinskifb9f5642015-05-11 17:21:15 -05001822ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory(
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -06001823 VkQueue queue,
1824 VkImage image,
1825 uint32_t numBindings,
1826 const VkSparseImageMemoryBindInfo* pBindInfo)
David Pinedo0257fbf2015-02-02 18:02:40 -07001827{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001828 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001829 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001830}
Jon Ashburn0e249962015-07-10 09:41:15 -07001831ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
1832 VkDevice device,
1833 const VkPipelineCacheCreateInfo* pCreateInfo,
1834 VkPipelineCache* pPipelineCache)
1835{
David Pinedo0257fbf2015-02-02 18:02:40 -07001836
Jon Ashburn0e249962015-07-10 09:41:15 -07001837 NULLDRV_LOG_FUNC;
1838 return VK_SUCCESS;
1839}
1840
Tony Barbourde4124d2015-07-03 10:33:54 -06001841ICD_EXPORT VkResult VKAPI vkDestroyPipeline(
1842 VkDevice device,
1843 VkPipeline pipeline)
1844{
1845 NULLDRV_LOG_FUNC;
1846 return VK_SUCCESS;
1847}
1848
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06001849VkResult VKAPI vkDestroyPipelineCache(
1850 VkDevice device,
1851 VkPipelineCache pipelineCache)
Jon Ashburn0e249962015-07-10 09:41:15 -07001852{
1853 NULLDRV_LOG_FUNC;
1854 return VK_SUCCESS;
1855}
1856
1857ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize(
1858 VkDevice device,
1859 VkPipelineCache pipelineCache)
1860{
1861 NULLDRV_LOG_FUNC;
1862 return VK_ERROR_UNAVAILABLE;
1863}
1864
1865ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
1866 VkDevice device,
1867 VkPipelineCache pipelineCache,
1868 void* pData)
1869{
1870 NULLDRV_LOG_FUNC;
1871 return VK_ERROR_UNAVAILABLE;
1872}
1873
1874ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
1875 VkDevice device,
1876 VkPipelineCache destCache,
1877 uint32_t srcCacheCount,
1878 const VkPipelineCache* pSrcCaches)
1879{
1880 NULLDRV_LOG_FUNC;
1881 return VK_ERROR_UNAVAILABLE;
1882}
1883ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001884 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001885 VkPipelineCache pipelineCache,
1886 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001887 const VkGraphicsPipelineCreateInfo* pCreateInfo,
1888 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001889{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001890 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07001891 struct nulldrv_dev *dev = nulldrv_dev(device);
1892
1893 return graphics_pipeline_create(dev, pCreateInfo,
1894 (struct nulldrv_pipeline **) pPipeline);
1895}
1896
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001897
Courtney Goeltzenleuchter32876a12015-03-25 15:37:49 -06001898
Jon Ashburn0e249962015-07-10 09:41:15 -07001899ICD_EXPORT VkResult VKAPI vkCreateComputePipelines(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001900 VkDevice device,
Jon Ashburn0e249962015-07-10 09:41:15 -07001901 VkPipelineCache pipelineCache,
1902 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001903 const VkComputePipelineCreateInfo* pCreateInfo,
1904 VkPipeline* pPipeline)
David Pinedo0257fbf2015-02-02 18:02:40 -07001905{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001906 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001907 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001908}
1909
David Pinedo0257fbf2015-02-02 18:02:40 -07001910
David Pinedo0257fbf2015-02-02 18:02:40 -07001911
Jon Ashburn0e249962015-07-10 09:41:15 -07001912
David Pinedo0257fbf2015-02-02 18:02:40 -07001913
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001914ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
1915 VkDevice device,
1916 const VkQueryPoolCreateInfo* pCreateInfo,
1917 VkQueryPool* pQueryPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07001918{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001919 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001920 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001921}
1922
Tony Barbourde4124d2015-07-03 10:33:54 -06001923ICD_EXPORT VkResult VKAPI vkDestroyQueryPool(
1924 VkDevice device,
1925 VkQueryPool queryPoool)
1926{
1927 NULLDRV_LOG_FUNC;
1928 return VK_SUCCESS;
1929}
1930
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001931ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults(
Mike Stroyan230e6252015-04-17 12:36:38 -06001932 VkDevice device,
1933 VkQueryPool queryPool,
David Pinedo0257fbf2015-02-02 18:02:40 -07001934 uint32_t startQuery,
1935 uint32_t queryCount,
1936 size_t* pDataSize,
Tony Barbour8205d902015-04-16 15:59:00 -06001937 void* pData,
1938 VkQueryResultFlags flags)
David Pinedo0257fbf2015-02-02 18:02:40 -07001939{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001940 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001941 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001942}
1943
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001944ICD_EXPORT VkResult VKAPI vkQueueWaitIdle(
1945 VkQueue queue_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001946{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001947 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001948 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001949}
1950
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001951ICD_EXPORT VkResult VKAPI vkQueueSubmit(
1952 VkQueue queue_,
David Pinedo0257fbf2015-02-02 18:02:40 -07001953 uint32_t cmdBufferCount,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001954 const VkCmdBuffer* pCmdBuffers,
1955 VkFence fence_)
David Pinedo0257fbf2015-02-02 18:02:40 -07001956{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001957 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001958 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001959}
1960
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001961ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
1962 VkDevice device,
1963 const VkSemaphoreCreateInfo* pCreateInfo,
1964 VkSemaphore* pSemaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001965{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001966 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001967 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001968}
1969
Tony Barbourde4124d2015-07-03 10:33:54 -06001970ICD_EXPORT VkResult VKAPI vkDestroySemaphore(
1971 VkDevice device,
1972 VkSemaphore semaphore)
1973{
1974 NULLDRV_LOG_FUNC;
1975 return VK_SUCCESS;
1976}
1977
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001978ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore(
1979 VkQueue queue,
1980 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001981{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001982 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001983 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001984}
1985
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001986ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore(
1987 VkQueue queue,
1988 VkSemaphore semaphore)
David Pinedo0257fbf2015-02-02 18:02:40 -07001989{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001990 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06001991 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07001992}
1993
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06001994ICD_EXPORT VkResult VKAPI vkCreateSampler(
1995 VkDevice device,
1996 const VkSamplerCreateInfo* pCreateInfo,
1997 VkSampler* pSampler)
David Pinedo0257fbf2015-02-02 18:02:40 -07001998{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07001999 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002000 struct nulldrv_dev *dev = nulldrv_dev(device);
2001
2002 return nulldrv_sampler_create(dev, pCreateInfo,
2003 (struct nulldrv_sampler **) pSampler);
2004}
2005
Tony Barbourde4124d2015-07-03 10:33:54 -06002006ICD_EXPORT VkResult VKAPI vkDestroySampler(
2007 VkDevice device,
2008 VkSampler sampler)
2009{
2010 NULLDRV_LOG_FUNC;
2011 return VK_SUCCESS;
2012}
2013
Ian Elliotte924ab22015-07-08 13:24:30 -06002014ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
2015 VkDevice device,
2016 const VkShaderModuleCreateInfo* pCreateInfo,
2017 VkShaderModule* pShaderModule)
2018{
2019 // TODO: Fill in with real data
Tony Barbourde4124d2015-07-03 10:33:54 -06002020 NULLDRV_LOG_FUNC;
2021 return VK_SUCCESS;
2022}
2023
2024ICD_EXPORT VkResult VKAPI vkDestroyShaderModule(
2025 VkDevice device,
2026 VkShaderModule shaderModule)
2027{
2028 // TODO: Fill in with real data
2029 NULLDRV_LOG_FUNC;
Ian Elliotte924ab22015-07-08 13:24:30 -06002030 return VK_SUCCESS;
2031}
2032
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002033ICD_EXPORT VkResult VKAPI vkCreateShader(
2034 VkDevice device,
2035 const VkShaderCreateInfo* pCreateInfo,
2036 VkShader* pShader)
David Pinedo0257fbf2015-02-02 18:02:40 -07002037{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002038 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002039 struct nulldrv_dev *dev = nulldrv_dev(device);
2040
2041 return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader);
2042}
2043
Tony Barbourde4124d2015-07-03 10:33:54 -06002044ICD_EXPORT VkResult VKAPI vkDestroyShader(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002045 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002046 VkShader shader)
2047{
2048 NULLDRV_LOG_FUNC;
2049 return VK_SUCCESS;
2050}
2051
2052ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState(
2053 VkDevice device,
2054 const VkDynamicViewportStateCreateInfo* pCreateInfo,
2055 VkDynamicViewportState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002056{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002057 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002058 struct nulldrv_dev *dev = nulldrv_dev(device);
2059
2060 return nulldrv_viewport_state_create(dev, pCreateInfo,
2061 (struct nulldrv_dynamic_vp **) pState);
2062}
2063
Tony Barbourde4124d2015-07-03 10:33:54 -06002064ICD_EXPORT VkResult VKAPI vkDestroyDynamicViewportState(
2065 VkDevice device,
2066 VkDynamicViewportState dynamicViewportState)
2067{
2068 NULLDRV_LOG_FUNC;
2069 return VK_SUCCESS;
2070}
2071
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002072ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState(
2073 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002074 const VkDynamicRasterStateCreateInfo* pCreateInfo,
2075 VkDynamicRasterState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002076{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002077 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002078 struct nulldrv_dev *dev = nulldrv_dev(device);
2079
2080 return nulldrv_raster_state_create(dev, pCreateInfo,
2081 (struct nulldrv_dynamic_rs **) pState);
2082}
2083
Tony Barbourde4124d2015-07-03 10:33:54 -06002084ICD_EXPORT VkResult VKAPI vkDestroyDynamicRasterState(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002085 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002086 VkDynamicRasterState dynamicRasterState)
2087{
2088 NULLDRV_LOG_FUNC;
2089 return VK_SUCCESS;
2090}
2091
2092ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState(
2093 VkDevice device,
2094 const VkDynamicColorBlendStateCreateInfo* pCreateInfo,
2095 VkDynamicColorBlendState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002096{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002097 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002098 struct nulldrv_dev *dev = nulldrv_dev(device);
2099
2100 return nulldrv_blend_state_create(dev, pCreateInfo,
2101 (struct nulldrv_dynamic_cb **) pState);
2102}
2103
Tony Barbourde4124d2015-07-03 10:33:54 -06002104ICD_EXPORT VkResult VKAPI vkDestroyDynamicColorBlendState(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002105 VkDevice device,
Tony Barbourde4124d2015-07-03 10:33:54 -06002106 VkDynamicColorBlendState dynamicColorBlendState)
2107{
2108 NULLDRV_LOG_FUNC;
2109 return VK_SUCCESS;
2110}
2111
2112ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState(
2113 VkDevice device,
2114 const VkDynamicDepthStencilStateCreateInfo* pCreateInfo,
2115 VkDynamicDepthStencilState* pState)
David Pinedo0257fbf2015-02-02 18:02:40 -07002116{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002117 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002118 struct nulldrv_dev *dev = nulldrv_dev(device);
2119
2120 return nulldrv_ds_state_create(dev, pCreateInfo,
2121 (struct nulldrv_dynamic_ds **) pState);
2122}
2123
Tony Barbourde4124d2015-07-03 10:33:54 -06002124ICD_EXPORT VkResult VKAPI vkDestroyDynamicDepthStencilState(
2125 VkDevice device,
2126 VkDynamicDepthStencilState dynamicDepthStencilState)
2127{
2128 NULLDRV_LOG_FUNC;
2129 return VK_SUCCESS;
2130}
2131
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002132ICD_EXPORT VkResult VKAPI vkCreateBufferView(
2133 VkDevice device,
Courtney Goeltzenleuchterddcb6192015-04-14 18:48:46 -06002134 const VkBufferViewCreateInfo* pCreateInfo,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002135 VkBufferView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002136{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002137 NULLDRV_LOG_FUNC;
2138 struct nulldrv_dev *dev = nulldrv_dev(device);
2139
2140 return nulldrv_buf_view_create(dev, pCreateInfo,
2141 (struct nulldrv_buf_view **) pView);
David Pinedo0257fbf2015-02-02 18:02:40 -07002142}
2143
Tony Barbourde4124d2015-07-03 10:33:54 -06002144ICD_EXPORT VkResult VKAPI vkDestroyBufferView(
2145 VkDevice device,
2146 VkBufferView bufferView)
2147{
2148 NULLDRV_LOG_FUNC;
2149 return VK_SUCCESS;
2150}
2151
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002152ICD_EXPORT VkResult VKAPI vkCreateImageView(
2153 VkDevice device,
2154 const VkImageViewCreateInfo* pCreateInfo,
2155 VkImageView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002156{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002157 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002158 struct nulldrv_dev *dev = nulldrv_dev(device);
2159
2160 return nulldrv_img_view_create(dev, pCreateInfo,
2161 (struct nulldrv_img_view **) pView);
2162}
2163
Tony Barbourde4124d2015-07-03 10:33:54 -06002164ICD_EXPORT VkResult VKAPI vkDestroyImageView(
2165 VkDevice device,
2166 VkImageView imageView)
2167{
2168 NULLDRV_LOG_FUNC;
2169 return VK_SUCCESS;
2170}
2171
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06002172ICD_EXPORT VkResult VKAPI vkCreateAttachmentView(
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002173 VkDevice device,
Chia-I Wuc278df82015-07-07 11:50:03 +08002174 const VkAttachmentViewCreateInfo* pCreateInfo,
2175 VkAttachmentView* pView)
David Pinedo0257fbf2015-02-02 18:02:40 -07002176{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002177 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002178 struct nulldrv_dev *dev = nulldrv_dev(device);
2179
2180 return nulldrv_rt_view_create(dev, pCreateInfo,
2181 (struct nulldrv_rt_view **) pView);
2182}
2183
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06002184ICD_EXPORT VkResult VKAPI vkDestroyAttachmentView(
Tony Barbourde4124d2015-07-03 10:33:54 -06002185 VkDevice device,
Courtney Goeltzenleuchtera4cd8192015-07-10 17:44:33 -06002186 VkAttachmentView attachmentView)
Tony Barbourde4124d2015-07-03 10:33:54 -06002187{
2188 NULLDRV_LOG_FUNC;
2189 return VK_SUCCESS;
2190}
2191
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002192ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
2193 VkDevice device,
2194 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
2195 VkDescriptorSetLayout* pSetLayout)
David Pinedo0257fbf2015-02-02 18:02:40 -07002196{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002197 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002198 struct nulldrv_dev *dev = nulldrv_dev(device);
David Pinedo0257fbf2015-02-02 18:02:40 -07002199
Chia-I Wu7732cb22015-03-26 15:27:55 +08002200 return nulldrv_desc_layout_create(dev, pCreateInfo,
David Pinedo0257fbf2015-02-02 18:02:40 -07002201 (struct nulldrv_desc_layout **) pSetLayout);
2202}
2203
Tony Barbourde4124d2015-07-03 10:33:54 -06002204ICD_EXPORT VkResult VKAPI vkDestroyDescriptorSetLayout(
2205 VkDevice device,
2206 VkDescriptorSetLayout descriptorSetLayout)
2207{
2208 NULLDRV_LOG_FUNC;
2209 return VK_SUCCESS;
2210}
2211
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002212ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
2213 VkDevice device,
2214 const VkPipelineLayoutCreateInfo* pCreateInfo,
2215 VkPipelineLayout* pPipelineLayout)
Chia-I Wu7732cb22015-03-26 15:27:55 +08002216{
2217 NULLDRV_LOG_FUNC;
2218 struct nulldrv_dev *dev = nulldrv_dev(device);
2219
Mark Lobodzinski556f7212015-04-17 14:11:39 -05002220 return nulldrv_pipeline_layout_create(dev,
2221 pCreateInfo,
2222 (struct nulldrv_pipeline_layout **) pPipelineLayout);
Chia-I Wu7732cb22015-03-26 15:27:55 +08002223}
2224
Tony Barbourde4124d2015-07-03 10:33:54 -06002225ICD_EXPORT VkResult VKAPI vkDestroyPipelineLayout(
2226 VkDevice device,
2227 VkPipelineLayout pipelineLayout)
2228{
2229 NULLDRV_LOG_FUNC;
2230 return VK_SUCCESS;
2231}
2232
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002233ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
2234 VkDevice device,
2235 VkDescriptorPoolUsage poolUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002236 uint32_t maxSets,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002237 const VkDescriptorPoolCreateInfo* pCreateInfo,
2238 VkDescriptorPool* pDescriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002239{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002240 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002241 struct nulldrv_dev *dev = nulldrv_dev(device);
2242
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002243 return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo,
2244 (struct nulldrv_desc_pool **) pDescriptorPool);
David Pinedo0257fbf2015-02-02 18:02:40 -07002245}
2246
Tony Barbourde4124d2015-07-03 10:33:54 -06002247ICD_EXPORT VkResult VKAPI vkDestroyDescriptorPool(
2248 VkDevice device,
2249 VkDescriptorPool descriptorPool)
2250{
2251 NULLDRV_LOG_FUNC;
2252 return VK_SUCCESS;
2253}
2254
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002255ICD_EXPORT VkResult VKAPI vkResetDescriptorPool(
Mike Stroyan230e6252015-04-17 12:36:38 -06002256 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002257 VkDescriptorPool descriptorPool)
David Pinedo0257fbf2015-02-02 18:02:40 -07002258{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002259 NULLDRV_LOG_FUNC;
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002260 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002261}
2262
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002263ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets(
Mike Stroyan230e6252015-04-17 12:36:38 -06002264 VkDevice device,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002265 VkDescriptorPool descriptorPool,
2266 VkDescriptorSetUsage setUsage,
David Pinedo0257fbf2015-02-02 18:02:40 -07002267 uint32_t count,
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002268 const VkDescriptorSetLayout* pSetLayouts,
Cody Northropc8aa4a52015-08-03 12:47:29 -06002269 VkDescriptorSet* pDescriptorSets)
David Pinedo0257fbf2015-02-02 18:02:40 -07002270{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002271 NULLDRV_LOG_FUNC;
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002272 struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool);
2273 struct nulldrv_dev *dev = pool->dev;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002274 VkResult ret = VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002275 uint32_t i;
2276
2277 for (i = 0; i < count; i++) {
2278 const struct nulldrv_desc_layout *layout =
Tony Barbour8db65372015-07-10 18:32:33 -06002279 nulldrv_desc_layout(pSetLayouts[i]);
David Pinedo0257fbf2015-02-02 18:02:40 -07002280
Chia-I Wu8d24b3b2015-03-26 13:14:16 +08002281 ret = nulldrv_desc_set_create(dev, pool, setUsage, layout,
David Pinedo0257fbf2015-02-02 18:02:40 -07002282 (struct nulldrv_desc_set **) &pDescriptorSets[i]);
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002283 if (ret != VK_SUCCESS)
David Pinedo0257fbf2015-02-02 18:02:40 -07002284 break;
2285 }
2286
David Pinedo0257fbf2015-02-02 18:02:40 -07002287 return ret;
2288}
2289
Tony Barbourb857d312015-07-10 10:50:45 -06002290ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets(
2291 VkDevice device,
2292 VkDescriptorPool descriptorPool,
2293 uint32_t count,
2294 const VkDescriptorSet* pDescriptorSets)
2295{
2296 NULLDRV_LOG_FUNC;
2297 return VK_SUCCESS;
2298}
2299
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002300ICD_EXPORT VkResult VKAPI vkUpdateDescriptorSets(
2301 VkDevice device,
2302 uint32_t writeCount,
2303 const VkWriteDescriptorSet* pDescriptorWrites,
2304 uint32_t copyCount,
2305 const VkCopyDescriptorSet* pDescriptorCopies)
David Pinedo0257fbf2015-02-02 18:02:40 -07002306{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002307 NULLDRV_LOG_FUNC;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +08002308 return VK_SUCCESS;
David Pinedo0257fbf2015-02-02 18:02:40 -07002309}
2310
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002311ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
2312 VkDevice device,
2313 const VkFramebufferCreateInfo* info,
2314 VkFramebuffer* fb_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002315{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002316 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002317 struct nulldrv_dev *dev = nulldrv_dev(device);
2318
2319 return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret);
2320}
2321
Tony Barbourde4124d2015-07-03 10:33:54 -06002322ICD_EXPORT VkResult VKAPI vkDestroyFramebuffer(
2323 VkDevice device,
2324 VkFramebuffer framebuffer)
2325{
2326 NULLDRV_LOG_FUNC;
2327 return VK_SUCCESS;
2328}
David Pinedo0257fbf2015-02-02 18:02:40 -07002329
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002330ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
2331 VkDevice device,
2332 const VkRenderPassCreateInfo* info,
2333 VkRenderPass* rp_ret)
David Pinedo0257fbf2015-02-02 18:02:40 -07002334{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002335 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002336 struct nulldrv_dev *dev = nulldrv_dev(device);
2337
2338 return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret);
2339}
2340
Tony Barbourde4124d2015-07-03 10:33:54 -06002341ICD_EXPORT VkResult VKAPI vkDestroyRenderPass(
2342 VkDevice device,
2343 VkRenderPass renderPass)
2344{
2345 NULLDRV_LOG_FUNC;
2346 return VK_SUCCESS;
2347}
2348
Courtney Goeltzenleuchtera375b622015-07-27 14:04:01 -06002349ICD_EXPORT void VKAPI vkCmdPushConstants(
2350 VkCmdBuffer cmdBuffer,
2351 VkPipelineLayout layout,
2352 VkShaderStageFlags stageFlags,
2353 uint32_t start,
2354 uint32_t length,
2355 const void* values)
2356{
2357 /* TODO: Implement */
2358}
2359
Courtney Goeltzenleuchter07fe0662015-07-27 13:47:08 -06002360ICD_EXPORT VkResult VKAPI vkGetRenderAreaGranularity(
2361 VkDevice device,
2362 VkRenderPass renderPass,
2363 VkExtent2D* pGranularity)
2364{
2365 pGranularity->height = 1;
2366 pGranularity->width = 1;
2367
2368 return VK_SUCCESS;
2369}
2370
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002371ICD_EXPORT void VKAPI vkCmdBeginRenderPass(
Chia-I Wuc278df82015-07-07 11:50:03 +08002372 VkCmdBuffer cmdBuffer,
2373 const VkRenderPassBeginInfo* pRenderPassBegin,
2374 VkRenderPassContents contents)
2375{
2376 NULLDRV_LOG_FUNC;
2377}
2378
2379ICD_EXPORT void VKAPI vkCmdNextSubpass(
2380 VkCmdBuffer cmdBuffer,
2381 VkRenderPassContents contents)
David Pinedo0257fbf2015-02-02 18:02:40 -07002382{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002383 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002384}
2385
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002386ICD_EXPORT void VKAPI vkCmdEndRenderPass(
Chia-I Wu88eaa3b2015-06-26 15:34:39 +08002387 VkCmdBuffer cmdBuffer)
2388{
2389 NULLDRV_LOG_FUNC;
2390}
2391
2392ICD_EXPORT void VKAPI vkCmdExecuteCommands(
2393 VkCmdBuffer cmdBuffer,
2394 uint32_t cmdBuffersCount,
2395 const VkCmdBuffer* pCmdBuffers)
David Pinedo0257fbf2015-02-02 18:02:40 -07002396{
David Pinedo8e9cb3b2015-02-10 15:02:08 -07002397 NULLDRV_LOG_FUNC;
David Pinedo0257fbf2015-02-02 18:02:40 -07002398}
Ian Elliottf93069f2015-02-19 14:26:19 -07002399
2400ICD_EXPORT void* xcbCreateWindow(
2401 uint16_t width,
2402 uint16_t height)
2403{
2404 static uint32_t window; // Kludge to the max
2405 NULLDRV_LOG_FUNC;
2406 return &window;
2407}
2408
2409// May not be needed, if we stub out stuf in tri.c
2410ICD_EXPORT void xcbDestroyWindow()
2411{
2412 NULLDRV_LOG_FUNC;
2413}
2414
2415ICD_EXPORT int xcbGetMessage(void *msg)
2416{
2417 NULLDRV_LOG_FUNC;
2418 return 0;
2419}
2420
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -06002421ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence)
Ian Elliottf93069f2015-02-19 14:26:19 -07002422{
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -06002423 return VK_SUCCESS;
Ian Elliottf93069f2015-02-19 14:26:19 -07002424}
David Pinedo07494fd2015-07-24 10:54:41 -06002425
2426ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties(
2427 VkPhysicalDevice physicalDevice,
2428 VkFormat format,
2429 VkImageType type,
2430 VkImageTiling tiling,
2431 VkImageUsageFlags usage,
2432 VkImageFormatProperties* pImageFormatProperties)
2433{
2434 return VK_ERROR_UNAVAILABLE;
2435}