David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1 | /* |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2 | * Vulkan null driver |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 3 | * |
| 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 Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 27 | #include <stdio.h> |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 28 | |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 29 | #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 Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 42 | static const char * const nulldrv_gpu_exts[NULLDRV_EXT_COUNT] = { |
Ian Elliott | 53bd3dc | 2015-07-06 14:29:31 -0600 | [diff] [blame] | 43 | [NULLDRV_EXT_WSI_SWAPCHAIN] = VK_WSI_SWAPCHAIN_EXTENSION_NAME, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 44 | }; |
Courtney Goeltzenleuchter | e023ff4 | 2015-06-01 15:10:03 -0600 | [diff] [blame] | 45 | static const VkExtensionProperties intel_gpu_exts[NULLDRV_EXT_COUNT] = { |
| 46 | { |
Ian Elliott | 53bd3dc | 2015-07-06 14:29:31 -0600 | [diff] [blame] | 47 | .extName = VK_WSI_SWAPCHAIN_EXTENSION_NAME, |
| 48 | .specVersion = VK_WSI_SWAPCHAIN_REVISION, |
Courtney Goeltzenleuchter | e023ff4 | 2015-06-01 15:10:03 -0600 | [diff] [blame] | 49 | } |
| 50 | }; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 51 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 52 | static struct nulldrv_base *nulldrv_base(void* base) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 53 | { |
| 54 | return (struct nulldrv_base *) base; |
| 55 | } |
| 56 | |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 57 | static struct nulldrv_base *nulldrv_base_create( |
| 58 | struct nulldrv_dev *dev, |
| 59 | size_t obj_size, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 60 | VkDbgObjectType type) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 61 | { |
| 62 | struct nulldrv_base *base; |
| 63 | |
| 64 | if (!obj_size) |
| 65 | obj_size = sizeof(*base); |
| 66 | |
| 67 | assert(obj_size >= sizeof(*base)); |
| 68 | |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 69 | base = (struct nulldrv_base*)malloc(obj_size); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 70 | 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 Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 76 | set_loader_magic_value(base); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 77 | |
| 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 Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 87 | base->get_memory_requirements = NULL; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 88 | |
| 89 | return base; |
| 90 | } |
| 91 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 92 | static VkResult nulldrv_gpu_add(int devid, const char *primary_node, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 93 | const char *render_node, struct nulldrv_gpu **gpu_ret) |
| 94 | { |
| 95 | struct nulldrv_gpu *gpu; |
| 96 | |
Chia-I Wu | 493a175 | 2015-02-22 14:40:25 +0800 | [diff] [blame] | 97 | gpu = malloc(sizeof(*gpu)); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 98 | if (!gpu) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 99 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 100 | memset(gpu, 0, sizeof(*gpu)); |
Mark Lobodzinski | 97dcd04 | 2015-04-16 08:52:00 -0500 | [diff] [blame] | 101 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 102 | // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 103 | set_loader_magic_value(gpu); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 104 | |
| 105 | *gpu_ret = gpu; |
| 106 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 107 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 108 | } |
| 109 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 110 | static VkResult nulldrv_queue_create(struct nulldrv_dev *dev, |
Chia-I Wu | b5ed9e6 | 2015-03-05 14:26:54 -0700 | [diff] [blame] | 111 | uint32_t node_index, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 112 | struct nulldrv_queue **queue_ret) |
| 113 | { |
| 114 | struct nulldrv_queue *queue; |
| 115 | |
| 116 | queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 117 | VK_OBJECT_TYPE_QUEUE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 118 | if (!queue) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 119 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 120 | |
| 121 | queue->dev = dev; |
| 122 | |
| 123 | *queue_ret = queue; |
| 124 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 125 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 126 | } |
| 127 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 128 | static VkResult dev_create_queues(struct nulldrv_dev *dev, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 129 | const VkDeviceQueueCreateInfo *queues, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 130 | uint32_t count) |
| 131 | { |
| 132 | uint32_t i; |
| 133 | |
| 134 | if (!count) |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 135 | return VK_ERROR_INVALID_POINTER; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 136 | |
| 137 | for (i = 0; i < count; i++) { |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 138 | const VkDeviceQueueCreateInfo *q = &queues[i]; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 139 | VkResult ret = VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 140 | |
Tony Barbour | 29b1206 | 2015-07-13 13:37:24 -0600 | [diff] [blame] | 141 | if (q->queueCount == 1 && !dev->queues[q->queueFamilyIndex]) { |
| 142 | ret = nulldrv_queue_create(dev, q->queueFamilyIndex, |
| 143 | &dev->queues[q->queueFamilyIndex]); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 144 | } |
| 145 | else { |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 146 | ret = VK_ERROR_INVALID_POINTER; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 147 | } |
| 148 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 149 | if (ret != VK_SUCCESS) { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 150 | return ret; |
| 151 | } |
| 152 | } |
| 153 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 154 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 155 | } |
| 156 | |
Courtney Goeltzenleuchter | e023ff4 | 2015-06-01 15:10:03 -0600 | [diff] [blame] | 157 | static enum nulldrv_ext_type nulldrv_gpu_lookup_extension( |
| 158 | const struct nulldrv_gpu *gpu, |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 159 | const char* extName) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 160 | { |
| 161 | enum nulldrv_ext_type type; |
| 162 | |
| 163 | for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) { |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 164 | if (strcmp(nulldrv_gpu_exts[type], extName) == 0) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 165 | break; |
| 166 | } |
| 167 | |
| 168 | assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID); |
| 169 | |
| 170 | return type; |
| 171 | } |
| 172 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 173 | static VkResult nulldrv_desc_ooxx_create(struct nulldrv_dev *dev, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 174 | struct nulldrv_desc_ooxx **ooxx_ret) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 175 | { |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 176 | struct nulldrv_desc_ooxx *ooxx; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 177 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 178 | ooxx = malloc(sizeof(*ooxx)); |
| 179 | if (!ooxx) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 180 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 181 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 182 | memset(ooxx, 0, sizeof(*ooxx)); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 183 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 184 | ooxx->surface_desc_size = 0; |
| 185 | ooxx->sampler_desc_size = 0; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 186 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 187 | *ooxx_ret = ooxx; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 188 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 189 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 190 | } |
| 191 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 192 | static VkResult nulldrv_dev_create(struct nulldrv_gpu *gpu, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 193 | const VkDeviceCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 194 | struct nulldrv_dev **dev_ret) |
| 195 | { |
| 196 | struct nulldrv_dev *dev; |
| 197 | uint32_t i; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 198 | VkResult ret; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 199 | |
| 200 | dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 201 | VK_OBJECT_TYPE_DEVICE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 202 | if (!dev) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 203 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 204 | |
Courtney Goeltzenleuchter | e023ff4 | 2015-06-01 15:10:03 -0600 | [diff] [blame] | 205 | for (i = 0; i < info->extensionCount; i++) { |
| 206 | const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension( |
| 207 | gpu, |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 208 | info->ppEnabledExtensionNames[i]); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 209 | |
Courtney Goeltzenleuchter | e023ff4 | 2015-06-01 15:10:03 -0600 | [diff] [blame] | 210 | if (ext == NULLDRV_EXT_INVALID) |
| 211 | return VK_ERROR_INVALID_EXTENSION; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 212 | |
Courtney Goeltzenleuchter | e023ff4 | 2015-06-01 15:10:03 -0600 | [diff] [blame] | 213 | dev->exts[ext] = true; |
| 214 | } |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 215 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 216 | ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx); |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 217 | if (ret != VK_SUCCESS) { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 218 | return ret; |
| 219 | } |
| 220 | |
| 221 | ret = dev_create_queues(dev, info->pRequestedQueues, |
| 222 | info->queueRecordCount); |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 223 | if (ret != VK_SUCCESS) { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 224 | return ret; |
| 225 | } |
| 226 | |
| 227 | *dev_ret = dev; |
| 228 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 229 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 230 | } |
| 231 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 232 | static struct nulldrv_gpu *nulldrv_gpu(VkPhysicalDevice gpu) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 233 | { |
| 234 | return (struct nulldrv_gpu *) gpu; |
| 235 | } |
| 236 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 237 | static VkResult nulldrv_rt_view_create(struct nulldrv_dev *dev, |
Chia-I Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 238 | const VkAttachmentViewCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 239 | 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 Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 244 | VK_OBJECT_TYPE_ATTACHMENT_VIEW); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 245 | if (!view) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 246 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 247 | |
| 248 | *view_ret = view; |
| 249 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 250 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 253 | static VkResult nulldrv_fence_create(struct nulldrv_dev *dev, |
| 254 | const VkFenceCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 255 | struct nulldrv_fence **fence_ret) |
| 256 | { |
| 257 | struct nulldrv_fence *fence; |
| 258 | |
| 259 | fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 260 | VK_OBJECT_TYPE_FENCE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 261 | if (!fence) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 262 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 263 | |
| 264 | *fence_ret = fence; |
| 265 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 266 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 267 | } |
| 268 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 269 | static struct nulldrv_dev *nulldrv_dev(VkDevice dev) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 270 | { |
| 271 | return (struct nulldrv_dev *) dev; |
| 272 | } |
| 273 | |
| 274 | static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base) |
| 275 | { |
| 276 | return (struct nulldrv_img *) base; |
| 277 | } |
| 278 | |
| 279 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 280 | static VkResult img_get_memory_requirements(struct nulldrv_base *base, |
| 281 | VkMemoryRequirements *pRequirements) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 282 | { |
| 283 | struct nulldrv_img *img = nulldrv_img_from_base(base); |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 284 | VkResult ret = VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 285 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 286 | pRequirements->size = img->total_size; |
| 287 | pRequirements->alignment = 4096; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 288 | |
| 289 | return ret; |
| 290 | } |
| 291 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 292 | static VkResult nulldrv_img_create(struct nulldrv_dev *dev, |
| 293 | const VkImageCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 294 | 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 Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 300 | VK_OBJECT_TYPE_IMAGE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 301 | if (!img) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 302 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 303 | |
| 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 Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 309 | img->samples = info->samples; |
| 310 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 311 | img->obj.base.get_memory_requirements = img_get_memory_requirements; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 312 | |
| 313 | *img_ret = img; |
| 314 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 315 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 316 | } |
| 317 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 318 | static struct nulldrv_img *nulldrv_img(VkImage image) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 319 | { |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 320 | return *(struct nulldrv_img **) ℑ |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 321 | } |
| 322 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 323 | static VkResult nulldrv_mem_alloc(struct nulldrv_dev *dev, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 324 | const VkMemoryAllocInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 325 | struct nulldrv_mem **mem_ret) |
| 326 | { |
| 327 | struct nulldrv_mem *mem; |
| 328 | |
| 329 | mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 330 | VK_OBJECT_TYPE_DEVICE_MEMORY); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 331 | if (!mem) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 332 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 333 | |
Chia-I Wu | b5ed9e6 | 2015-03-05 14:26:54 -0700 | [diff] [blame] | 334 | mem->bo = malloc(info->allocationSize); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 335 | if (!mem->bo) { |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 336 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | mem->size = info->allocationSize; |
| 340 | |
| 341 | *mem_ret = mem; |
| 342 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 343 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 344 | } |
| 345 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 346 | static VkResult nulldrv_sampler_create(struct nulldrv_dev *dev, |
| 347 | const VkSamplerCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 348 | struct nulldrv_sampler **sampler_ret) |
| 349 | { |
| 350 | struct nulldrv_sampler *sampler; |
| 351 | |
| 352 | sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev, |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 353 | sizeof(*sampler), VK_OBJECT_TYPE_SAMPLER); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 354 | if (!sampler) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 355 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 356 | |
| 357 | *sampler_ret = sampler; |
| 358 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 359 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 360 | } |
| 361 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 362 | static VkResult nulldrv_img_view_create(struct nulldrv_dev *dev, |
| 363 | const VkImageViewCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 364 | struct nulldrv_img_view **view_ret) |
| 365 | { |
| 366 | struct nulldrv_img *img = nulldrv_img(info->image); |
| 367 | struct nulldrv_img_view *view; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 368 | |
| 369 | view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 370 | VK_OBJECT_TYPE_IMAGE_VIEW); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 371 | if (!view) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 372 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 373 | |
| 374 | view->img = img; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 375 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 376 | view->cmd_len = 8; |
| 377 | |
| 378 | *view_ret = view; |
| 379 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 380 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 381 | } |
| 382 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 383 | static void *nulldrv_mem_map(struct nulldrv_mem *mem, VkFlags flags) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 384 | { |
| 385 | return mem->bo; |
| 386 | } |
| 387 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 388 | static struct nulldrv_mem *nulldrv_mem(VkDeviceMemory mem) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 389 | { |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 390 | return *(struct nulldrv_mem **) &mem; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 391 | } |
| 392 | |
| 393 | static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base) |
| 394 | { |
| 395 | return (struct nulldrv_buf *) base; |
| 396 | } |
| 397 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 398 | static VkResult buf_get_memory_requirements(struct nulldrv_base *base, |
| 399 | VkMemoryRequirements* pMemoryRequirements) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 400 | { |
| 401 | struct nulldrv_buf *buf = nulldrv_buf_from_base(base); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 402 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 403 | if (pMemoryRequirements == NULL) |
| 404 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 405 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 406 | pMemoryRequirements->size = buf->size; |
| 407 | pMemoryRequirements->alignment = 4096; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 408 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 409 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 410 | } |
| 411 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 412 | static VkResult nulldrv_buf_create(struct nulldrv_dev *dev, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 413 | const VkBufferCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 414 | struct nulldrv_buf **buf_ret) |
| 415 | { |
| 416 | struct nulldrv_buf *buf; |
| 417 | |
| 418 | buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 419 | VK_OBJECT_TYPE_BUFFER); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 420 | if (!buf) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 421 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 422 | |
| 423 | buf->size = info->size; |
| 424 | buf->usage = info->usage; |
| 425 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 426 | buf->obj.base.get_memory_requirements = buf_get_memory_requirements; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 427 | |
| 428 | *buf_ret = buf; |
| 429 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 430 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 431 | } |
| 432 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 433 | static VkResult nulldrv_desc_layout_create(struct nulldrv_dev *dev, |
| 434 | const VkDescriptorSetLayoutCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 435 | 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 Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 441 | VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 442 | if (!layout) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 443 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 444 | |
| 445 | *layout_ret = layout; |
| 446 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 447 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 448 | } |
| 449 | |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 450 | static VkResult nulldrv_pipeline_layout_create(struct nulldrv_dev *dev, |
| 451 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 452 | struct nulldrv_pipeline_layout **pipeline_layout_ret) |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 453 | { |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 454 | struct nulldrv_pipeline_layout *pipeline_layout; |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 455 | |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 456 | pipeline_layout = (struct nulldrv_pipeline_layout *) |
| 457 | nulldrv_base_create(dev, sizeof(*pipeline_layout), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 458 | VK_OBJECT_TYPE_PIPELINE_LAYOUT); |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 459 | if (!pipeline_layout) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 460 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 461 | |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 462 | *pipeline_layout_ret = pipeline_layout; |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 463 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 464 | return VK_SUCCESS; |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 465 | } |
| 466 | |
Tony Barbour | 8db6537 | 2015-07-10 18:32:33 -0600 | [diff] [blame] | 467 | static struct nulldrv_desc_layout *nulldrv_desc_layout(const VkDescriptorSetLayout layout) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 468 | { |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 469 | return *(struct nulldrv_desc_layout **) &layout; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 470 | } |
| 471 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 472 | static VkResult shader_create(struct nulldrv_dev *dev, |
| 473 | const VkShaderCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 474 | struct nulldrv_shader **sh_ret) |
| 475 | { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 476 | struct nulldrv_shader *sh; |
| 477 | |
| 478 | sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 479 | VK_OBJECT_TYPE_SHADER); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 480 | if (!sh) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 481 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 482 | |
| 483 | *sh_ret = sh; |
| 484 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 485 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 486 | } |
| 487 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 488 | static VkResult graphics_pipeline_create(struct nulldrv_dev *dev, |
| 489 | const VkGraphicsPipelineCreateInfo *info_, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 490 | 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 Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 496 | VK_OBJECT_TYPE_PIPELINE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 497 | if (!pipeline) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 498 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 499 | |
| 500 | *pipeline_ret = pipeline; |
| 501 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 502 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 503 | } |
| 504 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 505 | static VkResult nulldrv_viewport_state_create(struct nulldrv_dev *dev, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 506 | const VkDynamicViewportStateCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 507 | 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 Barbour | 2a199c1 | 2015-07-09 17:31:46 -0600 | [diff] [blame] | 512 | sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_VIEWPORT_STATE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 513 | if (!state) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 514 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 515 | |
| 516 | *state_ret = state; |
| 517 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 518 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 519 | } |
| 520 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 521 | static VkResult nulldrv_raster_state_create(struct nulldrv_dev *dev, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 522 | const VkDynamicRasterStateCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 523 | 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 Barbour | 2a199c1 | 2015-07-09 17:31:46 -0600 | [diff] [blame] | 528 | sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_RASTER_STATE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 529 | if (!state) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 530 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 531 | |
| 532 | *state_ret = state; |
| 533 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 534 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 535 | } |
| 536 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 537 | static VkResult nulldrv_blend_state_create(struct nulldrv_dev *dev, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 538 | const VkDynamicColorBlendStateCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 539 | 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 Barbour | 2a199c1 | 2015-07-09 17:31:46 -0600 | [diff] [blame] | 544 | sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_COLOR_BLEND_STATE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 545 | if (!state) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 546 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 547 | |
| 548 | *state_ret = state; |
| 549 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 550 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 551 | } |
| 552 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 553 | static VkResult nulldrv_ds_state_create(struct nulldrv_dev *dev, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 554 | const VkDynamicDepthStencilStateCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 555 | 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 Barbour | 2a199c1 | 2015-07-09 17:31:46 -0600 | [diff] [blame] | 560 | sizeof(*state), VK_OBJECT_TYPE_DYNAMIC_DEPTH_STENCIL_STATE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 561 | if (!state) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 562 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 563 | |
| 564 | *state_ret = state; |
| 565 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 566 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 567 | } |
| 568 | |
| 569 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 570 | static VkResult nulldrv_cmd_create(struct nulldrv_dev *dev, |
| 571 | const VkCmdBufferCreateInfo *info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 572 | struct nulldrv_cmd **cmd_ret) |
| 573 | { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 574 | struct nulldrv_cmd *cmd; |
| 575 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 576 | cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 577 | VK_OBJECT_TYPE_COMMAND_BUFFER); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 578 | if (!cmd) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 579 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 580 | |
| 581 | *cmd_ret = cmd; |
| 582 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 583 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 584 | } |
| 585 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 586 | static VkResult nulldrv_desc_pool_create(struct nulldrv_dev *dev, |
| 587 | VkDescriptorPoolUsage usage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 588 | uint32_t max_sets, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 589 | const VkDescriptorPoolCreateInfo *info, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 590 | struct nulldrv_desc_pool **pool_ret) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 591 | { |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 592 | struct nulldrv_desc_pool *pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 593 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 594 | pool = (struct nulldrv_desc_pool *) |
| 595 | nulldrv_base_create(dev, sizeof(*pool), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 596 | VK_OBJECT_TYPE_DESCRIPTOR_POOL); |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 597 | if (!pool) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 598 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 599 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 600 | pool->dev = dev; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 601 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 602 | *pool_ret = pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 603 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 604 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 605 | } |
| 606 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 607 | static VkResult nulldrv_desc_set_create(struct nulldrv_dev *dev, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 608 | struct nulldrv_desc_pool *pool, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 609 | VkDescriptorSetUsage usage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 610 | 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 Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 617 | VK_OBJECT_TYPE_DESCRIPTOR_SET); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 618 | if (!set) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 619 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 620 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 621 | set->ooxx = dev->desc_ooxx; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 622 | set->layout = layout; |
| 623 | *set_ret = set; |
| 624 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 625 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 626 | } |
| 627 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 628 | static struct nulldrv_desc_pool *nulldrv_desc_pool(VkDescriptorPool pool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 629 | { |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 630 | return *(struct nulldrv_desc_pool **) &pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 631 | } |
| 632 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 633 | static VkResult nulldrv_fb_create(struct nulldrv_dev *dev, |
| 634 | const VkFramebufferCreateInfo* info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 635 | struct nulldrv_framebuffer ** fb_ret) |
| 636 | { |
| 637 | |
| 638 | struct nulldrv_framebuffer *fb; |
| 639 | fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 640 | VK_OBJECT_TYPE_FRAMEBUFFER); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 641 | if (!fb) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 642 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 643 | |
| 644 | *fb_ret = fb; |
| 645 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 646 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 647 | |
| 648 | } |
| 649 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 650 | static VkResult nulldrv_render_pass_create(struct nulldrv_dev *dev, |
| 651 | const VkRenderPassCreateInfo* info, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 652 | 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 Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 656 | VK_OBJECT_TYPE_RENDER_PASS); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 657 | if (!rp) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 658 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 659 | |
| 660 | *rp_ret = rp; |
| 661 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 662 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 663 | } |
| 664 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 665 | static struct nulldrv_buf *nulldrv_buf(VkBuffer buf) |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 666 | { |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 667 | return *(struct nulldrv_buf **) &buf; |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 668 | } |
| 669 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 670 | static VkResult nulldrv_buf_view_create(struct nulldrv_dev *dev, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 671 | const VkBufferViewCreateInfo *info, |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 672 | 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 Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 678 | VK_OBJECT_TYPE_BUFFER_VIEW); |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 679 | if (!view) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 680 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 681 | |
| 682 | view->buf = buf; |
| 683 | |
| 684 | *view_ret = view; |
| 685 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 686 | return VK_SUCCESS; |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 687 | } |
| 688 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 689 | |
| 690 | //********************************************* |
| 691 | // Driver entry points |
| 692 | //********************************************* |
| 693 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 694 | ICD_EXPORT VkResult VKAPI vkCreateBuffer( |
| 695 | VkDevice device, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 696 | const VkBufferCreateInfo* pCreateInfo, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 697 | VkBuffer* pBuffer) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 698 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 699 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 700 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 701 | |
| 702 | return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer); |
| 703 | } |
| 704 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 705 | ICD_EXPORT VkResult VKAPI vkDestroyBuffer( |
| 706 | VkDevice device, |
| 707 | VkBuffer buffer) |
| 708 | { |
| 709 | NULLDRV_LOG_FUNC; |
| 710 | return VK_SUCCESS; |
| 711 | } |
| 712 | |
Cody Northrop | f02f9f8 | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 713 | ICD_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 | |
| 722 | ICD_EXPORT VkResult VKAPI vkDestroyCommandPool( |
| 723 | VkDevice device, |
| 724 | VkCmdPool cmdPool) |
| 725 | { |
| 726 | NULLDRV_LOG_FUNC; |
| 727 | return VK_SUCCESS; |
| 728 | } |
| 729 | |
| 730 | ICD_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 Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 739 | ICD_EXPORT VkResult VKAPI vkCreateCommandBuffer( |
| 740 | VkDevice device, |
| 741 | const VkCmdBufferCreateInfo* pCreateInfo, |
| 742 | VkCmdBuffer* pCmdBuffer) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 743 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 744 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 745 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 746 | |
| 747 | return nulldrv_cmd_create(dev, pCreateInfo, |
| 748 | (struct nulldrv_cmd **) pCmdBuffer); |
| 749 | } |
| 750 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 751 | ICD_EXPORT VkResult VKAPI vkDestroyCommandBuffer( |
| 752 | VkDevice device, |
| 753 | VkCmdBuffer cmdBuffer) |
| 754 | { |
| 755 | NULLDRV_LOG_FUNC; |
| 756 | return VK_SUCCESS; |
| 757 | } |
| 758 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 759 | ICD_EXPORT VkResult VKAPI vkBeginCommandBuffer( |
| 760 | VkCmdBuffer cmdBuffer, |
| 761 | const VkCmdBufferBeginInfo *info) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 762 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 763 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 764 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 765 | } |
| 766 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 767 | ICD_EXPORT VkResult VKAPI vkEndCommandBuffer( |
| 768 | VkCmdBuffer cmdBuffer) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 769 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 770 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 771 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 772 | } |
| 773 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 774 | ICD_EXPORT VkResult VKAPI vkResetCommandBuffer( |
Cody Northrop | f02f9f8 | 2015-07-09 18:08:05 -0600 | [diff] [blame] | 775 | VkCmdBuffer cmdBuffer, |
| 776 | VkCmdBufferResetFlags flags) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 777 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 778 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 779 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 780 | } |
| 781 | |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 782 | static const VkFormat nulldrv_presentable_formats[] = { |
| 783 | VK_FORMAT_B8G8R8A8_UNORM, |
| 784 | }; |
| 785 | |
Jon Ashburn | ba4a195 | 2015-06-16 12:44:51 -0600 | [diff] [blame] | 786 | #if 0 |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 787 | ICD_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 Ashburn | ba4a195 | 2015-06-16 12:44:51 -0600 | [diff] [blame] | 827 | #endif |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 828 | |
| 829 | ICD_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 Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 839 | VK_OBJECT_TYPE_SWAP_CHAIN_WSI); |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 840 | if (!sc) { |
| 841 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 842 | } |
| 843 | sc->dev = dev; |
| 844 | |
Tony Barbour | 7910de7 | 2015-07-13 16:37:21 -0600 | [diff] [blame] | 845 | *(VkSwapChainWSI **)pSwapChain = *(VkSwapChainWSI **)≻ |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 846 | |
| 847 | return VK_SUCCESS; |
| 848 | } |
| 849 | |
| 850 | ICD_EXPORT VkResult VKAPI vkDestroySwapChainWSI( |
Ian Elliott | 53bd3dc | 2015-07-06 14:29:31 -0600 | [diff] [blame] | 851 | VkDevice device, |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 852 | VkSwapChainWSI swapChain) |
| 853 | { |
| 854 | NULLDRV_LOG_FUNC; |
Tony Barbour | 7910de7 | 2015-07-13 16:37:21 -0600 | [diff] [blame] | 855 | struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapChain; |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 856 | |
| 857 | free(sc); |
| 858 | |
| 859 | return VK_SUCCESS; |
| 860 | } |
| 861 | |
| 862 | ICD_EXPORT VkResult VKAPI vkGetSwapChainInfoWSI( |
Ian Elliott | 53bd3dc | 2015-07-06 14:29:31 -0600 | [diff] [blame] | 863 | VkDevice device, |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 864 | VkSwapChainWSI swapChain, |
| 865 | VkSwapChainInfoTypeWSI infoType, |
| 866 | size_t* pDataSize, |
| 867 | void* pData) |
| 868 | { |
| 869 | NULLDRV_LOG_FUNC; |
Tony Barbour | 7910de7 | 2015-07-13 16:37:21 -0600 | [diff] [blame] | 870 | struct nulldrv_swap_chain *sc = *(struct nulldrv_swap_chain **) &swapChain; |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 871 | struct nulldrv_dev *dev = sc->dev; |
| 872 | VkResult ret = VK_SUCCESS; |
| 873 | |
| 874 | if (!pDataSize) |
| 875 | return VK_ERROR_INVALID_POINTER; |
| 876 | |
| 877 | switch (infoType) { |
Ian Elliott | 53bd3dc | 2015-07-06 14:29:31 -0600 | [diff] [blame] | 878 | case VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI: |
| 879 | *pDataSize = (sizeof(VkSwapChainImagePropertiesWSI) * 2); |
| 880 | if (pData) { |
| 881 | VkSwapChainImagePropertiesWSI *images = |
| 882 | (VkSwapChainImagePropertiesWSI *) pData; |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 883 | uint32_t i; |
| 884 | |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 885 | for (i = 0; i < 2; i++) { |
| 886 | struct nulldrv_img *img; |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 887 | |
| 888 | img = (struct nulldrv_img *) nulldrv_base_create(dev, |
| 889 | sizeof(*img), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 890 | VK_OBJECT_TYPE_IMAGE); |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 891 | if (!img) |
| 892 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Tony Barbour | 7910de7 | 2015-07-13 16:37:21 -0600 | [diff] [blame] | 893 | *(VkImage **) &images[i].image = *(VkImage **) &img; |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 894 | } |
| 895 | } |
| 896 | break; |
| 897 | default: |
| 898 | ret = VK_ERROR_INVALID_VALUE; |
| 899 | break; |
| 900 | } |
| 901 | |
| 902 | return ret; |
| 903 | } |
| 904 | |
Tony Barbour | 7910de7 | 2015-07-13 16:37:21 -0600 | [diff] [blame] | 905 | ICD_EXPORT VkResult VKAPI vkAcquireNextImageWSI( |
| 906 | VkDevice device, |
| 907 | VkSwapChainWSI swapChain, |
| 908 | uint64_t timeout, |
| 909 | VkSemaphore semaphore, |
| 910 | uint32_t* pImageIndex) |
| 911 | { |
| 912 | NULLDRV_LOG_FUNC; |
| 913 | |
| 914 | return VK_SUCCESS; |
| 915 | } |
| 916 | |
| 917 | ICD_EXPORT VkResult VKAPI vkGetSurfaceInfoWSI( |
| 918 | VkDevice device, |
| 919 | const VkSurfaceDescriptionWSI* pSurfaceDescription, |
| 920 | VkSurfaceInfoTypeWSI infoType, |
| 921 | size_t* pDataSize, |
| 922 | void* pData) |
| 923 | { |
| 924 | NULLDRV_LOG_FUNC; |
| 925 | |
| 926 | return VK_SUCCESS; |
| 927 | } |
| 928 | |
| 929 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSurfaceSupportWSI( |
| 930 | VkPhysicalDevice physicalDevice, |
| 931 | uint32_t queueFamilyIndex, |
| 932 | const VkSurfaceDescriptionWSI* pSurfaceDescription, |
| 933 | VkBool32* pSupported) |
| 934 | { |
| 935 | NULLDRV_LOG_FUNC; |
| 936 | |
| 937 | return VK_SUCCESS; |
| 938 | } |
| 939 | |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 940 | ICD_EXPORT VkResult VKAPI vkQueuePresentWSI( |
Ian Elliott | 53bd3dc | 2015-07-06 14:29:31 -0600 | [diff] [blame] | 941 | VkQueue queue_, |
| 942 | VkPresentInfoWSI* pPresentInfo) |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 943 | { |
| 944 | NULLDRV_LOG_FUNC; |
| 945 | |
| 946 | return VK_SUCCESS; |
| 947 | } |
| 948 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 949 | ICD_EXPORT void VKAPI vkCmdCopyBuffer( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 950 | VkCmdBuffer cmdBuffer, |
| 951 | VkBuffer srcBuffer, |
| 952 | VkBuffer destBuffer, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 953 | uint32_t regionCount, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 954 | const VkBufferCopy* pRegions) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 955 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 956 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 957 | } |
| 958 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 959 | ICD_EXPORT void VKAPI vkCmdCopyImage( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 960 | VkCmdBuffer cmdBuffer, |
| 961 | VkImage srcImage, |
| 962 | VkImageLayout srcImageLayout, |
| 963 | VkImage destImage, |
| 964 | VkImageLayout destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 965 | uint32_t regionCount, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 966 | const VkImageCopy* pRegions) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 967 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 968 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 969 | } |
| 970 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 971 | ICD_EXPORT void VKAPI vkCmdBlitImage( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 972 | VkCmdBuffer cmdBuffer, |
Mark Lobodzinski | 20f6859 | 2015-05-22 14:43:25 -0500 | [diff] [blame] | 973 | VkImage srcImage, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 974 | VkImageLayout srcImageLayout, |
Mark Lobodzinski | 20f6859 | 2015-05-22 14:43:25 -0500 | [diff] [blame] | 975 | VkImage destImage, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 976 | VkImageLayout destImageLayout, |
Mark Lobodzinski | 20f6859 | 2015-05-22 14:43:25 -0500 | [diff] [blame] | 977 | uint32_t regionCount, |
| 978 | const VkImageBlit* pRegions, |
| 979 | VkTexFilter filter) |
Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 980 | { |
| 981 | NULLDRV_LOG_FUNC; |
| 982 | } |
| 983 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 984 | ICD_EXPORT void VKAPI vkCmdCopyBufferToImage( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 985 | VkCmdBuffer cmdBuffer, |
| 986 | VkBuffer srcBuffer, |
| 987 | VkImage destImage, |
| 988 | VkImageLayout destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 989 | uint32_t regionCount, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 990 | const VkBufferImageCopy* pRegions) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 991 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 992 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 993 | } |
| 994 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 995 | ICD_EXPORT void VKAPI vkCmdCopyImageToBuffer( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 996 | VkCmdBuffer cmdBuffer, |
| 997 | VkImage srcImage, |
| 998 | VkImageLayout srcImageLayout, |
| 999 | VkBuffer destBuffer, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1000 | uint32_t regionCount, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1001 | const VkBufferImageCopy* pRegions) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1002 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1003 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1004 | } |
| 1005 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1006 | ICD_EXPORT void VKAPI vkCmdUpdateBuffer( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1007 | VkCmdBuffer cmdBuffer, |
| 1008 | VkBuffer destBuffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1009 | VkDeviceSize destOffset, |
| 1010 | VkDeviceSize dataSize, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1011 | const uint32_t* pData) |
| 1012 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1013 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1014 | } |
| 1015 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1016 | ICD_EXPORT void VKAPI vkCmdFillBuffer( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1017 | VkCmdBuffer cmdBuffer, |
| 1018 | VkBuffer destBuffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1019 | VkDeviceSize destOffset, |
| 1020 | VkDeviceSize fillSize, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1021 | uint32_t data) |
| 1022 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1023 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1024 | } |
| 1025 | |
Ian Elliott | e924ab2 | 2015-07-08 13:24:30 -0600 | [diff] [blame] | 1026 | ICD_EXPORT void VKAPI vkCmdClearDepthStencilImage( |
| 1027 | VkCmdBuffer cmdBuffer, |
| 1028 | VkImage image, |
| 1029 | VkImageLayout imageLayout, |
| 1030 | float depth, |
| 1031 | uint32_t stencil, |
| 1032 | uint32_t rangeCount, |
| 1033 | const VkImageSubresourceRange* pRanges) |
| 1034 | { |
| 1035 | NULLDRV_LOG_FUNC; |
| 1036 | } |
| 1037 | |
| 1038 | ICD_EXPORT void VKAPI vkCmdClearColorAttachment( |
| 1039 | VkCmdBuffer cmdBuffer, |
| 1040 | uint32_t colorAttachment, |
| 1041 | VkImageLayout imageLayout, |
| 1042 | const VkClearColorValue *pColor, |
| 1043 | uint32_t rectCount, |
| 1044 | const VkRect3D *pRects) |
| 1045 | { |
| 1046 | NULLDRV_LOG_FUNC; |
| 1047 | } |
| 1048 | |
| 1049 | ICD_EXPORT void VKAPI vkCmdClearDepthStencilAttachment( |
| 1050 | VkCmdBuffer cmdBuffer, |
| 1051 | VkImageAspectFlags imageAspectMask, |
| 1052 | VkImageLayout imageLayout, |
| 1053 | float depth, |
| 1054 | uint32_t stencil, |
| 1055 | uint32_t rectCount, |
| 1056 | const VkRect3D *pRects) |
| 1057 | { |
| 1058 | NULLDRV_LOG_FUNC; |
| 1059 | } |
| 1060 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1061 | ICD_EXPORT void VKAPI vkCmdClearColorImage( |
Courtney Goeltzenleuchter | da4a99e | 2015-04-23 17:49:22 -0600 | [diff] [blame] | 1062 | VkCmdBuffer cmdBuffer, |
| 1063 | VkImage image, |
| 1064 | VkImageLayout imageLayout, |
Chris Forbes | e310597 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 1065 | const VkClearColorValue *pColor, |
Courtney Goeltzenleuchter | da4a99e | 2015-04-23 17:49:22 -0600 | [diff] [blame] | 1066 | uint32_t rangeCount, |
| 1067 | const VkImageSubresourceRange* pRanges) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1068 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1069 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1070 | } |
| 1071 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1072 | ICD_EXPORT void VKAPI vkCmdClearDepthStencil( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1073 | VkCmdBuffer cmdBuffer, |
| 1074 | VkImage image, |
| 1075 | VkImageLayout imageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1076 | float depth, |
| 1077 | uint32_t stencil, |
| 1078 | uint32_t rangeCount, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1079 | const VkImageSubresourceRange* pRanges) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1080 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1081 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1082 | } |
| 1083 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1084 | ICD_EXPORT void VKAPI vkCmdResolveImage( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1085 | VkCmdBuffer cmdBuffer, |
| 1086 | VkImage srcImage, |
| 1087 | VkImageLayout srcImageLayout, |
| 1088 | VkImage destImage, |
| 1089 | VkImageLayout destImageLayout, |
Tony Barbour | 11f7437 | 2015-04-13 15:02:52 -0600 | [diff] [blame] | 1090 | uint32_t regionCount, |
| 1091 | const VkImageResolve* pRegions) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1092 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1093 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1094 | } |
| 1095 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1096 | ICD_EXPORT void VKAPI vkCmdBeginQuery( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1097 | VkCmdBuffer cmdBuffer, |
| 1098 | VkQueryPool queryPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1099 | uint32_t slot, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1100 | VkFlags flags) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1101 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1102 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1103 | } |
| 1104 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1105 | ICD_EXPORT void VKAPI vkCmdEndQuery( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1106 | VkCmdBuffer cmdBuffer, |
| 1107 | VkQueryPool queryPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1108 | uint32_t slot) |
| 1109 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1110 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1111 | } |
| 1112 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1113 | ICD_EXPORT void VKAPI vkCmdResetQueryPool( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1114 | VkCmdBuffer cmdBuffer, |
| 1115 | VkQueryPool queryPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1116 | uint32_t startQuery, |
| 1117 | uint32_t queryCount) |
| 1118 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1119 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1120 | } |
| 1121 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1122 | ICD_EXPORT void VKAPI vkCmdSetEvent( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1123 | VkCmdBuffer cmdBuffer, |
Tony Barbour | c2e987e | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1124 | VkEvent event_, |
| 1125 | VkPipelineStageFlags stageMask) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1126 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1127 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1128 | } |
| 1129 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1130 | ICD_EXPORT void VKAPI vkCmdResetEvent( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1131 | VkCmdBuffer cmdBuffer, |
Tony Barbour | c2e987e | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1132 | VkEvent event_, |
| 1133 | VkPipelineStageFlags stageMask) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1134 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1135 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1136 | } |
| 1137 | |
Ian Elliott | 63f1edb | 2015-04-16 18:10:19 -0600 | [diff] [blame] | 1138 | ICD_EXPORT void VKAPI vkCmdCopyQueryPoolResults( |
| 1139 | VkCmdBuffer cmdBuffer, |
| 1140 | VkQueryPool queryPool, |
| 1141 | uint32_t startQuery, |
| 1142 | uint32_t queryCount, |
| 1143 | VkBuffer destBuffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1144 | VkDeviceSize destOffset, |
| 1145 | VkDeviceSize destStride, |
Ian Elliott | 63f1edb | 2015-04-16 18:10:19 -0600 | [diff] [blame] | 1146 | VkFlags flags) |
| 1147 | { |
| 1148 | NULLDRV_LOG_FUNC; |
| 1149 | } |
| 1150 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1151 | ICD_EXPORT void VKAPI vkCmdWriteTimestamp( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1152 | VkCmdBuffer cmdBuffer, |
| 1153 | VkTimestampType timestampType, |
| 1154 | VkBuffer destBuffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1155 | VkDeviceSize destOffset) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1156 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1157 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1158 | } |
| 1159 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1160 | ICD_EXPORT void VKAPI vkCmdBindPipeline( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1161 | VkCmdBuffer cmdBuffer, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1162 | VkPipelineBindPoint pipelineBindPoint, |
| 1163 | VkPipeline pipeline) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1164 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1165 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1166 | } |
| 1167 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1168 | ICD_EXPORT void VKAPI vkCmdBindDynamicViewportState( |
| 1169 | VkCmdBuffer cmdBuffer, |
| 1170 | VkDynamicViewportState state) |
| 1171 | { |
| 1172 | NULLDRV_LOG_FUNC; |
| 1173 | } |
| 1174 | |
| 1175 | ICD_EXPORT void VKAPI vkCmdBindDynamicRasterState( |
| 1176 | VkCmdBuffer cmdBuffer, |
| 1177 | VkDynamicRasterState state) |
| 1178 | { |
| 1179 | NULLDRV_LOG_FUNC; |
| 1180 | } |
| 1181 | |
| 1182 | ICD_EXPORT void VKAPI vkCmdBindDynamicColorBlendState( |
| 1183 | VkCmdBuffer cmdBuffer, |
| 1184 | VkDynamicColorBlendState state) |
| 1185 | { |
| 1186 | NULLDRV_LOG_FUNC; |
| 1187 | } |
| 1188 | |
| 1189 | ICD_EXPORT void VKAPI vkCmdBindDynamicDepthStencilState( |
| 1190 | VkCmdBuffer cmdBuffer, |
| 1191 | VkDynamicDepthStencilState state) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1192 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1193 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1194 | } |
| 1195 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1196 | ICD_EXPORT void VKAPI vkCmdBindDescriptorSets( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1197 | VkCmdBuffer cmdBuffer, |
| 1198 | VkPipelineBindPoint pipelineBindPoint, |
Mark Lobodzinski | a65c463 | 2015-06-15 13:21:21 -0600 | [diff] [blame] | 1199 | VkPipelineLayout layout, |
Cody Northrop | 1a01b1d | 2015-04-16 13:41:56 -0600 | [diff] [blame] | 1200 | uint32_t firstSet, |
| 1201 | uint32_t setCount, |
| 1202 | const VkDescriptorSet* pDescriptorSets, |
| 1203 | uint32_t dynamicOffsetCount, |
| 1204 | const uint32_t* pDynamicOffsets) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1205 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1206 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1207 | } |
| 1208 | |
Courtney Goeltzenleuchter | 4696294 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 1209 | ICD_EXPORT void VKAPI vkCmdBindVertexBuffers( |
| 1210 | VkCmdBuffer cmdBuffer, |
| 1211 | uint32_t startBinding, |
| 1212 | uint32_t bindingCount, |
| 1213 | const VkBuffer* pBuffers, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1214 | const VkDeviceSize* pOffsets) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1215 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1216 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1217 | } |
| 1218 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1219 | ICD_EXPORT void VKAPI vkCmdBindIndexBuffer( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1220 | VkCmdBuffer cmdBuffer, |
| 1221 | VkBuffer buffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1222 | VkDeviceSize offset, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1223 | VkIndexType indexType) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1224 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1225 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1226 | } |
| 1227 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1228 | ICD_EXPORT void VKAPI vkCmdDraw( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1229 | VkCmdBuffer cmdBuffer, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1230 | uint32_t firstVertex, |
| 1231 | uint32_t vertexCount, |
| 1232 | uint32_t firstInstance, |
| 1233 | uint32_t instanceCount) |
| 1234 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1235 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1236 | } |
| 1237 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1238 | ICD_EXPORT void VKAPI vkCmdDrawIndexed( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1239 | VkCmdBuffer cmdBuffer, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1240 | uint32_t firstIndex, |
| 1241 | uint32_t indexCount, |
| 1242 | int32_t vertexOffset, |
| 1243 | uint32_t firstInstance, |
| 1244 | uint32_t instanceCount) |
| 1245 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1246 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1247 | } |
| 1248 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1249 | ICD_EXPORT void VKAPI vkCmdDrawIndirect( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1250 | VkCmdBuffer cmdBuffer, |
| 1251 | VkBuffer buffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1252 | VkDeviceSize offset, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1253 | uint32_t count, |
| 1254 | uint32_t stride) |
| 1255 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1256 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1257 | } |
| 1258 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1259 | ICD_EXPORT void VKAPI vkCmdDrawIndexedIndirect( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1260 | VkCmdBuffer cmdBuffer, |
| 1261 | VkBuffer buffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1262 | VkDeviceSize offset, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1263 | uint32_t count, |
| 1264 | uint32_t stride) |
| 1265 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1266 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1267 | } |
| 1268 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1269 | ICD_EXPORT void VKAPI vkCmdDispatch( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1270 | VkCmdBuffer cmdBuffer, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1271 | uint32_t x, |
| 1272 | uint32_t y, |
| 1273 | uint32_t z) |
| 1274 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1275 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1276 | } |
| 1277 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1278 | ICD_EXPORT void VKAPI vkCmdDispatchIndirect( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1279 | VkCmdBuffer cmdBuffer, |
| 1280 | VkBuffer buffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1281 | VkDeviceSize offset) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1282 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1283 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1284 | } |
| 1285 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1286 | void VKAPI vkCmdWaitEvents( |
| 1287 | VkCmdBuffer cmdBuffer, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1288 | uint32_t eventCount, |
| 1289 | const VkEvent* pEvents, |
Tony Barbour | c2e987e | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1290 | VkPipelineStageFlags sourceStageMask, |
| 1291 | VkPipelineStageFlags destStageMask, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1292 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | d9ba342 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 1293 | const void* const* ppMemBarriers) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1294 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1295 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1296 | } |
| 1297 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1298 | void VKAPI vkCmdPipelineBarrier( |
| 1299 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | 82b348f | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 1300 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | c2e987e | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 1301 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | 1f41f54 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 1302 | VkBool32 byRegion, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1303 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | 82b348f | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 1304 | const void* const* ppMemBarriers) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1305 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1306 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1307 | } |
| 1308 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1309 | ICD_EXPORT VkResult VKAPI vkCreateDevice( |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1310 | VkPhysicalDevice gpu_, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 1311 | const VkDeviceCreateInfo* pCreateInfo, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1312 | VkDevice* pDevice) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1313 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1314 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1315 | struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_); |
| 1316 | return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice); |
| 1317 | } |
| 1318 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1319 | ICD_EXPORT VkResult VKAPI vkDestroyDevice( |
| 1320 | VkDevice device) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1321 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1322 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1323 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1324 | } |
| 1325 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1326 | ICD_EXPORT VkResult VKAPI vkGetDeviceQueue( |
| 1327 | VkDevice device, |
Courtney Goeltzenleuchter | f316806 | 2015-03-05 18:09:39 -0700 | [diff] [blame] | 1328 | uint32_t queueNodeIndex, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1329 | uint32_t queueIndex, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1330 | VkQueue* pQueue) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1331 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1332 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1333 | struct nulldrv_dev *dev = nulldrv_dev(device); |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1334 | *pQueue = (VkQueue) dev->queues[0]; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1335 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1336 | } |
| 1337 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1338 | ICD_EXPORT VkResult VKAPI vkDeviceWaitIdle( |
| 1339 | VkDevice device) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1340 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1341 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1342 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1343 | } |
| 1344 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1345 | ICD_EXPORT VkResult VKAPI vkCreateEvent( |
| 1346 | VkDevice device, |
| 1347 | const VkEventCreateInfo* pCreateInfo, |
| 1348 | VkEvent* pEvent) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1349 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1350 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1351 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1352 | } |
| 1353 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1354 | ICD_EXPORT VkResult VKAPI vkDestroyEvent( |
| 1355 | VkDevice device, |
| 1356 | VkEvent event) |
| 1357 | { |
| 1358 | NULLDRV_LOG_FUNC; |
| 1359 | return VK_SUCCESS; |
| 1360 | } |
| 1361 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1362 | ICD_EXPORT VkResult VKAPI vkGetEventStatus( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1363 | VkDevice device, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1364 | VkEvent event_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1365 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1366 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1367 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1368 | } |
| 1369 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1370 | ICD_EXPORT VkResult VKAPI vkSetEvent( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1371 | VkDevice device, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1372 | VkEvent event_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1373 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1374 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1375 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1376 | } |
| 1377 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1378 | ICD_EXPORT VkResult VKAPI vkResetEvent( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1379 | VkDevice device, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1380 | VkEvent event_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1381 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1382 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1383 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1384 | } |
| 1385 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1386 | ICD_EXPORT VkResult VKAPI vkCreateFence( |
| 1387 | VkDevice device, |
| 1388 | const VkFenceCreateInfo* pCreateInfo, |
| 1389 | VkFence* pFence) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1390 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1391 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1392 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1393 | |
| 1394 | return nulldrv_fence_create(dev, pCreateInfo, |
| 1395 | (struct nulldrv_fence **) pFence); |
| 1396 | } |
| 1397 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1398 | ICD_EXPORT VkResult VKAPI vkDestroyFence( |
| 1399 | VkDevice device, |
| 1400 | VkFence fence) |
| 1401 | { |
| 1402 | NULLDRV_LOG_FUNC; |
| 1403 | return VK_SUCCESS; |
| 1404 | } |
| 1405 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1406 | ICD_EXPORT VkResult VKAPI vkGetFenceStatus( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1407 | VkDevice device, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1408 | VkFence fence_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1409 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1410 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1411 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1412 | } |
| 1413 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1414 | ICD_EXPORT VkResult VKAPI vkResetFences( |
Courtney Goeltzenleuchter | f2e33ad | 2015-06-18 17:28:20 -0600 | [diff] [blame] | 1415 | VkDevice device, |
| 1416 | uint32_t fenceCount, |
| 1417 | const VkFence* pFences) |
Courtney Goeltzenleuchter | 1042b47 | 2015-04-14 19:07:06 -0600 | [diff] [blame] | 1418 | { |
| 1419 | NULLDRV_LOG_FUNC; |
| 1420 | return VK_SUCCESS; |
| 1421 | } |
| 1422 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1423 | ICD_EXPORT VkResult VKAPI vkWaitForFences( |
| 1424 | VkDevice device, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1425 | uint32_t fenceCount, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1426 | const VkFence* pFences, |
Courtney Goeltzenleuchter | 1f41f54 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 1427 | VkBool32 waitAll, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1428 | uint64_t timeout) |
| 1429 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1430 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1431 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1432 | } |
| 1433 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1434 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
| 1435 | VkPhysicalDevice gpu_, |
| 1436 | VkPhysicalDeviceProperties* pProperties) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1437 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1438 | NULLDRV_LOG_FUNC; |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 1439 | VkResult ret = VK_SUCCESS; |
| 1440 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1441 | pProperties->apiVersion = VK_API_VERSION; |
| 1442 | pProperties->driverVersion = 0; // Appropriate that the nulldrv have 0's |
| 1443 | pProperties->vendorId = 0; |
| 1444 | pProperties->deviceId = 0; |
| 1445 | pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER; |
| 1446 | strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv")); |
Ian Elliott | 64a68e1 | 2015-04-16 11:57:46 -0600 | [diff] [blame] | 1447 | |
| 1448 | return ret; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1449 | } |
| 1450 | |
Chris Forbes | d757630 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 1451 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 1452 | VkPhysicalDevice physicalDevice, |
| 1453 | VkPhysicalDeviceFeatures* pFeatures) |
| 1454 | { |
| 1455 | NULLDRV_LOG_FUNC; |
| 1456 | VkResult ret = VK_SUCCESS; |
| 1457 | |
| 1458 | /* TODO: fill out features */ |
| 1459 | memset(pFeatures, 0, sizeof(*pFeatures)); |
| 1460 | |
| 1461 | return ret; |
| 1462 | } |
| 1463 | |
Courtney Goeltzenleuchter | 4da96aa | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1464 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties( |
Chris Forbes | d757630 | 2015-06-21 22:55:02 +1200 | [diff] [blame] | 1465 | VkPhysicalDevice physicalDevice, |
| 1466 | VkFormat format, |
| 1467 | VkFormatProperties* pFormatInfo) |
| 1468 | { |
| 1469 | NULLDRV_LOG_FUNC; |
| 1470 | VkResult ret = VK_SUCCESS; |
| 1471 | |
| 1472 | pFormatInfo->linearTilingFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT; |
| 1473 | pFormatInfo->optimalTilingFeatures = pFormatInfo->linearTilingFeatures; |
| 1474 | |
| 1475 | return ret; |
| 1476 | } |
| 1477 | |
| 1478 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits( |
| 1479 | VkPhysicalDevice physicalDevice, |
| 1480 | VkPhysicalDeviceLimits* pLimits) |
| 1481 | { |
| 1482 | NULLDRV_LOG_FUNC; |
| 1483 | VkResult ret = VK_SUCCESS; |
| 1484 | |
| 1485 | /* TODO: fill out limits */ |
| 1486 | memset(pLimits, 0, sizeof(*pLimits)); |
| 1487 | |
| 1488 | return ret; |
| 1489 | } |
| 1490 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1491 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueCount( |
| 1492 | VkPhysicalDevice gpu_, |
| 1493 | uint32_t* pCount) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1494 | { |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1495 | *pCount = 1; |
| 1496 | return VK_SUCCESS; |
| 1497 | } |
Tobin Ehlis | 0ef6ec5 | 2015-04-16 12:51:37 -0600 | [diff] [blame] | 1498 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1499 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 1500 | VkPhysicalDevice gpu_, |
| 1501 | uint32_t count, |
| 1502 | VkPhysicalDeviceQueueProperties* pProperties) |
| 1503 | { |
| 1504 | pProperties->queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_SPARSE_MEMMGR_BIT; |
| 1505 | pProperties->queueCount = 1; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1506 | pProperties->supportsTimestamps = false; |
Tobin Ehlis | 0ef6ec5 | 2015-04-16 12:51:37 -0600 | [diff] [blame] | 1507 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1508 | return VK_SUCCESS; |
| 1509 | } |
| 1510 | |
Ian Elliott | e924ab2 | 2015-07-08 13:24:30 -0600 | [diff] [blame] | 1511 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 1512 | VkPhysicalDevice gpu_, |
| 1513 | VkPhysicalDeviceMemoryProperties* pProperties) |
| 1514 | { |
| 1515 | // TODO: Fill in with real data |
| 1516 | return VK_SUCCESS; |
| 1517 | } |
| 1518 | |
| 1519 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties( |
| 1520 | VkPhysicalDevice physicalDevice, |
| 1521 | uint32_t* pCount, |
| 1522 | VkLayerProperties* pProperties) |
| 1523 | { |
| 1524 | // TODO: Fill in with real data |
| 1525 | return VK_SUCCESS; |
| 1526 | } |
| 1527 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1528 | ICD_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties( |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1529 | const char* pLayerName, |
| 1530 | uint32_t* pCount, |
| 1531 | VkExtensionProperties* pProperties) |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1532 | { |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1533 | uint32_t copy_size; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1534 | |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1535 | if (pCount == NULL) { |
| 1536 | return VK_ERROR_INVALID_POINTER; |
| 1537 | } |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1538 | |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1539 | if (pProperties == NULL) { |
| 1540 | *pCount = NULLDRV_EXT_COUNT; |
| 1541 | return VK_SUCCESS; |
| 1542 | } |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1543 | |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1544 | copy_size = *pCount < NULLDRV_EXT_COUNT ? *pCount : NULLDRV_EXT_COUNT; |
| 1545 | memcpy(pProperties, intel_gpu_exts, copy_size * sizeof(VkExtensionProperties)); |
| 1546 | *pCount = copy_size; |
| 1547 | if (copy_size < NULLDRV_EXT_COUNT) { |
| 1548 | return VK_INCOMPLETE; |
| 1549 | } |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1550 | return VK_SUCCESS; |
| 1551 | } |
Ian Elliott | e924ab2 | 2015-07-08 13:24:30 -0600 | [diff] [blame] | 1552 | ICD_EXPORT VkResult VKAPI vkGetGlobalLayerProperties( |
| 1553 | uint32_t* pCount, |
| 1554 | VkLayerProperties* pProperties) |
| 1555 | { |
| 1556 | // TODO: Fill in with real data |
| 1557 | return VK_SUCCESS; |
| 1558 | } |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1559 | |
| 1560 | VkResult VKAPI vkGetPhysicalDeviceExtensionProperties( |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1561 | VkPhysicalDevice physicalDevice, |
| 1562 | const char* pLayerName, |
| 1563 | uint32_t* pCount, |
| 1564 | VkExtensionProperties* pProperties) |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1565 | { |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1566 | |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1567 | if (pCount == NULL) { |
| 1568 | return VK_ERROR_INVALID_POINTER; |
| 1569 | } |
| 1570 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1571 | *pCount = 0; |
Courtney Goeltzenleuchter | 18061cd | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 1572 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1573 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1574 | } |
| 1575 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1576 | ICD_EXPORT VkResult VKAPI vkCreateImage( |
| 1577 | VkDevice device, |
| 1578 | const VkImageCreateInfo* pCreateInfo, |
| 1579 | VkImage* pImage) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1580 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1581 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1582 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1583 | |
| 1584 | return nulldrv_img_create(dev, pCreateInfo, false, |
| 1585 | (struct nulldrv_img **) pImage); |
| 1586 | } |
| 1587 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1588 | ICD_EXPORT VkResult VKAPI vkDestroyImage( |
| 1589 | VkDevice device, |
| 1590 | VkImage image) |
| 1591 | { |
| 1592 | NULLDRV_LOG_FUNC; |
| 1593 | return VK_SUCCESS; |
| 1594 | } |
| 1595 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1596 | ICD_EXPORT VkResult VKAPI vkGetImageSubresourceLayout( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1597 | VkDevice device, |
| 1598 | VkImage image, |
| 1599 | const VkImageSubresource* pSubresource, |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1600 | VkSubresourceLayout* pLayout) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1601 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1602 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1603 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1604 | pLayout->offset = 0; |
| 1605 | pLayout->size = 1; |
| 1606 | pLayout->rowPitch = 4; |
| 1607 | pLayout->depthPitch = 4; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1608 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1609 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1610 | } |
| 1611 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1612 | ICD_EXPORT VkResult VKAPI vkAllocMemory( |
| 1613 | VkDevice device, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 1614 | const VkMemoryAllocInfo* pAllocInfo, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1615 | VkDeviceMemory* pMem) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1616 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1617 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1618 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1619 | |
| 1620 | return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem); |
| 1621 | } |
| 1622 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1623 | ICD_EXPORT VkResult VKAPI vkFreeMemory( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1624 | VkDevice device, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1625 | VkDeviceMemory mem_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1626 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1627 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1628 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1629 | } |
| 1630 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1631 | ICD_EXPORT VkResult VKAPI vkMapMemory( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1632 | VkDevice device, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1633 | VkDeviceMemory mem_, |
Tony Barbour | 3e3420a | 2015-04-16 19:09:28 -0600 | [diff] [blame] | 1634 | VkDeviceSize offset, |
| 1635 | VkDeviceSize size, |
| 1636 | VkFlags flags, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1637 | void** ppData) |
| 1638 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1639 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1640 | struct nulldrv_mem *mem = nulldrv_mem(mem_); |
| 1641 | void *ptr = nulldrv_mem_map(mem, flags); |
| 1642 | |
| 1643 | *ppData = ptr; |
| 1644 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1645 | return (ptr) ? VK_SUCCESS : VK_ERROR_UNKNOWN; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1646 | } |
| 1647 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1648 | ICD_EXPORT VkResult VKAPI vkUnmapMemory( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1649 | VkDevice device, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1650 | VkDeviceMemory mem_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1651 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1652 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1653 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1654 | } |
| 1655 | |
Courtney Goeltzenleuchter | a569a50 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1656 | ICD_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1657 | VkDevice device, |
Courtney Goeltzenleuchter | a569a50 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1658 | uint32_t memRangeCount, |
| 1659 | const VkMappedMemoryRange* pMemRanges) |
| 1660 | { |
| 1661 | NULLDRV_LOG_FUNC; |
| 1662 | return VK_SUCCESS; |
| 1663 | } |
| 1664 | |
| 1665 | ICD_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges( |
| 1666 | VkDevice device, |
| 1667 | uint32_t memRangeCount, |
| 1668 | const VkMappedMemoryRange* pMemRanges) |
Ian Elliott | 07de923 | 2015-04-17 10:04:00 -0600 | [diff] [blame] | 1669 | { |
| 1670 | NULLDRV_LOG_FUNC; |
| 1671 | return VK_SUCCESS; |
| 1672 | } |
| 1673 | |
Courtney Goeltzenleuchter | d040c5c | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1674 | ICD_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment( |
| 1675 | VkDevice device, |
| 1676 | VkDeviceMemory memory, |
| 1677 | VkDeviceSize* pCommittedMemoryInBytes) |
| 1678 | { |
| 1679 | return VK_SUCCESS; |
| 1680 | } |
| 1681 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1682 | ICD_EXPORT VkResult VKAPI vkCreateInstance( |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 1683 | const VkInstanceCreateInfo* pCreateInfo, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1684 | VkInstance* pInstance) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1685 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1686 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1687 | struct nulldrv_instance *inst; |
| 1688 | |
| 1689 | inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst), |
Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 1690 | VK_OBJECT_TYPE_INSTANCE); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1691 | if (!inst) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1692 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1693 | |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 1694 | inst->obj.base.get_memory_requirements = NULL; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1695 | |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1696 | *pInstance = (VkInstance) inst; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1697 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1698 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1699 | } |
| 1700 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1701 | ICD_EXPORT VkResult VKAPI vkDestroyInstance( |
| 1702 | VkInstance pInstance) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1703 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1704 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1705 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1706 | } |
| 1707 | |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1708 | ICD_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1709 | VkInstance instance, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1710 | uint32_t* pGpuCount, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1711 | VkPhysicalDevice* pGpus) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1712 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1713 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1714 | VkResult ret; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1715 | struct nulldrv_gpu *gpu; |
| 1716 | *pGpuCount = 1; |
| 1717 | ret = nulldrv_gpu_add(0, 0, 0, &gpu); |
David Pinedo | f676845 | 2015-04-21 14:44:02 -0600 | [diff] [blame] | 1718 | if (ret == VK_SUCCESS && pGpus) |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1719 | pGpus[0] = (VkPhysicalDevice) gpu; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1720 | return ret; |
| 1721 | } |
| 1722 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1723 | ICD_EXPORT VkResult VKAPI vkEnumerateLayers( |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1724 | VkPhysicalDevice gpu, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1725 | size_t maxStringSize, |
Courtney Goeltzenleuchter | bb1f360 | 2015-04-20 11:04:54 -0600 | [diff] [blame] | 1726 | size_t* pLayerCount, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1727 | char* const* pOutLayers, |
| 1728 | void* pReserved) |
| 1729 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1730 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1731 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1732 | } |
| 1733 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1734 | ICD_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements( |
| 1735 | VkDevice device, |
| 1736 | VkBuffer buffer, |
| 1737 | VkMemoryRequirements* pMemoryRequirements) |
| 1738 | { |
| 1739 | NULLDRV_LOG_FUNC; |
| 1740 | struct nulldrv_base *base = nulldrv_base((void*)buffer.handle); |
| 1741 | |
| 1742 | return base->get_memory_requirements(base, pMemoryRequirements); |
| 1743 | } |
| 1744 | |
| 1745 | ICD_EXPORT VkResult VKAPI vkGetImageMemoryRequirements( |
| 1746 | VkDevice device, |
| 1747 | VkImage image, |
| 1748 | VkMemoryRequirements* pMemoryRequirements) |
| 1749 | { |
| 1750 | NULLDRV_LOG_FUNC; |
| 1751 | struct nulldrv_base *base = nulldrv_base((void*)image.handle); |
| 1752 | |
| 1753 | return base->get_memory_requirements(base, pMemoryRequirements); |
| 1754 | } |
| 1755 | |
| 1756 | ICD_EXPORT VkResult VKAPI vkBindBufferMemory( |
| 1757 | VkDevice device, |
| 1758 | VkBuffer buffer, |
| 1759 | VkDeviceMemory mem_, |
| 1760 | VkDeviceSize memOffset) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1761 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1762 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1763 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1764 | } |
| 1765 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1766 | ICD_EXPORT VkResult VKAPI vkBindImageMemory( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1767 | VkDevice device, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1768 | VkImage image, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1769 | VkDeviceMemory mem_, |
| 1770 | VkDeviceSize memOffset) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1771 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1772 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1773 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1774 | } |
| 1775 | |
Mark Lobodzinski | 83d4e6a | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1776 | ICD_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements( |
| 1777 | VkDevice device, |
| 1778 | VkImage image, |
| 1779 | uint32_t* pNumRequirements, |
| 1780 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 1781 | { |
| 1782 | NULLDRV_LOG_FUNC; |
| 1783 | return VK_SUCCESS; |
| 1784 | } |
| 1785 | |
| 1786 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties( |
| 1787 | VkPhysicalDevice physicalDevice, |
| 1788 | VkFormat format, |
| 1789 | VkImageType type, |
| 1790 | uint32_t samples, |
| 1791 | VkImageUsageFlags usage, |
| 1792 | VkImageTiling tiling, |
| 1793 | uint32_t* pNumProperties, |
| 1794 | VkSparseImageFormatProperties* pProperties) |
| 1795 | { |
| 1796 | NULLDRV_LOG_FUNC; |
| 1797 | return VK_SUCCESS; |
| 1798 | } |
| 1799 | |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 1800 | ICD_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1801 | VkQueue queue, |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 1802 | VkBuffer buffer, |
Mark Lobodzinski | 83d4e6a | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1803 | uint32_t numBindings, |
| 1804 | const VkSparseMemoryBindInfo* pBindInfo) |
| 1805 | { |
| 1806 | NULLDRV_LOG_FUNC; |
| 1807 | return VK_SUCCESS; |
| 1808 | } |
| 1809 | |
| 1810 | ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory( |
| 1811 | VkQueue queue, |
| 1812 | VkImage image, |
| 1813 | uint32_t numBindings, |
| 1814 | const VkSparseMemoryBindInfo* pBindInfo) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1815 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1816 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1817 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1818 | } |
| 1819 | |
Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 1820 | ICD_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Mark Lobodzinski | 83d4e6a | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 1821 | VkQueue queue, |
| 1822 | VkImage image, |
| 1823 | uint32_t numBindings, |
| 1824 | const VkSparseImageMemoryBindInfo* pBindInfo) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1825 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1826 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1827 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1828 | } |
Jon Ashburn | 0e24996 | 2015-07-10 09:41:15 -0700 | [diff] [blame] | 1829 | ICD_EXPORT VkResult VKAPI vkCreatePipelineCache( |
| 1830 | VkDevice device, |
| 1831 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 1832 | VkPipelineCache* pPipelineCache) |
| 1833 | { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1834 | |
Jon Ashburn | 0e24996 | 2015-07-10 09:41:15 -0700 | [diff] [blame] | 1835 | NULLDRV_LOG_FUNC; |
| 1836 | return VK_SUCCESS; |
| 1837 | } |
| 1838 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1839 | ICD_EXPORT VkResult VKAPI vkDestroyPipeline( |
| 1840 | VkDevice device, |
| 1841 | VkPipeline pipeline) |
| 1842 | { |
| 1843 | NULLDRV_LOG_FUNC; |
| 1844 | return VK_SUCCESS; |
| 1845 | } |
| 1846 | |
Courtney Goeltzenleuchter | a4cd819 | 2015-07-10 17:44:33 -0600 | [diff] [blame] | 1847 | VkResult VKAPI vkDestroyPipelineCache( |
| 1848 | VkDevice device, |
| 1849 | VkPipelineCache pipelineCache) |
Jon Ashburn | 0e24996 | 2015-07-10 09:41:15 -0700 | [diff] [blame] | 1850 | { |
| 1851 | NULLDRV_LOG_FUNC; |
| 1852 | return VK_SUCCESS; |
| 1853 | } |
| 1854 | |
| 1855 | ICD_EXPORT size_t VKAPI vkGetPipelineCacheSize( |
| 1856 | VkDevice device, |
| 1857 | VkPipelineCache pipelineCache) |
| 1858 | { |
| 1859 | NULLDRV_LOG_FUNC; |
| 1860 | return VK_ERROR_UNAVAILABLE; |
| 1861 | } |
| 1862 | |
| 1863 | ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData( |
| 1864 | VkDevice device, |
| 1865 | VkPipelineCache pipelineCache, |
| 1866 | void* pData) |
| 1867 | { |
| 1868 | NULLDRV_LOG_FUNC; |
| 1869 | return VK_ERROR_UNAVAILABLE; |
| 1870 | } |
| 1871 | |
| 1872 | ICD_EXPORT VkResult VKAPI vkMergePipelineCaches( |
| 1873 | VkDevice device, |
| 1874 | VkPipelineCache destCache, |
| 1875 | uint32_t srcCacheCount, |
| 1876 | const VkPipelineCache* pSrcCaches) |
| 1877 | { |
| 1878 | NULLDRV_LOG_FUNC; |
| 1879 | return VK_ERROR_UNAVAILABLE; |
| 1880 | } |
| 1881 | ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1882 | VkDevice device, |
Jon Ashburn | 0e24996 | 2015-07-10 09:41:15 -0700 | [diff] [blame] | 1883 | VkPipelineCache pipelineCache, |
| 1884 | uint32_t count, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1885 | const VkGraphicsPipelineCreateInfo* pCreateInfo, |
| 1886 | VkPipeline* pPipeline) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1887 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1888 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1889 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1890 | |
| 1891 | return graphics_pipeline_create(dev, pCreateInfo, |
| 1892 | (struct nulldrv_pipeline **) pPipeline); |
| 1893 | } |
| 1894 | |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1895 | |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1896 | |
Jon Ashburn | 0e24996 | 2015-07-10 09:41:15 -0700 | [diff] [blame] | 1897 | ICD_EXPORT VkResult VKAPI vkCreateComputePipelines( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1898 | VkDevice device, |
Jon Ashburn | 0e24996 | 2015-07-10 09:41:15 -0700 | [diff] [blame] | 1899 | VkPipelineCache pipelineCache, |
| 1900 | uint32_t count, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1901 | const VkComputePipelineCreateInfo* pCreateInfo, |
| 1902 | VkPipeline* pPipeline) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1903 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1904 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1905 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1906 | } |
| 1907 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1908 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1909 | |
Jon Ashburn | 0e24996 | 2015-07-10 09:41:15 -0700 | [diff] [blame] | 1910 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1911 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1912 | ICD_EXPORT VkResult VKAPI vkCreateQueryPool( |
| 1913 | VkDevice device, |
| 1914 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 1915 | VkQueryPool* pQueryPool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1916 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1917 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1918 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1919 | } |
| 1920 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1921 | ICD_EXPORT VkResult VKAPI vkDestroyQueryPool( |
| 1922 | VkDevice device, |
| 1923 | VkQueryPool queryPoool) |
| 1924 | { |
| 1925 | NULLDRV_LOG_FUNC; |
| 1926 | return VK_SUCCESS; |
| 1927 | } |
| 1928 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1929 | ICD_EXPORT VkResult VKAPI vkGetQueryPoolResults( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 1930 | VkDevice device, |
| 1931 | VkQueryPool queryPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1932 | uint32_t startQuery, |
| 1933 | uint32_t queryCount, |
| 1934 | size_t* pDataSize, |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 1935 | void* pData, |
| 1936 | VkQueryResultFlags flags) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1937 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1938 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1939 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1940 | } |
| 1941 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1942 | ICD_EXPORT VkResult VKAPI vkQueueWaitIdle( |
| 1943 | VkQueue queue_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1944 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1945 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1946 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1947 | } |
| 1948 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1949 | ICD_EXPORT VkResult VKAPI vkQueueSubmit( |
| 1950 | VkQueue queue_, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1951 | uint32_t cmdBufferCount, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1952 | const VkCmdBuffer* pCmdBuffers, |
| 1953 | VkFence fence_) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1954 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1955 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1956 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1957 | } |
| 1958 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1959 | ICD_EXPORT VkResult VKAPI vkCreateSemaphore( |
| 1960 | VkDevice device, |
| 1961 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 1962 | VkSemaphore* pSemaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1963 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1964 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1965 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1966 | } |
| 1967 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 1968 | ICD_EXPORT VkResult VKAPI vkDestroySemaphore( |
| 1969 | VkDevice device, |
| 1970 | VkSemaphore semaphore) |
| 1971 | { |
| 1972 | NULLDRV_LOG_FUNC; |
| 1973 | return VK_SUCCESS; |
| 1974 | } |
| 1975 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1976 | ICD_EXPORT VkResult VKAPI vkQueueSignalSemaphore( |
| 1977 | VkQueue queue, |
| 1978 | VkSemaphore semaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1979 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1980 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1981 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1982 | } |
| 1983 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1984 | ICD_EXPORT VkResult VKAPI vkQueueWaitSemaphore( |
| 1985 | VkQueue queue, |
| 1986 | VkSemaphore semaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1987 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1988 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1989 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1990 | } |
| 1991 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 1992 | ICD_EXPORT VkResult VKAPI vkCreateSampler( |
| 1993 | VkDevice device, |
| 1994 | const VkSamplerCreateInfo* pCreateInfo, |
| 1995 | VkSampler* pSampler) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1996 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1997 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1998 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1999 | |
| 2000 | return nulldrv_sampler_create(dev, pCreateInfo, |
| 2001 | (struct nulldrv_sampler **) pSampler); |
| 2002 | } |
| 2003 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2004 | ICD_EXPORT VkResult VKAPI vkDestroySampler( |
| 2005 | VkDevice device, |
| 2006 | VkSampler sampler) |
| 2007 | { |
| 2008 | NULLDRV_LOG_FUNC; |
| 2009 | return VK_SUCCESS; |
| 2010 | } |
| 2011 | |
Ian Elliott | e924ab2 | 2015-07-08 13:24:30 -0600 | [diff] [blame] | 2012 | ICD_EXPORT VkResult VKAPI vkCreateShaderModule( |
| 2013 | VkDevice device, |
| 2014 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 2015 | VkShaderModule* pShaderModule) |
| 2016 | { |
| 2017 | // TODO: Fill in with real data |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2018 | NULLDRV_LOG_FUNC; |
| 2019 | return VK_SUCCESS; |
| 2020 | } |
| 2021 | |
| 2022 | ICD_EXPORT VkResult VKAPI vkDestroyShaderModule( |
| 2023 | VkDevice device, |
| 2024 | VkShaderModule shaderModule) |
| 2025 | { |
| 2026 | // TODO: Fill in with real data |
| 2027 | NULLDRV_LOG_FUNC; |
Ian Elliott | e924ab2 | 2015-07-08 13:24:30 -0600 | [diff] [blame] | 2028 | return VK_SUCCESS; |
| 2029 | } |
| 2030 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2031 | ICD_EXPORT VkResult VKAPI vkCreateShader( |
| 2032 | VkDevice device, |
| 2033 | const VkShaderCreateInfo* pCreateInfo, |
| 2034 | VkShader* pShader) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2035 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2036 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2037 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2038 | |
| 2039 | return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader); |
| 2040 | } |
| 2041 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2042 | ICD_EXPORT VkResult VKAPI vkDestroyShader( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2043 | VkDevice device, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2044 | VkShader shader) |
| 2045 | { |
| 2046 | NULLDRV_LOG_FUNC; |
| 2047 | return VK_SUCCESS; |
| 2048 | } |
| 2049 | |
| 2050 | ICD_EXPORT VkResult VKAPI vkCreateDynamicViewportState( |
| 2051 | VkDevice device, |
| 2052 | const VkDynamicViewportStateCreateInfo* pCreateInfo, |
| 2053 | VkDynamicViewportState* pState) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2054 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2055 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2056 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2057 | |
| 2058 | return nulldrv_viewport_state_create(dev, pCreateInfo, |
| 2059 | (struct nulldrv_dynamic_vp **) pState); |
| 2060 | } |
| 2061 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2062 | ICD_EXPORT VkResult VKAPI vkDestroyDynamicViewportState( |
| 2063 | VkDevice device, |
| 2064 | VkDynamicViewportState dynamicViewportState) |
| 2065 | { |
| 2066 | NULLDRV_LOG_FUNC; |
| 2067 | return VK_SUCCESS; |
| 2068 | } |
| 2069 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2070 | ICD_EXPORT VkResult VKAPI vkCreateDynamicRasterState( |
| 2071 | VkDevice device, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2072 | const VkDynamicRasterStateCreateInfo* pCreateInfo, |
| 2073 | VkDynamicRasterState* pState) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2074 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2075 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2076 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2077 | |
| 2078 | return nulldrv_raster_state_create(dev, pCreateInfo, |
| 2079 | (struct nulldrv_dynamic_rs **) pState); |
| 2080 | } |
| 2081 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2082 | ICD_EXPORT VkResult VKAPI vkDestroyDynamicRasterState( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2083 | VkDevice device, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2084 | VkDynamicRasterState dynamicRasterState) |
| 2085 | { |
| 2086 | NULLDRV_LOG_FUNC; |
| 2087 | return VK_SUCCESS; |
| 2088 | } |
| 2089 | |
| 2090 | ICD_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState( |
| 2091 | VkDevice device, |
| 2092 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo, |
| 2093 | VkDynamicColorBlendState* pState) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2094 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2095 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2096 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2097 | |
| 2098 | return nulldrv_blend_state_create(dev, pCreateInfo, |
| 2099 | (struct nulldrv_dynamic_cb **) pState); |
| 2100 | } |
| 2101 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2102 | ICD_EXPORT VkResult VKAPI vkDestroyDynamicColorBlendState( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2103 | VkDevice device, |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2104 | VkDynamicColorBlendState dynamicColorBlendState) |
| 2105 | { |
| 2106 | NULLDRV_LOG_FUNC; |
| 2107 | return VK_SUCCESS; |
| 2108 | } |
| 2109 | |
| 2110 | ICD_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState( |
| 2111 | VkDevice device, |
| 2112 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, |
| 2113 | VkDynamicDepthStencilState* pState) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2114 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2115 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2116 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2117 | |
| 2118 | return nulldrv_ds_state_create(dev, pCreateInfo, |
| 2119 | (struct nulldrv_dynamic_ds **) pState); |
| 2120 | } |
| 2121 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2122 | ICD_EXPORT VkResult VKAPI vkDestroyDynamicDepthStencilState( |
| 2123 | VkDevice device, |
| 2124 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 2125 | { |
| 2126 | NULLDRV_LOG_FUNC; |
| 2127 | return VK_SUCCESS; |
| 2128 | } |
| 2129 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2130 | ICD_EXPORT VkResult VKAPI vkCreateBufferView( |
| 2131 | VkDevice device, |
Courtney Goeltzenleuchter | ddcb619 | 2015-04-14 18:48:46 -0600 | [diff] [blame] | 2132 | const VkBufferViewCreateInfo* pCreateInfo, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2133 | VkBufferView* pView) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2134 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2135 | NULLDRV_LOG_FUNC; |
| 2136 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2137 | |
| 2138 | return nulldrv_buf_view_create(dev, pCreateInfo, |
| 2139 | (struct nulldrv_buf_view **) pView); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2140 | } |
| 2141 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2142 | ICD_EXPORT VkResult VKAPI vkDestroyBufferView( |
| 2143 | VkDevice device, |
| 2144 | VkBufferView bufferView) |
| 2145 | { |
| 2146 | NULLDRV_LOG_FUNC; |
| 2147 | return VK_SUCCESS; |
| 2148 | } |
| 2149 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2150 | ICD_EXPORT VkResult VKAPI vkCreateImageView( |
| 2151 | VkDevice device, |
| 2152 | const VkImageViewCreateInfo* pCreateInfo, |
| 2153 | VkImageView* pView) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2154 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2155 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2156 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2157 | |
| 2158 | return nulldrv_img_view_create(dev, pCreateInfo, |
| 2159 | (struct nulldrv_img_view **) pView); |
| 2160 | } |
| 2161 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2162 | ICD_EXPORT VkResult VKAPI vkDestroyImageView( |
| 2163 | VkDevice device, |
| 2164 | VkImageView imageView) |
| 2165 | { |
| 2166 | NULLDRV_LOG_FUNC; |
| 2167 | return VK_SUCCESS; |
| 2168 | } |
| 2169 | |
Courtney Goeltzenleuchter | a4cd819 | 2015-07-10 17:44:33 -0600 | [diff] [blame] | 2170 | ICD_EXPORT VkResult VKAPI vkCreateAttachmentView( |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2171 | VkDevice device, |
Chia-I Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 2172 | const VkAttachmentViewCreateInfo* pCreateInfo, |
| 2173 | VkAttachmentView* pView) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2174 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2175 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2176 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2177 | |
| 2178 | return nulldrv_rt_view_create(dev, pCreateInfo, |
| 2179 | (struct nulldrv_rt_view **) pView); |
| 2180 | } |
| 2181 | |
Courtney Goeltzenleuchter | a4cd819 | 2015-07-10 17:44:33 -0600 | [diff] [blame] | 2182 | ICD_EXPORT VkResult VKAPI vkDestroyAttachmentView( |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2183 | VkDevice device, |
Courtney Goeltzenleuchter | a4cd819 | 2015-07-10 17:44:33 -0600 | [diff] [blame] | 2184 | VkAttachmentView attachmentView) |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2185 | { |
| 2186 | NULLDRV_LOG_FUNC; |
| 2187 | return VK_SUCCESS; |
| 2188 | } |
| 2189 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2190 | ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( |
| 2191 | VkDevice device, |
| 2192 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 2193 | VkDescriptorSetLayout* pSetLayout) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2194 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2195 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2196 | struct nulldrv_dev *dev = nulldrv_dev(device); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2197 | |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 2198 | return nulldrv_desc_layout_create(dev, pCreateInfo, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2199 | (struct nulldrv_desc_layout **) pSetLayout); |
| 2200 | } |
| 2201 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2202 | ICD_EXPORT VkResult VKAPI vkDestroyDescriptorSetLayout( |
| 2203 | VkDevice device, |
| 2204 | VkDescriptorSetLayout descriptorSetLayout) |
| 2205 | { |
| 2206 | NULLDRV_LOG_FUNC; |
| 2207 | return VK_SUCCESS; |
| 2208 | } |
| 2209 | |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 2210 | ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout( |
| 2211 | VkDevice device, |
| 2212 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 2213 | VkPipelineLayout* pPipelineLayout) |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 2214 | { |
| 2215 | NULLDRV_LOG_FUNC; |
| 2216 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2217 | |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 2218 | return nulldrv_pipeline_layout_create(dev, |
| 2219 | pCreateInfo, |
| 2220 | (struct nulldrv_pipeline_layout **) pPipelineLayout); |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 2221 | } |
| 2222 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2223 | ICD_EXPORT VkResult VKAPI vkDestroyPipelineLayout( |
| 2224 | VkDevice device, |
| 2225 | VkPipelineLayout pipelineLayout) |
| 2226 | { |
| 2227 | NULLDRV_LOG_FUNC; |
| 2228 | return VK_SUCCESS; |
| 2229 | } |
| 2230 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2231 | ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool( |
| 2232 | VkDevice device, |
| 2233 | VkDescriptorPoolUsage poolUsage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2234 | uint32_t maxSets, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2235 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 2236 | VkDescriptorPool* pDescriptorPool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2237 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2238 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2239 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2240 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 2241 | return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo, |
| 2242 | (struct nulldrv_desc_pool **) pDescriptorPool); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2243 | } |
| 2244 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2245 | ICD_EXPORT VkResult VKAPI vkDestroyDescriptorPool( |
| 2246 | VkDevice device, |
| 2247 | VkDescriptorPool descriptorPool) |
| 2248 | { |
| 2249 | NULLDRV_LOG_FUNC; |
| 2250 | return VK_SUCCESS; |
| 2251 | } |
| 2252 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2253 | ICD_EXPORT VkResult VKAPI vkResetDescriptorPool( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 2254 | VkDevice device, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2255 | VkDescriptorPool descriptorPool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2256 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2257 | NULLDRV_LOG_FUNC; |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2258 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2259 | } |
| 2260 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2261 | ICD_EXPORT VkResult VKAPI vkAllocDescriptorSets( |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 2262 | VkDevice device, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2263 | VkDescriptorPool descriptorPool, |
| 2264 | VkDescriptorSetUsage setUsage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2265 | uint32_t count, |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2266 | const VkDescriptorSetLayout* pSetLayouts, |
| 2267 | VkDescriptorSet* pDescriptorSets, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2268 | uint32_t* pCount) |
| 2269 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2270 | NULLDRV_LOG_FUNC; |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 2271 | struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool); |
| 2272 | struct nulldrv_dev *dev = pool->dev; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2273 | VkResult ret = VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2274 | uint32_t i; |
| 2275 | |
| 2276 | for (i = 0; i < count; i++) { |
| 2277 | const struct nulldrv_desc_layout *layout = |
Tony Barbour | 8db6537 | 2015-07-10 18:32:33 -0600 | [diff] [blame] | 2278 | nulldrv_desc_layout(pSetLayouts[i]); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2279 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 2280 | ret = nulldrv_desc_set_create(dev, pool, setUsage, layout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2281 | (struct nulldrv_desc_set **) &pDescriptorSets[i]); |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2282 | if (ret != VK_SUCCESS) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2283 | break; |
| 2284 | } |
| 2285 | |
| 2286 | if (pCount) |
| 2287 | *pCount = i; |
| 2288 | |
| 2289 | return ret; |
| 2290 | } |
| 2291 | |
Tony Barbour | b857d31 | 2015-07-10 10:50:45 -0600 | [diff] [blame] | 2292 | ICD_EXPORT VkResult VKAPI vkFreeDescriptorSets( |
| 2293 | VkDevice device, |
| 2294 | VkDescriptorPool descriptorPool, |
| 2295 | uint32_t count, |
| 2296 | const VkDescriptorSet* pDescriptorSets) |
| 2297 | { |
| 2298 | NULLDRV_LOG_FUNC; |
| 2299 | return VK_SUCCESS; |
| 2300 | } |
| 2301 | |
Chia-I Wu | 8cd8ecd | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 2302 | ICD_EXPORT VkResult VKAPI vkUpdateDescriptorSets( |
| 2303 | VkDevice device, |
| 2304 | uint32_t writeCount, |
| 2305 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 2306 | uint32_t copyCount, |
| 2307 | const VkCopyDescriptorSet* pDescriptorCopies) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2308 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2309 | NULLDRV_LOG_FUNC; |
Chia-I Wu | 8cd8ecd | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 2310 | return VK_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2311 | } |
| 2312 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2313 | ICD_EXPORT VkResult VKAPI vkCreateFramebuffer( |
| 2314 | VkDevice device, |
| 2315 | const VkFramebufferCreateInfo* info, |
| 2316 | VkFramebuffer* fb_ret) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2317 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2318 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2319 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2320 | |
| 2321 | return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret); |
| 2322 | } |
| 2323 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2324 | ICD_EXPORT VkResult VKAPI vkDestroyFramebuffer( |
| 2325 | VkDevice device, |
| 2326 | VkFramebuffer framebuffer) |
| 2327 | { |
| 2328 | NULLDRV_LOG_FUNC; |
| 2329 | return VK_SUCCESS; |
| 2330 | } |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2331 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2332 | ICD_EXPORT VkResult VKAPI vkCreateRenderPass( |
| 2333 | VkDevice device, |
| 2334 | const VkRenderPassCreateInfo* info, |
| 2335 | VkRenderPass* rp_ret) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2336 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2337 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2338 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2339 | |
| 2340 | return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret); |
| 2341 | } |
| 2342 | |
Tony Barbour | de4124d | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 2343 | ICD_EXPORT VkResult VKAPI vkDestroyRenderPass( |
| 2344 | VkDevice device, |
| 2345 | VkRenderPass renderPass) |
| 2346 | { |
| 2347 | NULLDRV_LOG_FUNC; |
| 2348 | return VK_SUCCESS; |
| 2349 | } |
| 2350 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2351 | ICD_EXPORT void VKAPI vkCmdBeginRenderPass( |
Chia-I Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 2352 | VkCmdBuffer cmdBuffer, |
| 2353 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 2354 | VkRenderPassContents contents) |
| 2355 | { |
| 2356 | NULLDRV_LOG_FUNC; |
| 2357 | } |
| 2358 | |
| 2359 | ICD_EXPORT void VKAPI vkCmdNextSubpass( |
| 2360 | VkCmdBuffer cmdBuffer, |
| 2361 | VkRenderPassContents contents) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2362 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2363 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2364 | } |
| 2365 | |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2366 | ICD_EXPORT void VKAPI vkCmdEndRenderPass( |
Chia-I Wu | 88eaa3b | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 2367 | VkCmdBuffer cmdBuffer) |
| 2368 | { |
| 2369 | NULLDRV_LOG_FUNC; |
| 2370 | } |
| 2371 | |
| 2372 | ICD_EXPORT void VKAPI vkCmdExecuteCommands( |
| 2373 | VkCmdBuffer cmdBuffer, |
| 2374 | uint32_t cmdBuffersCount, |
| 2375 | const VkCmdBuffer* pCmdBuffers) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2376 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2377 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2378 | } |
Ian Elliott | f93069f | 2015-02-19 14:26:19 -0700 | [diff] [blame] | 2379 | |
| 2380 | ICD_EXPORT void* xcbCreateWindow( |
| 2381 | uint16_t width, |
| 2382 | uint16_t height) |
| 2383 | { |
| 2384 | static uint32_t window; // Kludge to the max |
| 2385 | NULLDRV_LOG_FUNC; |
| 2386 | return &window; |
| 2387 | } |
| 2388 | |
| 2389 | // May not be needed, if we stub out stuf in tri.c |
| 2390 | ICD_EXPORT void xcbDestroyWindow() |
| 2391 | { |
| 2392 | NULLDRV_LOG_FUNC; |
| 2393 | } |
| 2394 | |
| 2395 | ICD_EXPORT int xcbGetMessage(void *msg) |
| 2396 | { |
| 2397 | NULLDRV_LOG_FUNC; |
| 2398 | return 0; |
| 2399 | } |
| 2400 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 2401 | ICD_EXPORT VkResult xcbQueuePresent(void *queue, void *image, void* fence) |
Ian Elliott | f93069f | 2015-02-19 14:26:19 -0700 | [diff] [blame] | 2402 | { |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2403 | return VK_SUCCESS; |
Ian Elliott | f93069f | 2015-02-19 14:26:19 -0700 | [diff] [blame] | 2404 | } |
David Pinedo | 07494fd | 2015-07-24 10:54:41 -0600 | [diff] [blame] | 2405 | |
| 2406 | ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties( |
| 2407 | VkPhysicalDevice physicalDevice, |
| 2408 | VkFormat format, |
| 2409 | VkImageType type, |
| 2410 | VkImageTiling tiling, |
| 2411 | VkImageUsageFlags usage, |
| 2412 | VkImageFormatProperties* pImageFormatProperties) |
| 2413 | { |
| 2414 | return VK_ERROR_UNAVAILABLE; |
| 2415 | } |