David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * XGL null driver |
| 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] = { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 43 | [NULLDRV_EXT_WSI_X11] = "XGL_WSI_X11", |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 44 | [NULLDRV_EXT_WSI_WINDOWS] = "XGL_WSI_WINDOWS" |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | static struct nulldrv_base *nulldrv_base(XGL_BASE_OBJECT base) |
| 48 | { |
| 49 | return (struct nulldrv_base *) base; |
| 50 | } |
| 51 | |
| 52 | static XGL_RESULT nulldrv_base_get_info(struct nulldrv_base *base, int type, |
| 53 | size_t *size, void *data) |
| 54 | { |
| 55 | XGL_RESULT ret = XGL_SUCCESS; |
| 56 | size_t s; |
| 57 | uint32_t *count; |
| 58 | |
| 59 | switch (type) { |
| 60 | case XGL_INFO_TYPE_MEMORY_REQUIREMENTS: |
| 61 | { |
| 62 | XGL_MEMORY_REQUIREMENTS *mem_req = data; |
| 63 | s = sizeof(XGL_MEMORY_REQUIREMENTS); |
| 64 | *size = s; |
| 65 | if (data == NULL) |
| 66 | return ret; |
| 67 | memset(data, 0, s); |
| 68 | mem_req->memType = XGL_MEMORY_TYPE_OTHER; |
| 69 | break; |
| 70 | } |
| 71 | case XGL_INFO_TYPE_MEMORY_ALLOCATION_COUNT: |
| 72 | *size = sizeof(uint32_t); |
| 73 | if (data == NULL) |
| 74 | return ret; |
| 75 | count = (uint32_t *) data; |
| 76 | *count = 1; |
| 77 | break; |
| 78 | case XGL_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS: |
| 79 | s = sizeof(XGL_IMAGE_MEMORY_REQUIREMENTS); |
| 80 | *size = s; |
| 81 | if (data == NULL) |
| 82 | return ret; |
| 83 | memset(data, 0, s); |
| 84 | break; |
| 85 | case XGL_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS: |
| 86 | s = sizeof(XGL_BUFFER_MEMORY_REQUIREMENTS); |
| 87 | *size = s; |
| 88 | if (data == NULL) |
| 89 | return ret; |
| 90 | memset(data, 0, s); |
| 91 | break; |
| 92 | default: |
| 93 | ret = XGL_ERROR_INVALID_VALUE; |
| 94 | break; |
| 95 | } |
| 96 | |
| 97 | return ret; |
| 98 | } |
| 99 | |
| 100 | static struct nulldrv_base *nulldrv_base_create(struct nulldrv_dev *dev, |
| 101 | size_t obj_size, |
| 102 | XGL_DBG_OBJECT_TYPE type) |
| 103 | { |
| 104 | struct nulldrv_base *base; |
| 105 | |
| 106 | if (!obj_size) |
| 107 | obj_size = sizeof(*base); |
| 108 | |
| 109 | assert(obj_size >= sizeof(*base)); |
| 110 | |
Chia-I Wu | 493a175 | 2015-02-22 14:40:25 +0800 | [diff] [blame] | 111 | base = (struct nulldrv_base*)malloc(obj_size); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 112 | if (!base) |
| 113 | return NULL; |
| 114 | |
| 115 | memset(base, 0, obj_size); |
| 116 | |
| 117 | // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC |
| 118 | set_loader_magic_value(base); |
| 119 | |
| 120 | if (dev == NULL) { |
| 121 | /* |
| 122 | * dev is NULL when we are creating the base device object |
| 123 | * Set dev now so that debug setup happens correctly |
| 124 | */ |
| 125 | dev = (struct nulldrv_dev *) base; |
| 126 | } |
| 127 | |
| 128 | |
| 129 | base->get_info = NULL; |
| 130 | |
| 131 | return base; |
| 132 | } |
| 133 | |
| 134 | static XGL_RESULT nulldrv_gpu_add(int devid, const char *primary_node, |
| 135 | const char *render_node, struct nulldrv_gpu **gpu_ret) |
| 136 | { |
| 137 | struct nulldrv_gpu *gpu; |
| 138 | |
Chia-I Wu | 493a175 | 2015-02-22 14:40:25 +0800 | [diff] [blame] | 139 | gpu = malloc(sizeof(*gpu)); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 140 | if (!gpu) |
| 141 | return XGL_ERROR_OUT_OF_MEMORY; |
| 142 | memset(gpu, 0, sizeof(*gpu)); |
| 143 | |
| 144 | // Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC |
| 145 | set_loader_magic_value(gpu); |
| 146 | |
| 147 | *gpu_ret = gpu; |
| 148 | |
| 149 | return XGL_SUCCESS; |
| 150 | } |
| 151 | |
| 152 | static XGL_RESULT nulldrv_queue_create(struct nulldrv_dev *dev, |
Chia-I Wu | b5ed9e6 | 2015-03-05 14:26:54 -0700 | [diff] [blame] | 153 | uint32_t node_index, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 154 | struct nulldrv_queue **queue_ret) |
| 155 | { |
| 156 | struct nulldrv_queue *queue; |
| 157 | |
| 158 | queue = (struct nulldrv_queue *) nulldrv_base_create(dev, sizeof(*queue), |
| 159 | XGL_DBG_OBJECT_QUEUE); |
| 160 | if (!queue) |
| 161 | return XGL_ERROR_OUT_OF_MEMORY; |
| 162 | |
| 163 | queue->dev = dev; |
| 164 | |
| 165 | *queue_ret = queue; |
| 166 | |
| 167 | return XGL_SUCCESS; |
| 168 | } |
| 169 | |
| 170 | static XGL_RESULT dev_create_queues(struct nulldrv_dev *dev, |
| 171 | const XGL_DEVICE_QUEUE_CREATE_INFO *queues, |
| 172 | uint32_t count) |
| 173 | { |
| 174 | uint32_t i; |
| 175 | |
| 176 | if (!count) |
| 177 | return XGL_ERROR_INVALID_POINTER; |
| 178 | |
| 179 | for (i = 0; i < count; i++) { |
| 180 | const XGL_DEVICE_QUEUE_CREATE_INFO *q = &queues[i]; |
| 181 | XGL_RESULT ret = XGL_SUCCESS; |
| 182 | |
| 183 | if (q->queueCount == 1 && !dev->queues[q->queueNodeIndex]) { |
| 184 | ret = nulldrv_queue_create(dev, q->queueNodeIndex, |
| 185 | &dev->queues[q->queueNodeIndex]); |
| 186 | } |
| 187 | else { |
| 188 | ret = XGL_ERROR_INVALID_POINTER; |
| 189 | } |
| 190 | |
| 191 | if (ret != XGL_SUCCESS) { |
| 192 | return ret; |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | return XGL_SUCCESS; |
| 197 | } |
| 198 | |
| 199 | static enum nulldrv_ext_type nulldrv_gpu_lookup_extension(const struct nulldrv_gpu *gpu, |
| 200 | const char *ext) |
| 201 | { |
| 202 | enum nulldrv_ext_type type; |
| 203 | |
| 204 | for (type = 0; type < ARRAY_SIZE(nulldrv_gpu_exts); type++) { |
| 205 | if (nulldrv_gpu_exts[type] && strcmp(nulldrv_gpu_exts[type], ext) == 0) |
| 206 | break; |
| 207 | } |
| 208 | |
| 209 | assert(type < NULLDRV_EXT_COUNT || type == NULLDRV_EXT_INVALID); |
| 210 | |
| 211 | return type; |
| 212 | } |
| 213 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 214 | static XGL_RESULT nulldrv_desc_ooxx_create(struct nulldrv_dev *dev, |
| 215 | struct nulldrv_desc_ooxx **ooxx_ret) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 216 | { |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 217 | struct nulldrv_desc_ooxx *ooxx; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 218 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 219 | ooxx = malloc(sizeof(*ooxx)); |
| 220 | if (!ooxx) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 221 | return XGL_ERROR_OUT_OF_MEMORY; |
| 222 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 223 | memset(ooxx, 0, sizeof(*ooxx)); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 224 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 225 | ooxx->surface_desc_size = 0; |
| 226 | ooxx->sampler_desc_size = 0; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 227 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 228 | *ooxx_ret = ooxx; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 229 | |
| 230 | return XGL_SUCCESS; |
| 231 | } |
| 232 | |
| 233 | static XGL_RESULT nulldrv_dev_create(struct nulldrv_gpu *gpu, |
| 234 | const XGL_DEVICE_CREATE_INFO *info, |
| 235 | struct nulldrv_dev **dev_ret) |
| 236 | { |
| 237 | struct nulldrv_dev *dev; |
| 238 | uint32_t i; |
| 239 | XGL_RESULT ret; |
| 240 | |
| 241 | dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev), |
| 242 | XGL_DBG_OBJECT_DEVICE); |
| 243 | if (!dev) |
| 244 | return XGL_ERROR_OUT_OF_MEMORY; |
| 245 | |
| 246 | for (i = 0; i < info->extensionCount; i++) { |
| 247 | const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(gpu, |
| 248 | info->ppEnabledExtensionNames[i]); |
| 249 | |
| 250 | if (ext == NULLDRV_EXT_INVALID) |
| 251 | return XGL_ERROR_INVALID_EXTENSION; |
| 252 | |
| 253 | dev->exts[ext] = true; |
| 254 | } |
| 255 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 256 | ret = nulldrv_desc_ooxx_create(dev, &dev->desc_ooxx); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 257 | if (ret != XGL_SUCCESS) { |
| 258 | return ret; |
| 259 | } |
| 260 | |
| 261 | ret = dev_create_queues(dev, info->pRequestedQueues, |
| 262 | info->queueRecordCount); |
| 263 | if (ret != XGL_SUCCESS) { |
| 264 | return ret; |
| 265 | } |
| 266 | |
| 267 | *dev_ret = dev; |
| 268 | |
| 269 | return XGL_SUCCESS; |
| 270 | } |
| 271 | |
| 272 | static struct nulldrv_gpu *nulldrv_gpu(XGL_PHYSICAL_GPU gpu) |
| 273 | { |
| 274 | return (struct nulldrv_gpu *) gpu; |
| 275 | } |
| 276 | |
| 277 | static XGL_RESULT nulldrv_rt_view_create(struct nulldrv_dev *dev, |
| 278 | const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO *info, |
| 279 | struct nulldrv_rt_view **view_ret) |
| 280 | { |
| 281 | struct nulldrv_rt_view *view; |
| 282 | |
| 283 | view = (struct nulldrv_rt_view *) nulldrv_base_create(dev, sizeof(*view), |
| 284 | XGL_DBG_OBJECT_COLOR_TARGET_VIEW); |
| 285 | if (!view) |
| 286 | return XGL_ERROR_OUT_OF_MEMORY; |
| 287 | |
| 288 | *view_ret = view; |
| 289 | |
| 290 | return XGL_SUCCESS; |
| 291 | } |
| 292 | |
| 293 | static XGL_RESULT nulldrv_fence_create(struct nulldrv_dev *dev, |
| 294 | const XGL_FENCE_CREATE_INFO *info, |
| 295 | struct nulldrv_fence **fence_ret) |
| 296 | { |
| 297 | struct nulldrv_fence *fence; |
| 298 | |
| 299 | fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence), |
| 300 | XGL_DBG_OBJECT_FENCE); |
| 301 | if (!fence) |
| 302 | return XGL_ERROR_OUT_OF_MEMORY; |
| 303 | |
| 304 | *fence_ret = fence; |
| 305 | |
| 306 | return XGL_SUCCESS; |
| 307 | } |
| 308 | |
| 309 | static struct nulldrv_dev *nulldrv_dev(XGL_DEVICE dev) |
| 310 | { |
| 311 | return (struct nulldrv_dev *) dev; |
| 312 | } |
| 313 | |
| 314 | static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base) |
| 315 | { |
| 316 | return (struct nulldrv_img *) base; |
| 317 | } |
| 318 | |
| 319 | |
| 320 | static XGL_RESULT img_get_info(struct nulldrv_base *base, int type, |
| 321 | size_t *size, void *data) |
| 322 | { |
| 323 | struct nulldrv_img *img = nulldrv_img_from_base(base); |
| 324 | XGL_RESULT ret = XGL_SUCCESS; |
| 325 | |
| 326 | switch (type) { |
| 327 | case XGL_INFO_TYPE_MEMORY_REQUIREMENTS: |
| 328 | { |
| 329 | XGL_MEMORY_REQUIREMENTS *mem_req = data; |
| 330 | |
| 331 | *size = sizeof(XGL_MEMORY_REQUIREMENTS); |
| 332 | if (data == NULL) |
| 333 | return ret; |
| 334 | mem_req->size = img->total_size; |
| 335 | mem_req->alignment = 4096; |
| 336 | mem_req->memType = XGL_MEMORY_TYPE_IMAGE; |
| 337 | } |
| 338 | break; |
| 339 | case XGL_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS: |
| 340 | { |
| 341 | XGL_IMAGE_MEMORY_REQUIREMENTS *img_req = data; |
| 342 | |
| 343 | *size = sizeof(XGL_IMAGE_MEMORY_REQUIREMENTS); |
| 344 | if (data == NULL) |
| 345 | return ret; |
| 346 | img_req->usage = img->usage; |
| 347 | img_req->formatClass = img->format_class; |
| 348 | img_req->samples = img->samples; |
| 349 | } |
| 350 | break; |
| 351 | case XGL_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS: |
| 352 | { |
| 353 | XGL_BUFFER_MEMORY_REQUIREMENTS *buf_req = data; |
| 354 | |
Ian Elliott | a8f1f94 | 2015-02-19 14:04:56 -0700 | [diff] [blame] | 355 | *size = sizeof(XGL_BUFFER_MEMORY_REQUIREMENTS); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 356 | if (data == NULL) |
| 357 | return ret; |
| 358 | buf_req->usage = img->usage; |
| 359 | } |
| 360 | break; |
| 361 | default: |
| 362 | ret = nulldrv_base_get_info(base, type, size, data); |
| 363 | break; |
| 364 | } |
| 365 | |
| 366 | return ret; |
| 367 | } |
| 368 | |
| 369 | static XGL_RESULT nulldrv_img_create(struct nulldrv_dev *dev, |
| 370 | const XGL_IMAGE_CREATE_INFO *info, |
| 371 | bool scanout, |
| 372 | struct nulldrv_img **img_ret) |
| 373 | { |
| 374 | struct nulldrv_img *img; |
| 375 | |
| 376 | img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img), |
| 377 | XGL_DBG_OBJECT_IMAGE); |
| 378 | if (!img) |
| 379 | return XGL_ERROR_OUT_OF_MEMORY; |
| 380 | |
| 381 | img->type = info->imageType; |
| 382 | img->depth = info->extent.depth; |
| 383 | img->mip_levels = info->mipLevels; |
| 384 | img->array_size = info->arraySize; |
| 385 | img->usage = info->usage; |
| 386 | if (info->tiling == XGL_LINEAR_TILING) |
| 387 | img->format_class = XGL_IMAGE_FORMAT_CLASS_LINEAR; |
| 388 | else |
| 389 | img->format_class = icd_format_get_class(info->format); |
| 390 | img->samples = info->samples; |
| 391 | |
| 392 | img->obj.base.get_info = img_get_info; |
| 393 | |
| 394 | *img_ret = img; |
| 395 | |
| 396 | return XGL_SUCCESS; |
| 397 | } |
| 398 | |
| 399 | static struct nulldrv_img *nulldrv_img(XGL_IMAGE image) |
| 400 | { |
| 401 | return (struct nulldrv_img *) image; |
| 402 | } |
| 403 | |
| 404 | static XGL_RESULT nulldrv_mem_alloc(struct nulldrv_dev *dev, |
| 405 | const XGL_MEMORY_ALLOC_INFO *info, |
| 406 | struct nulldrv_mem **mem_ret) |
| 407 | { |
| 408 | struct nulldrv_mem *mem; |
| 409 | |
| 410 | mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem), |
| 411 | XGL_DBG_OBJECT_GPU_MEMORY); |
| 412 | if (!mem) |
| 413 | return XGL_ERROR_OUT_OF_MEMORY; |
| 414 | |
Chia-I Wu | b5ed9e6 | 2015-03-05 14:26:54 -0700 | [diff] [blame] | 415 | mem->bo = malloc(info->allocationSize); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 416 | if (!mem->bo) { |
| 417 | return XGL_ERROR_OUT_OF_MEMORY; |
| 418 | } |
| 419 | |
| 420 | mem->size = info->allocationSize; |
| 421 | |
| 422 | *mem_ret = mem; |
| 423 | |
| 424 | return XGL_SUCCESS; |
| 425 | } |
| 426 | |
| 427 | static XGL_RESULT nulldrv_ds_view_create(struct nulldrv_dev *dev, |
| 428 | const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO *info, |
| 429 | struct nulldrv_ds_view **view_ret) |
| 430 | { |
| 431 | struct nulldrv_img *img = nulldrv_img(info->image); |
| 432 | struct nulldrv_ds_view *view; |
| 433 | |
| 434 | view = (struct nulldrv_ds_view *) nulldrv_base_create(dev, sizeof(*view), |
| 435 | XGL_DBG_OBJECT_DEPTH_STENCIL_VIEW); |
| 436 | if (!view) |
| 437 | return XGL_ERROR_OUT_OF_MEMORY; |
| 438 | |
| 439 | view->img = img; |
| 440 | |
| 441 | view->array_size = info->arraySize; |
| 442 | |
| 443 | *view_ret = view; |
| 444 | |
| 445 | return XGL_SUCCESS; |
| 446 | } |
| 447 | |
| 448 | static XGL_RESULT nulldrv_sampler_create(struct nulldrv_dev *dev, |
| 449 | const XGL_SAMPLER_CREATE_INFO *info, |
| 450 | struct nulldrv_sampler **sampler_ret) |
| 451 | { |
| 452 | struct nulldrv_sampler *sampler; |
| 453 | |
| 454 | sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev, |
| 455 | sizeof(*sampler), XGL_DBG_OBJECT_SAMPLER); |
| 456 | if (!sampler) |
| 457 | return XGL_ERROR_OUT_OF_MEMORY; |
| 458 | |
| 459 | *sampler_ret = sampler; |
| 460 | |
| 461 | return XGL_SUCCESS; |
| 462 | } |
| 463 | |
| 464 | static XGL_RESULT nulldrv_img_view_create(struct nulldrv_dev *dev, |
| 465 | const XGL_IMAGE_VIEW_CREATE_INFO *info, |
| 466 | struct nulldrv_img_view **view_ret) |
| 467 | { |
| 468 | struct nulldrv_img *img = nulldrv_img(info->image); |
| 469 | struct nulldrv_img_view *view; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 470 | |
| 471 | view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view), |
| 472 | XGL_DBG_OBJECT_IMAGE_VIEW); |
| 473 | if (!view) |
| 474 | return XGL_ERROR_OUT_OF_MEMORY; |
| 475 | |
| 476 | view->img = img; |
| 477 | view->min_lod = info->minLod; |
| 478 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 479 | view->cmd_len = 8; |
| 480 | |
| 481 | *view_ret = view; |
| 482 | |
| 483 | return XGL_SUCCESS; |
| 484 | } |
| 485 | |
| 486 | static void *nulldrv_mem_map(struct nulldrv_mem *mem, XGL_FLAGS flags) |
| 487 | { |
| 488 | return mem->bo; |
| 489 | } |
| 490 | |
| 491 | static struct nulldrv_mem *nulldrv_mem(XGL_GPU_MEMORY mem) |
| 492 | { |
| 493 | return (struct nulldrv_mem *) mem; |
| 494 | } |
| 495 | |
| 496 | static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base) |
| 497 | { |
| 498 | return (struct nulldrv_buf *) base; |
| 499 | } |
| 500 | |
| 501 | static XGL_RESULT buf_get_info(struct nulldrv_base *base, int type, |
| 502 | size_t *size, void *data) |
| 503 | { |
| 504 | struct nulldrv_buf *buf = nulldrv_buf_from_base(base); |
| 505 | XGL_RESULT ret = XGL_SUCCESS; |
| 506 | |
| 507 | switch (type) { |
| 508 | case XGL_INFO_TYPE_MEMORY_REQUIREMENTS: |
| 509 | { |
| 510 | XGL_MEMORY_REQUIREMENTS *mem_req = data; |
| 511 | |
| 512 | *size = sizeof(XGL_MEMORY_REQUIREMENTS); |
| 513 | if (data == NULL) |
| 514 | return ret; |
| 515 | |
| 516 | mem_req->size = buf->size; |
| 517 | mem_req->alignment = 4096; |
| 518 | mem_req->memType = XGL_MEMORY_TYPE_BUFFER; |
| 519 | |
| 520 | } |
| 521 | break; |
| 522 | case XGL_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS: |
| 523 | { |
| 524 | XGL_BUFFER_MEMORY_REQUIREMENTS *buf_req = data; |
| 525 | |
| 526 | *size = sizeof(XGL_BUFFER_MEMORY_REQUIREMENTS); |
| 527 | if (data == NULL) |
| 528 | return ret; |
| 529 | buf_req->usage = buf->usage; |
| 530 | } |
| 531 | break; |
| 532 | default: |
| 533 | ret = nulldrv_base_get_info(base, type, size, data); |
| 534 | break; |
| 535 | } |
| 536 | |
| 537 | return ret; |
| 538 | } |
| 539 | |
| 540 | static XGL_RESULT nulldrv_buf_create(struct nulldrv_dev *dev, |
| 541 | const XGL_BUFFER_CREATE_INFO *info, |
| 542 | struct nulldrv_buf **buf_ret) |
| 543 | { |
| 544 | struct nulldrv_buf *buf; |
| 545 | |
| 546 | buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf), |
| 547 | XGL_DBG_OBJECT_BUFFER); |
| 548 | if (!buf) |
| 549 | return XGL_ERROR_OUT_OF_MEMORY; |
| 550 | |
| 551 | buf->size = info->size; |
| 552 | buf->usage = info->usage; |
| 553 | |
| 554 | buf->obj.base.get_info = buf_get_info; |
| 555 | |
| 556 | *buf_ret = buf; |
| 557 | |
| 558 | return XGL_SUCCESS; |
| 559 | } |
| 560 | |
| 561 | static XGL_RESULT nulldrv_desc_layout_create(struct nulldrv_dev *dev, |
| 562 | XGL_FLAGS stage_flags, |
| 563 | const uint32_t *bind_points, |
| 564 | const struct nulldrv_desc_layout *prior_layout, |
| 565 | const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO *info, |
| 566 | struct nulldrv_desc_layout **layout_ret) |
| 567 | { |
| 568 | struct nulldrv_desc_layout *layout; |
| 569 | |
| 570 | layout = (struct nulldrv_desc_layout *) |
| 571 | nulldrv_base_create(dev, sizeof(*layout), |
| 572 | XGL_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT); |
| 573 | if (!layout) |
| 574 | return XGL_ERROR_OUT_OF_MEMORY; |
| 575 | |
| 576 | *layout_ret = layout; |
| 577 | |
| 578 | return XGL_SUCCESS; |
| 579 | } |
| 580 | |
| 581 | static struct nulldrv_desc_layout *nulldrv_desc_layout(XGL_DESCRIPTOR_SET_LAYOUT layout) |
| 582 | { |
| 583 | return (struct nulldrv_desc_layout *) layout; |
| 584 | } |
| 585 | |
| 586 | static XGL_RESULT shader_create(struct nulldrv_dev *dev, |
| 587 | const XGL_SHADER_CREATE_INFO *info, |
| 588 | struct nulldrv_shader **sh_ret) |
| 589 | { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 590 | struct nulldrv_shader *sh; |
| 591 | |
| 592 | sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh), |
| 593 | XGL_DBG_OBJECT_SHADER); |
| 594 | if (!sh) |
| 595 | return XGL_ERROR_OUT_OF_MEMORY; |
| 596 | |
| 597 | *sh_ret = sh; |
| 598 | |
| 599 | return XGL_SUCCESS; |
| 600 | } |
| 601 | |
| 602 | static XGL_RESULT graphics_pipeline_create(struct nulldrv_dev *dev, |
| 603 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO *info_, |
| 604 | struct nulldrv_pipeline **pipeline_ret) |
| 605 | { |
| 606 | struct nulldrv_pipeline *pipeline; |
| 607 | |
| 608 | pipeline = (struct nulldrv_pipeline *) |
| 609 | nulldrv_base_create(dev, sizeof(*pipeline), |
| 610 | XGL_DBG_OBJECT_GRAPHICS_PIPELINE); |
| 611 | if (!pipeline) |
| 612 | return XGL_ERROR_OUT_OF_MEMORY; |
| 613 | |
| 614 | *pipeline_ret = pipeline; |
| 615 | |
| 616 | return XGL_SUCCESS; |
| 617 | } |
| 618 | |
| 619 | static XGL_RESULT nulldrv_viewport_state_create(struct nulldrv_dev *dev, |
| 620 | const XGL_DYNAMIC_VP_STATE_CREATE_INFO *info, |
| 621 | struct nulldrv_dynamic_vp **state_ret) |
| 622 | { |
| 623 | struct nulldrv_dynamic_vp *state; |
| 624 | |
| 625 | state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev, |
| 626 | sizeof(*state), XGL_DBG_OBJECT_VIEWPORT_STATE); |
| 627 | if (!state) |
| 628 | return XGL_ERROR_OUT_OF_MEMORY; |
| 629 | |
| 630 | *state_ret = state; |
| 631 | |
| 632 | return XGL_SUCCESS; |
| 633 | } |
| 634 | |
| 635 | static XGL_RESULT nulldrv_raster_state_create(struct nulldrv_dev *dev, |
| 636 | const XGL_DYNAMIC_RS_STATE_CREATE_INFO *info, |
| 637 | struct nulldrv_dynamic_rs **state_ret) |
| 638 | { |
| 639 | struct nulldrv_dynamic_rs *state; |
| 640 | |
| 641 | state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev, |
| 642 | sizeof(*state), XGL_DBG_OBJECT_RASTER_STATE); |
| 643 | if (!state) |
| 644 | return XGL_ERROR_OUT_OF_MEMORY; |
| 645 | |
| 646 | *state_ret = state; |
| 647 | |
| 648 | return XGL_SUCCESS; |
| 649 | } |
| 650 | |
| 651 | static XGL_RESULT nulldrv_blend_state_create(struct nulldrv_dev *dev, |
| 652 | const XGL_DYNAMIC_CB_STATE_CREATE_INFO *info, |
| 653 | struct nulldrv_dynamic_cb **state_ret) |
| 654 | { |
| 655 | struct nulldrv_dynamic_cb *state; |
| 656 | |
| 657 | state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev, |
| 658 | sizeof(*state), XGL_DBG_OBJECT_COLOR_BLEND_STATE); |
| 659 | if (!state) |
| 660 | return XGL_ERROR_OUT_OF_MEMORY; |
| 661 | |
| 662 | *state_ret = state; |
| 663 | |
| 664 | return XGL_SUCCESS; |
| 665 | } |
| 666 | |
| 667 | static XGL_RESULT nulldrv_ds_state_create(struct nulldrv_dev *dev, |
| 668 | const XGL_DYNAMIC_DS_STATE_CREATE_INFO *info, |
| 669 | struct nulldrv_dynamic_ds **state_ret) |
| 670 | { |
| 671 | struct nulldrv_dynamic_ds *state; |
| 672 | |
| 673 | state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev, |
| 674 | sizeof(*state), XGL_DBG_OBJECT_DEPTH_STENCIL_STATE); |
| 675 | if (!state) |
| 676 | return XGL_ERROR_OUT_OF_MEMORY; |
| 677 | |
| 678 | *state_ret = state; |
| 679 | |
| 680 | return XGL_SUCCESS; |
| 681 | } |
| 682 | |
| 683 | |
| 684 | static XGL_RESULT nulldrv_cmd_create(struct nulldrv_dev *dev, |
| 685 | const XGL_CMD_BUFFER_CREATE_INFO *info, |
| 686 | struct nulldrv_cmd **cmd_ret) |
| 687 | { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 688 | struct nulldrv_cmd *cmd; |
| 689 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 690 | cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd), |
| 691 | XGL_DBG_OBJECT_CMD_BUFFER); |
| 692 | if (!cmd) |
| 693 | return XGL_ERROR_OUT_OF_MEMORY; |
| 694 | |
| 695 | *cmd_ret = cmd; |
| 696 | |
| 697 | return XGL_SUCCESS; |
| 698 | } |
| 699 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 700 | static XGL_RESULT nulldrv_desc_pool_create(struct nulldrv_dev *dev, |
| 701 | XGL_DESCRIPTOR_POOL_USAGE usage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 702 | uint32_t max_sets, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 703 | const XGL_DESCRIPTOR_POOL_CREATE_INFO *info, |
| 704 | struct nulldrv_desc_pool **pool_ret) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 705 | { |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 706 | struct nulldrv_desc_pool *pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 707 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 708 | pool = (struct nulldrv_desc_pool *) |
| 709 | nulldrv_base_create(dev, sizeof(*pool), |
| 710 | XGL_DBG_OBJECT_DESCRIPTOR_POOL); |
| 711 | if (!pool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 712 | return XGL_ERROR_OUT_OF_MEMORY; |
| 713 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 714 | pool->dev = dev; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 715 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 716 | *pool_ret = pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 717 | |
| 718 | return XGL_SUCCESS; |
| 719 | } |
| 720 | |
| 721 | static XGL_RESULT nulldrv_desc_set_create(struct nulldrv_dev *dev, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 722 | struct nulldrv_desc_pool *pool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 723 | XGL_DESCRIPTOR_SET_USAGE usage, |
| 724 | const struct nulldrv_desc_layout *layout, |
| 725 | struct nulldrv_desc_set **set_ret) |
| 726 | { |
| 727 | struct nulldrv_desc_set *set; |
| 728 | |
| 729 | set = (struct nulldrv_desc_set *) |
| 730 | nulldrv_base_create(dev, sizeof(*set), |
| 731 | XGL_DBG_OBJECT_DESCRIPTOR_SET); |
| 732 | if (!set) |
| 733 | return XGL_ERROR_OUT_OF_MEMORY; |
| 734 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 735 | set->ooxx = dev->desc_ooxx; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 736 | set->layout = layout; |
| 737 | *set_ret = set; |
| 738 | |
| 739 | return XGL_SUCCESS; |
| 740 | } |
| 741 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 742 | static struct nulldrv_desc_pool *nulldrv_desc_pool(XGL_DESCRIPTOR_POOL pool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 743 | { |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 744 | return (struct nulldrv_desc_pool *) pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 745 | } |
| 746 | |
| 747 | static XGL_RESULT nulldrv_fb_create(struct nulldrv_dev *dev, |
| 748 | const XGL_FRAMEBUFFER_CREATE_INFO* info, |
| 749 | struct nulldrv_framebuffer ** fb_ret) |
| 750 | { |
| 751 | |
| 752 | struct nulldrv_framebuffer *fb; |
| 753 | fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb), |
| 754 | XGL_DBG_OBJECT_FRAMEBUFFER); |
| 755 | if (!fb) |
| 756 | return XGL_ERROR_OUT_OF_MEMORY; |
| 757 | |
| 758 | *fb_ret = fb; |
| 759 | |
| 760 | return XGL_SUCCESS; |
| 761 | |
| 762 | } |
| 763 | |
| 764 | static XGL_RESULT nulldrv_render_pass_create(struct nulldrv_dev *dev, |
| 765 | const XGL_RENDER_PASS_CREATE_INFO* info, |
| 766 | struct nulldrv_render_pass** rp_ret) |
| 767 | { |
| 768 | struct nulldrv_render_pass *rp; |
| 769 | rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp), |
| 770 | XGL_DBG_OBJECT_RENDER_PASS); |
| 771 | if (!rp) |
| 772 | return XGL_ERROR_OUT_OF_MEMORY; |
| 773 | |
| 774 | *rp_ret = rp; |
| 775 | |
| 776 | return XGL_SUCCESS; |
| 777 | } |
| 778 | |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 779 | static struct nulldrv_buf *nulldrv_buf(XGL_BUFFER buf) |
| 780 | { |
| 781 | return (struct nulldrv_buf *) buf; |
| 782 | } |
| 783 | |
| 784 | static XGL_RESULT nulldrv_buf_view_create(struct nulldrv_dev *dev, |
| 785 | const XGL_BUFFER_VIEW_CREATE_INFO *info, |
| 786 | struct nulldrv_buf_view **view_ret) |
| 787 | { |
| 788 | struct nulldrv_buf *buf = nulldrv_buf(info->buffer); |
| 789 | struct nulldrv_buf_view *view; |
| 790 | |
| 791 | view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view), |
| 792 | XGL_DBG_OBJECT_BUFFER_VIEW); |
| 793 | if (!view) |
| 794 | return XGL_ERROR_OUT_OF_MEMORY; |
| 795 | |
| 796 | view->buf = buf; |
| 797 | |
| 798 | *view_ret = view; |
| 799 | |
| 800 | return XGL_SUCCESS; |
| 801 | } |
| 802 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 803 | |
| 804 | //********************************************* |
| 805 | // Driver entry points |
| 806 | //********************************************* |
| 807 | |
| 808 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateBuffer( |
| 809 | XGL_DEVICE device, |
| 810 | const XGL_BUFFER_CREATE_INFO* pCreateInfo, |
| 811 | XGL_BUFFER* pBuffer) |
| 812 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 813 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 814 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 815 | |
| 816 | return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer); |
| 817 | } |
| 818 | |
| 819 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateCommandBuffer( |
| 820 | XGL_DEVICE device, |
| 821 | const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, |
| 822 | XGL_CMD_BUFFER* pCmdBuffer) |
| 823 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 824 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 825 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 826 | |
| 827 | return nulldrv_cmd_create(dev, pCreateInfo, |
| 828 | (struct nulldrv_cmd **) pCmdBuffer); |
| 829 | } |
| 830 | |
| 831 | ICD_EXPORT XGL_RESULT XGLAPI xglBeginCommandBuffer( |
| 832 | XGL_CMD_BUFFER cmdBuffer, |
| 833 | const XGL_CMD_BUFFER_BEGIN_INFO *info) |
| 834 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 835 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 836 | return XGL_SUCCESS; |
| 837 | } |
| 838 | |
| 839 | ICD_EXPORT XGL_RESULT XGLAPI xglEndCommandBuffer( |
| 840 | XGL_CMD_BUFFER cmdBuffer) |
| 841 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 842 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 843 | return XGL_SUCCESS; |
| 844 | } |
| 845 | |
| 846 | ICD_EXPORT XGL_RESULT XGLAPI xglResetCommandBuffer( |
| 847 | XGL_CMD_BUFFER cmdBuffer) |
| 848 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 849 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 850 | return XGL_SUCCESS; |
| 851 | } |
| 852 | |
| 853 | ICD_EXPORT void XGLAPI xglCmdInitAtomicCounters( |
| 854 | XGL_CMD_BUFFER cmdBuffer, |
| 855 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 856 | uint32_t startCounter, |
| 857 | uint32_t counterCount, |
| 858 | const uint32_t* pData) |
| 859 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 860 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 861 | } |
| 862 | |
| 863 | ICD_EXPORT void XGLAPI xglCmdLoadAtomicCounters( |
| 864 | XGL_CMD_BUFFER cmdBuffer, |
| 865 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 866 | uint32_t startCounter, |
| 867 | uint32_t counterCount, |
| 868 | XGL_BUFFER srcBuffer, |
| 869 | XGL_GPU_SIZE srcOffset) |
| 870 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 871 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 872 | } |
| 873 | |
| 874 | ICD_EXPORT void XGLAPI xglCmdSaveAtomicCounters( |
| 875 | XGL_CMD_BUFFER cmdBuffer, |
| 876 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 877 | uint32_t startCounter, |
| 878 | uint32_t counterCount, |
| 879 | XGL_BUFFER destBuffer, |
| 880 | XGL_GPU_SIZE destOffset) |
| 881 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 882 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 883 | } |
| 884 | |
| 885 | ICD_EXPORT void XGLAPI xglCmdDbgMarkerBegin( |
| 886 | XGL_CMD_BUFFER cmdBuffer, |
| 887 | const char* pMarker) |
| 888 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 889 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 890 | } |
| 891 | |
| 892 | ICD_EXPORT void XGLAPI xglCmdDbgMarkerEnd( |
| 893 | XGL_CMD_BUFFER cmdBuffer) |
| 894 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 895 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 896 | } |
| 897 | |
| 898 | ICD_EXPORT void XGLAPI xglCmdCopyBuffer( |
| 899 | XGL_CMD_BUFFER cmdBuffer, |
| 900 | XGL_BUFFER srcBuffer, |
| 901 | XGL_BUFFER destBuffer, |
| 902 | uint32_t regionCount, |
| 903 | const XGL_BUFFER_COPY* pRegions) |
| 904 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 905 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 906 | } |
| 907 | |
| 908 | ICD_EXPORT void XGLAPI xglCmdCopyImage( |
| 909 | XGL_CMD_BUFFER cmdBuffer, |
| 910 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 911 | XGL_IMAGE_LAYOUT srcImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 912 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 913 | XGL_IMAGE_LAYOUT destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 914 | uint32_t regionCount, |
| 915 | const XGL_IMAGE_COPY* pRegions) |
| 916 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 917 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 918 | } |
| 919 | |
Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 920 | ICD_EXPORT void XGLAPI xglCmdBlitImage( |
| 921 | XGL_CMD_BUFFER cmdBuffer, |
| 922 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 923 | XGL_IMAGE_LAYOUT srcImageLayout, |
Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 924 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 925 | XGL_IMAGE_LAYOUT destImageLayout, |
Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 926 | uint32_t regionCount, |
| 927 | const XGL_IMAGE_BLIT* pRegions) |
| 928 | { |
| 929 | NULLDRV_LOG_FUNC; |
| 930 | } |
| 931 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 932 | ICD_EXPORT void XGLAPI xglCmdCopyBufferToImage( |
| 933 | XGL_CMD_BUFFER cmdBuffer, |
| 934 | XGL_BUFFER srcBuffer, |
| 935 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 936 | XGL_IMAGE_LAYOUT destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 937 | uint32_t regionCount, |
| 938 | const XGL_BUFFER_IMAGE_COPY* pRegions) |
| 939 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 940 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 941 | } |
| 942 | |
| 943 | ICD_EXPORT void XGLAPI xglCmdCopyImageToBuffer( |
| 944 | XGL_CMD_BUFFER cmdBuffer, |
| 945 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 946 | XGL_IMAGE_LAYOUT srcImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 947 | XGL_BUFFER destBuffer, |
| 948 | uint32_t regionCount, |
| 949 | const XGL_BUFFER_IMAGE_COPY* pRegions) |
| 950 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 951 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 952 | } |
| 953 | |
| 954 | ICD_EXPORT void XGLAPI xglCmdCloneImageData( |
| 955 | XGL_CMD_BUFFER cmdBuffer, |
| 956 | XGL_IMAGE srcImage, |
| 957 | XGL_IMAGE_LAYOUT srcImageLayout, |
| 958 | XGL_IMAGE destImage, |
| 959 | XGL_IMAGE_LAYOUT destImageLayout) |
| 960 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 961 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 962 | } |
| 963 | |
| 964 | ICD_EXPORT void XGLAPI xglCmdUpdateBuffer( |
| 965 | XGL_CMD_BUFFER cmdBuffer, |
| 966 | XGL_BUFFER destBuffer, |
| 967 | XGL_GPU_SIZE destOffset, |
| 968 | XGL_GPU_SIZE dataSize, |
| 969 | const uint32_t* pData) |
| 970 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 971 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 972 | } |
| 973 | |
| 974 | ICD_EXPORT void XGLAPI xglCmdFillBuffer( |
| 975 | XGL_CMD_BUFFER cmdBuffer, |
| 976 | XGL_BUFFER destBuffer, |
| 977 | XGL_GPU_SIZE destOffset, |
| 978 | XGL_GPU_SIZE fillSize, |
| 979 | uint32_t data) |
| 980 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 981 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 982 | } |
| 983 | |
| 984 | ICD_EXPORT void XGLAPI xglCmdClearColorImage( |
| 985 | XGL_CMD_BUFFER cmdBuffer, |
| 986 | XGL_IMAGE image, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 987 | XGL_IMAGE_LAYOUT imageLayout, |
Courtney Goeltzenleuchter | 9a1ded8 | 2015-04-03 16:35:32 -0600 | [diff] [blame] | 988 | XGL_CLEAR_COLOR color, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 989 | uint32_t rangeCount, |
| 990 | const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 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 | |
| 995 | ICD_EXPORT void XGLAPI xglCmdClearDepthStencil( |
| 996 | XGL_CMD_BUFFER cmdBuffer, |
| 997 | XGL_IMAGE image, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 998 | XGL_IMAGE_LAYOUT imageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 999 | float depth, |
| 1000 | uint32_t stencil, |
| 1001 | uint32_t rangeCount, |
| 1002 | const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 1003 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1004 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1005 | } |
| 1006 | |
| 1007 | ICD_EXPORT void XGLAPI xglCmdResolveImage( |
| 1008 | XGL_CMD_BUFFER cmdBuffer, |
| 1009 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 1010 | XGL_IMAGE_LAYOUT srcImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1011 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 1012 | XGL_IMAGE_LAYOUT destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1013 | uint32_t rectCount, |
| 1014 | const XGL_IMAGE_RESOLVE* pRects) |
| 1015 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1016 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1017 | } |
| 1018 | |
| 1019 | ICD_EXPORT void XGLAPI xglCmdBeginQuery( |
| 1020 | XGL_CMD_BUFFER cmdBuffer, |
| 1021 | XGL_QUERY_POOL queryPool, |
| 1022 | uint32_t slot, |
| 1023 | XGL_FLAGS flags) |
| 1024 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1025 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1026 | } |
| 1027 | |
| 1028 | ICD_EXPORT void XGLAPI xglCmdEndQuery( |
| 1029 | XGL_CMD_BUFFER cmdBuffer, |
| 1030 | XGL_QUERY_POOL queryPool, |
| 1031 | uint32_t slot) |
| 1032 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1033 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1034 | } |
| 1035 | |
| 1036 | ICD_EXPORT void XGLAPI xglCmdResetQueryPool( |
| 1037 | XGL_CMD_BUFFER cmdBuffer, |
| 1038 | XGL_QUERY_POOL queryPool, |
| 1039 | uint32_t startQuery, |
| 1040 | uint32_t queryCount) |
| 1041 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1042 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1043 | } |
| 1044 | |
| 1045 | ICD_EXPORT void XGLAPI xglCmdSetEvent( |
| 1046 | XGL_CMD_BUFFER cmdBuffer, |
| 1047 | XGL_EVENT event_, |
Courtney Goeltzenleuchter | aa86e0e | 2015-03-24 18:02:34 -0600 | [diff] [blame] | 1048 | XGL_PIPE_EVENT pipeEvent) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1049 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1050 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1051 | } |
| 1052 | |
| 1053 | ICD_EXPORT void XGLAPI xglCmdResetEvent( |
| 1054 | XGL_CMD_BUFFER cmdBuffer, |
Courtney Goeltzenleuchter | aa86e0e | 2015-03-24 18:02:34 -0600 | [diff] [blame] | 1055 | XGL_EVENT event_, |
| 1056 | XGL_PIPE_EVENT pipeEvent) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1057 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1058 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1059 | } |
| 1060 | |
| 1061 | ICD_EXPORT void XGLAPI xglCmdWriteTimestamp( |
| 1062 | XGL_CMD_BUFFER cmdBuffer, |
| 1063 | XGL_TIMESTAMP_TYPE timestampType, |
| 1064 | XGL_BUFFER destBuffer, |
| 1065 | XGL_GPU_SIZE destOffset) |
| 1066 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1067 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1068 | } |
| 1069 | |
| 1070 | ICD_EXPORT void XGLAPI xglCmdBindPipeline( |
| 1071 | XGL_CMD_BUFFER cmdBuffer, |
| 1072 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 1073 | XGL_PIPELINE pipeline) |
| 1074 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1075 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1076 | } |
| 1077 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1078 | ICD_EXPORT void XGLAPI xglCmdBindDynamicStateObject( |
| 1079 | XGL_CMD_BUFFER cmdBuffer, |
| 1080 | XGL_STATE_BIND_POINT stateBindPoint, |
| 1081 | XGL_DYNAMIC_STATE_OBJECT state) |
| 1082 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1083 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1084 | } |
| 1085 | |
| 1086 | ICD_EXPORT void XGLAPI xglCmdBindDescriptorSet( |
| 1087 | XGL_CMD_BUFFER cmdBuffer, |
| 1088 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 1089 | XGL_DESCRIPTOR_SET descriptorSet, |
| 1090 | const uint32_t* pUserData) |
| 1091 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1092 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1093 | } |
| 1094 | |
| 1095 | ICD_EXPORT void XGLAPI xglCmdBindVertexBuffer( |
| 1096 | XGL_CMD_BUFFER cmdBuffer, |
| 1097 | XGL_BUFFER buffer, |
| 1098 | XGL_GPU_SIZE offset, |
| 1099 | uint32_t binding) |
| 1100 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1101 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1102 | } |
| 1103 | |
| 1104 | ICD_EXPORT void XGLAPI xglCmdBindIndexBuffer( |
| 1105 | XGL_CMD_BUFFER cmdBuffer, |
| 1106 | XGL_BUFFER buffer, |
| 1107 | XGL_GPU_SIZE offset, |
| 1108 | XGL_INDEX_TYPE indexType) |
| 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 | |
| 1113 | ICD_EXPORT void XGLAPI xglCmdDraw( |
| 1114 | XGL_CMD_BUFFER cmdBuffer, |
| 1115 | uint32_t firstVertex, |
| 1116 | uint32_t vertexCount, |
| 1117 | uint32_t firstInstance, |
| 1118 | uint32_t instanceCount) |
| 1119 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1120 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1121 | } |
| 1122 | |
| 1123 | ICD_EXPORT void XGLAPI xglCmdDrawIndexed( |
| 1124 | XGL_CMD_BUFFER cmdBuffer, |
| 1125 | uint32_t firstIndex, |
| 1126 | uint32_t indexCount, |
| 1127 | int32_t vertexOffset, |
| 1128 | uint32_t firstInstance, |
| 1129 | uint32_t instanceCount) |
| 1130 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1131 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1132 | } |
| 1133 | |
| 1134 | ICD_EXPORT void XGLAPI xglCmdDrawIndirect( |
| 1135 | XGL_CMD_BUFFER cmdBuffer, |
| 1136 | XGL_BUFFER buffer, |
| 1137 | XGL_GPU_SIZE offset, |
| 1138 | uint32_t count, |
| 1139 | uint32_t stride) |
| 1140 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1141 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1142 | } |
| 1143 | |
| 1144 | ICD_EXPORT void XGLAPI xglCmdDrawIndexedIndirect( |
| 1145 | XGL_CMD_BUFFER cmdBuffer, |
| 1146 | XGL_BUFFER buffer, |
| 1147 | XGL_GPU_SIZE offset, |
| 1148 | uint32_t count, |
| 1149 | uint32_t stride) |
| 1150 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1151 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1152 | } |
| 1153 | |
| 1154 | ICD_EXPORT void XGLAPI xglCmdDispatch( |
| 1155 | XGL_CMD_BUFFER cmdBuffer, |
| 1156 | uint32_t x, |
| 1157 | uint32_t y, |
| 1158 | uint32_t z) |
| 1159 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1160 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1161 | } |
| 1162 | |
| 1163 | ICD_EXPORT void XGLAPI xglCmdDispatchIndirect( |
| 1164 | XGL_CMD_BUFFER cmdBuffer, |
| 1165 | XGL_BUFFER buffer, |
| 1166 | XGL_GPU_SIZE offset) |
| 1167 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1168 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1169 | } |
| 1170 | |
| 1171 | ICD_EXPORT void XGLAPI xglCmdWaitEvents( |
| 1172 | XGL_CMD_BUFFER cmdBuffer, |
| 1173 | const XGL_EVENT_WAIT_INFO* pWaitInfo) |
| 1174 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1175 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1176 | } |
| 1177 | |
| 1178 | ICD_EXPORT void XGLAPI xglCmdPipelineBarrier( |
| 1179 | XGL_CMD_BUFFER cmdBuffer, |
| 1180 | const XGL_PIPELINE_BARRIER* pBarrier) |
| 1181 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1182 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1183 | } |
| 1184 | |
| 1185 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDevice( |
| 1186 | XGL_PHYSICAL_GPU gpu_, |
| 1187 | const XGL_DEVICE_CREATE_INFO* pCreateInfo, |
| 1188 | XGL_DEVICE* pDevice) |
| 1189 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1190 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1191 | struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_); |
| 1192 | return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice); |
| 1193 | } |
| 1194 | |
| 1195 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyDevice( |
| 1196 | XGL_DEVICE device) |
| 1197 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1198 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1199 | return XGL_SUCCESS; |
| 1200 | } |
| 1201 | |
| 1202 | ICD_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue( |
| 1203 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | f316806 | 2015-03-05 18:09:39 -0700 | [diff] [blame] | 1204 | uint32_t queueNodeIndex, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1205 | uint32_t queueIndex, |
| 1206 | XGL_QUEUE* pQueue) |
| 1207 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1208 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1209 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1210 | *pQueue = dev->queues[0]; |
| 1211 | return XGL_SUCCESS; |
| 1212 | } |
| 1213 | |
| 1214 | ICD_EXPORT XGL_RESULT XGLAPI xglDeviceWaitIdle( |
| 1215 | XGL_DEVICE device) |
| 1216 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1217 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1218 | return XGL_SUCCESS; |
| 1219 | } |
| 1220 | |
| 1221 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetValidationLevel( |
| 1222 | XGL_DEVICE device, |
| 1223 | XGL_VALIDATION_LEVEL validationLevel) |
| 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 | return XGL_SUCCESS; |
| 1227 | } |
| 1228 | |
| 1229 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetMessageFilter( |
| 1230 | XGL_DEVICE device, |
| 1231 | int32_t msgCode, |
| 1232 | XGL_DBG_MSG_FILTER filter) |
| 1233 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1234 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1235 | return XGL_SUCCESS; |
| 1236 | } |
| 1237 | |
| 1238 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetDeviceOption( |
| 1239 | XGL_DEVICE device, |
| 1240 | XGL_DBG_DEVICE_OPTION dbgOption, |
| 1241 | size_t dataSize, |
| 1242 | const void* pData) |
| 1243 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1244 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1245 | return XGL_SUCCESS; |
| 1246 | } |
| 1247 | |
| 1248 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateEvent( |
| 1249 | XGL_DEVICE device, |
| 1250 | const XGL_EVENT_CREATE_INFO* pCreateInfo, |
| 1251 | XGL_EVENT* pEvent) |
| 1252 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1253 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1254 | return XGL_SUCCESS; |
| 1255 | } |
| 1256 | |
| 1257 | ICD_EXPORT XGL_RESULT XGLAPI xglGetEventStatus( |
| 1258 | XGL_EVENT event_) |
| 1259 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1260 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1261 | return XGL_SUCCESS; |
| 1262 | } |
| 1263 | |
| 1264 | ICD_EXPORT XGL_RESULT XGLAPI xglSetEvent( |
| 1265 | XGL_EVENT event_) |
| 1266 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1267 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1268 | return XGL_SUCCESS; |
| 1269 | } |
| 1270 | |
| 1271 | ICD_EXPORT XGL_RESULT XGLAPI xglResetEvent( |
| 1272 | XGL_EVENT event_) |
| 1273 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1274 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1275 | return XGL_SUCCESS; |
| 1276 | } |
| 1277 | |
| 1278 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateFence( |
| 1279 | XGL_DEVICE device, |
| 1280 | const XGL_FENCE_CREATE_INFO* pCreateInfo, |
| 1281 | XGL_FENCE* pFence) |
| 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 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1285 | |
| 1286 | return nulldrv_fence_create(dev, pCreateInfo, |
| 1287 | (struct nulldrv_fence **) pFence); |
| 1288 | } |
| 1289 | |
| 1290 | ICD_EXPORT XGL_RESULT XGLAPI xglGetFenceStatus( |
| 1291 | XGL_FENCE fence_) |
| 1292 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1293 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1294 | return XGL_SUCCESS; |
| 1295 | } |
| 1296 | |
| 1297 | ICD_EXPORT XGL_RESULT XGLAPI xglWaitForFences( |
| 1298 | XGL_DEVICE device, |
| 1299 | uint32_t fenceCount, |
| 1300 | const XGL_FENCE* pFences, |
| 1301 | bool32_t waitAll, |
| 1302 | uint64_t timeout) |
| 1303 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1304 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1305 | return XGL_SUCCESS; |
| 1306 | } |
| 1307 | |
| 1308 | ICD_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo( |
| 1309 | XGL_DEVICE device, |
| 1310 | XGL_FORMAT format, |
| 1311 | XGL_FORMAT_INFO_TYPE infoType, |
| 1312 | size_t* pDataSize, |
| 1313 | void* pData) |
| 1314 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1315 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1316 | return XGL_SUCCESS; |
| 1317 | } |
| 1318 | |
| 1319 | ICD_EXPORT XGL_RESULT XGLAPI xglGetGpuInfo( |
| 1320 | XGL_PHYSICAL_GPU gpu_, |
| 1321 | XGL_PHYSICAL_GPU_INFO_TYPE infoType, |
| 1322 | size_t* pDataSize, |
| 1323 | void* pData) |
| 1324 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1325 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1326 | return XGL_SUCCESS; |
| 1327 | } |
| 1328 | |
| 1329 | ICD_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport( |
| 1330 | XGL_PHYSICAL_GPU gpu_, |
| 1331 | const char* pExtName) |
| 1332 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1333 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1334 | return XGL_SUCCESS; |
| 1335 | } |
| 1336 | |
| 1337 | ICD_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility( |
| 1338 | XGL_PHYSICAL_GPU gpu0_, |
| 1339 | XGL_PHYSICAL_GPU gpu1_, |
| 1340 | XGL_GPU_COMPATIBILITY_INFO* pInfo) |
| 1341 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1342 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1343 | return XGL_SUCCESS; |
| 1344 | } |
| 1345 | |
| 1346 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenPeerImage( |
| 1347 | XGL_DEVICE device, |
| 1348 | const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, |
| 1349 | XGL_IMAGE* pImage, |
| 1350 | XGL_GPU_MEMORY* pMem) |
| 1351 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1352 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1353 | return XGL_SUCCESS; |
| 1354 | } |
| 1355 | |
| 1356 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateImage( |
| 1357 | XGL_DEVICE device, |
| 1358 | const XGL_IMAGE_CREATE_INFO* pCreateInfo, |
| 1359 | XGL_IMAGE* pImage) |
| 1360 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1361 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1362 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1363 | |
| 1364 | return nulldrv_img_create(dev, pCreateInfo, false, |
| 1365 | (struct nulldrv_img **) pImage); |
| 1366 | } |
| 1367 | |
| 1368 | ICD_EXPORT XGL_RESULT XGLAPI xglGetImageSubresourceInfo( |
| 1369 | XGL_IMAGE image, |
| 1370 | const XGL_IMAGE_SUBRESOURCE* pSubresource, |
| 1371 | XGL_SUBRESOURCE_INFO_TYPE infoType, |
| 1372 | size_t* pDataSize, |
| 1373 | void* pData) |
| 1374 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1375 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1376 | XGL_RESULT ret = XGL_SUCCESS; |
| 1377 | |
| 1378 | switch (infoType) { |
| 1379 | case XGL_INFO_TYPE_SUBRESOURCE_LAYOUT: |
| 1380 | { |
| 1381 | XGL_SUBRESOURCE_LAYOUT *layout = (XGL_SUBRESOURCE_LAYOUT *) pData; |
| 1382 | |
| 1383 | *pDataSize = sizeof(XGL_SUBRESOURCE_LAYOUT); |
| 1384 | |
| 1385 | if (pData == NULL) |
| 1386 | return ret; |
| 1387 | layout->offset = 0; |
| 1388 | layout->size = 1; |
| 1389 | layout->rowPitch = 4; |
| 1390 | layout->depthPitch = 4; |
| 1391 | } |
| 1392 | break; |
| 1393 | default: |
| 1394 | ret = XGL_ERROR_INVALID_VALUE; |
| 1395 | break; |
| 1396 | } |
| 1397 | |
| 1398 | return ret; |
| 1399 | } |
| 1400 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1401 | ICD_EXPORT XGL_RESULT XGLAPI xglAllocMemory( |
| 1402 | XGL_DEVICE device, |
| 1403 | const XGL_MEMORY_ALLOC_INFO* pAllocInfo, |
| 1404 | XGL_GPU_MEMORY* pMem) |
| 1405 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1406 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1407 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1408 | |
| 1409 | return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem); |
| 1410 | } |
| 1411 | |
| 1412 | ICD_EXPORT XGL_RESULT XGLAPI xglFreeMemory( |
| 1413 | XGL_GPU_MEMORY mem_) |
| 1414 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1415 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1416 | return XGL_SUCCESS; |
| 1417 | } |
| 1418 | |
| 1419 | ICD_EXPORT XGL_RESULT XGLAPI xglSetMemoryPriority( |
| 1420 | XGL_GPU_MEMORY mem_, |
| 1421 | XGL_MEMORY_PRIORITY priority) |
| 1422 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1423 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1424 | return XGL_SUCCESS; |
| 1425 | } |
| 1426 | |
| 1427 | ICD_EXPORT XGL_RESULT XGLAPI xglMapMemory( |
| 1428 | XGL_GPU_MEMORY mem_, |
| 1429 | XGL_FLAGS flags, |
| 1430 | void** ppData) |
| 1431 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1432 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1433 | struct nulldrv_mem *mem = nulldrv_mem(mem_); |
| 1434 | void *ptr = nulldrv_mem_map(mem, flags); |
| 1435 | |
| 1436 | *ppData = ptr; |
| 1437 | |
| 1438 | return (ptr) ? XGL_SUCCESS : XGL_ERROR_UNKNOWN; |
| 1439 | } |
| 1440 | |
| 1441 | ICD_EXPORT XGL_RESULT XGLAPI xglUnmapMemory( |
| 1442 | XGL_GPU_MEMORY mem_) |
| 1443 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1444 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1445 | return XGL_SUCCESS; |
| 1446 | } |
| 1447 | |
| 1448 | ICD_EXPORT XGL_RESULT XGLAPI xglPinSystemMemory( |
| 1449 | XGL_DEVICE device, |
| 1450 | const void* pSysMem, |
| 1451 | size_t memSize, |
| 1452 | XGL_GPU_MEMORY* pMem) |
| 1453 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1454 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1455 | return XGL_SUCCESS; |
| 1456 | } |
| 1457 | |
| 1458 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenSharedMemory( |
| 1459 | XGL_DEVICE device, |
| 1460 | const XGL_MEMORY_OPEN_INFO* pOpenInfo, |
| 1461 | XGL_GPU_MEMORY* pMem) |
| 1462 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1463 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1464 | return XGL_SUCCESS; |
| 1465 | } |
| 1466 | |
| 1467 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenPeerMemory( |
| 1468 | XGL_DEVICE device, |
| 1469 | const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, |
| 1470 | XGL_GPU_MEMORY* pMem) |
| 1471 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1472 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1473 | return XGL_SUCCESS; |
| 1474 | } |
| 1475 | |
| 1476 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateInstance( |
| 1477 | const XGL_APPLICATION_INFO* pAppInfo, |
| 1478 | const XGL_ALLOC_CALLBACKS* pAllocCb, |
| 1479 | XGL_INSTANCE* pInstance) |
| 1480 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1481 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1482 | struct nulldrv_instance *inst; |
| 1483 | |
| 1484 | inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst), |
| 1485 | XGL_DBG_OBJECT_INSTANCE); |
| 1486 | if (!inst) |
| 1487 | return XGL_ERROR_OUT_OF_MEMORY; |
| 1488 | |
| 1489 | inst->obj.base.get_info = NULL; |
| 1490 | |
| 1491 | *pInstance = (XGL_INSTANCE*)inst; |
| 1492 | |
Chia-I Wu | 493a175 | 2015-02-22 14:40:25 +0800 | [diff] [blame] | 1493 | return XGL_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1494 | } |
| 1495 | |
| 1496 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyInstance( |
| 1497 | XGL_INSTANCE pInstance) |
| 1498 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1499 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1500 | return XGL_SUCCESS; |
| 1501 | } |
| 1502 | |
| 1503 | ICD_EXPORT XGL_RESULT XGLAPI xglEnumerateGpus( |
| 1504 | XGL_INSTANCE instance, |
| 1505 | uint32_t maxGpus, |
| 1506 | uint32_t* pGpuCount, |
| 1507 | XGL_PHYSICAL_GPU* pGpus) |
| 1508 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1509 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1510 | XGL_RESULT ret; |
| 1511 | struct nulldrv_gpu *gpu; |
| 1512 | *pGpuCount = 1; |
| 1513 | ret = nulldrv_gpu_add(0, 0, 0, &gpu); |
| 1514 | if (ret == XGL_SUCCESS) |
| 1515 | pGpus[0] = (XGL_PHYSICAL_GPU) gpu; |
| 1516 | return ret; |
| 1517 | } |
| 1518 | |
| 1519 | ICD_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers( |
| 1520 | XGL_PHYSICAL_GPU gpu, |
| 1521 | size_t maxLayerCount, |
| 1522 | size_t maxStringSize, |
| 1523 | size_t* pOutLayerCount, |
| 1524 | char* const* pOutLayers, |
| 1525 | void* pReserved) |
| 1526 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1527 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1528 | return XGL_SUCCESS; |
| 1529 | } |
| 1530 | |
| 1531 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgRegisterMsgCallback( |
Courtney Goeltzenleuchter | 9d36ef4 | 2015-04-13 14:10:06 -0600 | [diff] [blame] | 1532 | XGL_INSTANCE instance, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1533 | XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, |
| 1534 | void* pUserData) |
| 1535 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1536 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1537 | return XGL_SUCCESS; |
| 1538 | } |
| 1539 | |
| 1540 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgUnregisterMsgCallback( |
Courtney Goeltzenleuchter | 9d36ef4 | 2015-04-13 14:10:06 -0600 | [diff] [blame] | 1541 | XGL_INSTANCE instance, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1542 | XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback) |
| 1543 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1544 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1545 | return XGL_SUCCESS; |
| 1546 | } |
| 1547 | |
| 1548 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetGlobalOption( |
Courtney Goeltzenleuchter | 9d36ef4 | 2015-04-13 14:10:06 -0600 | [diff] [blame] | 1549 | XGL_INSTANCE instance, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1550 | XGL_DBG_GLOBAL_OPTION dbgOption, |
| 1551 | size_t dataSize, |
| 1552 | const void* pData) |
| 1553 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1554 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1555 | return XGL_SUCCESS; |
| 1556 | } |
| 1557 | |
| 1558 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyObject( |
| 1559 | XGL_OBJECT object) |
| 1560 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1561 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1562 | return XGL_SUCCESS; |
| 1563 | } |
| 1564 | |
| 1565 | ICD_EXPORT XGL_RESULT XGLAPI xglGetObjectInfo( |
| 1566 | XGL_BASE_OBJECT object, |
| 1567 | XGL_OBJECT_INFO_TYPE infoType, |
| 1568 | size_t* pDataSize, |
| 1569 | void* pData) |
| 1570 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1571 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1572 | struct nulldrv_base *base = nulldrv_base(object); |
| 1573 | |
| 1574 | return base->get_info(base, infoType, pDataSize, pData); |
| 1575 | } |
| 1576 | |
| 1577 | ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory( |
| 1578 | XGL_OBJECT object, |
| 1579 | uint32_t allocationIdx, |
| 1580 | XGL_GPU_MEMORY mem_, |
| 1581 | XGL_GPU_SIZE memOffset) |
| 1582 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1583 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1584 | return XGL_SUCCESS; |
| 1585 | } |
| 1586 | |
| 1587 | ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemoryRange( |
| 1588 | XGL_OBJECT object, |
| 1589 | uint32_t allocationIdx, |
| 1590 | XGL_GPU_SIZE rangeOffset, |
| 1591 | XGL_GPU_SIZE rangeSize, |
| 1592 | XGL_GPU_MEMORY mem, |
| 1593 | XGL_GPU_SIZE memOffset) |
| 1594 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1595 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1596 | return XGL_SUCCESS; |
| 1597 | } |
| 1598 | |
| 1599 | ICD_EXPORT XGL_RESULT XGLAPI xglBindImageMemoryRange( |
| 1600 | XGL_IMAGE image, |
| 1601 | uint32_t allocationIdx, |
| 1602 | const XGL_IMAGE_MEMORY_BIND_INFO* bindInfo, |
| 1603 | XGL_GPU_MEMORY mem, |
| 1604 | XGL_GPU_SIZE memOffset) |
| 1605 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1606 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1607 | return XGL_SUCCESS; |
| 1608 | } |
| 1609 | |
| 1610 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetObjectTag( |
| 1611 | XGL_BASE_OBJECT object, |
| 1612 | size_t tagSize, |
| 1613 | const void* pTag) |
| 1614 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1615 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1616 | return XGL_SUCCESS; |
| 1617 | } |
| 1618 | |
| 1619 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipeline( |
| 1620 | XGL_DEVICE device, |
| 1621 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1622 | XGL_PIPELINE* pPipeline) |
| 1623 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1624 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1625 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1626 | |
| 1627 | return graphics_pipeline_create(dev, pCreateInfo, |
| 1628 | (struct nulldrv_pipeline **) pPipeline); |
| 1629 | } |
| 1630 | |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1631 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipelineDerivative( |
| 1632 | XGL_DEVICE device, |
| 1633 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1634 | XGL_PIPELINE basePipeline, |
| 1635 | XGL_PIPELINE* pPipeline) |
| 1636 | { |
| 1637 | NULLDRV_LOG_FUNC; |
| 1638 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1639 | |
| 1640 | return graphics_pipeline_create(dev, pCreateInfo, |
| 1641 | (struct nulldrv_pipeline **) pPipeline); |
| 1642 | } |
| 1643 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1644 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateComputePipeline( |
| 1645 | XGL_DEVICE device, |
| 1646 | const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1647 | XGL_PIPELINE* pPipeline) |
| 1648 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1649 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1650 | return XGL_SUCCESS; |
| 1651 | } |
| 1652 | |
| 1653 | ICD_EXPORT XGL_RESULT XGLAPI xglStorePipeline( |
| 1654 | XGL_PIPELINE pipeline, |
| 1655 | size_t* pDataSize, |
| 1656 | void* pData) |
| 1657 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1658 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1659 | return XGL_SUCCESS; |
| 1660 | } |
| 1661 | |
| 1662 | ICD_EXPORT XGL_RESULT XGLAPI xglLoadPipeline( |
| 1663 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1664 | size_t dataSize, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1665 | const void* pData, |
| 1666 | XGL_PIPELINE* pPipeline) |
| 1667 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1668 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1669 | return XGL_SUCCESS; |
| 1670 | } |
| 1671 | |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1672 | ICD_EXPORT XGL_RESULT XGLAPI xglLoadPipelineDerivative( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1673 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1674 | size_t dataSize, |
| 1675 | const void* pData, |
| 1676 | XGL_PIPELINE basePipeline, |
| 1677 | XGL_PIPELINE* pPipeline) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1678 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1679 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1680 | return XGL_SUCCESS; |
| 1681 | } |
| 1682 | |
| 1683 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateQueryPool( |
| 1684 | XGL_DEVICE device, |
| 1685 | const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, |
| 1686 | XGL_QUERY_POOL* pQueryPool) |
| 1687 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1688 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1689 | return XGL_SUCCESS; |
| 1690 | } |
| 1691 | |
| 1692 | ICD_EXPORT XGL_RESULT XGLAPI xglGetQueryPoolResults( |
| 1693 | XGL_QUERY_POOL queryPool, |
| 1694 | uint32_t startQuery, |
| 1695 | uint32_t queryCount, |
| 1696 | size_t* pDataSize, |
| 1697 | void* pData) |
| 1698 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1699 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1700 | return XGL_SUCCESS; |
| 1701 | } |
| 1702 | |
| 1703 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueSetGlobalMemReferences( |
| 1704 | XGL_QUEUE queue, |
| 1705 | uint32_t memRefCount, |
| 1706 | const XGL_MEMORY_REF* pMemRefs) |
| 1707 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1708 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1709 | return XGL_SUCCESS; |
| 1710 | } |
| 1711 | |
| 1712 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueWaitIdle( |
| 1713 | XGL_QUEUE queue_) |
| 1714 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1715 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1716 | return XGL_SUCCESS; |
| 1717 | } |
| 1718 | |
| 1719 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueSubmit( |
| 1720 | XGL_QUEUE queue_, |
| 1721 | uint32_t cmdBufferCount, |
| 1722 | const XGL_CMD_BUFFER* pCmdBuffers, |
| 1723 | uint32_t memRefCount, |
| 1724 | const XGL_MEMORY_REF* pMemRefs, |
| 1725 | XGL_FENCE fence_) |
| 1726 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1727 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1728 | return XGL_SUCCESS; |
| 1729 | } |
| 1730 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1731 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenSharedSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1732 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1733 | const XGL_SEMAPHORE_OPEN_INFO* pOpenInfo, |
| 1734 | XGL_SEMAPHORE* pSemaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1735 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1736 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1737 | return XGL_SUCCESS; |
| 1738 | } |
| 1739 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1740 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1741 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1742 | const XGL_SEMAPHORE_CREATE_INFO* pCreateInfo, |
| 1743 | XGL_SEMAPHORE* pSemaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1744 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1745 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1746 | return XGL_SUCCESS; |
| 1747 | } |
| 1748 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1749 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueSignalSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1750 | XGL_QUEUE queue, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1751 | XGL_SEMAPHORE semaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1752 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1753 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1754 | return XGL_SUCCESS; |
| 1755 | } |
| 1756 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1757 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueWaitSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1758 | XGL_QUEUE queue, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1759 | XGL_SEMAPHORE semaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1760 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1761 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1762 | return XGL_SUCCESS; |
| 1763 | } |
| 1764 | |
| 1765 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateSampler( |
| 1766 | XGL_DEVICE device, |
| 1767 | const XGL_SAMPLER_CREATE_INFO* pCreateInfo, |
| 1768 | XGL_SAMPLER* pSampler) |
| 1769 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1770 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1771 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1772 | |
| 1773 | return nulldrv_sampler_create(dev, pCreateInfo, |
| 1774 | (struct nulldrv_sampler **) pSampler); |
| 1775 | } |
| 1776 | |
| 1777 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateShader( |
| 1778 | XGL_DEVICE device, |
| 1779 | const XGL_SHADER_CREATE_INFO* pCreateInfo, |
| 1780 | XGL_SHADER* pShader) |
| 1781 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1782 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1783 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1784 | |
| 1785 | return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader); |
| 1786 | } |
| 1787 | |
| 1788 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicViewportState( |
| 1789 | XGL_DEVICE device, |
| 1790 | const XGL_DYNAMIC_VP_STATE_CREATE_INFO* pCreateInfo, |
| 1791 | XGL_DYNAMIC_VP_STATE_OBJECT* pState) |
| 1792 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1793 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1794 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1795 | |
| 1796 | return nulldrv_viewport_state_create(dev, pCreateInfo, |
| 1797 | (struct nulldrv_dynamic_vp **) pState); |
| 1798 | } |
| 1799 | |
| 1800 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicRasterState( |
| 1801 | XGL_DEVICE device, |
| 1802 | const XGL_DYNAMIC_RS_STATE_CREATE_INFO* pCreateInfo, |
| 1803 | XGL_DYNAMIC_RS_STATE_OBJECT* pState) |
| 1804 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1805 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1806 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1807 | |
| 1808 | return nulldrv_raster_state_create(dev, pCreateInfo, |
| 1809 | (struct nulldrv_dynamic_rs **) pState); |
| 1810 | } |
| 1811 | |
| 1812 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicColorBlendState( |
| 1813 | XGL_DEVICE device, |
| 1814 | const XGL_DYNAMIC_CB_STATE_CREATE_INFO* pCreateInfo, |
| 1815 | XGL_DYNAMIC_CB_STATE_OBJECT* pState) |
| 1816 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1817 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1818 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1819 | |
| 1820 | return nulldrv_blend_state_create(dev, pCreateInfo, |
| 1821 | (struct nulldrv_dynamic_cb **) pState); |
| 1822 | } |
| 1823 | |
| 1824 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicDepthStencilState( |
| 1825 | XGL_DEVICE device, |
| 1826 | const XGL_DYNAMIC_DS_STATE_CREATE_INFO* pCreateInfo, |
| 1827 | XGL_DYNAMIC_DS_STATE_OBJECT* pState) |
| 1828 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1829 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1830 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1831 | |
| 1832 | return nulldrv_ds_state_create(dev, pCreateInfo, |
| 1833 | (struct nulldrv_dynamic_ds **) pState); |
| 1834 | } |
| 1835 | |
| 1836 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateBufferView( |
| 1837 | XGL_DEVICE device, |
| 1838 | const XGL_BUFFER_VIEW_CREATE_INFO* pCreateInfo, |
| 1839 | XGL_BUFFER_VIEW* pView) |
| 1840 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1841 | NULLDRV_LOG_FUNC; |
| 1842 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1843 | |
| 1844 | return nulldrv_buf_view_create(dev, pCreateInfo, |
| 1845 | (struct nulldrv_buf_view **) pView); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1846 | } |
| 1847 | |
| 1848 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateImageView( |
| 1849 | XGL_DEVICE device, |
| 1850 | const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, |
| 1851 | XGL_IMAGE_VIEW* pView) |
| 1852 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1853 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1854 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1855 | |
| 1856 | return nulldrv_img_view_create(dev, pCreateInfo, |
| 1857 | (struct nulldrv_img_view **) pView); |
| 1858 | } |
| 1859 | |
| 1860 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateColorAttachmentView( |
| 1861 | XGL_DEVICE device, |
| 1862 | const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, |
| 1863 | XGL_COLOR_ATTACHMENT_VIEW* pView) |
| 1864 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1865 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1866 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1867 | |
| 1868 | return nulldrv_rt_view_create(dev, pCreateInfo, |
| 1869 | (struct nulldrv_rt_view **) pView); |
| 1870 | } |
| 1871 | |
| 1872 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilView( |
| 1873 | XGL_DEVICE device, |
| 1874 | const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, |
| 1875 | XGL_DEPTH_STENCIL_VIEW* pView) |
| 1876 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1877 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1878 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1879 | |
| 1880 | return nulldrv_ds_view_create(dev, pCreateInfo, |
| 1881 | (struct nulldrv_ds_view **) pView); |
| 1882 | |
| 1883 | } |
| 1884 | |
| 1885 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSetLayout( |
| 1886 | XGL_DEVICE device, |
| 1887 | XGL_FLAGS stageFlags, |
| 1888 | const uint32_t* pSetBindPoints, |
| 1889 | XGL_DESCRIPTOR_SET_LAYOUT priorSetLayout, |
Chia-I Wu | fc9d913 | 2015-03-26 15:04:41 +0800 | [diff] [blame] | 1890 | const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfo, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1891 | XGL_DESCRIPTOR_SET_LAYOUT* pSetLayout) |
| 1892 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1893 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1894 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1895 | struct nulldrv_desc_layout *prior_layout = nulldrv_desc_layout(priorSetLayout); |
| 1896 | |
| 1897 | return nulldrv_desc_layout_create(dev, stageFlags, pSetBindPoints, |
Chia-I Wu | fc9d913 | 2015-03-26 15:04:41 +0800 | [diff] [blame] | 1898 | prior_layout, pCreateInfo, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1899 | (struct nulldrv_desc_layout **) pSetLayout); |
| 1900 | } |
| 1901 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1902 | ICD_EXPORT XGL_RESULT XGLAPI xglBeginDescriptorPoolUpdate( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1903 | XGL_DEVICE device, |
| 1904 | XGL_DESCRIPTOR_UPDATE_MODE updateMode) |
| 1905 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1906 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1907 | return XGL_SUCCESS; |
| 1908 | } |
| 1909 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1910 | ICD_EXPORT XGL_RESULT XGLAPI xglEndDescriptorPoolUpdate( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1911 | XGL_DEVICE device, |
| 1912 | XGL_CMD_BUFFER cmd_) |
| 1913 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1914 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1915 | return XGL_SUCCESS; |
| 1916 | } |
| 1917 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1918 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorPool( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1919 | XGL_DEVICE device, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1920 | XGL_DESCRIPTOR_POOL_USAGE poolUsage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1921 | uint32_t maxSets, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1922 | const XGL_DESCRIPTOR_POOL_CREATE_INFO* pCreateInfo, |
| 1923 | XGL_DESCRIPTOR_POOL* pDescriptorPool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1924 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1925 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1926 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1927 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1928 | return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo, |
| 1929 | (struct nulldrv_desc_pool **) pDescriptorPool); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1930 | } |
| 1931 | |
Chia-I Wu | dee9561 | 2015-03-26 15:23:52 +0800 | [diff] [blame^] | 1932 | ICD_EXPORT XGL_RESULT XGLAPI xglResetDescriptorPool( |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1933 | XGL_DESCRIPTOR_POOL descriptorPool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1934 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1935 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1936 | return XGL_SUCCESS; |
| 1937 | } |
| 1938 | |
| 1939 | ICD_EXPORT XGL_RESULT XGLAPI xglAllocDescriptorSets( |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1940 | XGL_DESCRIPTOR_POOL descriptorPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1941 | XGL_DESCRIPTOR_SET_USAGE setUsage, |
| 1942 | uint32_t count, |
| 1943 | const XGL_DESCRIPTOR_SET_LAYOUT* pSetLayouts, |
| 1944 | XGL_DESCRIPTOR_SET* pDescriptorSets, |
| 1945 | uint32_t* pCount) |
| 1946 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1947 | NULLDRV_LOG_FUNC; |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1948 | struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool); |
| 1949 | struct nulldrv_dev *dev = pool->dev; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1950 | XGL_RESULT ret = XGL_SUCCESS; |
| 1951 | uint32_t i; |
| 1952 | |
| 1953 | for (i = 0; i < count; i++) { |
| 1954 | const struct nulldrv_desc_layout *layout = |
| 1955 | nulldrv_desc_layout((XGL_DESCRIPTOR_SET_LAYOUT) pSetLayouts[i]); |
| 1956 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1957 | ret = nulldrv_desc_set_create(dev, pool, setUsage, layout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1958 | (struct nulldrv_desc_set **) &pDescriptorSets[i]); |
| 1959 | if (ret != XGL_SUCCESS) |
| 1960 | break; |
| 1961 | } |
| 1962 | |
| 1963 | if (pCount) |
| 1964 | *pCount = i; |
| 1965 | |
| 1966 | return ret; |
| 1967 | } |
| 1968 | |
| 1969 | ICD_EXPORT void XGLAPI xglClearDescriptorSets( |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1970 | XGL_DESCRIPTOR_POOL descriptorPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1971 | uint32_t count, |
| 1972 | const XGL_DESCRIPTOR_SET* pDescriptorSets) |
| 1973 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1974 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1975 | } |
| 1976 | |
| 1977 | ICD_EXPORT void XGLAPI xglUpdateDescriptors( |
| 1978 | XGL_DESCRIPTOR_SET descriptorSet, |
| 1979 | const void* pUpdateChain) |
| 1980 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1981 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1982 | } |
| 1983 | |
| 1984 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateFramebuffer( |
| 1985 | XGL_DEVICE device, |
| 1986 | const XGL_FRAMEBUFFER_CREATE_INFO* info, |
| 1987 | XGL_FRAMEBUFFER* fb_ret) |
| 1988 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1989 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1990 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1991 | |
| 1992 | return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret); |
| 1993 | } |
| 1994 | |
| 1995 | |
| 1996 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateRenderPass( |
| 1997 | XGL_DEVICE device, |
| 1998 | const XGL_RENDER_PASS_CREATE_INFO* info, |
| 1999 | XGL_RENDER_PASS* rp_ret) |
| 2000 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2001 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2002 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2003 | |
| 2004 | return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret); |
| 2005 | } |
| 2006 | |
| 2007 | ICD_EXPORT void XGLAPI xglCmdBeginRenderPass( |
| 2008 | XGL_CMD_BUFFER cmdBuffer, |
Courtney Goeltzenleuchter | e3b0f3a | 2015-04-03 15:25:24 -0600 | [diff] [blame] | 2009 | const XGL_RENDER_PASS_BEGIN* pRenderPassBegin) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2010 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2011 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2012 | } |
| 2013 | |
| 2014 | ICD_EXPORT void XGLAPI xglCmdEndRenderPass( |
| 2015 | XGL_CMD_BUFFER cmdBuffer, |
| 2016 | XGL_RENDER_PASS renderPass) |
| 2017 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2018 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2019 | } |
Ian Elliott | f93069f | 2015-02-19 14:26:19 -0700 | [diff] [blame] | 2020 | |
| 2021 | ICD_EXPORT void* xcbCreateWindow( |
| 2022 | uint16_t width, |
| 2023 | uint16_t height) |
| 2024 | { |
| 2025 | static uint32_t window; // Kludge to the max |
| 2026 | NULLDRV_LOG_FUNC; |
| 2027 | return &window; |
| 2028 | } |
| 2029 | |
| 2030 | // May not be needed, if we stub out stuf in tri.c |
| 2031 | ICD_EXPORT void xcbDestroyWindow() |
| 2032 | { |
| 2033 | NULLDRV_LOG_FUNC; |
| 2034 | } |
| 2035 | |
| 2036 | ICD_EXPORT int xcbGetMessage(void *msg) |
| 2037 | { |
| 2038 | NULLDRV_LOG_FUNC; |
| 2039 | return 0; |
| 2040 | } |
| 2041 | |
| 2042 | ICD_EXPORT XGL_RESULT xcbQueuePresent(void *queue, void *image, void* fence) |
| 2043 | { |
| 2044 | return XGL_SUCCESS; |
| 2045 | } |