Chia-I Wu | e46da3e | 2014-08-08 21:52:48 +0800 | [diff] [blame] | 1 | /* |
| 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 Wu | feb441f | 2014-08-08 21:27:38 +0800 | [diff] [blame] | 28 | #include "kmd/winsys.h" |
Chia-I Wu | e46da3e | 2014-08-08 21:52:48 +0800 | [diff] [blame] | 29 | #include "intel.h" |
Chia-I Wu | 2b685d7 | 2014-08-14 13:45:37 +0800 | [diff] [blame^] | 30 | #include "layout.h" |
Chia-I Wu | e46da3e | 2014-08-08 21:52:48 +0800 | [diff] [blame] | 31 | #include "obj.h" |
| 32 | |
Chia-I Wu | e46da3e | 2014-08-08 21:52:48 +0800 | [diff] [blame] | 33 | struct intel_img { |
| 34 | struct intel_obj obj; |
Chia-I Wu | feb441f | 2014-08-08 21:27:38 +0800 | [diff] [blame] | 35 | |
Chia-I Wu | 2b685d7 | 2014-08-14 13:45:37 +0800 | [diff] [blame^] | 36 | struct intel_layout layout; |
Chia-I Wu | e46da3e | 2014-08-08 21:52:48 +0800 | [diff] [blame] | 37 | }; |
| 38 | |
Chia-I Wu | feb441f | 2014-08-08 21:27:38 +0800 | [diff] [blame] | 39 | static inline struct intel_img *intel_img(XGL_IMAGE image) |
| 40 | { |
| 41 | return (struct intel_img *) image; |
| 42 | } |
| 43 | |
| 44 | static inline struct intel_img *intel_img_from_base(struct intel_base *base) |
| 45 | { |
| 46 | return (struct intel_img *) base; |
| 47 | } |
| 48 | |
| 49 | static inline struct intel_img *intel_img_from_obj(struct intel_obj *obj) |
| 50 | { |
| 51 | return intel_img_from_base(&obj->base); |
| 52 | } |
| 53 | |
| 54 | XGL_RESULT intel_img_create(struct intel_dev *dev, |
| 55 | const XGL_IMAGE_CREATE_INFO *info, |
| 56 | struct intel_img **img_ret); |
| 57 | |
| 58 | void intel_img_destroy(struct intel_img *img); |
| 59 | |
| 60 | XGL_RESULT XGLAPI intelCreateImage( |
| 61 | XGL_DEVICE device, |
| 62 | const XGL_IMAGE_CREATE_INFO* pCreateInfo, |
| 63 | XGL_IMAGE* pImage); |
| 64 | |
| 65 | XGL_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 Wu | e46da3e | 2014-08-08 21:52:48 +0800 | [diff] [blame] | 72 | #endif /* IMG_H */ |