blob: f7c6b1f39c343c432e7dda371e14eb518b70535b [file] [log] [blame]
Jon Ashburnc6f4a412014-12-24 12:38:36 -07001/*
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 */
Chia-I Wu4f7730d2015-02-18 15:21:38 -070025
26#ifndef FB_H
27#define FB_H
28
29#include "intel.h"
30#include "obj.h"
Jon Ashburnc6f4a412014-12-24 12:38:36 -070031
Chia-I Wu9d748fd2015-02-18 14:46:55 -070032struct intel_fb {
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070033 struct intel_obj obj;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070034
Courtney Goeltzenleuchter5f5a6182015-01-23 14:27:58 -070035 const struct intel_rt_view *rt[INTEL_MAX_RENDER_TARGETS];
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -060036 uint32_t rt_count;
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070037
38 const struct intel_ds_view *ds;
Chia-I Wuc45db532015-02-19 11:20:38 -070039 bool optimal_ds;
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070040
Mark Lobodzinskie2d07a52015-01-29 08:55:56 -060041 uint32_t sample_count;
42 uint32_t width;
43 uint32_t height;
Chia-I Wu4f7730d2015-02-18 15:21:38 -070044 uint32_t array_size;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070045};
46
47struct intel_render_pass {
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070048 struct intel_obj obj;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070049
Chia-I Wu9d748fd2015-02-18 14:46:55 -070050 struct intel_fb *fb;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070051};
52
Chia-I Wu9d748fd2015-02-18 14:46:55 -070053static inline struct intel_fb *intel_fb(XGL_FRAMEBUFFER fb)
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070054{
Chia-I Wu9d748fd2015-02-18 14:46:55 -070055 return (struct intel_fb *) fb;
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070056}
57
Chia-I Wu9d748fd2015-02-18 14:46:55 -070058static inline struct intel_fb *intel_fb_from_obj(struct intel_obj *obj)
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070059{
Chia-I Wu9d748fd2015-02-18 14:46:55 -070060 return (struct intel_fb *) obj;
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070061}
62
63static inline struct intel_render_pass *intel_render_pass(XGL_RENDER_PASS rp)
64{
65 return (struct intel_render_pass *) rp;
66}
67
Chia-I Wu768a14b2015-02-18 14:48:21 -070068static inline struct intel_render_pass *intel_render_pass_from_obj(struct intel_obj *obj)
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070069{
70 return (struct intel_render_pass *) obj;
71}
72
73XGL_RESULT intel_fb_create(struct intel_dev *dev,
Chia-I Wu4f7730d2015-02-18 15:21:38 -070074 const XGL_FRAMEBUFFER_CREATE_INFO *pInfo,
75 struct intel_fb **fb_ret);
Chia-I Wu9d748fd2015-02-18 14:46:55 -070076void intel_fb_destroy(struct intel_fb *fb);
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070077
Courtney Goeltzenleuchter5f5a6182015-01-23 14:27:58 -070078XGL_RESULT intel_render_pass_create(struct intel_dev *dev,
Chia-I Wu4f7730d2015-02-18 15:21:38 -070079 const XGL_RENDER_PASS_CREATE_INFO *pInfo,
80 struct intel_render_pass **rp_ret);
Courtney Goeltzenleuchter5f5a6182015-01-23 14:27:58 -070081void intel_render_pass_destroy(struct intel_render_pass *rp);
Chia-I Wu4f7730d2015-02-18 15:21:38 -070082
83#endif /* FB_H */