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, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 562 | const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO *info, |
| 563 | struct nulldrv_desc_layout **layout_ret) |
| 564 | { |
| 565 | struct nulldrv_desc_layout *layout; |
| 566 | |
| 567 | layout = (struct nulldrv_desc_layout *) |
| 568 | nulldrv_base_create(dev, sizeof(*layout), |
| 569 | XGL_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT); |
| 570 | if (!layout) |
| 571 | return XGL_ERROR_OUT_OF_MEMORY; |
| 572 | |
| 573 | *layout_ret = layout; |
| 574 | |
| 575 | return XGL_SUCCESS; |
| 576 | } |
| 577 | |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 578 | static XGL_RESULT nulldrv_desc_layout_chain_create(struct nulldrv_dev *dev, |
| 579 | uint32_t setLayoutArrayCount, |
| 580 | const XGL_DESCRIPTOR_SET_LAYOUT *pSetLayoutArray, |
| 581 | struct nulldrv_desc_layout_chain **chain_ret) |
| 582 | { |
| 583 | struct nulldrv_desc_layout_chain *chain; |
| 584 | |
| 585 | chain = (struct nulldrv_desc_layout_chain *) |
| 586 | nulldrv_base_create(dev, sizeof(*chain), |
| 587 | XGL_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT_CHAIN); |
| 588 | if (!chain) |
| 589 | return XGL_ERROR_OUT_OF_MEMORY; |
| 590 | |
| 591 | *chain_ret = chain; |
| 592 | |
| 593 | return XGL_SUCCESS; |
| 594 | } |
| 595 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 596 | static struct nulldrv_desc_layout *nulldrv_desc_layout(XGL_DESCRIPTOR_SET_LAYOUT layout) |
| 597 | { |
| 598 | return (struct nulldrv_desc_layout *) layout; |
| 599 | } |
| 600 | |
| 601 | static XGL_RESULT shader_create(struct nulldrv_dev *dev, |
| 602 | const XGL_SHADER_CREATE_INFO *info, |
| 603 | struct nulldrv_shader **sh_ret) |
| 604 | { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 605 | struct nulldrv_shader *sh; |
| 606 | |
| 607 | sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh), |
| 608 | XGL_DBG_OBJECT_SHADER); |
| 609 | if (!sh) |
| 610 | return XGL_ERROR_OUT_OF_MEMORY; |
| 611 | |
| 612 | *sh_ret = sh; |
| 613 | |
| 614 | return XGL_SUCCESS; |
| 615 | } |
| 616 | |
| 617 | static XGL_RESULT graphics_pipeline_create(struct nulldrv_dev *dev, |
| 618 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO *info_, |
| 619 | struct nulldrv_pipeline **pipeline_ret) |
| 620 | { |
| 621 | struct nulldrv_pipeline *pipeline; |
| 622 | |
| 623 | pipeline = (struct nulldrv_pipeline *) |
| 624 | nulldrv_base_create(dev, sizeof(*pipeline), |
| 625 | XGL_DBG_OBJECT_GRAPHICS_PIPELINE); |
| 626 | if (!pipeline) |
| 627 | return XGL_ERROR_OUT_OF_MEMORY; |
| 628 | |
| 629 | *pipeline_ret = pipeline; |
| 630 | |
| 631 | return XGL_SUCCESS; |
| 632 | } |
| 633 | |
| 634 | static XGL_RESULT nulldrv_viewport_state_create(struct nulldrv_dev *dev, |
| 635 | const XGL_DYNAMIC_VP_STATE_CREATE_INFO *info, |
| 636 | struct nulldrv_dynamic_vp **state_ret) |
| 637 | { |
| 638 | struct nulldrv_dynamic_vp *state; |
| 639 | |
| 640 | state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev, |
| 641 | sizeof(*state), XGL_DBG_OBJECT_VIEWPORT_STATE); |
| 642 | if (!state) |
| 643 | return XGL_ERROR_OUT_OF_MEMORY; |
| 644 | |
| 645 | *state_ret = state; |
| 646 | |
| 647 | return XGL_SUCCESS; |
| 648 | } |
| 649 | |
| 650 | static XGL_RESULT nulldrv_raster_state_create(struct nulldrv_dev *dev, |
| 651 | const XGL_DYNAMIC_RS_STATE_CREATE_INFO *info, |
| 652 | struct nulldrv_dynamic_rs **state_ret) |
| 653 | { |
| 654 | struct nulldrv_dynamic_rs *state; |
| 655 | |
| 656 | state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev, |
| 657 | sizeof(*state), XGL_DBG_OBJECT_RASTER_STATE); |
| 658 | if (!state) |
| 659 | return XGL_ERROR_OUT_OF_MEMORY; |
| 660 | |
| 661 | *state_ret = state; |
| 662 | |
| 663 | return XGL_SUCCESS; |
| 664 | } |
| 665 | |
| 666 | static XGL_RESULT nulldrv_blend_state_create(struct nulldrv_dev *dev, |
| 667 | const XGL_DYNAMIC_CB_STATE_CREATE_INFO *info, |
| 668 | struct nulldrv_dynamic_cb **state_ret) |
| 669 | { |
| 670 | struct nulldrv_dynamic_cb *state; |
| 671 | |
| 672 | state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev, |
| 673 | sizeof(*state), XGL_DBG_OBJECT_COLOR_BLEND_STATE); |
| 674 | if (!state) |
| 675 | return XGL_ERROR_OUT_OF_MEMORY; |
| 676 | |
| 677 | *state_ret = state; |
| 678 | |
| 679 | return XGL_SUCCESS; |
| 680 | } |
| 681 | |
| 682 | static XGL_RESULT nulldrv_ds_state_create(struct nulldrv_dev *dev, |
| 683 | const XGL_DYNAMIC_DS_STATE_CREATE_INFO *info, |
| 684 | struct nulldrv_dynamic_ds **state_ret) |
| 685 | { |
| 686 | struct nulldrv_dynamic_ds *state; |
| 687 | |
| 688 | state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev, |
| 689 | sizeof(*state), XGL_DBG_OBJECT_DEPTH_STENCIL_STATE); |
| 690 | if (!state) |
| 691 | return XGL_ERROR_OUT_OF_MEMORY; |
| 692 | |
| 693 | *state_ret = state; |
| 694 | |
| 695 | return XGL_SUCCESS; |
| 696 | } |
| 697 | |
| 698 | |
| 699 | static XGL_RESULT nulldrv_cmd_create(struct nulldrv_dev *dev, |
| 700 | const XGL_CMD_BUFFER_CREATE_INFO *info, |
| 701 | struct nulldrv_cmd **cmd_ret) |
| 702 | { |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 703 | struct nulldrv_cmd *cmd; |
| 704 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 705 | cmd = (struct nulldrv_cmd *) nulldrv_base_create(dev, sizeof(*cmd), |
| 706 | XGL_DBG_OBJECT_CMD_BUFFER); |
| 707 | if (!cmd) |
| 708 | return XGL_ERROR_OUT_OF_MEMORY; |
| 709 | |
| 710 | *cmd_ret = cmd; |
| 711 | |
| 712 | return XGL_SUCCESS; |
| 713 | } |
| 714 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 715 | static XGL_RESULT nulldrv_desc_pool_create(struct nulldrv_dev *dev, |
| 716 | XGL_DESCRIPTOR_POOL_USAGE usage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 717 | uint32_t max_sets, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 718 | const XGL_DESCRIPTOR_POOL_CREATE_INFO *info, |
| 719 | struct nulldrv_desc_pool **pool_ret) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 720 | { |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 721 | struct nulldrv_desc_pool *pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 722 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 723 | pool = (struct nulldrv_desc_pool *) |
| 724 | nulldrv_base_create(dev, sizeof(*pool), |
| 725 | XGL_DBG_OBJECT_DESCRIPTOR_POOL); |
| 726 | if (!pool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 727 | return XGL_ERROR_OUT_OF_MEMORY; |
| 728 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 729 | pool->dev = dev; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 730 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 731 | *pool_ret = pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 732 | |
| 733 | return XGL_SUCCESS; |
| 734 | } |
| 735 | |
| 736 | static XGL_RESULT nulldrv_desc_set_create(struct nulldrv_dev *dev, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 737 | struct nulldrv_desc_pool *pool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 738 | XGL_DESCRIPTOR_SET_USAGE usage, |
| 739 | const struct nulldrv_desc_layout *layout, |
| 740 | struct nulldrv_desc_set **set_ret) |
| 741 | { |
| 742 | struct nulldrv_desc_set *set; |
| 743 | |
| 744 | set = (struct nulldrv_desc_set *) |
| 745 | nulldrv_base_create(dev, sizeof(*set), |
| 746 | XGL_DBG_OBJECT_DESCRIPTOR_SET); |
| 747 | if (!set) |
| 748 | return XGL_ERROR_OUT_OF_MEMORY; |
| 749 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 750 | set->ooxx = dev->desc_ooxx; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 751 | set->layout = layout; |
| 752 | *set_ret = set; |
| 753 | |
| 754 | return XGL_SUCCESS; |
| 755 | } |
| 756 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 757 | static struct nulldrv_desc_pool *nulldrv_desc_pool(XGL_DESCRIPTOR_POOL pool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 758 | { |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 759 | return (struct nulldrv_desc_pool *) pool; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 760 | } |
| 761 | |
| 762 | static XGL_RESULT nulldrv_fb_create(struct nulldrv_dev *dev, |
| 763 | const XGL_FRAMEBUFFER_CREATE_INFO* info, |
| 764 | struct nulldrv_framebuffer ** fb_ret) |
| 765 | { |
| 766 | |
| 767 | struct nulldrv_framebuffer *fb; |
| 768 | fb = (struct nulldrv_framebuffer *) nulldrv_base_create(dev, sizeof(*fb), |
| 769 | XGL_DBG_OBJECT_FRAMEBUFFER); |
| 770 | if (!fb) |
| 771 | return XGL_ERROR_OUT_OF_MEMORY; |
| 772 | |
| 773 | *fb_ret = fb; |
| 774 | |
| 775 | return XGL_SUCCESS; |
| 776 | |
| 777 | } |
| 778 | |
| 779 | static XGL_RESULT nulldrv_render_pass_create(struct nulldrv_dev *dev, |
| 780 | const XGL_RENDER_PASS_CREATE_INFO* info, |
| 781 | struct nulldrv_render_pass** rp_ret) |
| 782 | { |
| 783 | struct nulldrv_render_pass *rp; |
| 784 | rp = (struct nulldrv_render_pass *) nulldrv_base_create(dev, sizeof(*rp), |
| 785 | XGL_DBG_OBJECT_RENDER_PASS); |
| 786 | if (!rp) |
| 787 | return XGL_ERROR_OUT_OF_MEMORY; |
| 788 | |
| 789 | *rp_ret = rp; |
| 790 | |
| 791 | return XGL_SUCCESS; |
| 792 | } |
| 793 | |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 794 | static struct nulldrv_buf *nulldrv_buf(XGL_BUFFER buf) |
| 795 | { |
| 796 | return (struct nulldrv_buf *) buf; |
| 797 | } |
| 798 | |
| 799 | static XGL_RESULT nulldrv_buf_view_create(struct nulldrv_dev *dev, |
| 800 | const XGL_BUFFER_VIEW_CREATE_INFO *info, |
| 801 | struct nulldrv_buf_view **view_ret) |
| 802 | { |
| 803 | struct nulldrv_buf *buf = nulldrv_buf(info->buffer); |
| 804 | struct nulldrv_buf_view *view; |
| 805 | |
| 806 | view = (struct nulldrv_buf_view *) nulldrv_base_create(dev, sizeof(*view), |
| 807 | XGL_DBG_OBJECT_BUFFER_VIEW); |
| 808 | if (!view) |
| 809 | return XGL_ERROR_OUT_OF_MEMORY; |
| 810 | |
| 811 | view->buf = buf; |
| 812 | |
| 813 | *view_ret = view; |
| 814 | |
| 815 | return XGL_SUCCESS; |
| 816 | } |
| 817 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 818 | |
| 819 | //********************************************* |
| 820 | // Driver entry points |
| 821 | //********************************************* |
| 822 | |
| 823 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateBuffer( |
| 824 | XGL_DEVICE device, |
| 825 | const XGL_BUFFER_CREATE_INFO* pCreateInfo, |
| 826 | XGL_BUFFER* pBuffer) |
| 827 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 828 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 829 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 830 | |
| 831 | return nulldrv_buf_create(dev, pCreateInfo, (struct nulldrv_buf **) pBuffer); |
| 832 | } |
| 833 | |
| 834 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateCommandBuffer( |
| 835 | XGL_DEVICE device, |
| 836 | const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, |
| 837 | XGL_CMD_BUFFER* pCmdBuffer) |
| 838 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 839 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 840 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 841 | |
| 842 | return nulldrv_cmd_create(dev, pCreateInfo, |
| 843 | (struct nulldrv_cmd **) pCmdBuffer); |
| 844 | } |
| 845 | |
| 846 | ICD_EXPORT XGL_RESULT XGLAPI xglBeginCommandBuffer( |
| 847 | XGL_CMD_BUFFER cmdBuffer, |
| 848 | const XGL_CMD_BUFFER_BEGIN_INFO *info) |
| 849 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 850 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 851 | return XGL_SUCCESS; |
| 852 | } |
| 853 | |
| 854 | ICD_EXPORT XGL_RESULT XGLAPI xglEndCommandBuffer( |
| 855 | XGL_CMD_BUFFER cmdBuffer) |
| 856 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 857 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 858 | return XGL_SUCCESS; |
| 859 | } |
| 860 | |
| 861 | ICD_EXPORT XGL_RESULT XGLAPI xglResetCommandBuffer( |
| 862 | XGL_CMD_BUFFER cmdBuffer) |
| 863 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 864 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 865 | return XGL_SUCCESS; |
| 866 | } |
| 867 | |
| 868 | ICD_EXPORT void XGLAPI xglCmdInitAtomicCounters( |
| 869 | XGL_CMD_BUFFER cmdBuffer, |
| 870 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 871 | uint32_t startCounter, |
| 872 | uint32_t counterCount, |
| 873 | const uint32_t* pData) |
| 874 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 875 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 876 | } |
| 877 | |
| 878 | ICD_EXPORT void XGLAPI xglCmdLoadAtomicCounters( |
| 879 | XGL_CMD_BUFFER cmdBuffer, |
| 880 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 881 | uint32_t startCounter, |
| 882 | uint32_t counterCount, |
| 883 | XGL_BUFFER srcBuffer, |
| 884 | XGL_GPU_SIZE srcOffset) |
| 885 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 886 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 887 | } |
| 888 | |
| 889 | ICD_EXPORT void XGLAPI xglCmdSaveAtomicCounters( |
| 890 | XGL_CMD_BUFFER cmdBuffer, |
| 891 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 892 | uint32_t startCounter, |
| 893 | uint32_t counterCount, |
| 894 | XGL_BUFFER destBuffer, |
| 895 | XGL_GPU_SIZE destOffset) |
| 896 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 897 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 898 | } |
| 899 | |
| 900 | ICD_EXPORT void XGLAPI xglCmdDbgMarkerBegin( |
| 901 | XGL_CMD_BUFFER cmdBuffer, |
| 902 | const char* pMarker) |
| 903 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 904 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 905 | } |
| 906 | |
| 907 | ICD_EXPORT void XGLAPI xglCmdDbgMarkerEnd( |
| 908 | XGL_CMD_BUFFER cmdBuffer) |
| 909 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 910 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 911 | } |
| 912 | |
| 913 | ICD_EXPORT void XGLAPI xglCmdCopyBuffer( |
| 914 | XGL_CMD_BUFFER cmdBuffer, |
| 915 | XGL_BUFFER srcBuffer, |
| 916 | XGL_BUFFER destBuffer, |
| 917 | uint32_t regionCount, |
| 918 | const XGL_BUFFER_COPY* pRegions) |
| 919 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 920 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 921 | } |
| 922 | |
| 923 | ICD_EXPORT void XGLAPI xglCmdCopyImage( |
| 924 | XGL_CMD_BUFFER cmdBuffer, |
| 925 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 926 | XGL_IMAGE_LAYOUT srcImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 927 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 928 | XGL_IMAGE_LAYOUT destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 929 | uint32_t regionCount, |
| 930 | const XGL_IMAGE_COPY* pRegions) |
| 931 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 932 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 933 | } |
| 934 | |
Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 935 | ICD_EXPORT void XGLAPI xglCmdBlitImage( |
| 936 | XGL_CMD_BUFFER cmdBuffer, |
| 937 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 938 | XGL_IMAGE_LAYOUT srcImageLayout, |
Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 939 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 940 | XGL_IMAGE_LAYOUT destImageLayout, |
Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 941 | uint32_t regionCount, |
| 942 | const XGL_IMAGE_BLIT* pRegions) |
| 943 | { |
| 944 | NULLDRV_LOG_FUNC; |
| 945 | } |
| 946 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 947 | ICD_EXPORT void XGLAPI xglCmdCopyBufferToImage( |
| 948 | XGL_CMD_BUFFER cmdBuffer, |
| 949 | XGL_BUFFER srcBuffer, |
| 950 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 951 | XGL_IMAGE_LAYOUT destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 952 | uint32_t regionCount, |
| 953 | const XGL_BUFFER_IMAGE_COPY* pRegions) |
| 954 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 955 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 956 | } |
| 957 | |
| 958 | ICD_EXPORT void XGLAPI xglCmdCopyImageToBuffer( |
| 959 | XGL_CMD_BUFFER cmdBuffer, |
| 960 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 961 | XGL_IMAGE_LAYOUT srcImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 962 | XGL_BUFFER destBuffer, |
| 963 | uint32_t regionCount, |
| 964 | const XGL_BUFFER_IMAGE_COPY* pRegions) |
| 965 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 966 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 967 | } |
| 968 | |
| 969 | ICD_EXPORT void XGLAPI xglCmdCloneImageData( |
| 970 | XGL_CMD_BUFFER cmdBuffer, |
| 971 | XGL_IMAGE srcImage, |
| 972 | XGL_IMAGE_LAYOUT srcImageLayout, |
| 973 | XGL_IMAGE destImage, |
| 974 | XGL_IMAGE_LAYOUT destImageLayout) |
| 975 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 976 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 977 | } |
| 978 | |
| 979 | ICD_EXPORT void XGLAPI xglCmdUpdateBuffer( |
| 980 | XGL_CMD_BUFFER cmdBuffer, |
| 981 | XGL_BUFFER destBuffer, |
| 982 | XGL_GPU_SIZE destOffset, |
| 983 | XGL_GPU_SIZE dataSize, |
| 984 | const uint32_t* pData) |
| 985 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 986 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 987 | } |
| 988 | |
| 989 | ICD_EXPORT void XGLAPI xglCmdFillBuffer( |
| 990 | XGL_CMD_BUFFER cmdBuffer, |
| 991 | XGL_BUFFER destBuffer, |
| 992 | XGL_GPU_SIZE destOffset, |
| 993 | XGL_GPU_SIZE fillSize, |
| 994 | uint32_t data) |
| 995 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 996 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 997 | } |
| 998 | |
| 999 | ICD_EXPORT void XGLAPI xglCmdClearColorImage( |
| 1000 | XGL_CMD_BUFFER cmdBuffer, |
| 1001 | XGL_IMAGE image, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 1002 | XGL_IMAGE_LAYOUT imageLayout, |
Courtney Goeltzenleuchter | 9a1ded8 | 2015-04-03 16:35:32 -0600 | [diff] [blame] | 1003 | XGL_CLEAR_COLOR color, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1004 | uint32_t rangeCount, |
| 1005 | const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 1006 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1007 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1008 | } |
| 1009 | |
| 1010 | ICD_EXPORT void XGLAPI xglCmdClearDepthStencil( |
| 1011 | XGL_CMD_BUFFER cmdBuffer, |
| 1012 | XGL_IMAGE image, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 1013 | XGL_IMAGE_LAYOUT imageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1014 | float depth, |
| 1015 | uint32_t stencil, |
| 1016 | uint32_t rangeCount, |
| 1017 | const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 1018 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1019 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1020 | } |
| 1021 | |
| 1022 | ICD_EXPORT void XGLAPI xglCmdResolveImage( |
| 1023 | XGL_CMD_BUFFER cmdBuffer, |
| 1024 | XGL_IMAGE srcImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 1025 | XGL_IMAGE_LAYOUT srcImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1026 | XGL_IMAGE destImage, |
Courtney Goeltzenleuchter | 51cbf30 | 2015-03-25 11:25:10 -0600 | [diff] [blame] | 1027 | XGL_IMAGE_LAYOUT destImageLayout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1028 | uint32_t rectCount, |
| 1029 | const XGL_IMAGE_RESOLVE* pRects) |
| 1030 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1031 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1032 | } |
| 1033 | |
| 1034 | ICD_EXPORT void XGLAPI xglCmdBeginQuery( |
| 1035 | XGL_CMD_BUFFER cmdBuffer, |
| 1036 | XGL_QUERY_POOL queryPool, |
| 1037 | uint32_t slot, |
| 1038 | XGL_FLAGS flags) |
| 1039 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1040 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1041 | } |
| 1042 | |
| 1043 | ICD_EXPORT void XGLAPI xglCmdEndQuery( |
| 1044 | XGL_CMD_BUFFER cmdBuffer, |
| 1045 | XGL_QUERY_POOL queryPool, |
| 1046 | uint32_t slot) |
| 1047 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1048 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1049 | } |
| 1050 | |
| 1051 | ICD_EXPORT void XGLAPI xglCmdResetQueryPool( |
| 1052 | XGL_CMD_BUFFER cmdBuffer, |
| 1053 | XGL_QUERY_POOL queryPool, |
| 1054 | uint32_t startQuery, |
| 1055 | uint32_t queryCount) |
| 1056 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1057 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1058 | } |
| 1059 | |
| 1060 | ICD_EXPORT void XGLAPI xglCmdSetEvent( |
| 1061 | XGL_CMD_BUFFER cmdBuffer, |
| 1062 | XGL_EVENT event_, |
Courtney Goeltzenleuchter | aa86e0e | 2015-03-24 18:02:34 -0600 | [diff] [blame] | 1063 | XGL_PIPE_EVENT pipeEvent) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1064 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1065 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1066 | } |
| 1067 | |
| 1068 | ICD_EXPORT void XGLAPI xglCmdResetEvent( |
| 1069 | XGL_CMD_BUFFER cmdBuffer, |
Courtney Goeltzenleuchter | aa86e0e | 2015-03-24 18:02:34 -0600 | [diff] [blame] | 1070 | XGL_EVENT event_, |
| 1071 | XGL_PIPE_EVENT pipeEvent) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1072 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1073 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1074 | } |
| 1075 | |
| 1076 | ICD_EXPORT void XGLAPI xglCmdWriteTimestamp( |
| 1077 | XGL_CMD_BUFFER cmdBuffer, |
| 1078 | XGL_TIMESTAMP_TYPE timestampType, |
| 1079 | XGL_BUFFER destBuffer, |
| 1080 | XGL_GPU_SIZE destOffset) |
| 1081 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1082 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1083 | } |
| 1084 | |
| 1085 | ICD_EXPORT void XGLAPI xglCmdBindPipeline( |
| 1086 | XGL_CMD_BUFFER cmdBuffer, |
| 1087 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 1088 | XGL_PIPELINE pipeline) |
| 1089 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1090 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1091 | } |
| 1092 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1093 | ICD_EXPORT void XGLAPI xglCmdBindDynamicStateObject( |
| 1094 | XGL_CMD_BUFFER cmdBuffer, |
| 1095 | XGL_STATE_BIND_POINT stateBindPoint, |
| 1096 | XGL_DYNAMIC_STATE_OBJECT state) |
| 1097 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1098 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1099 | } |
| 1100 | |
Chia-I Wu | 862c557 | 2015-03-28 15:23:55 +0800 | [diff] [blame] | 1101 | ICD_EXPORT void XGLAPI xglCmdBindDescriptorSets( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1102 | XGL_CMD_BUFFER cmdBuffer, |
| 1103 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
Chia-I Wu | 862c557 | 2015-03-28 15:23:55 +0800 | [diff] [blame] | 1104 | XGL_DESCRIPTOR_SET_LAYOUT_CHAIN layoutChain, |
| 1105 | uint32_t layoutChainSlot, |
| 1106 | uint32_t count, |
| 1107 | const XGL_DESCRIPTOR_SET* pDescriptorSets, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1108 | const uint32_t* pUserData) |
| 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 xglCmdBindVertexBuffer( |
| 1114 | XGL_CMD_BUFFER cmdBuffer, |
| 1115 | XGL_BUFFER buffer, |
| 1116 | XGL_GPU_SIZE offset, |
| 1117 | uint32_t binding) |
| 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 | |
| 1122 | ICD_EXPORT void XGLAPI xglCmdBindIndexBuffer( |
| 1123 | XGL_CMD_BUFFER cmdBuffer, |
| 1124 | XGL_BUFFER buffer, |
| 1125 | XGL_GPU_SIZE offset, |
| 1126 | XGL_INDEX_TYPE indexType) |
| 1127 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1128 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1129 | } |
| 1130 | |
| 1131 | ICD_EXPORT void XGLAPI xglCmdDraw( |
| 1132 | XGL_CMD_BUFFER cmdBuffer, |
| 1133 | uint32_t firstVertex, |
| 1134 | uint32_t vertexCount, |
| 1135 | uint32_t firstInstance, |
| 1136 | uint32_t instanceCount) |
| 1137 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1138 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1139 | } |
| 1140 | |
| 1141 | ICD_EXPORT void XGLAPI xglCmdDrawIndexed( |
| 1142 | XGL_CMD_BUFFER cmdBuffer, |
| 1143 | uint32_t firstIndex, |
| 1144 | uint32_t indexCount, |
| 1145 | int32_t vertexOffset, |
| 1146 | uint32_t firstInstance, |
| 1147 | uint32_t instanceCount) |
| 1148 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1149 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1150 | } |
| 1151 | |
| 1152 | ICD_EXPORT void XGLAPI xglCmdDrawIndirect( |
| 1153 | XGL_CMD_BUFFER cmdBuffer, |
| 1154 | XGL_BUFFER buffer, |
| 1155 | XGL_GPU_SIZE offset, |
| 1156 | uint32_t count, |
| 1157 | uint32_t stride) |
| 1158 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1159 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1160 | } |
| 1161 | |
| 1162 | ICD_EXPORT void XGLAPI xglCmdDrawIndexedIndirect( |
| 1163 | XGL_CMD_BUFFER cmdBuffer, |
| 1164 | XGL_BUFFER buffer, |
| 1165 | XGL_GPU_SIZE offset, |
| 1166 | uint32_t count, |
| 1167 | uint32_t stride) |
| 1168 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1169 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1170 | } |
| 1171 | |
| 1172 | ICD_EXPORT void XGLAPI xglCmdDispatch( |
| 1173 | XGL_CMD_BUFFER cmdBuffer, |
| 1174 | uint32_t x, |
| 1175 | uint32_t y, |
| 1176 | uint32_t z) |
| 1177 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1178 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1179 | } |
| 1180 | |
| 1181 | ICD_EXPORT void XGLAPI xglCmdDispatchIndirect( |
| 1182 | XGL_CMD_BUFFER cmdBuffer, |
| 1183 | XGL_BUFFER buffer, |
| 1184 | XGL_GPU_SIZE offset) |
| 1185 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1186 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1187 | } |
| 1188 | |
| 1189 | ICD_EXPORT void XGLAPI xglCmdWaitEvents( |
| 1190 | XGL_CMD_BUFFER cmdBuffer, |
| 1191 | const XGL_EVENT_WAIT_INFO* pWaitInfo) |
| 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 | |
| 1196 | ICD_EXPORT void XGLAPI xglCmdPipelineBarrier( |
| 1197 | XGL_CMD_BUFFER cmdBuffer, |
| 1198 | const XGL_PIPELINE_BARRIER* pBarrier) |
| 1199 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1200 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1201 | } |
| 1202 | |
| 1203 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDevice( |
| 1204 | XGL_PHYSICAL_GPU gpu_, |
| 1205 | const XGL_DEVICE_CREATE_INFO* pCreateInfo, |
| 1206 | XGL_DEVICE* pDevice) |
| 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_gpu *gpu = nulldrv_gpu(gpu_); |
| 1210 | return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice); |
| 1211 | } |
| 1212 | |
| 1213 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyDevice( |
| 1214 | XGL_DEVICE device) |
| 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 | return XGL_SUCCESS; |
| 1218 | } |
| 1219 | |
| 1220 | ICD_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue( |
| 1221 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | f316806 | 2015-03-05 18:09:39 -0700 | [diff] [blame] | 1222 | uint32_t queueNodeIndex, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1223 | uint32_t queueIndex, |
| 1224 | XGL_QUEUE* pQueue) |
| 1225 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1226 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1227 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1228 | *pQueue = dev->queues[0]; |
| 1229 | return XGL_SUCCESS; |
| 1230 | } |
| 1231 | |
| 1232 | ICD_EXPORT XGL_RESULT XGLAPI xglDeviceWaitIdle( |
| 1233 | XGL_DEVICE device) |
| 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 | return XGL_SUCCESS; |
| 1237 | } |
| 1238 | |
| 1239 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetValidationLevel( |
| 1240 | XGL_DEVICE device, |
| 1241 | XGL_VALIDATION_LEVEL validationLevel) |
| 1242 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1243 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1244 | return XGL_SUCCESS; |
| 1245 | } |
| 1246 | |
| 1247 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetMessageFilter( |
| 1248 | XGL_DEVICE device, |
| 1249 | int32_t msgCode, |
| 1250 | XGL_DBG_MSG_FILTER filter) |
| 1251 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1252 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1253 | return XGL_SUCCESS; |
| 1254 | } |
| 1255 | |
| 1256 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetDeviceOption( |
| 1257 | XGL_DEVICE device, |
| 1258 | XGL_DBG_DEVICE_OPTION dbgOption, |
| 1259 | size_t dataSize, |
| 1260 | const void* pData) |
| 1261 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1262 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1263 | return XGL_SUCCESS; |
| 1264 | } |
| 1265 | |
| 1266 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateEvent( |
| 1267 | XGL_DEVICE device, |
| 1268 | const XGL_EVENT_CREATE_INFO* pCreateInfo, |
| 1269 | XGL_EVENT* pEvent) |
| 1270 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1271 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1272 | return XGL_SUCCESS; |
| 1273 | } |
| 1274 | |
| 1275 | ICD_EXPORT XGL_RESULT XGLAPI xglGetEventStatus( |
| 1276 | XGL_EVENT event_) |
| 1277 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1278 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1279 | return XGL_SUCCESS; |
| 1280 | } |
| 1281 | |
| 1282 | ICD_EXPORT XGL_RESULT XGLAPI xglSetEvent( |
| 1283 | XGL_EVENT event_) |
| 1284 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1285 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1286 | return XGL_SUCCESS; |
| 1287 | } |
| 1288 | |
| 1289 | ICD_EXPORT XGL_RESULT XGLAPI xglResetEvent( |
| 1290 | XGL_EVENT event_) |
| 1291 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1292 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1293 | return XGL_SUCCESS; |
| 1294 | } |
| 1295 | |
| 1296 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateFence( |
| 1297 | XGL_DEVICE device, |
| 1298 | const XGL_FENCE_CREATE_INFO* pCreateInfo, |
| 1299 | XGL_FENCE* pFence) |
| 1300 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1301 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1302 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1303 | |
| 1304 | return nulldrv_fence_create(dev, pCreateInfo, |
| 1305 | (struct nulldrv_fence **) pFence); |
| 1306 | } |
| 1307 | |
| 1308 | ICD_EXPORT XGL_RESULT XGLAPI xglGetFenceStatus( |
| 1309 | XGL_FENCE fence_) |
| 1310 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1311 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1312 | return XGL_SUCCESS; |
| 1313 | } |
| 1314 | |
| 1315 | ICD_EXPORT XGL_RESULT XGLAPI xglWaitForFences( |
| 1316 | XGL_DEVICE device, |
| 1317 | uint32_t fenceCount, |
| 1318 | const XGL_FENCE* pFences, |
| 1319 | bool32_t waitAll, |
| 1320 | uint64_t timeout) |
| 1321 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1322 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1323 | return XGL_SUCCESS; |
| 1324 | } |
| 1325 | |
| 1326 | ICD_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo( |
| 1327 | XGL_DEVICE device, |
| 1328 | XGL_FORMAT format, |
| 1329 | XGL_FORMAT_INFO_TYPE infoType, |
| 1330 | size_t* pDataSize, |
| 1331 | void* pData) |
| 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 xglGetGpuInfo( |
| 1338 | XGL_PHYSICAL_GPU gpu_, |
| 1339 | XGL_PHYSICAL_GPU_INFO_TYPE infoType, |
| 1340 | size_t* pDataSize, |
| 1341 | void* pData) |
| 1342 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1343 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1344 | return XGL_SUCCESS; |
| 1345 | } |
| 1346 | |
| 1347 | ICD_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport( |
| 1348 | XGL_PHYSICAL_GPU gpu_, |
| 1349 | const char* pExtName) |
| 1350 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1351 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1352 | return XGL_SUCCESS; |
| 1353 | } |
| 1354 | |
| 1355 | ICD_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility( |
| 1356 | XGL_PHYSICAL_GPU gpu0_, |
| 1357 | XGL_PHYSICAL_GPU gpu1_, |
| 1358 | XGL_GPU_COMPATIBILITY_INFO* pInfo) |
| 1359 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1360 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1361 | return XGL_SUCCESS; |
| 1362 | } |
| 1363 | |
| 1364 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenPeerImage( |
| 1365 | XGL_DEVICE device, |
| 1366 | const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, |
| 1367 | XGL_IMAGE* pImage, |
| 1368 | XGL_GPU_MEMORY* pMem) |
| 1369 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1370 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1371 | return XGL_SUCCESS; |
| 1372 | } |
| 1373 | |
| 1374 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateImage( |
| 1375 | XGL_DEVICE device, |
| 1376 | const XGL_IMAGE_CREATE_INFO* pCreateInfo, |
| 1377 | XGL_IMAGE* pImage) |
| 1378 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1379 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1380 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1381 | |
| 1382 | return nulldrv_img_create(dev, pCreateInfo, false, |
| 1383 | (struct nulldrv_img **) pImage); |
| 1384 | } |
| 1385 | |
| 1386 | ICD_EXPORT XGL_RESULT XGLAPI xglGetImageSubresourceInfo( |
| 1387 | XGL_IMAGE image, |
| 1388 | const XGL_IMAGE_SUBRESOURCE* pSubresource, |
| 1389 | XGL_SUBRESOURCE_INFO_TYPE infoType, |
| 1390 | size_t* pDataSize, |
| 1391 | void* pData) |
| 1392 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1393 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1394 | XGL_RESULT ret = XGL_SUCCESS; |
| 1395 | |
| 1396 | switch (infoType) { |
| 1397 | case XGL_INFO_TYPE_SUBRESOURCE_LAYOUT: |
| 1398 | { |
| 1399 | XGL_SUBRESOURCE_LAYOUT *layout = (XGL_SUBRESOURCE_LAYOUT *) pData; |
| 1400 | |
| 1401 | *pDataSize = sizeof(XGL_SUBRESOURCE_LAYOUT); |
| 1402 | |
| 1403 | if (pData == NULL) |
| 1404 | return ret; |
| 1405 | layout->offset = 0; |
| 1406 | layout->size = 1; |
| 1407 | layout->rowPitch = 4; |
| 1408 | layout->depthPitch = 4; |
| 1409 | } |
| 1410 | break; |
| 1411 | default: |
| 1412 | ret = XGL_ERROR_INVALID_VALUE; |
| 1413 | break; |
| 1414 | } |
| 1415 | |
| 1416 | return ret; |
| 1417 | } |
| 1418 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1419 | ICD_EXPORT XGL_RESULT XGLAPI xglAllocMemory( |
| 1420 | XGL_DEVICE device, |
| 1421 | const XGL_MEMORY_ALLOC_INFO* pAllocInfo, |
| 1422 | XGL_GPU_MEMORY* pMem) |
| 1423 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1424 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1425 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1426 | |
| 1427 | return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem); |
| 1428 | } |
| 1429 | |
| 1430 | ICD_EXPORT XGL_RESULT XGLAPI xglFreeMemory( |
| 1431 | XGL_GPU_MEMORY mem_) |
| 1432 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1433 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1434 | return XGL_SUCCESS; |
| 1435 | } |
| 1436 | |
| 1437 | ICD_EXPORT XGL_RESULT XGLAPI xglSetMemoryPriority( |
| 1438 | XGL_GPU_MEMORY mem_, |
| 1439 | XGL_MEMORY_PRIORITY priority) |
| 1440 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1441 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1442 | return XGL_SUCCESS; |
| 1443 | } |
| 1444 | |
| 1445 | ICD_EXPORT XGL_RESULT XGLAPI xglMapMemory( |
| 1446 | XGL_GPU_MEMORY mem_, |
| 1447 | XGL_FLAGS flags, |
| 1448 | void** ppData) |
| 1449 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1450 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1451 | struct nulldrv_mem *mem = nulldrv_mem(mem_); |
| 1452 | void *ptr = nulldrv_mem_map(mem, flags); |
| 1453 | |
| 1454 | *ppData = ptr; |
| 1455 | |
| 1456 | return (ptr) ? XGL_SUCCESS : XGL_ERROR_UNKNOWN; |
| 1457 | } |
| 1458 | |
| 1459 | ICD_EXPORT XGL_RESULT XGLAPI xglUnmapMemory( |
| 1460 | XGL_GPU_MEMORY mem_) |
| 1461 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1462 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1463 | return XGL_SUCCESS; |
| 1464 | } |
| 1465 | |
| 1466 | ICD_EXPORT XGL_RESULT XGLAPI xglPinSystemMemory( |
| 1467 | XGL_DEVICE device, |
| 1468 | const void* pSysMem, |
| 1469 | size_t memSize, |
| 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 xglOpenSharedMemory( |
| 1477 | XGL_DEVICE device, |
| 1478 | const XGL_MEMORY_OPEN_INFO* pOpenInfo, |
| 1479 | XGL_GPU_MEMORY* pMem) |
| 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 | return XGL_SUCCESS; |
| 1483 | } |
| 1484 | |
| 1485 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenPeerMemory( |
| 1486 | XGL_DEVICE device, |
| 1487 | const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, |
| 1488 | XGL_GPU_MEMORY* pMem) |
| 1489 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1490 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1491 | return XGL_SUCCESS; |
| 1492 | } |
| 1493 | |
| 1494 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateInstance( |
Jon Ashburn | 29669a4 | 2015-04-04 14:52:07 -0600 | [diff] [blame] | 1495 | const XGL_INSTANCE_CREATE_INFO* pCreateInfo, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1496 | XGL_INSTANCE* pInstance) |
| 1497 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1498 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1499 | struct nulldrv_instance *inst; |
| 1500 | |
| 1501 | inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst), |
| 1502 | XGL_DBG_OBJECT_INSTANCE); |
| 1503 | if (!inst) |
| 1504 | return XGL_ERROR_OUT_OF_MEMORY; |
| 1505 | |
| 1506 | inst->obj.base.get_info = NULL; |
| 1507 | |
| 1508 | *pInstance = (XGL_INSTANCE*)inst; |
| 1509 | |
Chia-I Wu | 493a175 | 2015-02-22 14:40:25 +0800 | [diff] [blame] | 1510 | return XGL_SUCCESS; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1511 | } |
| 1512 | |
| 1513 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyInstance( |
| 1514 | XGL_INSTANCE pInstance) |
| 1515 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1516 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1517 | return XGL_SUCCESS; |
| 1518 | } |
| 1519 | |
| 1520 | ICD_EXPORT XGL_RESULT XGLAPI xglEnumerateGpus( |
| 1521 | XGL_INSTANCE instance, |
| 1522 | uint32_t maxGpus, |
| 1523 | uint32_t* pGpuCount, |
| 1524 | XGL_PHYSICAL_GPU* pGpus) |
| 1525 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1526 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1527 | XGL_RESULT ret; |
| 1528 | struct nulldrv_gpu *gpu; |
| 1529 | *pGpuCount = 1; |
| 1530 | ret = nulldrv_gpu_add(0, 0, 0, &gpu); |
| 1531 | if (ret == XGL_SUCCESS) |
| 1532 | pGpus[0] = (XGL_PHYSICAL_GPU) gpu; |
| 1533 | return ret; |
| 1534 | } |
| 1535 | |
| 1536 | ICD_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers( |
| 1537 | XGL_PHYSICAL_GPU gpu, |
| 1538 | size_t maxLayerCount, |
| 1539 | size_t maxStringSize, |
| 1540 | size_t* pOutLayerCount, |
| 1541 | char* const* pOutLayers, |
| 1542 | void* pReserved) |
| 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 xglDbgRegisterMsgCallback( |
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_MSG_CALLBACK_FUNCTION pfnMsgCallback, |
| 1551 | void* pUserData) |
| 1552 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1553 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1554 | return XGL_SUCCESS; |
| 1555 | } |
| 1556 | |
| 1557 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgUnregisterMsgCallback( |
Courtney Goeltzenleuchter | 9d36ef4 | 2015-04-13 14:10:06 -0600 | [diff] [blame] | 1558 | XGL_INSTANCE instance, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1559 | XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback) |
| 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 xglDbgSetGlobalOption( |
Courtney Goeltzenleuchter | 9d36ef4 | 2015-04-13 14:10:06 -0600 | [diff] [blame] | 1566 | XGL_INSTANCE instance, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1567 | XGL_DBG_GLOBAL_OPTION dbgOption, |
| 1568 | size_t dataSize, |
| 1569 | const 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 | return XGL_SUCCESS; |
| 1573 | } |
| 1574 | |
| 1575 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyObject( |
| 1576 | XGL_OBJECT object) |
| 1577 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1578 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1579 | return XGL_SUCCESS; |
| 1580 | } |
| 1581 | |
| 1582 | ICD_EXPORT XGL_RESULT XGLAPI xglGetObjectInfo( |
| 1583 | XGL_BASE_OBJECT object, |
| 1584 | XGL_OBJECT_INFO_TYPE infoType, |
| 1585 | size_t* pDataSize, |
| 1586 | void* pData) |
| 1587 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1588 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1589 | struct nulldrv_base *base = nulldrv_base(object); |
| 1590 | |
| 1591 | return base->get_info(base, infoType, pDataSize, pData); |
| 1592 | } |
| 1593 | |
| 1594 | ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory( |
| 1595 | XGL_OBJECT object, |
| 1596 | uint32_t allocationIdx, |
| 1597 | XGL_GPU_MEMORY mem_, |
| 1598 | XGL_GPU_SIZE memOffset) |
| 1599 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1600 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1601 | return XGL_SUCCESS; |
| 1602 | } |
| 1603 | |
| 1604 | ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemoryRange( |
| 1605 | XGL_OBJECT object, |
| 1606 | uint32_t allocationIdx, |
| 1607 | XGL_GPU_SIZE rangeOffset, |
| 1608 | XGL_GPU_SIZE rangeSize, |
| 1609 | XGL_GPU_MEMORY mem, |
| 1610 | XGL_GPU_SIZE memOffset) |
| 1611 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1612 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1613 | return XGL_SUCCESS; |
| 1614 | } |
| 1615 | |
| 1616 | ICD_EXPORT XGL_RESULT XGLAPI xglBindImageMemoryRange( |
| 1617 | XGL_IMAGE image, |
| 1618 | uint32_t allocationIdx, |
| 1619 | const XGL_IMAGE_MEMORY_BIND_INFO* bindInfo, |
| 1620 | XGL_GPU_MEMORY mem, |
| 1621 | XGL_GPU_SIZE memOffset) |
| 1622 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1623 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1624 | return XGL_SUCCESS; |
| 1625 | } |
| 1626 | |
| 1627 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetObjectTag( |
| 1628 | XGL_BASE_OBJECT object, |
| 1629 | size_t tagSize, |
| 1630 | const void* pTag) |
| 1631 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1632 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1633 | return XGL_SUCCESS; |
| 1634 | } |
| 1635 | |
| 1636 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipeline( |
| 1637 | XGL_DEVICE device, |
| 1638 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1639 | XGL_PIPELINE* pPipeline) |
| 1640 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1641 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1642 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1643 | |
| 1644 | return graphics_pipeline_create(dev, pCreateInfo, |
| 1645 | (struct nulldrv_pipeline **) pPipeline); |
| 1646 | } |
| 1647 | |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1648 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipelineDerivative( |
| 1649 | XGL_DEVICE device, |
| 1650 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1651 | XGL_PIPELINE basePipeline, |
| 1652 | XGL_PIPELINE* pPipeline) |
| 1653 | { |
| 1654 | NULLDRV_LOG_FUNC; |
| 1655 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1656 | |
| 1657 | return graphics_pipeline_create(dev, pCreateInfo, |
| 1658 | (struct nulldrv_pipeline **) pPipeline); |
| 1659 | } |
| 1660 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1661 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateComputePipeline( |
| 1662 | XGL_DEVICE device, |
| 1663 | const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1664 | XGL_PIPELINE* pPipeline) |
| 1665 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1666 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1667 | return XGL_SUCCESS; |
| 1668 | } |
| 1669 | |
| 1670 | ICD_EXPORT XGL_RESULT XGLAPI xglStorePipeline( |
| 1671 | XGL_PIPELINE pipeline, |
| 1672 | size_t* pDataSize, |
| 1673 | void* pData) |
| 1674 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1675 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1676 | return XGL_SUCCESS; |
| 1677 | } |
| 1678 | |
| 1679 | ICD_EXPORT XGL_RESULT XGLAPI xglLoadPipeline( |
| 1680 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1681 | size_t dataSize, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1682 | const void* pData, |
| 1683 | XGL_PIPELINE* pPipeline) |
| 1684 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1685 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1686 | return XGL_SUCCESS; |
| 1687 | } |
| 1688 | |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1689 | ICD_EXPORT XGL_RESULT XGLAPI xglLoadPipelineDerivative( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1690 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 1691 | size_t dataSize, |
| 1692 | const void* pData, |
| 1693 | XGL_PIPELINE basePipeline, |
| 1694 | XGL_PIPELINE* pPipeline) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1695 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1696 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1697 | return XGL_SUCCESS; |
| 1698 | } |
| 1699 | |
| 1700 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateQueryPool( |
| 1701 | XGL_DEVICE device, |
| 1702 | const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, |
| 1703 | XGL_QUERY_POOL* pQueryPool) |
| 1704 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1705 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1706 | return XGL_SUCCESS; |
| 1707 | } |
| 1708 | |
| 1709 | ICD_EXPORT XGL_RESULT XGLAPI xglGetQueryPoolResults( |
| 1710 | XGL_QUERY_POOL queryPool, |
| 1711 | uint32_t startQuery, |
| 1712 | uint32_t queryCount, |
| 1713 | size_t* pDataSize, |
| 1714 | void* pData) |
| 1715 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1716 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1717 | return XGL_SUCCESS; |
| 1718 | } |
| 1719 | |
Courtney Goeltzenleuchter | cfedf36 | 2015-04-02 13:39:07 -0600 | [diff] [blame] | 1720 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueAddMemReference( |
| 1721 | XGL_QUEUE queue, |
| 1722 | XGL_GPU_MEMORY mem) |
| 1723 | { |
| 1724 | NULLDRV_LOG_FUNC; |
| 1725 | return XGL_SUCCESS; |
| 1726 | } |
| 1727 | |
| 1728 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueRemoveMemReference( |
| 1729 | XGL_QUEUE queue, |
| 1730 | XGL_GPU_MEMORY mem) |
| 1731 | { |
| 1732 | NULLDRV_LOG_FUNC; |
| 1733 | return XGL_SUCCESS; |
| 1734 | } |
| 1735 | |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1736 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueWaitIdle( |
| 1737 | XGL_QUEUE queue_) |
| 1738 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1739 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1740 | return XGL_SUCCESS; |
| 1741 | } |
| 1742 | |
| 1743 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueSubmit( |
| 1744 | XGL_QUEUE queue_, |
| 1745 | uint32_t cmdBufferCount, |
| 1746 | const XGL_CMD_BUFFER* pCmdBuffers, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1747 | XGL_FENCE fence_) |
| 1748 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1749 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1750 | return XGL_SUCCESS; |
| 1751 | } |
| 1752 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1753 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenSharedSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1754 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1755 | const XGL_SEMAPHORE_OPEN_INFO* pOpenInfo, |
| 1756 | XGL_SEMAPHORE* pSemaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1757 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1758 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1759 | return XGL_SUCCESS; |
| 1760 | } |
| 1761 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1762 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1763 | XGL_DEVICE device, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1764 | const XGL_SEMAPHORE_CREATE_INFO* pCreateInfo, |
| 1765 | XGL_SEMAPHORE* pSemaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1766 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1767 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1768 | return XGL_SUCCESS; |
| 1769 | } |
| 1770 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1771 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueSignalSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1772 | XGL_QUEUE queue, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1773 | XGL_SEMAPHORE semaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1774 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1775 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1776 | return XGL_SUCCESS; |
| 1777 | } |
| 1778 | |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1779 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueWaitSemaphore( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1780 | XGL_QUEUE queue, |
Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 1781 | XGL_SEMAPHORE semaphore) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1782 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1783 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1784 | return XGL_SUCCESS; |
| 1785 | } |
| 1786 | |
| 1787 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateSampler( |
| 1788 | XGL_DEVICE device, |
| 1789 | const XGL_SAMPLER_CREATE_INFO* pCreateInfo, |
| 1790 | XGL_SAMPLER* pSampler) |
| 1791 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1792 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1793 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1794 | |
| 1795 | return nulldrv_sampler_create(dev, pCreateInfo, |
| 1796 | (struct nulldrv_sampler **) pSampler); |
| 1797 | } |
| 1798 | |
| 1799 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateShader( |
| 1800 | XGL_DEVICE device, |
| 1801 | const XGL_SHADER_CREATE_INFO* pCreateInfo, |
| 1802 | XGL_SHADER* pShader) |
| 1803 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1804 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1805 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1806 | |
| 1807 | return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader); |
| 1808 | } |
| 1809 | |
| 1810 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicViewportState( |
| 1811 | XGL_DEVICE device, |
| 1812 | const XGL_DYNAMIC_VP_STATE_CREATE_INFO* pCreateInfo, |
| 1813 | XGL_DYNAMIC_VP_STATE_OBJECT* pState) |
| 1814 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1815 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1816 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1817 | |
| 1818 | return nulldrv_viewport_state_create(dev, pCreateInfo, |
| 1819 | (struct nulldrv_dynamic_vp **) pState); |
| 1820 | } |
| 1821 | |
| 1822 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicRasterState( |
| 1823 | XGL_DEVICE device, |
| 1824 | const XGL_DYNAMIC_RS_STATE_CREATE_INFO* pCreateInfo, |
| 1825 | XGL_DYNAMIC_RS_STATE_OBJECT* pState) |
| 1826 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1827 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1828 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1829 | |
| 1830 | return nulldrv_raster_state_create(dev, pCreateInfo, |
| 1831 | (struct nulldrv_dynamic_rs **) pState); |
| 1832 | } |
| 1833 | |
| 1834 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicColorBlendState( |
| 1835 | XGL_DEVICE device, |
| 1836 | const XGL_DYNAMIC_CB_STATE_CREATE_INFO* pCreateInfo, |
| 1837 | XGL_DYNAMIC_CB_STATE_OBJECT* pState) |
| 1838 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1839 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1840 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1841 | |
| 1842 | return nulldrv_blend_state_create(dev, pCreateInfo, |
| 1843 | (struct nulldrv_dynamic_cb **) pState); |
| 1844 | } |
| 1845 | |
| 1846 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicDepthStencilState( |
| 1847 | XGL_DEVICE device, |
| 1848 | const XGL_DYNAMIC_DS_STATE_CREATE_INFO* pCreateInfo, |
| 1849 | XGL_DYNAMIC_DS_STATE_OBJECT* pState) |
| 1850 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1851 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1852 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1853 | |
| 1854 | return nulldrv_ds_state_create(dev, pCreateInfo, |
| 1855 | (struct nulldrv_dynamic_ds **) pState); |
| 1856 | } |
| 1857 | |
| 1858 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateBufferView( |
| 1859 | XGL_DEVICE device, |
| 1860 | const XGL_BUFFER_VIEW_CREATE_INFO* pCreateInfo, |
| 1861 | XGL_BUFFER_VIEW* pView) |
| 1862 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1863 | NULLDRV_LOG_FUNC; |
| 1864 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1865 | |
| 1866 | return nulldrv_buf_view_create(dev, pCreateInfo, |
| 1867 | (struct nulldrv_buf_view **) pView); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1868 | } |
| 1869 | |
| 1870 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateImageView( |
| 1871 | XGL_DEVICE device, |
| 1872 | const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, |
| 1873 | XGL_IMAGE_VIEW* pView) |
| 1874 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1875 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1876 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1877 | |
| 1878 | return nulldrv_img_view_create(dev, pCreateInfo, |
| 1879 | (struct nulldrv_img_view **) pView); |
| 1880 | } |
| 1881 | |
| 1882 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateColorAttachmentView( |
| 1883 | XGL_DEVICE device, |
| 1884 | const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, |
| 1885 | XGL_COLOR_ATTACHMENT_VIEW* pView) |
| 1886 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1887 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1888 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1889 | |
| 1890 | return nulldrv_rt_view_create(dev, pCreateInfo, |
| 1891 | (struct nulldrv_rt_view **) pView); |
| 1892 | } |
| 1893 | |
| 1894 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilView( |
| 1895 | XGL_DEVICE device, |
| 1896 | const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, |
| 1897 | XGL_DEPTH_STENCIL_VIEW* pView) |
| 1898 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1899 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1900 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1901 | |
| 1902 | return nulldrv_ds_view_create(dev, pCreateInfo, |
| 1903 | (struct nulldrv_ds_view **) pView); |
| 1904 | |
| 1905 | } |
| 1906 | |
| 1907 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSetLayout( |
| 1908 | XGL_DEVICE device, |
Chia-I Wu | fc9d913 | 2015-03-26 15:04:41 +0800 | [diff] [blame] | 1909 | const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pCreateInfo, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1910 | XGL_DESCRIPTOR_SET_LAYOUT* pSetLayout) |
| 1911 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1912 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1913 | struct nulldrv_dev *dev = nulldrv_dev(device); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1914 | |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 1915 | return nulldrv_desc_layout_create(dev, pCreateInfo, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1916 | (struct nulldrv_desc_layout **) pSetLayout); |
| 1917 | } |
| 1918 | |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 1919 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSetLayoutChain( |
| 1920 | XGL_DEVICE device, |
| 1921 | uint32_t setLayoutArrayCount, |
| 1922 | const XGL_DESCRIPTOR_SET_LAYOUT* pSetLayoutArray, |
| 1923 | XGL_DESCRIPTOR_SET_LAYOUT_CHAIN* pLayoutChain) |
| 1924 | { |
| 1925 | NULLDRV_LOG_FUNC; |
| 1926 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1927 | |
| 1928 | return nulldrv_desc_layout_chain_create(dev, |
| 1929 | setLayoutArrayCount, pSetLayoutArray, |
| 1930 | (struct nulldrv_desc_layout_chain **) pLayoutChain); |
| 1931 | } |
| 1932 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1933 | ICD_EXPORT XGL_RESULT XGLAPI xglBeginDescriptorPoolUpdate( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1934 | XGL_DEVICE device, |
| 1935 | XGL_DESCRIPTOR_UPDATE_MODE updateMode) |
| 1936 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1937 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1938 | return XGL_SUCCESS; |
| 1939 | } |
| 1940 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1941 | ICD_EXPORT XGL_RESULT XGLAPI xglEndDescriptorPoolUpdate( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1942 | XGL_DEVICE device, |
| 1943 | XGL_CMD_BUFFER cmd_) |
| 1944 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1945 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1946 | return XGL_SUCCESS; |
| 1947 | } |
| 1948 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1949 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorPool( |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1950 | XGL_DEVICE device, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1951 | XGL_DESCRIPTOR_POOL_USAGE poolUsage, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1952 | uint32_t maxSets, |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1953 | const XGL_DESCRIPTOR_POOL_CREATE_INFO* pCreateInfo, |
| 1954 | XGL_DESCRIPTOR_POOL* pDescriptorPool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1955 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1956 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1957 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1958 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1959 | return nulldrv_desc_pool_create(dev, poolUsage, maxSets, pCreateInfo, |
| 1960 | (struct nulldrv_desc_pool **) pDescriptorPool); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1961 | } |
| 1962 | |
Chia-I Wu | dee9561 | 2015-03-26 15:23:52 +0800 | [diff] [blame] | 1963 | ICD_EXPORT XGL_RESULT XGLAPI xglResetDescriptorPool( |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1964 | XGL_DESCRIPTOR_POOL descriptorPool) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1965 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1966 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1967 | return XGL_SUCCESS; |
| 1968 | } |
| 1969 | |
| 1970 | ICD_EXPORT XGL_RESULT XGLAPI xglAllocDescriptorSets( |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1971 | XGL_DESCRIPTOR_POOL descriptorPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1972 | XGL_DESCRIPTOR_SET_USAGE setUsage, |
| 1973 | uint32_t count, |
| 1974 | const XGL_DESCRIPTOR_SET_LAYOUT* pSetLayouts, |
| 1975 | XGL_DESCRIPTOR_SET* pDescriptorSets, |
| 1976 | uint32_t* pCount) |
| 1977 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1978 | NULLDRV_LOG_FUNC; |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1979 | struct nulldrv_desc_pool *pool = nulldrv_desc_pool(descriptorPool); |
| 1980 | struct nulldrv_dev *dev = pool->dev; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1981 | XGL_RESULT ret = XGL_SUCCESS; |
| 1982 | uint32_t i; |
| 1983 | |
| 1984 | for (i = 0; i < count; i++) { |
| 1985 | const struct nulldrv_desc_layout *layout = |
| 1986 | nulldrv_desc_layout((XGL_DESCRIPTOR_SET_LAYOUT) pSetLayouts[i]); |
| 1987 | |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 1988 | ret = nulldrv_desc_set_create(dev, pool, setUsage, layout, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1989 | (struct nulldrv_desc_set **) &pDescriptorSets[i]); |
| 1990 | if (ret != XGL_SUCCESS) |
| 1991 | break; |
| 1992 | } |
| 1993 | |
| 1994 | if (pCount) |
| 1995 | *pCount = i; |
| 1996 | |
| 1997 | return ret; |
| 1998 | } |
| 1999 | |
| 2000 | ICD_EXPORT void XGLAPI xglClearDescriptorSets( |
Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame] | 2001 | XGL_DESCRIPTOR_POOL descriptorPool, |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2002 | uint32_t count, |
| 2003 | const XGL_DESCRIPTOR_SET* pDescriptorSets) |
| 2004 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2005 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2006 | } |
| 2007 | |
| 2008 | ICD_EXPORT void XGLAPI xglUpdateDescriptors( |
| 2009 | XGL_DESCRIPTOR_SET descriptorSet, |
Chia-I Wu | 7732cb2 | 2015-03-26 15:27:55 +0800 | [diff] [blame] | 2010 | uint32_t updateCount, |
| 2011 | const void** ppUpdateArray) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2012 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2013 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2014 | } |
| 2015 | |
| 2016 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateFramebuffer( |
| 2017 | XGL_DEVICE device, |
| 2018 | const XGL_FRAMEBUFFER_CREATE_INFO* info, |
| 2019 | XGL_FRAMEBUFFER* fb_ret) |
| 2020 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2021 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2022 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2023 | |
| 2024 | return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret); |
| 2025 | } |
| 2026 | |
| 2027 | |
| 2028 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateRenderPass( |
| 2029 | XGL_DEVICE device, |
| 2030 | const XGL_RENDER_PASS_CREATE_INFO* info, |
| 2031 | XGL_RENDER_PASS* rp_ret) |
| 2032 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2033 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2034 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2035 | |
| 2036 | return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret); |
| 2037 | } |
| 2038 | |
| 2039 | ICD_EXPORT void XGLAPI xglCmdBeginRenderPass( |
| 2040 | XGL_CMD_BUFFER cmdBuffer, |
Courtney Goeltzenleuchter | e3b0f3a | 2015-04-03 15:25:24 -0600 | [diff] [blame] | 2041 | const XGL_RENDER_PASS_BEGIN* pRenderPassBegin) |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2042 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2043 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2044 | } |
| 2045 | |
| 2046 | ICD_EXPORT void XGLAPI xglCmdEndRenderPass( |
| 2047 | XGL_CMD_BUFFER cmdBuffer, |
| 2048 | XGL_RENDER_PASS renderPass) |
| 2049 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2050 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2051 | } |
Ian Elliott | f93069f | 2015-02-19 14:26:19 -0700 | [diff] [blame] | 2052 | |
| 2053 | ICD_EXPORT void* xcbCreateWindow( |
| 2054 | uint16_t width, |
| 2055 | uint16_t height) |
| 2056 | { |
| 2057 | static uint32_t window; // Kludge to the max |
| 2058 | NULLDRV_LOG_FUNC; |
| 2059 | return &window; |
| 2060 | } |
| 2061 | |
| 2062 | // May not be needed, if we stub out stuf in tri.c |
| 2063 | ICD_EXPORT void xcbDestroyWindow() |
| 2064 | { |
| 2065 | NULLDRV_LOG_FUNC; |
| 2066 | } |
| 2067 | |
| 2068 | ICD_EXPORT int xcbGetMessage(void *msg) |
| 2069 | { |
| 2070 | NULLDRV_LOG_FUNC; |
| 2071 | return 0; |
| 2072 | } |
| 2073 | |
| 2074 | ICD_EXPORT XGL_RESULT xcbQueuePresent(void *queue, void *image, void* fence) |
| 2075 | { |
| 2076 | return XGL_SUCCESS; |
| 2077 | } |