blob: 7576e74ee4179a3150ed66e34fec737e5c9710a9 [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 Wue46da3e2014-08-08 21:52:48 +080037};
38
Chia-I Wufeb441f2014-08-08 21:27:38 +080039static inline struct intel_img *intel_img(XGL_IMAGE image)
40{
41 return (struct intel_img *) image;
42}
43
44static inline struct intel_img *intel_img_from_base(struct intel_base *base)
45{
46 return (struct intel_img *) base;
47}
48
49static inline struct intel_img *intel_img_from_obj(struct intel_obj *obj)
50{
51 return intel_img_from_base(&obj->base);
52}
53
54XGL_RESULT intel_img_create(struct intel_dev *dev,
55 const XGL_IMAGE_CREATE_INFO *info,
56 struct intel_img **img_ret);
57
58void intel_img_destroy(struct intel_img *img);
59
60XGL_RESULT XGLAPI intelCreateImage(
61 XGL_DEVICE device,
62 const XGL_IMAGE_CREATE_INFO* pCreateInfo,
63 XGL_IMAGE* pImage);
64
65XGL_RESULT XGLAPI intelGetImageSubresourceInfo(
66 XGL_IMAGE image,
67 const XGL_IMAGE_SUBRESOURCE* pSubresource,
68 XGL_SUBRESOURCE_INFO_TYPE infoType,
69 XGL_SIZE* pDataSize,
70 XGL_VOID* pData);
71
Chia-I Wue46da3e2014-08-08 21:52:48 +080072#endif /* IMG_H */