blob: 5ad645c2bcb362dee1f1c3da35524348ba78699e [file] [log] [blame]
Chia-I Wue46da3e2014-08-08 21:52:48 +08001/*
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#ifndef IMG_H
26#define IMG_H
27
Chia-I Wufeb441f2014-08-08 21:27:38 +080028#include "kmd/winsys.h"
Chia-I Wue46da3e2014-08-08 21:52:48 +080029#include "intel.h"
Chia-I Wu2b685d72014-08-14 13:45:37 +080030#include "layout.h"
Chia-I Wue46da3e2014-08-08 21:52:48 +080031#include "obj.h"
32
Chia-I Wue46da3e2014-08-08 21:52:48 +080033struct intel_img {
34 struct intel_obj obj;
Chia-I Wufeb441f2014-08-08 21:27:38 +080035
Chia-I Wu2b685d72014-08-14 13:45:37 +080036 struct intel_layout layout;
Chia-I Wu9b752e12014-08-15 16:21:44 +080037
38 /* layout of separate stencil */
39 struct intel_layout *s8_layout;
40
41 XGL_SIZE total_size;
42 XGL_SIZE aux_offset;
43 XGL_SIZE s8_offset;
Chia-I Wue46da3e2014-08-08 21:52:48 +080044};
45
Chia-I Wufeb441f2014-08-08 21:27:38 +080046static inline struct intel_img *intel_img(XGL_IMAGE image)
47{
48 return (struct intel_img *) image;
49}
50
51static inline struct intel_img *intel_img_from_base(struct intel_base *base)
52{
53 return (struct intel_img *) base;
54}
55
56static inline struct intel_img *intel_img_from_obj(struct intel_obj *obj)
57{
58 return intel_img_from_base(&obj->base);
59}
60
61XGL_RESULT intel_img_create(struct intel_dev *dev,
62 const XGL_IMAGE_CREATE_INFO *info,
63 struct intel_img **img_ret);
64
65void intel_img_destroy(struct intel_img *img);
66
67XGL_RESULT XGLAPI intelCreateImage(
68 XGL_DEVICE device,
69 const XGL_IMAGE_CREATE_INFO* pCreateInfo,
70 XGL_IMAGE* pImage);
71
72XGL_RESULT XGLAPI intelGetImageSubresourceInfo(
73 XGL_IMAGE image,
74 const XGL_IMAGE_SUBRESOURCE* pSubresource,
75 XGL_SUBRESOURCE_INFO_TYPE infoType,
76 XGL_SIZE* pDataSize,
77 XGL_VOID* pData);
78
Chia-I Wue46da3e2014-08-08 21:52:48 +080079#endif /* IMG_H */