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 | |
| 111 | base = (struct nulldrv_base*)icd_alloc(obj_size, 0, XGL_SYSTEM_ALLOC_API_OBJECT); |
| 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 | |
| 139 | gpu = icd_alloc(sizeof(*gpu), 0, XGL_SYSTEM_ALLOC_API_OBJECT); |
| 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, |
| 153 | enum nulldrv_gpu_engine_type engine, |
| 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 | |
| 214 | static XGL_RESULT nulldrv_desc_pool_create(struct nulldrv_dev *dev, |
| 215 | struct nulldrv_desc_pool **pool_ret) |
| 216 | { |
| 217 | const uint32_t surface_count = 1; |
| 218 | const uint32_t sampler_count = 1; |
| 219 | struct nulldrv_desc_pool *pool; |
| 220 | |
| 221 | pool = malloc(sizeof(*pool)); |
| 222 | if (!pool) |
| 223 | return XGL_ERROR_OUT_OF_MEMORY; |
| 224 | |
| 225 | memset(pool, 0, sizeof(*pool)); |
| 226 | |
| 227 | pool->surface_desc_size = 0; |
| 228 | pool->sampler_desc_size = 0; |
| 229 | |
| 230 | *pool_ret = pool; |
| 231 | |
| 232 | return XGL_SUCCESS; |
| 233 | } |
| 234 | |
| 235 | static XGL_RESULT nulldrv_dev_create(struct nulldrv_gpu *gpu, |
| 236 | const XGL_DEVICE_CREATE_INFO *info, |
| 237 | struct nulldrv_dev **dev_ret) |
| 238 | { |
| 239 | struct nulldrv_dev *dev; |
| 240 | uint32_t i; |
| 241 | XGL_RESULT ret; |
| 242 | |
| 243 | dev = (struct nulldrv_dev *) nulldrv_base_create(NULL, sizeof(*dev), |
| 244 | XGL_DBG_OBJECT_DEVICE); |
| 245 | if (!dev) |
| 246 | return XGL_ERROR_OUT_OF_MEMORY; |
| 247 | |
| 248 | for (i = 0; i < info->extensionCount; i++) { |
| 249 | const enum nulldrv_ext_type ext = nulldrv_gpu_lookup_extension(gpu, |
| 250 | info->ppEnabledExtensionNames[i]); |
| 251 | |
| 252 | if (ext == NULLDRV_EXT_INVALID) |
| 253 | return XGL_ERROR_INVALID_EXTENSION; |
| 254 | |
| 255 | dev->exts[ext] = true; |
| 256 | } |
| 257 | |
| 258 | ret = nulldrv_desc_pool_create(dev, &dev->desc_pool); |
| 259 | if (ret != XGL_SUCCESS) { |
| 260 | return ret; |
| 261 | } |
| 262 | |
| 263 | ret = dev_create_queues(dev, info->pRequestedQueues, |
| 264 | info->queueRecordCount); |
| 265 | if (ret != XGL_SUCCESS) { |
| 266 | return ret; |
| 267 | } |
| 268 | |
| 269 | *dev_ret = dev; |
| 270 | |
| 271 | return XGL_SUCCESS; |
| 272 | } |
| 273 | |
| 274 | static struct nulldrv_gpu *nulldrv_gpu(XGL_PHYSICAL_GPU gpu) |
| 275 | { |
| 276 | return (struct nulldrv_gpu *) gpu; |
| 277 | } |
| 278 | |
| 279 | static XGL_RESULT nulldrv_rt_view_create(struct nulldrv_dev *dev, |
| 280 | const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO *info, |
| 281 | struct nulldrv_rt_view **view_ret) |
| 282 | { |
| 283 | struct nulldrv_rt_view *view; |
| 284 | |
| 285 | view = (struct nulldrv_rt_view *) nulldrv_base_create(dev, sizeof(*view), |
| 286 | XGL_DBG_OBJECT_COLOR_TARGET_VIEW); |
| 287 | if (!view) |
| 288 | return XGL_ERROR_OUT_OF_MEMORY; |
| 289 | |
| 290 | *view_ret = view; |
| 291 | |
| 292 | return XGL_SUCCESS; |
| 293 | } |
| 294 | |
| 295 | static XGL_RESULT nulldrv_fence_create(struct nulldrv_dev *dev, |
| 296 | const XGL_FENCE_CREATE_INFO *info, |
| 297 | struct nulldrv_fence **fence_ret) |
| 298 | { |
| 299 | struct nulldrv_fence *fence; |
| 300 | |
| 301 | fence = (struct nulldrv_fence *) nulldrv_base_create(dev, sizeof(*fence), |
| 302 | XGL_DBG_OBJECT_FENCE); |
| 303 | if (!fence) |
| 304 | return XGL_ERROR_OUT_OF_MEMORY; |
| 305 | |
| 306 | *fence_ret = fence; |
| 307 | |
| 308 | return XGL_SUCCESS; |
| 309 | } |
| 310 | |
| 311 | static struct nulldrv_dev *nulldrv_dev(XGL_DEVICE dev) |
| 312 | { |
| 313 | return (struct nulldrv_dev *) dev; |
| 314 | } |
| 315 | |
| 316 | static struct nulldrv_img *nulldrv_img_from_base(struct nulldrv_base *base) |
| 317 | { |
| 318 | return (struct nulldrv_img *) base; |
| 319 | } |
| 320 | |
| 321 | |
| 322 | static XGL_RESULT img_get_info(struct nulldrv_base *base, int type, |
| 323 | size_t *size, void *data) |
| 324 | { |
| 325 | struct nulldrv_img *img = nulldrv_img_from_base(base); |
| 326 | XGL_RESULT ret = XGL_SUCCESS; |
| 327 | |
| 328 | switch (type) { |
| 329 | case XGL_INFO_TYPE_MEMORY_REQUIREMENTS: |
| 330 | { |
| 331 | XGL_MEMORY_REQUIREMENTS *mem_req = data; |
| 332 | |
| 333 | *size = sizeof(XGL_MEMORY_REQUIREMENTS); |
| 334 | if (data == NULL) |
| 335 | return ret; |
| 336 | mem_req->size = img->total_size; |
| 337 | mem_req->alignment = 4096; |
| 338 | mem_req->memType = XGL_MEMORY_TYPE_IMAGE; |
| 339 | } |
| 340 | break; |
| 341 | case XGL_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS: |
| 342 | { |
| 343 | XGL_IMAGE_MEMORY_REQUIREMENTS *img_req = data; |
| 344 | |
| 345 | *size = sizeof(XGL_IMAGE_MEMORY_REQUIREMENTS); |
| 346 | if (data == NULL) |
| 347 | return ret; |
| 348 | img_req->usage = img->usage; |
| 349 | img_req->formatClass = img->format_class; |
| 350 | img_req->samples = img->samples; |
| 351 | } |
| 352 | break; |
| 353 | case XGL_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS: |
| 354 | { |
| 355 | XGL_BUFFER_MEMORY_REQUIREMENTS *buf_req = data; |
| 356 | |
Ian Elliott | a8f1f94 | 2015-02-19 14:04:56 -0700 | [diff] [blame] | 357 | *size = sizeof(XGL_BUFFER_MEMORY_REQUIREMENTS); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 358 | if (data == NULL) |
| 359 | return ret; |
| 360 | buf_req->usage = img->usage; |
| 361 | } |
| 362 | break; |
| 363 | default: |
| 364 | ret = nulldrv_base_get_info(base, type, size, data); |
| 365 | break; |
| 366 | } |
| 367 | |
| 368 | return ret; |
| 369 | } |
| 370 | |
| 371 | static XGL_RESULT nulldrv_img_create(struct nulldrv_dev *dev, |
| 372 | const XGL_IMAGE_CREATE_INFO *info, |
| 373 | bool scanout, |
| 374 | struct nulldrv_img **img_ret) |
| 375 | { |
| 376 | struct nulldrv_img *img; |
| 377 | |
| 378 | img = (struct nulldrv_img *) nulldrv_base_create(dev, sizeof(*img), |
| 379 | XGL_DBG_OBJECT_IMAGE); |
| 380 | if (!img) |
| 381 | return XGL_ERROR_OUT_OF_MEMORY; |
| 382 | |
| 383 | img->type = info->imageType; |
| 384 | img->depth = info->extent.depth; |
| 385 | img->mip_levels = info->mipLevels; |
| 386 | img->array_size = info->arraySize; |
| 387 | img->usage = info->usage; |
| 388 | if (info->tiling == XGL_LINEAR_TILING) |
| 389 | img->format_class = XGL_IMAGE_FORMAT_CLASS_LINEAR; |
| 390 | else |
| 391 | img->format_class = icd_format_get_class(info->format); |
| 392 | img->samples = info->samples; |
| 393 | |
| 394 | img->obj.base.get_info = img_get_info; |
| 395 | |
| 396 | *img_ret = img; |
| 397 | |
| 398 | return XGL_SUCCESS; |
| 399 | } |
| 400 | |
| 401 | static struct nulldrv_img *nulldrv_img(XGL_IMAGE image) |
| 402 | { |
| 403 | return (struct nulldrv_img *) image; |
| 404 | } |
| 405 | |
| 406 | static XGL_RESULT nulldrv_mem_alloc(struct nulldrv_dev *dev, |
| 407 | const XGL_MEMORY_ALLOC_INFO *info, |
| 408 | struct nulldrv_mem **mem_ret) |
| 409 | { |
| 410 | struct nulldrv_mem *mem; |
| 411 | |
| 412 | mem = (struct nulldrv_mem *) nulldrv_base_create(dev, sizeof(*mem), |
| 413 | XGL_DBG_OBJECT_GPU_MEMORY); |
| 414 | if (!mem) |
| 415 | return XGL_ERROR_OUT_OF_MEMORY; |
| 416 | |
| 417 | mem->bo = _aligned_malloc(info->allocationSize, 4096); |
| 418 | if (!mem->bo) { |
| 419 | return XGL_ERROR_OUT_OF_MEMORY; |
| 420 | } |
| 421 | |
| 422 | mem->size = info->allocationSize; |
| 423 | |
| 424 | *mem_ret = mem; |
| 425 | |
| 426 | return XGL_SUCCESS; |
| 427 | } |
| 428 | |
| 429 | static XGL_RESULT nulldrv_ds_view_create(struct nulldrv_dev *dev, |
| 430 | const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO *info, |
| 431 | struct nulldrv_ds_view **view_ret) |
| 432 | { |
| 433 | struct nulldrv_img *img = nulldrv_img(info->image); |
| 434 | struct nulldrv_ds_view *view; |
| 435 | |
| 436 | view = (struct nulldrv_ds_view *) nulldrv_base_create(dev, sizeof(*view), |
| 437 | XGL_DBG_OBJECT_DEPTH_STENCIL_VIEW); |
| 438 | if (!view) |
| 439 | return XGL_ERROR_OUT_OF_MEMORY; |
| 440 | |
| 441 | view->img = img; |
| 442 | |
| 443 | view->array_size = info->arraySize; |
| 444 | |
| 445 | *view_ret = view; |
| 446 | |
| 447 | return XGL_SUCCESS; |
| 448 | } |
| 449 | |
| 450 | static XGL_RESULT nulldrv_sampler_create(struct nulldrv_dev *dev, |
| 451 | const XGL_SAMPLER_CREATE_INFO *info, |
| 452 | struct nulldrv_sampler **sampler_ret) |
| 453 | { |
| 454 | struct nulldrv_sampler *sampler; |
| 455 | |
| 456 | sampler = (struct nulldrv_sampler *) nulldrv_base_create(dev, |
| 457 | sizeof(*sampler), XGL_DBG_OBJECT_SAMPLER); |
| 458 | if (!sampler) |
| 459 | return XGL_ERROR_OUT_OF_MEMORY; |
| 460 | |
| 461 | *sampler_ret = sampler; |
| 462 | |
| 463 | return XGL_SUCCESS; |
| 464 | } |
| 465 | |
| 466 | static XGL_RESULT nulldrv_img_view_create(struct nulldrv_dev *dev, |
| 467 | const XGL_IMAGE_VIEW_CREATE_INFO *info, |
| 468 | struct nulldrv_img_view **view_ret) |
| 469 | { |
| 470 | struct nulldrv_img *img = nulldrv_img(info->image); |
| 471 | struct nulldrv_img_view *view; |
| 472 | uint32_t mip_levels, array_size; |
| 473 | XGL_CHANNEL_MAPPING state_swizzles; |
| 474 | |
| 475 | mip_levels = info->subresourceRange.mipLevels; |
| 476 | |
| 477 | array_size = info->subresourceRange.arraySize; |
| 478 | |
| 479 | view = (struct nulldrv_img_view *) nulldrv_base_create(dev, sizeof(*view), |
| 480 | XGL_DBG_OBJECT_IMAGE_VIEW); |
| 481 | if (!view) |
| 482 | return XGL_ERROR_OUT_OF_MEMORY; |
| 483 | |
| 484 | view->img = img; |
| 485 | view->min_lod = info->minLod; |
| 486 | |
| 487 | state_swizzles = info->channels; |
| 488 | |
| 489 | view->cmd_len = 8; |
| 490 | |
| 491 | *view_ret = view; |
| 492 | |
| 493 | return XGL_SUCCESS; |
| 494 | } |
| 495 | |
| 496 | static void *nulldrv_mem_map(struct nulldrv_mem *mem, XGL_FLAGS flags) |
| 497 | { |
| 498 | return mem->bo; |
| 499 | } |
| 500 | |
| 501 | static struct nulldrv_mem *nulldrv_mem(XGL_GPU_MEMORY mem) |
| 502 | { |
| 503 | return (struct nulldrv_mem *) mem; |
| 504 | } |
| 505 | |
| 506 | static struct nulldrv_buf *nulldrv_buf_from_base(struct nulldrv_base *base) |
| 507 | { |
| 508 | return (struct nulldrv_buf *) base; |
| 509 | } |
| 510 | |
| 511 | static XGL_RESULT buf_get_info(struct nulldrv_base *base, int type, |
| 512 | size_t *size, void *data) |
| 513 | { |
| 514 | struct nulldrv_buf *buf = nulldrv_buf_from_base(base); |
| 515 | XGL_RESULT ret = XGL_SUCCESS; |
| 516 | |
| 517 | switch (type) { |
| 518 | case XGL_INFO_TYPE_MEMORY_REQUIREMENTS: |
| 519 | { |
| 520 | XGL_MEMORY_REQUIREMENTS *mem_req = data; |
| 521 | |
| 522 | *size = sizeof(XGL_MEMORY_REQUIREMENTS); |
| 523 | if (data == NULL) |
| 524 | return ret; |
| 525 | |
| 526 | mem_req->size = buf->size; |
| 527 | mem_req->alignment = 4096; |
| 528 | mem_req->memType = XGL_MEMORY_TYPE_BUFFER; |
| 529 | |
| 530 | } |
| 531 | break; |
| 532 | case XGL_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS: |
| 533 | { |
| 534 | XGL_BUFFER_MEMORY_REQUIREMENTS *buf_req = data; |
| 535 | |
| 536 | *size = sizeof(XGL_BUFFER_MEMORY_REQUIREMENTS); |
| 537 | if (data == NULL) |
| 538 | return ret; |
| 539 | buf_req->usage = buf->usage; |
| 540 | } |
| 541 | break; |
| 542 | default: |
| 543 | ret = nulldrv_base_get_info(base, type, size, data); |
| 544 | break; |
| 545 | } |
| 546 | |
| 547 | return ret; |
| 548 | } |
| 549 | |
| 550 | static XGL_RESULT nulldrv_buf_create(struct nulldrv_dev *dev, |
| 551 | const XGL_BUFFER_CREATE_INFO *info, |
| 552 | struct nulldrv_buf **buf_ret) |
| 553 | { |
| 554 | struct nulldrv_buf *buf; |
| 555 | |
| 556 | buf = (struct nulldrv_buf *) nulldrv_base_create(dev, sizeof(*buf), |
| 557 | XGL_DBG_OBJECT_BUFFER); |
| 558 | if (!buf) |
| 559 | return XGL_ERROR_OUT_OF_MEMORY; |
| 560 | |
| 561 | buf->size = info->size; |
| 562 | buf->usage = info->usage; |
| 563 | |
| 564 | buf->obj.base.get_info = buf_get_info; |
| 565 | |
| 566 | *buf_ret = buf; |
| 567 | |
| 568 | return XGL_SUCCESS; |
| 569 | } |
| 570 | |
| 571 | static XGL_RESULT nulldrv_desc_layout_create(struct nulldrv_dev *dev, |
| 572 | XGL_FLAGS stage_flags, |
| 573 | const uint32_t *bind_points, |
| 574 | const struct nulldrv_desc_layout *prior_layout, |
| 575 | const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO *info, |
| 576 | struct nulldrv_desc_layout **layout_ret) |
| 577 | { |
| 578 | struct nulldrv_desc_layout *layout; |
| 579 | |
| 580 | layout = (struct nulldrv_desc_layout *) |
| 581 | nulldrv_base_create(dev, sizeof(*layout), |
| 582 | XGL_DBG_OBJECT_DESCRIPTOR_SET_LAYOUT); |
| 583 | if (!layout) |
| 584 | return XGL_ERROR_OUT_OF_MEMORY; |
| 585 | |
| 586 | *layout_ret = layout; |
| 587 | |
| 588 | return XGL_SUCCESS; |
| 589 | } |
| 590 | |
| 591 | static struct nulldrv_desc_layout *nulldrv_desc_layout(XGL_DESCRIPTOR_SET_LAYOUT layout) |
| 592 | { |
| 593 | return (struct nulldrv_desc_layout *) layout; |
| 594 | } |
| 595 | |
| 596 | static XGL_RESULT shader_create(struct nulldrv_dev *dev, |
| 597 | const XGL_SHADER_CREATE_INFO *info, |
| 598 | struct nulldrv_shader **sh_ret) |
| 599 | { |
| 600 | const struct icd_bil_header *bil = |
| 601 | (const struct icd_bil_header *) info->pCode; |
| 602 | struct nulldrv_shader *sh; |
| 603 | |
| 604 | sh = (struct nulldrv_shader *) nulldrv_base_create(dev, sizeof(*sh), |
| 605 | XGL_DBG_OBJECT_SHADER); |
| 606 | if (!sh) |
| 607 | return XGL_ERROR_OUT_OF_MEMORY; |
| 608 | |
| 609 | *sh_ret = sh; |
| 610 | |
| 611 | return XGL_SUCCESS; |
| 612 | } |
| 613 | |
| 614 | static XGL_RESULT graphics_pipeline_create(struct nulldrv_dev *dev, |
| 615 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO *info_, |
| 616 | struct nulldrv_pipeline **pipeline_ret) |
| 617 | { |
| 618 | struct nulldrv_pipeline *pipeline; |
| 619 | |
| 620 | pipeline = (struct nulldrv_pipeline *) |
| 621 | nulldrv_base_create(dev, sizeof(*pipeline), |
| 622 | XGL_DBG_OBJECT_GRAPHICS_PIPELINE); |
| 623 | if (!pipeline) |
| 624 | return XGL_ERROR_OUT_OF_MEMORY; |
| 625 | |
| 626 | *pipeline_ret = pipeline; |
| 627 | |
| 628 | return XGL_SUCCESS; |
| 629 | } |
| 630 | |
| 631 | static XGL_RESULT nulldrv_viewport_state_create(struct nulldrv_dev *dev, |
| 632 | const XGL_DYNAMIC_VP_STATE_CREATE_INFO *info, |
| 633 | struct nulldrv_dynamic_vp **state_ret) |
| 634 | { |
| 635 | struct nulldrv_dynamic_vp *state; |
| 636 | |
| 637 | state = (struct nulldrv_dynamic_vp *) nulldrv_base_create(dev, |
| 638 | sizeof(*state), XGL_DBG_OBJECT_VIEWPORT_STATE); |
| 639 | if (!state) |
| 640 | return XGL_ERROR_OUT_OF_MEMORY; |
| 641 | |
| 642 | *state_ret = state; |
| 643 | |
| 644 | return XGL_SUCCESS; |
| 645 | } |
| 646 | |
| 647 | static XGL_RESULT nulldrv_raster_state_create(struct nulldrv_dev *dev, |
| 648 | const XGL_DYNAMIC_RS_STATE_CREATE_INFO *info, |
| 649 | struct nulldrv_dynamic_rs **state_ret) |
| 650 | { |
| 651 | struct nulldrv_dynamic_rs *state; |
| 652 | |
| 653 | state = (struct nulldrv_dynamic_rs *) nulldrv_base_create(dev, |
| 654 | sizeof(*state), XGL_DBG_OBJECT_RASTER_STATE); |
| 655 | if (!state) |
| 656 | return XGL_ERROR_OUT_OF_MEMORY; |
| 657 | |
| 658 | *state_ret = state; |
| 659 | |
| 660 | return XGL_SUCCESS; |
| 661 | } |
| 662 | |
| 663 | static XGL_RESULT nulldrv_blend_state_create(struct nulldrv_dev *dev, |
| 664 | const XGL_DYNAMIC_CB_STATE_CREATE_INFO *info, |
| 665 | struct nulldrv_dynamic_cb **state_ret) |
| 666 | { |
| 667 | struct nulldrv_dynamic_cb *state; |
| 668 | |
| 669 | state = (struct nulldrv_dynamic_cb *) nulldrv_base_create(dev, |
| 670 | sizeof(*state), XGL_DBG_OBJECT_COLOR_BLEND_STATE); |
| 671 | if (!state) |
| 672 | return XGL_ERROR_OUT_OF_MEMORY; |
| 673 | |
| 674 | *state_ret = state; |
| 675 | |
| 676 | return XGL_SUCCESS; |
| 677 | } |
| 678 | |
| 679 | static XGL_RESULT nulldrv_ds_state_create(struct nulldrv_dev *dev, |
| 680 | const XGL_DYNAMIC_DS_STATE_CREATE_INFO *info, |
| 681 | struct nulldrv_dynamic_ds **state_ret) |
| 682 | { |
| 683 | struct nulldrv_dynamic_ds *state; |
| 684 | |
| 685 | state = (struct nulldrv_dynamic_ds *) nulldrv_base_create(dev, |
| 686 | sizeof(*state), XGL_DBG_OBJECT_DEPTH_STENCIL_STATE); |
| 687 | if (!state) |
| 688 | return XGL_ERROR_OUT_OF_MEMORY; |
| 689 | |
| 690 | *state_ret = state; |
| 691 | |
| 692 | return XGL_SUCCESS; |
| 693 | } |
| 694 | |
| 695 | |
| 696 | static XGL_RESULT nulldrv_cmd_create(struct nulldrv_dev *dev, |
| 697 | const XGL_CMD_BUFFER_CREATE_INFO *info, |
| 698 | struct nulldrv_cmd **cmd_ret) |
| 699 | { |
| 700 | int pipeline_select; |
| 701 | struct nulldrv_cmd *cmd; |
| 702 | |
| 703 | pipeline_select = 0; |
| 704 | |
| 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 | |
| 715 | static XGL_RESULT nulldrv_desc_region_create(struct nulldrv_dev *dev, |
| 716 | XGL_DESCRIPTOR_REGION_USAGE usage, |
| 717 | uint32_t max_sets, |
| 718 | const XGL_DESCRIPTOR_REGION_CREATE_INFO *info, |
| 719 | struct nulldrv_desc_region **region_ret) |
| 720 | { |
| 721 | struct nulldrv_desc_region *region; |
| 722 | |
| 723 | region = (struct nulldrv_desc_region *) |
| 724 | nulldrv_base_create(dev, sizeof(*region), |
| 725 | XGL_DBG_OBJECT_DESCRIPTOR_REGION); |
| 726 | if (!region) |
| 727 | return XGL_ERROR_OUT_OF_MEMORY; |
| 728 | |
| 729 | region->dev = dev; |
| 730 | |
| 731 | *region_ret = region; |
| 732 | |
| 733 | return XGL_SUCCESS; |
| 734 | } |
| 735 | |
| 736 | static XGL_RESULT nulldrv_desc_set_create(struct nulldrv_dev *dev, |
| 737 | struct nulldrv_desc_region *region, |
| 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 | |
| 750 | set->pool = dev->desc_pool; |
| 751 | set->layout = layout; |
| 752 | *set_ret = set; |
| 753 | |
| 754 | return XGL_SUCCESS; |
| 755 | } |
| 756 | |
| 757 | static struct nulldrv_desc_region *nulldrv_desc_region(XGL_DESCRIPTOR_REGION region) |
| 758 | { |
| 759 | return (struct nulldrv_desc_region *) region; |
| 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, |
| 926 | XGL_IMAGE destImage, |
| 927 | uint32_t regionCount, |
| 928 | const XGL_IMAGE_COPY* pRegions) |
| 929 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 930 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 931 | } |
| 932 | |
| 933 | ICD_EXPORT void XGLAPI xglCmdCopyBufferToImage( |
| 934 | XGL_CMD_BUFFER cmdBuffer, |
| 935 | XGL_BUFFER srcBuffer, |
| 936 | XGL_IMAGE destImage, |
| 937 | uint32_t regionCount, |
| 938 | const XGL_BUFFER_IMAGE_COPY* pRegions) |
| 939 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 940 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 941 | } |
| 942 | |
| 943 | ICD_EXPORT void XGLAPI xglCmdCopyImageToBuffer( |
| 944 | XGL_CMD_BUFFER cmdBuffer, |
| 945 | XGL_IMAGE srcImage, |
| 946 | XGL_BUFFER destBuffer, |
| 947 | uint32_t regionCount, |
| 948 | const XGL_BUFFER_IMAGE_COPY* pRegions) |
| 949 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 950 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 951 | } |
| 952 | |
| 953 | ICD_EXPORT void XGLAPI xglCmdCloneImageData( |
| 954 | XGL_CMD_BUFFER cmdBuffer, |
| 955 | XGL_IMAGE srcImage, |
| 956 | XGL_IMAGE_LAYOUT srcImageLayout, |
| 957 | XGL_IMAGE destImage, |
| 958 | XGL_IMAGE_LAYOUT destImageLayout) |
| 959 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 960 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 961 | } |
| 962 | |
| 963 | ICD_EXPORT void XGLAPI xglCmdUpdateBuffer( |
| 964 | XGL_CMD_BUFFER cmdBuffer, |
| 965 | XGL_BUFFER destBuffer, |
| 966 | XGL_GPU_SIZE destOffset, |
| 967 | XGL_GPU_SIZE dataSize, |
| 968 | const uint32_t* pData) |
| 969 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 970 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 971 | } |
| 972 | |
| 973 | ICD_EXPORT void XGLAPI xglCmdFillBuffer( |
| 974 | XGL_CMD_BUFFER cmdBuffer, |
| 975 | XGL_BUFFER destBuffer, |
| 976 | XGL_GPU_SIZE destOffset, |
| 977 | XGL_GPU_SIZE fillSize, |
| 978 | uint32_t data) |
| 979 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 980 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 981 | } |
| 982 | |
| 983 | ICD_EXPORT void XGLAPI xglCmdClearColorImage( |
| 984 | XGL_CMD_BUFFER cmdBuffer, |
| 985 | XGL_IMAGE image, |
| 986 | const float color[4], |
| 987 | uint32_t rangeCount, |
| 988 | const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 989 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 990 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 991 | } |
| 992 | |
| 993 | ICD_EXPORT void XGLAPI xglCmdClearColorImageRaw( |
| 994 | XGL_CMD_BUFFER cmdBuffer, |
| 995 | XGL_IMAGE image, |
| 996 | const uint32_t color[4], |
| 997 | uint32_t rangeCount, |
| 998 | const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 999 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1000 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1001 | } |
| 1002 | |
| 1003 | ICD_EXPORT void XGLAPI xglCmdClearDepthStencil( |
| 1004 | XGL_CMD_BUFFER cmdBuffer, |
| 1005 | XGL_IMAGE image, |
| 1006 | float depth, |
| 1007 | uint32_t stencil, |
| 1008 | uint32_t rangeCount, |
| 1009 | const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 1010 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1011 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1012 | } |
| 1013 | |
| 1014 | ICD_EXPORT void XGLAPI xglCmdResolveImage( |
| 1015 | XGL_CMD_BUFFER cmdBuffer, |
| 1016 | XGL_IMAGE srcImage, |
| 1017 | XGL_IMAGE destImage, |
| 1018 | uint32_t rectCount, |
| 1019 | const XGL_IMAGE_RESOLVE* pRects) |
| 1020 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1021 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1022 | } |
| 1023 | |
| 1024 | ICD_EXPORT void XGLAPI xglCmdBeginQuery( |
| 1025 | XGL_CMD_BUFFER cmdBuffer, |
| 1026 | XGL_QUERY_POOL queryPool, |
| 1027 | uint32_t slot, |
| 1028 | XGL_FLAGS flags) |
| 1029 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1030 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1031 | } |
| 1032 | |
| 1033 | ICD_EXPORT void XGLAPI xglCmdEndQuery( |
| 1034 | XGL_CMD_BUFFER cmdBuffer, |
| 1035 | XGL_QUERY_POOL queryPool, |
| 1036 | uint32_t slot) |
| 1037 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1038 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1039 | } |
| 1040 | |
| 1041 | ICD_EXPORT void XGLAPI xglCmdResetQueryPool( |
| 1042 | XGL_CMD_BUFFER cmdBuffer, |
| 1043 | XGL_QUERY_POOL queryPool, |
| 1044 | uint32_t startQuery, |
| 1045 | uint32_t queryCount) |
| 1046 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1047 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1048 | } |
| 1049 | |
| 1050 | ICD_EXPORT void XGLAPI xglCmdSetEvent( |
| 1051 | XGL_CMD_BUFFER cmdBuffer, |
| 1052 | XGL_EVENT event_, |
| 1053 | XGL_SET_EVENT pipeEvent) |
| 1054 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1055 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1056 | } |
| 1057 | |
| 1058 | ICD_EXPORT void XGLAPI xglCmdResetEvent( |
| 1059 | XGL_CMD_BUFFER cmdBuffer, |
| 1060 | XGL_EVENT event_) |
| 1061 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1062 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1063 | } |
| 1064 | |
| 1065 | ICD_EXPORT void XGLAPI xglCmdWriteTimestamp( |
| 1066 | XGL_CMD_BUFFER cmdBuffer, |
| 1067 | XGL_TIMESTAMP_TYPE timestampType, |
| 1068 | XGL_BUFFER destBuffer, |
| 1069 | XGL_GPU_SIZE destOffset) |
| 1070 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1071 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1072 | } |
| 1073 | |
| 1074 | ICD_EXPORT void XGLAPI xglCmdBindPipeline( |
| 1075 | XGL_CMD_BUFFER cmdBuffer, |
| 1076 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 1077 | XGL_PIPELINE pipeline) |
| 1078 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1079 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1080 | } |
| 1081 | |
| 1082 | ICD_EXPORT void XGLAPI xglCmdBindPipelineDelta( |
| 1083 | XGL_CMD_BUFFER cmdBuffer, |
| 1084 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 1085 | XGL_PIPELINE_DELTA delta) |
| 1086 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1087 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1088 | } |
| 1089 | |
| 1090 | ICD_EXPORT void XGLAPI xglCmdBindDynamicStateObject( |
| 1091 | XGL_CMD_BUFFER cmdBuffer, |
| 1092 | XGL_STATE_BIND_POINT stateBindPoint, |
| 1093 | XGL_DYNAMIC_STATE_OBJECT state) |
| 1094 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1095 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1096 | } |
| 1097 | |
| 1098 | ICD_EXPORT void XGLAPI xglCmdBindDescriptorSet( |
| 1099 | XGL_CMD_BUFFER cmdBuffer, |
| 1100 | XGL_PIPELINE_BIND_POINT pipelineBindPoint, |
| 1101 | XGL_DESCRIPTOR_SET descriptorSet, |
| 1102 | const uint32_t* pUserData) |
| 1103 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1104 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1105 | } |
| 1106 | |
| 1107 | ICD_EXPORT void XGLAPI xglCmdBindVertexBuffer( |
| 1108 | XGL_CMD_BUFFER cmdBuffer, |
| 1109 | XGL_BUFFER buffer, |
| 1110 | XGL_GPU_SIZE offset, |
| 1111 | uint32_t binding) |
| 1112 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1113 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1114 | } |
| 1115 | |
| 1116 | ICD_EXPORT void XGLAPI xglCmdBindIndexBuffer( |
| 1117 | XGL_CMD_BUFFER cmdBuffer, |
| 1118 | XGL_BUFFER buffer, |
| 1119 | XGL_GPU_SIZE offset, |
| 1120 | XGL_INDEX_TYPE indexType) |
| 1121 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1122 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1123 | } |
| 1124 | |
| 1125 | ICD_EXPORT void XGLAPI xglCmdDraw( |
| 1126 | XGL_CMD_BUFFER cmdBuffer, |
| 1127 | uint32_t firstVertex, |
| 1128 | uint32_t vertexCount, |
| 1129 | uint32_t firstInstance, |
| 1130 | uint32_t instanceCount) |
| 1131 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1132 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1133 | } |
| 1134 | |
| 1135 | ICD_EXPORT void XGLAPI xglCmdDrawIndexed( |
| 1136 | XGL_CMD_BUFFER cmdBuffer, |
| 1137 | uint32_t firstIndex, |
| 1138 | uint32_t indexCount, |
| 1139 | int32_t vertexOffset, |
| 1140 | uint32_t firstInstance, |
| 1141 | uint32_t instanceCount) |
| 1142 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1143 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1144 | } |
| 1145 | |
| 1146 | ICD_EXPORT void XGLAPI xglCmdDrawIndirect( |
| 1147 | XGL_CMD_BUFFER cmdBuffer, |
| 1148 | XGL_BUFFER buffer, |
| 1149 | XGL_GPU_SIZE offset, |
| 1150 | uint32_t count, |
| 1151 | uint32_t stride) |
| 1152 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1153 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1154 | } |
| 1155 | |
| 1156 | ICD_EXPORT void XGLAPI xglCmdDrawIndexedIndirect( |
| 1157 | XGL_CMD_BUFFER cmdBuffer, |
| 1158 | XGL_BUFFER buffer, |
| 1159 | XGL_GPU_SIZE offset, |
| 1160 | uint32_t count, |
| 1161 | uint32_t stride) |
| 1162 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1163 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1164 | } |
| 1165 | |
| 1166 | ICD_EXPORT void XGLAPI xglCmdDispatch( |
| 1167 | XGL_CMD_BUFFER cmdBuffer, |
| 1168 | uint32_t x, |
| 1169 | uint32_t y, |
| 1170 | uint32_t z) |
| 1171 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1172 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1173 | } |
| 1174 | |
| 1175 | ICD_EXPORT void XGLAPI xglCmdDispatchIndirect( |
| 1176 | XGL_CMD_BUFFER cmdBuffer, |
| 1177 | XGL_BUFFER buffer, |
| 1178 | XGL_GPU_SIZE offset) |
| 1179 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1180 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1181 | } |
| 1182 | |
| 1183 | ICD_EXPORT void XGLAPI xglCmdWaitEvents( |
| 1184 | XGL_CMD_BUFFER cmdBuffer, |
| 1185 | const XGL_EVENT_WAIT_INFO* pWaitInfo) |
| 1186 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1187 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1188 | } |
| 1189 | |
| 1190 | ICD_EXPORT void XGLAPI xglCmdPipelineBarrier( |
| 1191 | XGL_CMD_BUFFER cmdBuffer, |
| 1192 | const XGL_PIPELINE_BARRIER* pBarrier) |
| 1193 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1194 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1195 | } |
| 1196 | |
| 1197 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDevice( |
| 1198 | XGL_PHYSICAL_GPU gpu_, |
| 1199 | const XGL_DEVICE_CREATE_INFO* pCreateInfo, |
| 1200 | XGL_DEVICE* pDevice) |
| 1201 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1202 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1203 | struct nulldrv_gpu *gpu = nulldrv_gpu(gpu_); |
| 1204 | return nulldrv_dev_create(gpu, pCreateInfo, (struct nulldrv_dev**)pDevice); |
| 1205 | } |
| 1206 | |
| 1207 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyDevice( |
| 1208 | XGL_DEVICE device) |
| 1209 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1210 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1211 | return XGL_SUCCESS; |
| 1212 | } |
| 1213 | |
| 1214 | ICD_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue( |
| 1215 | XGL_DEVICE device, |
| 1216 | XGL_QUEUE_TYPE queueType, |
| 1217 | uint32_t queueIndex, |
| 1218 | XGL_QUEUE* pQueue) |
| 1219 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1220 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1221 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1222 | *pQueue = dev->queues[0]; |
| 1223 | return XGL_SUCCESS; |
| 1224 | } |
| 1225 | |
| 1226 | ICD_EXPORT XGL_RESULT XGLAPI xglDeviceWaitIdle( |
| 1227 | XGL_DEVICE device) |
| 1228 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1229 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1230 | return XGL_SUCCESS; |
| 1231 | } |
| 1232 | |
| 1233 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetValidationLevel( |
| 1234 | XGL_DEVICE device, |
| 1235 | XGL_VALIDATION_LEVEL validationLevel) |
| 1236 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1237 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1238 | return XGL_SUCCESS; |
| 1239 | } |
| 1240 | |
| 1241 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetMessageFilter( |
| 1242 | XGL_DEVICE device, |
| 1243 | int32_t msgCode, |
| 1244 | XGL_DBG_MSG_FILTER filter) |
| 1245 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1246 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1247 | return XGL_SUCCESS; |
| 1248 | } |
| 1249 | |
| 1250 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgSetDeviceOption( |
| 1251 | XGL_DEVICE device, |
| 1252 | XGL_DBG_DEVICE_OPTION dbgOption, |
| 1253 | size_t dataSize, |
| 1254 | const void* pData) |
| 1255 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1256 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1257 | return XGL_SUCCESS; |
| 1258 | } |
| 1259 | |
| 1260 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateEvent( |
| 1261 | XGL_DEVICE device, |
| 1262 | const XGL_EVENT_CREATE_INFO* pCreateInfo, |
| 1263 | XGL_EVENT* pEvent) |
| 1264 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1265 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1266 | return XGL_SUCCESS; |
| 1267 | } |
| 1268 | |
| 1269 | ICD_EXPORT XGL_RESULT XGLAPI xglGetEventStatus( |
| 1270 | XGL_EVENT event_) |
| 1271 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1272 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1273 | return XGL_SUCCESS; |
| 1274 | } |
| 1275 | |
| 1276 | ICD_EXPORT XGL_RESULT XGLAPI xglSetEvent( |
| 1277 | XGL_EVENT event_) |
| 1278 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1279 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1280 | return XGL_SUCCESS; |
| 1281 | } |
| 1282 | |
| 1283 | ICD_EXPORT XGL_RESULT XGLAPI xglResetEvent( |
| 1284 | XGL_EVENT event_) |
| 1285 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1286 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1287 | return XGL_SUCCESS; |
| 1288 | } |
| 1289 | |
| 1290 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateFence( |
| 1291 | XGL_DEVICE device, |
| 1292 | const XGL_FENCE_CREATE_INFO* pCreateInfo, |
| 1293 | XGL_FENCE* pFence) |
| 1294 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1295 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1296 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1297 | |
| 1298 | return nulldrv_fence_create(dev, pCreateInfo, |
| 1299 | (struct nulldrv_fence **) pFence); |
| 1300 | } |
| 1301 | |
| 1302 | ICD_EXPORT XGL_RESULT XGLAPI xglGetFenceStatus( |
| 1303 | XGL_FENCE fence_) |
| 1304 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1305 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1306 | return XGL_SUCCESS; |
| 1307 | } |
| 1308 | |
| 1309 | ICD_EXPORT XGL_RESULT XGLAPI xglWaitForFences( |
| 1310 | XGL_DEVICE device, |
| 1311 | uint32_t fenceCount, |
| 1312 | const XGL_FENCE* pFences, |
| 1313 | bool32_t waitAll, |
| 1314 | uint64_t timeout) |
| 1315 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1316 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1317 | return XGL_SUCCESS; |
| 1318 | } |
| 1319 | |
| 1320 | ICD_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo( |
| 1321 | XGL_DEVICE device, |
| 1322 | XGL_FORMAT format, |
| 1323 | XGL_FORMAT_INFO_TYPE infoType, |
| 1324 | size_t* pDataSize, |
| 1325 | void* pData) |
| 1326 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1327 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1328 | return XGL_SUCCESS; |
| 1329 | } |
| 1330 | |
| 1331 | ICD_EXPORT XGL_RESULT XGLAPI xglGetGpuInfo( |
| 1332 | XGL_PHYSICAL_GPU gpu_, |
| 1333 | XGL_PHYSICAL_GPU_INFO_TYPE infoType, |
| 1334 | size_t* pDataSize, |
| 1335 | void* pData) |
| 1336 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1337 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1338 | return XGL_SUCCESS; |
| 1339 | } |
| 1340 | |
| 1341 | ICD_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport( |
| 1342 | XGL_PHYSICAL_GPU gpu_, |
| 1343 | const char* pExtName) |
| 1344 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1345 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1346 | return XGL_SUCCESS; |
| 1347 | } |
| 1348 | |
| 1349 | ICD_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility( |
| 1350 | XGL_PHYSICAL_GPU gpu0_, |
| 1351 | XGL_PHYSICAL_GPU gpu1_, |
| 1352 | XGL_GPU_COMPATIBILITY_INFO* pInfo) |
| 1353 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1354 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1355 | return XGL_SUCCESS; |
| 1356 | } |
| 1357 | |
| 1358 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenPeerImage( |
| 1359 | XGL_DEVICE device, |
| 1360 | const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, |
| 1361 | XGL_IMAGE* pImage, |
| 1362 | XGL_GPU_MEMORY* pMem) |
| 1363 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1364 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1365 | return XGL_SUCCESS; |
| 1366 | } |
| 1367 | |
| 1368 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateImage( |
| 1369 | XGL_DEVICE device, |
| 1370 | const XGL_IMAGE_CREATE_INFO* pCreateInfo, |
| 1371 | XGL_IMAGE* pImage) |
| 1372 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1373 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1374 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1375 | |
| 1376 | return nulldrv_img_create(dev, pCreateInfo, false, |
| 1377 | (struct nulldrv_img **) pImage); |
| 1378 | } |
| 1379 | |
| 1380 | ICD_EXPORT XGL_RESULT XGLAPI xglGetImageSubresourceInfo( |
| 1381 | XGL_IMAGE image, |
| 1382 | const XGL_IMAGE_SUBRESOURCE* pSubresource, |
| 1383 | XGL_SUBRESOURCE_INFO_TYPE infoType, |
| 1384 | size_t* pDataSize, |
| 1385 | void* pData) |
| 1386 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1387 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1388 | const struct nulldrv_img *img = nulldrv_img(image); |
| 1389 | XGL_RESULT ret = XGL_SUCCESS; |
| 1390 | |
| 1391 | switch (infoType) { |
| 1392 | case XGL_INFO_TYPE_SUBRESOURCE_LAYOUT: |
| 1393 | { |
| 1394 | XGL_SUBRESOURCE_LAYOUT *layout = (XGL_SUBRESOURCE_LAYOUT *) pData; |
| 1395 | |
| 1396 | *pDataSize = sizeof(XGL_SUBRESOURCE_LAYOUT); |
| 1397 | |
| 1398 | if (pData == NULL) |
| 1399 | return ret; |
| 1400 | layout->offset = 0; |
| 1401 | layout->size = 1; |
| 1402 | layout->rowPitch = 4; |
| 1403 | layout->depthPitch = 4; |
| 1404 | } |
| 1405 | break; |
| 1406 | default: |
| 1407 | ret = XGL_ERROR_INVALID_VALUE; |
| 1408 | break; |
| 1409 | } |
| 1410 | |
| 1411 | return ret; |
| 1412 | } |
| 1413 | |
| 1414 | ICD_EXPORT XGL_RESULT XGLAPI xglSetFastClearColor( |
| 1415 | XGL_IMAGE image, |
| 1416 | const float color[4]) |
| 1417 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1418 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1419 | return XGL_SUCCESS; |
| 1420 | } |
| 1421 | |
| 1422 | ICD_EXPORT XGL_RESULT XGLAPI xglSetFastClearDepth( |
| 1423 | XGL_IMAGE image, |
| 1424 | float depth) |
| 1425 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1426 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1427 | return XGL_SUCCESS; |
| 1428 | } |
| 1429 | |
| 1430 | ICD_EXPORT XGL_RESULT XGLAPI xglAllocMemory( |
| 1431 | XGL_DEVICE device, |
| 1432 | const XGL_MEMORY_ALLOC_INFO* pAllocInfo, |
| 1433 | XGL_GPU_MEMORY* pMem) |
| 1434 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1435 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1436 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1437 | |
| 1438 | return nulldrv_mem_alloc(dev, pAllocInfo, (struct nulldrv_mem **) pMem); |
| 1439 | } |
| 1440 | |
| 1441 | ICD_EXPORT XGL_RESULT XGLAPI xglFreeMemory( |
| 1442 | XGL_GPU_MEMORY mem_) |
| 1443 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1444 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1445 | return XGL_SUCCESS; |
| 1446 | } |
| 1447 | |
| 1448 | ICD_EXPORT XGL_RESULT XGLAPI xglSetMemoryPriority( |
| 1449 | XGL_GPU_MEMORY mem_, |
| 1450 | XGL_MEMORY_PRIORITY priority) |
| 1451 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1452 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1453 | return XGL_SUCCESS; |
| 1454 | } |
| 1455 | |
| 1456 | ICD_EXPORT XGL_RESULT XGLAPI xglMapMemory( |
| 1457 | XGL_GPU_MEMORY mem_, |
| 1458 | XGL_FLAGS flags, |
| 1459 | void** ppData) |
| 1460 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1461 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1462 | struct nulldrv_mem *mem = nulldrv_mem(mem_); |
| 1463 | void *ptr = nulldrv_mem_map(mem, flags); |
| 1464 | |
| 1465 | *ppData = ptr; |
| 1466 | |
| 1467 | return (ptr) ? XGL_SUCCESS : XGL_ERROR_UNKNOWN; |
| 1468 | } |
| 1469 | |
| 1470 | ICD_EXPORT XGL_RESULT XGLAPI xglUnmapMemory( |
| 1471 | XGL_GPU_MEMORY mem_) |
| 1472 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1473 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1474 | return XGL_SUCCESS; |
| 1475 | } |
| 1476 | |
| 1477 | ICD_EXPORT XGL_RESULT XGLAPI xglPinSystemMemory( |
| 1478 | XGL_DEVICE device, |
| 1479 | const void* pSysMem, |
| 1480 | size_t memSize, |
| 1481 | XGL_GPU_MEMORY* pMem) |
| 1482 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1483 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1484 | return XGL_SUCCESS; |
| 1485 | } |
| 1486 | |
| 1487 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenSharedMemory( |
| 1488 | XGL_DEVICE device, |
| 1489 | const XGL_MEMORY_OPEN_INFO* pOpenInfo, |
| 1490 | XGL_GPU_MEMORY* pMem) |
| 1491 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1492 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1493 | return XGL_SUCCESS; |
| 1494 | } |
| 1495 | |
| 1496 | ICD_EXPORT XGL_RESULT XGLAPI xglOpenPeerMemory( |
| 1497 | XGL_DEVICE device, |
| 1498 | const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, |
| 1499 | XGL_GPU_MEMORY* pMem) |
| 1500 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1501 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1502 | return XGL_SUCCESS; |
| 1503 | } |
| 1504 | |
| 1505 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateInstance( |
| 1506 | const XGL_APPLICATION_INFO* pAppInfo, |
| 1507 | const XGL_ALLOC_CALLBACKS* pAllocCb, |
| 1508 | XGL_INSTANCE* pInstance) |
| 1509 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1510 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1511 | struct nulldrv_instance *inst; |
| 1512 | |
| 1513 | inst = (struct nulldrv_instance *) nulldrv_base_create(NULL, sizeof(*inst), |
| 1514 | XGL_DBG_OBJECT_INSTANCE); |
| 1515 | if (!inst) |
| 1516 | return XGL_ERROR_OUT_OF_MEMORY; |
| 1517 | |
| 1518 | inst->obj.base.get_info = NULL; |
| 1519 | |
| 1520 | *pInstance = (XGL_INSTANCE*)inst; |
| 1521 | |
| 1522 | return icd_allocator_init(pAllocCb); |
| 1523 | } |
| 1524 | |
| 1525 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyInstance( |
| 1526 | XGL_INSTANCE pInstance) |
| 1527 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1528 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1529 | return XGL_SUCCESS; |
| 1530 | } |
| 1531 | |
| 1532 | ICD_EXPORT XGL_RESULT XGLAPI xglEnumerateGpus( |
| 1533 | XGL_INSTANCE instance, |
| 1534 | uint32_t maxGpus, |
| 1535 | uint32_t* pGpuCount, |
| 1536 | XGL_PHYSICAL_GPU* pGpus) |
| 1537 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1538 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1539 | XGL_RESULT ret; |
| 1540 | struct nulldrv_gpu *gpu; |
| 1541 | *pGpuCount = 1; |
| 1542 | ret = nulldrv_gpu_add(0, 0, 0, &gpu); |
| 1543 | if (ret == XGL_SUCCESS) |
| 1544 | pGpus[0] = (XGL_PHYSICAL_GPU) gpu; |
| 1545 | return ret; |
| 1546 | } |
| 1547 | |
| 1548 | ICD_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers( |
| 1549 | XGL_PHYSICAL_GPU gpu, |
| 1550 | size_t maxLayerCount, |
| 1551 | size_t maxStringSize, |
| 1552 | size_t* pOutLayerCount, |
| 1553 | char* const* pOutLayers, |
| 1554 | void* pReserved) |
| 1555 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1556 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1557 | return XGL_SUCCESS; |
| 1558 | } |
| 1559 | |
| 1560 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgRegisterMsgCallback( |
| 1561 | XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, |
| 1562 | void* pUserData) |
| 1563 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1564 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1565 | return XGL_SUCCESS; |
| 1566 | } |
| 1567 | |
| 1568 | ICD_EXPORT XGL_RESULT XGLAPI xglDbgUnregisterMsgCallback( |
| 1569 | XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback) |
| 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 xglDbgSetGlobalOption( |
| 1576 | XGL_DBG_GLOBAL_OPTION dbgOption, |
| 1577 | size_t dataSize, |
| 1578 | const void* pData) |
| 1579 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1580 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1581 | return XGL_SUCCESS; |
| 1582 | } |
| 1583 | |
| 1584 | ICD_EXPORT XGL_RESULT XGLAPI xglDestroyObject( |
| 1585 | XGL_OBJECT object) |
| 1586 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1587 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1588 | return XGL_SUCCESS; |
| 1589 | } |
| 1590 | |
| 1591 | ICD_EXPORT XGL_RESULT XGLAPI xglGetObjectInfo( |
| 1592 | XGL_BASE_OBJECT object, |
| 1593 | XGL_OBJECT_INFO_TYPE infoType, |
| 1594 | size_t* pDataSize, |
| 1595 | void* pData) |
| 1596 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1597 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1598 | struct nulldrv_base *base = nulldrv_base(object); |
| 1599 | |
| 1600 | return base->get_info(base, infoType, pDataSize, pData); |
| 1601 | } |
| 1602 | |
| 1603 | ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory( |
| 1604 | XGL_OBJECT object, |
| 1605 | uint32_t allocationIdx, |
| 1606 | XGL_GPU_MEMORY mem_, |
| 1607 | XGL_GPU_SIZE memOffset) |
| 1608 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1609 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1610 | return XGL_SUCCESS; |
| 1611 | } |
| 1612 | |
| 1613 | ICD_EXPORT XGL_RESULT XGLAPI xglBindObjectMemoryRange( |
| 1614 | XGL_OBJECT object, |
| 1615 | uint32_t allocationIdx, |
| 1616 | XGL_GPU_SIZE rangeOffset, |
| 1617 | XGL_GPU_SIZE rangeSize, |
| 1618 | XGL_GPU_MEMORY mem, |
| 1619 | XGL_GPU_SIZE memOffset) |
| 1620 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1621 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1622 | return XGL_SUCCESS; |
| 1623 | } |
| 1624 | |
| 1625 | ICD_EXPORT XGL_RESULT XGLAPI xglBindImageMemoryRange( |
| 1626 | XGL_IMAGE image, |
| 1627 | uint32_t allocationIdx, |
| 1628 | const XGL_IMAGE_MEMORY_BIND_INFO* bindInfo, |
| 1629 | XGL_GPU_MEMORY mem, |
| 1630 | XGL_GPU_SIZE memOffset) |
| 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 xglDbgSetObjectTag( |
| 1637 | XGL_BASE_OBJECT object, |
| 1638 | size_t tagSize, |
| 1639 | const void* pTag) |
| 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 | return XGL_SUCCESS; |
| 1643 | } |
| 1644 | |
| 1645 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipeline( |
| 1646 | XGL_DEVICE device, |
| 1647 | const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1648 | XGL_PIPELINE* pPipeline) |
| 1649 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1650 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1651 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1652 | |
| 1653 | return graphics_pipeline_create(dev, pCreateInfo, |
| 1654 | (struct nulldrv_pipeline **) pPipeline); |
| 1655 | } |
| 1656 | |
| 1657 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateComputePipeline( |
| 1658 | XGL_DEVICE device, |
| 1659 | const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, |
| 1660 | XGL_PIPELINE* pPipeline) |
| 1661 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1662 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1663 | return XGL_SUCCESS; |
| 1664 | } |
| 1665 | |
| 1666 | ICD_EXPORT XGL_RESULT XGLAPI xglStorePipeline( |
| 1667 | XGL_PIPELINE pipeline, |
| 1668 | size_t* pDataSize, |
| 1669 | void* pData) |
| 1670 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1671 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1672 | return XGL_SUCCESS; |
| 1673 | } |
| 1674 | |
| 1675 | ICD_EXPORT XGL_RESULT XGLAPI xglLoadPipeline( |
| 1676 | XGL_DEVICE device, |
| 1677 | size_t dataSize, |
| 1678 | const void* pData, |
| 1679 | XGL_PIPELINE* pPipeline) |
| 1680 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1681 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1682 | return XGL_SUCCESS; |
| 1683 | } |
| 1684 | |
| 1685 | ICD_EXPORT XGL_RESULT XGLAPI xglCreatePipelineDelta( |
| 1686 | XGL_DEVICE device, |
| 1687 | XGL_PIPELINE p1, |
| 1688 | XGL_PIPELINE p2, |
| 1689 | XGL_PIPELINE_DELTA* delta) |
| 1690 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1691 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1692 | return XGL_SUCCESS; |
| 1693 | } |
| 1694 | |
| 1695 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateQueryPool( |
| 1696 | XGL_DEVICE device, |
| 1697 | const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, |
| 1698 | XGL_QUERY_POOL* pQueryPool) |
| 1699 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1700 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1701 | return XGL_SUCCESS; |
| 1702 | } |
| 1703 | |
| 1704 | ICD_EXPORT XGL_RESULT XGLAPI xglGetQueryPoolResults( |
| 1705 | XGL_QUERY_POOL queryPool, |
| 1706 | uint32_t startQuery, |
| 1707 | uint32_t queryCount, |
| 1708 | size_t* pDataSize, |
| 1709 | void* pData) |
| 1710 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1711 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1712 | return XGL_SUCCESS; |
| 1713 | } |
| 1714 | |
| 1715 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueSetGlobalMemReferences( |
| 1716 | XGL_QUEUE queue, |
| 1717 | uint32_t memRefCount, |
| 1718 | const XGL_MEMORY_REF* pMemRefs) |
| 1719 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1720 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1721 | return XGL_SUCCESS; |
| 1722 | } |
| 1723 | |
| 1724 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueWaitIdle( |
| 1725 | XGL_QUEUE queue_) |
| 1726 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1727 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1728 | return XGL_SUCCESS; |
| 1729 | } |
| 1730 | |
| 1731 | ICD_EXPORT XGL_RESULT XGLAPI xglQueueSubmit( |
| 1732 | XGL_QUEUE queue_, |
| 1733 | uint32_t cmdBufferCount, |
| 1734 | const XGL_CMD_BUFFER* pCmdBuffers, |
| 1735 | uint32_t memRefCount, |
| 1736 | const XGL_MEMORY_REF* pMemRefs, |
| 1737 | XGL_FENCE fence_) |
| 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 xglOpenSharedQueueSemaphore( |
| 1744 | XGL_DEVICE device, |
| 1745 | const XGL_QUEUE_SEMAPHORE_OPEN_INFO* pOpenInfo, |
| 1746 | XGL_QUEUE_SEMAPHORE* pSemaphore) |
| 1747 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1748 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1749 | return XGL_SUCCESS; |
| 1750 | } |
| 1751 | |
| 1752 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateQueueSemaphore( |
| 1753 | XGL_DEVICE device, |
| 1754 | const XGL_QUEUE_SEMAPHORE_CREATE_INFO* pCreateInfo, |
| 1755 | XGL_QUEUE_SEMAPHORE* pSemaphore) |
| 1756 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1757 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1758 | return XGL_SUCCESS; |
| 1759 | } |
| 1760 | |
| 1761 | ICD_EXPORT XGL_RESULT XGLAPI xglSignalQueueSemaphore( |
| 1762 | XGL_QUEUE queue, |
| 1763 | XGL_QUEUE_SEMAPHORE semaphore) |
| 1764 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1765 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1766 | return XGL_SUCCESS; |
| 1767 | } |
| 1768 | |
| 1769 | ICD_EXPORT XGL_RESULT XGLAPI xglWaitQueueSemaphore( |
| 1770 | XGL_QUEUE queue, |
| 1771 | XGL_QUEUE_SEMAPHORE semaphore) |
| 1772 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1773 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1774 | return XGL_SUCCESS; |
| 1775 | } |
| 1776 | |
| 1777 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateSampler( |
| 1778 | XGL_DEVICE device, |
| 1779 | const XGL_SAMPLER_CREATE_INFO* pCreateInfo, |
| 1780 | XGL_SAMPLER* pSampler) |
| 1781 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1782 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1783 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1784 | |
| 1785 | return nulldrv_sampler_create(dev, pCreateInfo, |
| 1786 | (struct nulldrv_sampler **) pSampler); |
| 1787 | } |
| 1788 | |
| 1789 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateShader( |
| 1790 | XGL_DEVICE device, |
| 1791 | const XGL_SHADER_CREATE_INFO* pCreateInfo, |
| 1792 | XGL_SHADER* pShader) |
| 1793 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1794 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1795 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1796 | |
| 1797 | return shader_create(dev, pCreateInfo, (struct nulldrv_shader **) pShader); |
| 1798 | } |
| 1799 | |
| 1800 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicViewportState( |
| 1801 | XGL_DEVICE device, |
| 1802 | const XGL_DYNAMIC_VP_STATE_CREATE_INFO* pCreateInfo, |
| 1803 | XGL_DYNAMIC_VP_STATE_OBJECT* pState) |
| 1804 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1805 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1806 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1807 | |
| 1808 | return nulldrv_viewport_state_create(dev, pCreateInfo, |
| 1809 | (struct nulldrv_dynamic_vp **) pState); |
| 1810 | } |
| 1811 | |
| 1812 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicRasterState( |
| 1813 | XGL_DEVICE device, |
| 1814 | const XGL_DYNAMIC_RS_STATE_CREATE_INFO* pCreateInfo, |
| 1815 | XGL_DYNAMIC_RS_STATE_OBJECT* pState) |
| 1816 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1817 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1818 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1819 | |
| 1820 | return nulldrv_raster_state_create(dev, pCreateInfo, |
| 1821 | (struct nulldrv_dynamic_rs **) pState); |
| 1822 | } |
| 1823 | |
| 1824 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicColorBlendState( |
| 1825 | XGL_DEVICE device, |
| 1826 | const XGL_DYNAMIC_CB_STATE_CREATE_INFO* pCreateInfo, |
| 1827 | XGL_DYNAMIC_CB_STATE_OBJECT* pState) |
| 1828 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1829 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1830 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1831 | |
| 1832 | return nulldrv_blend_state_create(dev, pCreateInfo, |
| 1833 | (struct nulldrv_dynamic_cb **) pState); |
| 1834 | } |
| 1835 | |
| 1836 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDynamicDepthStencilState( |
| 1837 | XGL_DEVICE device, |
| 1838 | const XGL_DYNAMIC_DS_STATE_CREATE_INFO* pCreateInfo, |
| 1839 | XGL_DYNAMIC_DS_STATE_OBJECT* pState) |
| 1840 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1841 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1842 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1843 | |
| 1844 | return nulldrv_ds_state_create(dev, pCreateInfo, |
| 1845 | (struct nulldrv_dynamic_ds **) pState); |
| 1846 | } |
| 1847 | |
| 1848 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateBufferView( |
| 1849 | XGL_DEVICE device, |
| 1850 | const XGL_BUFFER_VIEW_CREATE_INFO* pCreateInfo, |
| 1851 | XGL_BUFFER_VIEW* pView) |
| 1852 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1853 | NULLDRV_LOG_FUNC; |
| 1854 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1855 | |
| 1856 | return nulldrv_buf_view_create(dev, pCreateInfo, |
| 1857 | (struct nulldrv_buf_view **) pView); |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1858 | } |
| 1859 | |
| 1860 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateImageView( |
| 1861 | XGL_DEVICE device, |
| 1862 | const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, |
| 1863 | XGL_IMAGE_VIEW* pView) |
| 1864 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1865 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1866 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1867 | |
| 1868 | return nulldrv_img_view_create(dev, pCreateInfo, |
| 1869 | (struct nulldrv_img_view **) pView); |
| 1870 | } |
| 1871 | |
| 1872 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateColorAttachmentView( |
| 1873 | XGL_DEVICE device, |
| 1874 | const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, |
| 1875 | XGL_COLOR_ATTACHMENT_VIEW* pView) |
| 1876 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1877 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1878 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1879 | |
| 1880 | return nulldrv_rt_view_create(dev, pCreateInfo, |
| 1881 | (struct nulldrv_rt_view **) pView); |
| 1882 | } |
| 1883 | |
| 1884 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilView( |
| 1885 | XGL_DEVICE device, |
| 1886 | const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, |
| 1887 | XGL_DEPTH_STENCIL_VIEW* pView) |
| 1888 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1889 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1890 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1891 | |
| 1892 | return nulldrv_ds_view_create(dev, pCreateInfo, |
| 1893 | (struct nulldrv_ds_view **) pView); |
| 1894 | |
| 1895 | } |
| 1896 | |
| 1897 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSetLayout( |
| 1898 | XGL_DEVICE device, |
| 1899 | XGL_FLAGS stageFlags, |
| 1900 | const uint32_t* pSetBindPoints, |
| 1901 | XGL_DESCRIPTOR_SET_LAYOUT priorSetLayout, |
| 1902 | const XGL_DESCRIPTOR_SET_LAYOUT_CREATE_INFO* pSetLayoutInfoList, |
| 1903 | XGL_DESCRIPTOR_SET_LAYOUT* pSetLayout) |
| 1904 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1905 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1906 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1907 | struct nulldrv_desc_layout *prior_layout = nulldrv_desc_layout(priorSetLayout); |
| 1908 | |
| 1909 | return nulldrv_desc_layout_create(dev, stageFlags, pSetBindPoints, |
| 1910 | prior_layout, pSetLayoutInfoList, |
| 1911 | (struct nulldrv_desc_layout **) pSetLayout); |
| 1912 | } |
| 1913 | |
| 1914 | ICD_EXPORT XGL_RESULT XGLAPI xglBeginDescriptorRegionUpdate( |
| 1915 | XGL_DEVICE device, |
| 1916 | XGL_DESCRIPTOR_UPDATE_MODE updateMode) |
| 1917 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1918 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1919 | return XGL_SUCCESS; |
| 1920 | } |
| 1921 | |
| 1922 | ICD_EXPORT XGL_RESULT XGLAPI xglEndDescriptorRegionUpdate( |
| 1923 | XGL_DEVICE device, |
| 1924 | XGL_CMD_BUFFER cmd_) |
| 1925 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1926 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1927 | return XGL_SUCCESS; |
| 1928 | } |
| 1929 | |
| 1930 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorRegion( |
| 1931 | XGL_DEVICE device, |
| 1932 | XGL_DESCRIPTOR_REGION_USAGE regionUsage, |
| 1933 | uint32_t maxSets, |
| 1934 | const XGL_DESCRIPTOR_REGION_CREATE_INFO* pCreateInfo, |
| 1935 | XGL_DESCRIPTOR_REGION* pDescriptorRegion) |
| 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 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 1939 | |
| 1940 | return nulldrv_desc_region_create(dev, regionUsage, maxSets, pCreateInfo, |
| 1941 | (struct nulldrv_desc_region **) pDescriptorRegion); |
| 1942 | } |
| 1943 | |
| 1944 | ICD_EXPORT XGL_RESULT XGLAPI xglClearDescriptorRegion( |
| 1945 | XGL_DESCRIPTOR_REGION descriptorRegion) |
| 1946 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1947 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1948 | return XGL_SUCCESS; |
| 1949 | } |
| 1950 | |
| 1951 | ICD_EXPORT XGL_RESULT XGLAPI xglAllocDescriptorSets( |
| 1952 | XGL_DESCRIPTOR_REGION descriptorRegion, |
| 1953 | XGL_DESCRIPTOR_SET_USAGE setUsage, |
| 1954 | uint32_t count, |
| 1955 | const XGL_DESCRIPTOR_SET_LAYOUT* pSetLayouts, |
| 1956 | XGL_DESCRIPTOR_SET* pDescriptorSets, |
| 1957 | uint32_t* pCount) |
| 1958 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1959 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1960 | struct nulldrv_desc_region *region = nulldrv_desc_region(descriptorRegion); |
| 1961 | struct nulldrv_dev *dev = region->dev; |
| 1962 | XGL_RESULT ret = XGL_SUCCESS; |
| 1963 | uint32_t i; |
| 1964 | |
| 1965 | for (i = 0; i < count; i++) { |
| 1966 | const struct nulldrv_desc_layout *layout = |
| 1967 | nulldrv_desc_layout((XGL_DESCRIPTOR_SET_LAYOUT) pSetLayouts[i]); |
| 1968 | |
| 1969 | ret = nulldrv_desc_set_create(dev, region, setUsage, layout, |
| 1970 | (struct nulldrv_desc_set **) &pDescriptorSets[i]); |
| 1971 | if (ret != XGL_SUCCESS) |
| 1972 | break; |
| 1973 | } |
| 1974 | |
| 1975 | if (pCount) |
| 1976 | *pCount = i; |
| 1977 | |
| 1978 | return ret; |
| 1979 | } |
| 1980 | |
| 1981 | ICD_EXPORT void XGLAPI xglClearDescriptorSets( |
| 1982 | XGL_DESCRIPTOR_REGION descriptorRegion, |
| 1983 | uint32_t count, |
| 1984 | const XGL_DESCRIPTOR_SET* pDescriptorSets) |
| 1985 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1986 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1987 | } |
| 1988 | |
| 1989 | ICD_EXPORT void XGLAPI xglUpdateDescriptors( |
| 1990 | XGL_DESCRIPTOR_SET descriptorSet, |
| 1991 | const void* pUpdateChain) |
| 1992 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 1993 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 1994 | } |
| 1995 | |
| 1996 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateFramebuffer( |
| 1997 | XGL_DEVICE device, |
| 1998 | const XGL_FRAMEBUFFER_CREATE_INFO* info, |
| 1999 | XGL_FRAMEBUFFER* fb_ret) |
| 2000 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2001 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2002 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2003 | |
| 2004 | return nulldrv_fb_create(dev, info, (struct nulldrv_framebuffer **) fb_ret); |
| 2005 | } |
| 2006 | |
| 2007 | |
| 2008 | ICD_EXPORT XGL_RESULT XGLAPI xglCreateRenderPass( |
| 2009 | XGL_DEVICE device, |
| 2010 | const XGL_RENDER_PASS_CREATE_INFO* info, |
| 2011 | XGL_RENDER_PASS* rp_ret) |
| 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 | struct nulldrv_dev *dev = nulldrv_dev(device); |
| 2015 | |
| 2016 | return nulldrv_render_pass_create(dev, info, (struct nulldrv_render_pass **) rp_ret); |
| 2017 | } |
| 2018 | |
| 2019 | ICD_EXPORT void XGLAPI xglCmdBeginRenderPass( |
| 2020 | XGL_CMD_BUFFER cmdBuffer, |
| 2021 | XGL_RENDER_PASS renderPass) |
| 2022 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2023 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2024 | } |
| 2025 | |
| 2026 | ICD_EXPORT void XGLAPI xglCmdEndRenderPass( |
| 2027 | XGL_CMD_BUFFER cmdBuffer, |
| 2028 | XGL_RENDER_PASS renderPass) |
| 2029 | { |
David Pinedo | 8e9cb3b | 2015-02-10 15:02:08 -0700 | [diff] [blame] | 2030 | NULLDRV_LOG_FUNC; |
David Pinedo | 0257fbf | 2015-02-02 18:02:40 -0700 | [diff] [blame] | 2031 | } |