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 | #pragma once |
| 26 | |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame^] | 27 | struct intel_fb { |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 28 | struct intel_obj obj; |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 29 | |
Courtney Goeltzenleuchter | 5f5a618 | 2015-01-23 14:27:58 -0700 | [diff] [blame] | 30 | const struct intel_rt_view *rt[INTEL_MAX_RENDER_TARGETS]; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 31 | uint32_t rt_count; |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 32 | |
| 33 | const struct intel_ds_view *ds; |
| 34 | |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 35 | uint32_t sample_count; |
| 36 | uint32_t width; |
| 37 | uint32_t height; |
| 38 | uint32_t layer_count; |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | struct intel_render_pass { |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 42 | struct intel_obj obj; |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 43 | |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame^] | 44 | struct intel_fb *fb; |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame^] | 47 | static inline struct intel_fb *intel_fb(XGL_FRAMEBUFFER fb) |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 48 | { |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame^] | 49 | return (struct intel_fb *) fb; |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame^] | 52 | static inline struct intel_fb *intel_fb_from_obj(struct intel_obj *obj) |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 53 | { |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame^] | 54 | return (struct intel_fb *) obj; |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | static inline struct intel_render_pass *intel_render_pass(XGL_RENDER_PASS rp) |
| 58 | { |
| 59 | return (struct intel_render_pass *) rp; |
| 60 | } |
| 61 | |
| 62 | static inline struct intel_render_pass *intel_rp_from_obj(struct intel_obj *obj) |
| 63 | { |
| 64 | return (struct intel_render_pass *) obj; |
| 65 | } |
| 66 | |
| 67 | XGL_RESULT intel_fb_create(struct intel_dev *dev, |
| 68 | const XGL_FRAMEBUFFER_CREATE_INFO* pInfo, |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame^] | 69 | struct intel_fb ** ppFramebuffer); |
| 70 | void intel_fb_destroy(struct intel_fb *fb); |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 71 | |
Courtney Goeltzenleuchter | 5f5a618 | 2015-01-23 14:27:58 -0700 | [diff] [blame] | 72 | XGL_RESULT intel_render_pass_create(struct intel_dev *dev, |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 73 | const XGL_RENDER_PASS_CREATE_INFO* pInfo, |
| 74 | struct intel_render_pass** ppRenderPass); |
Courtney Goeltzenleuchter | 5f5a618 | 2015-01-23 14:27:58 -0700 | [diff] [blame] | 75 | void intel_render_pass_destroy(struct intel_render_pass *rp); |
Jon Ashburn | b1dbb37 | 2015-02-02 09:58:11 -0700 | [diff] [blame] | 76 | void intel_cmd_begin_render_pass(struct intel_cmd *cmd, |
| 77 | const struct intel_render_pass *rp); |
| 78 | void intel_cmd_end_render_pass(struct intel_cmd *cmd, |
| 79 | const struct intel_render_pass *rp); |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 80 | XGL_RESULT XGLAPI intelCreateFramebuffer( |
| 81 | XGL_DEVICE device, |
| 82 | const XGL_FRAMEBUFFER_CREATE_INFO* pCreateInfo, |
| 83 | XGL_FRAMEBUFFER* pFramebuffer); |
| 84 | |
| 85 | XGL_RESULT XGLAPI intelCreateRenderPass( |
| 86 | XGL_DEVICE device, |
| 87 | const XGL_RENDER_PASS_CREATE_INFO* pCreateInfo, |
| 88 | XGL_RENDER_PASS* pRenderPass); |