blob: 81a1a331a836f6745dea173826157aa674f55ba1 [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 */
25#pragma once
26
27struct intel_framebuffer {
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070028 struct intel_obj obj;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070029
Courtney Goeltzenleuchter5f5a6182015-01-23 14:27:58 -070030 const struct intel_rt_view *rt[INTEL_MAX_RENDER_TARGETS];
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070031 XGL_UINT rt_count;
32
33 const struct intel_ds_view *ds;
34
35 XGL_UINT sample_count;
36 XGL_UINT width, height;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070037};
38
39struct intel_render_pass {
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070040 struct intel_obj obj;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070041
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070042 struct intel_framebuffer *fb;
Jon Ashburnc6f4a412014-12-24 12:38:36 -070043};
44
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070045static inline struct intel_framebuffer *intel_framebuffer(XGL_FRAMEBUFFER fb)
46{
47 return (struct intel_framebuffer *) fb;
48}
49
50static inline struct intel_framebuffer *intel_fb_from_obj(struct intel_obj *obj)
51{
52 return (struct intel_framebuffer *) obj;
53}
54
55static inline struct intel_render_pass *intel_render_pass(XGL_RENDER_PASS rp)
56{
57 return (struct intel_render_pass *) rp;
58}
59
60static inline struct intel_render_pass *intel_rp_from_obj(struct intel_obj *obj)
61{
62 return (struct intel_render_pass *) obj;
63}
64
65XGL_RESULT intel_fb_create(struct intel_dev *dev,
66 const XGL_FRAMEBUFFER_CREATE_INFO* pInfo,
67 struct intel_framebuffer ** ppFramebuffer);
68void intel_fb_destroy(struct intel_framebuffer *fb);
69
Courtney Goeltzenleuchter5f5a6182015-01-23 14:27:58 -070070XGL_RESULT intel_render_pass_create(struct intel_dev *dev,
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070071 const XGL_RENDER_PASS_CREATE_INFO* pInfo,
72 struct intel_render_pass** ppRenderPass);
Courtney Goeltzenleuchter5f5a6182015-01-23 14:27:58 -070073void intel_render_pass_destroy(struct intel_render_pass *rp);
Jon Ashburnc04b4dc2015-01-08 18:48:10 -070074
Jon Ashburnc6f4a412014-12-24 12:38:36 -070075XGL_RESULT XGLAPI intelCreateFramebuffer(
76 XGL_DEVICE device,
77 const XGL_FRAMEBUFFER_CREATE_INFO* pCreateInfo,
78 XGL_FRAMEBUFFER* pFramebuffer);
79
80XGL_RESULT XGLAPI intelCreateRenderPass(
81 XGL_DEVICE device,
82 const XGL_RENDER_PASS_CREATE_INFO* pCreateInfo,
83 XGL_RENDER_PASS* pRenderPass);