Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * XGL |
| 3 | * |
| 4 | * Copyright (C) 2014 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 "dev.h" |
| 27 | #include "obj.h" |
| 28 | #include "fb.h" |
| 29 | |
| 30 | XGL_RESULT intel_fb_create(struct intel_dev *dev, |
| 31 | const XGL_FRAMEBUFFER_CREATE_INFO* info, |
| 32 | struct intel_framebuffer ** fb_ret) |
| 33 | { |
| 34 | struct intel_framebuffer *fb; |
| 35 | fb = (struct intel_framebuffer *) intel_base_create(dev, sizeof(*fb), |
| 36 | dev->base.dbg, XGL_DBG_OBJECT_FRAMEBUFFER, info, 0); |
| 37 | if (!fb) |
| 38 | return XGL_ERROR_OUT_OF_MEMORY; |
| 39 | //todo |
| 40 | |
| 41 | *fb_ret = fb; |
| 42 | |
| 43 | return XGL_SUCCESS; |
| 44 | |
| 45 | } |
| 46 | |
| 47 | XGL_RESULT intel_rp_create(struct intel_dev *dev, |
| 48 | const XGL_RENDER_PASS_CREATE_INFO* info, |
| 49 | struct intel_render_pass** rp_ret) |
| 50 | { |
| 51 | struct intel_render_pass *rp; |
| 52 | rp = (struct intel_render_pass *) intel_base_create(dev, sizeof(*rp), |
| 53 | dev->base.dbg, XGL_DBG_OBJECT_RENDER_PASS, info, 0); |
| 54 | if (!rp) |
| 55 | return XGL_ERROR_OUT_OF_MEMORY; |
| 56 | //todo |
| 57 | |
| 58 | *rp_ret = rp; |
| 59 | |
| 60 | return XGL_SUCCESS; |
| 61 | } |
| 62 | |
| 63 | XGL_RESULT XGLAPI intelCreateFramebuffer( |
| 64 | XGL_DEVICE device, |
| 65 | const XGL_FRAMEBUFFER_CREATE_INFO* info, |
| 66 | XGL_FRAMEBUFFER* fb_ret) |
| 67 | { |
| 68 | struct intel_dev *dev = intel_dev(device); |
| 69 | |
| 70 | return intel_fb_create(dev, info, (struct intel_framebuffer **) fb_ret); |
| 71 | } |
| 72 | |
| 73 | |
| 74 | XGL_RESULT XGLAPI intelCreateRenderPass( |
| 75 | XGL_DEVICE device, |
| 76 | const XGL_RENDER_PASS_CREATE_INFO* info, |
| 77 | XGL_RENDER_PASS* rp_ret) |
| 78 | { |
| 79 | struct intel_dev *dev = intel_dev(device); |
| 80 | |
| 81 | return intel_rp_create(dev, info, (struct intel_render_pass **) rp_ret); |
| 82 | } |
| 83 | |
| 84 | |
| 85 | |