89ad8c20811a4e944482211c672b46c653be876e
2 * Mesa 3-D graphics library
4 * Copyright (C) 2012-2013 LunarG, Inc.
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:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
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.
25 * Chia-I Wu <olv@lunarg.com>
28 #ifndef ILO_RESOURCE_H
29 #define ILO_RESOURCE_H
31 #include "intel_winsys.h"
33 #include "ilo_common.h"
42 * ilo_resource, inherited by
45 * - ilo_global_binding
48 struct pipe_resource base
;
49 struct winsys_handle
*handle
;
54 * These are the values passed to or returned from winsys for bo
55 * allocation. As such,
57 * - width and height are in blocks,
58 * - cpp is the block size in bytes, and
59 * - stride is the distance in bytes between two block rows.
61 int bo_width
, bo_height
, bo_cpp
, bo_stride
;
62 enum intel_tiling_mode tiling
;
66 unsigned block_height
;
68 /* true if the mip level alignments are stricter */
69 bool halign_8
, valign_4
;
70 /* true if space is reserved between layers */
71 bool array_spacing_full
;
72 /* true if samples are interleaved */
75 /* 2D offsets into a layer/slice/face */
79 } *slice_offsets
[PIPE_MAX_TEXTURE_LEVELS
];
82 static inline struct ilo_resource
*
83 ilo_resource(struct pipe_resource
*res
)
85 return (struct ilo_resource
*) res
;
89 ilo_init_resource_functions(struct ilo_screen
*is
);
92 ilo_init_transfer_functions(struct ilo_context
*ilo
);
95 ilo_resource_get_slice_offset(const struct ilo_resource
*res
,
96 int level
, int slice
, bool tile_aligned
,
97 unsigned *x_offset
, unsigned *y_offset
);
99 #endif /* ILO_RESOURCE_H */