Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 1 | /* |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2 | * Vulkan |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 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 | */ |
Chia-I Wu | 4f7730d | 2015-02-18 15:21:38 -0700 | [diff] [blame] | 25 | |
| 26 | #ifndef FB_H |
| 27 | #define FB_H |
| 28 | |
| 29 | #include "intel.h" |
| 30 | #include "obj.h" |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 31 | |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame] | 32 | struct intel_fb { |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 33 | struct intel_obj obj; |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 34 | |
Courtney Goeltzenleuchter | 5f5a618 | 2015-01-23 14:27:58 -0700 | [diff] [blame] | 35 | const struct intel_rt_view *rt[INTEL_MAX_RENDER_TARGETS]; |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 36 | uint32_t rt_count; |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 37 | |
| 38 | const struct intel_ds_view *ds; |
Chia-I Wu | c45db53 | 2015-02-19 11:20:38 -0700 | [diff] [blame] | 39 | bool optimal_ds; |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 40 | |
Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 41 | uint32_t sample_count; |
| 42 | uint32_t width; |
| 43 | uint32_t height; |
Chia-I Wu | 4f7730d | 2015-02-18 15:21:38 -0700 | [diff] [blame] | 44 | uint32_t array_size; |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | struct intel_render_pass { |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 48 | struct intel_obj obj; |
Chris Forbes | fff9bf4 | 2015-06-15 15:26:19 +1200 | [diff] [blame] | 49 | |
| 50 | uint32_t colorAttachmentCount; |
Chris Forbes | 2951d7d | 2015-06-22 17:21:59 +1200 | [diff] [blame^] | 51 | VkRect2D renderArea; |
Chris Forbes | fff9bf4 | 2015-06-15 15:26:19 +1200 | [diff] [blame] | 52 | VkExtent2D extent; |
| 53 | VkAttachmentLoadOp colorLoadOps[INTEL_MAX_RENDER_TARGETS]; |
| 54 | VkFormat colorFormats[INTEL_MAX_RENDER_TARGETS]; |
| 55 | VkImageLayout colorLayouts[INTEL_MAX_RENDER_TARGETS]; |
| 56 | VkClearColor colorClearValues[INTEL_MAX_RENDER_TARGETS]; |
Jon Ashburn | c6f4a41 | 2014-12-24 12:38:36 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 59 | static inline struct intel_fb *intel_fb(VkFramebuffer fb) |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 60 | { |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame] | 61 | return (struct intel_fb *) fb; |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 62 | } |
| 63 | |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame] | 64 | 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] | 65 | { |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame] | 66 | return (struct intel_fb *) obj; |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 67 | } |
| 68 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 69 | static inline struct intel_render_pass *intel_render_pass(VkRenderPass rp) |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 70 | { |
| 71 | return (struct intel_render_pass *) rp; |
| 72 | } |
| 73 | |
Chia-I Wu | 768a14b | 2015-02-18 14:48:21 -0700 | [diff] [blame] | 74 | static inline struct intel_render_pass *intel_render_pass_from_obj(struct intel_obj *obj) |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 75 | { |
| 76 | return (struct intel_render_pass *) obj; |
| 77 | } |
| 78 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 79 | VkResult intel_fb_create(struct intel_dev *dev, |
| 80 | const VkFramebufferCreateInfo *pInfo, |
Chia-I Wu | 4f7730d | 2015-02-18 15:21:38 -0700 | [diff] [blame] | 81 | struct intel_fb **fb_ret); |
Chia-I Wu | 9d748fd | 2015-02-18 14:46:55 -0700 | [diff] [blame] | 82 | void intel_fb_destroy(struct intel_fb *fb); |
Jon Ashburn | c04b4dc | 2015-01-08 18:48:10 -0700 | [diff] [blame] | 83 | |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 84 | VkResult intel_render_pass_create(struct intel_dev *dev, |
| 85 | const VkRenderPassCreateInfo *pInfo, |
Chia-I Wu | 4f7730d | 2015-02-18 15:21:38 -0700 | [diff] [blame] | 86 | struct intel_render_pass **rp_ret); |
Courtney Goeltzenleuchter | 5f5a618 | 2015-01-23 14:27:58 -0700 | [diff] [blame] | 87 | void intel_render_pass_destroy(struct intel_render_pass *rp); |
Chia-I Wu | 4f7730d | 2015-02-18 15:21:38 -0700 | [diff] [blame] | 88 | |
| 89 | #endif /* FB_H */ |