blob: 247ce3f437528a659a16378bf704d3a3bb37f359 [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 Wueb2da592014-08-16 14:19:39 +080036 XGL_IMAGE_TYPE type;
37 XGL_EXTENT3D extent;
38 XGL_UINT array_size;
39 XGL_UINT samples;
Chia-I Wu2b685d72014-08-14 13:45:37 +080040 struct intel_layout layout;
Chia-I Wu9b752e12014-08-15 16:21:44 +080041
42 /* layout of separate stencil */
43 struct intel_layout *s8_layout;
44
45 XGL_SIZE total_size;
46 XGL_SIZE aux_offset;
47 XGL_SIZE s8_offset;
Chia-I Wue46da3e2014-08-08 21:52:48 +080048};
49
Chia-I Wufeb441f2014-08-08 21:27:38 +080050static inline struct intel_img *intel_img(XGL_IMAGE image)
51{
52 return (struct intel_img *) image;
53}
54
55static inline struct intel_img *intel_img_from_base(struct intel_base *base)
56{
57 return (struct intel_img *) base;
58}
59
60static inline struct intel_img *intel_img_from_obj(struct intel_obj *obj)
61{
62 return intel_img_from_base(&obj->base);
63}
64
65XGL_RESULT intel_img_create(struct intel_dev *dev,
66 const XGL_IMAGE_CREATE_INFO *info,
67 struct intel_img **img_ret);
68
69void intel_img_destroy(struct intel_img *img);
70
71XGL_RESULT XGLAPI intelCreateImage(
72 XGL_DEVICE device,
73 const XGL_IMAGE_CREATE_INFO* pCreateInfo,
74 XGL_IMAGE* pImage);
75
76XGL_RESULT XGLAPI intelGetImageSubresourceInfo(
77 XGL_IMAGE image,
78 const XGL_IMAGE_SUBRESOURCE* pSubresource,
79 XGL_SUBRESOURCE_INFO_TYPE infoType,
80 XGL_SIZE* pDataSize,
81 XGL_VOID* pData);
82
Chia-I Wue46da3e2014-08-08 21:52:48 +080083#endif /* IMG_H */