grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / mesa / src / gallium / drivers / nvc0 / nvc0_resource.h
blobf1c445b51525ecec47accbdf75180a986d26ce45
2 #ifndef __NVC0_RESOURCE_H__
3 #define __NVC0_RESOURCE_H__
5 #include "util/u_transfer.h"
6 #include "util/u_double_list.h"
7 #define NOUVEAU_NVC0
8 #include "nouveau/nouveau_winsys.h"
9 #include "nouveau/nouveau_fence.h"
10 #include "nouveau/nouveau_buffer.h"
11 #undef NOUVEAU_NVC0
13 void
14 nvc0_init_resource_functions(struct pipe_context *pcontext);
16 void
17 nvc0_screen_init_resource_functions(struct pipe_screen *pscreen);
19 #define NVC0_TILE_DIM_SHIFT(m, d) (((m) >> (d * 4)) & 0xf)
21 #define NVC0_TILE_PITCH(m) (64 << NVC0_TILE_DIM_SHIFT(m, 0))
22 #define NVC0_TILE_HEIGHT(m) ( 8 << NVC0_TILE_DIM_SHIFT(m, 1))
23 #define NVC0_TILE_DEPTH(m) ( 1 << NVC0_TILE_DIM_SHIFT(m, 2))
25 #define NVC0_TILE_SIZE_2D(m) (((64 * 8) << \
26 NVC0_TILE_DIM_SHIFT(m, 0)) << \
27 NVC0_TILE_DIM_SHIFT(m, 1))
29 #define NVC0_TILE_SIZE(m) (NVC0_TILE_SIZE_2D(m) << NVC0_TILE_DIM_SHIFT(m, 2))
31 struct nvc0_miptree_level {
32 uint32_t offset;
33 uint32_t pitch;
34 uint32_t tile_mode;
37 #define NVC0_MAX_TEXTURE_LEVELS 16
39 struct nvc0_miptree {
40 struct nv04_resource base;
41 struct nvc0_miptree_level level[NVC0_MAX_TEXTURE_LEVELS];
42 uint32_t total_size;
43 uint32_t layer_stride;
44 boolean layout_3d; /* TRUE if layer count varies with mip level */
47 static INLINE struct nvc0_miptree *
48 nvc0_miptree(struct pipe_resource *pt)
50 return (struct nvc0_miptree *)pt;
53 /* Internal functions:
55 struct pipe_resource *
56 nvc0_miptree_create(struct pipe_screen *pscreen,
57 const struct pipe_resource *tmp);
59 struct pipe_resource *
60 nvc0_miptree_from_handle(struct pipe_screen *pscreen,
61 const struct pipe_resource *template,
62 struct winsys_handle *whandle);
64 struct pipe_surface *
65 nvc0_miptree_surface_new(struct pipe_context *,
66 struct pipe_resource *,
67 const struct pipe_surface *templ);
69 void
70 nvc0_miptree_surface_del(struct pipe_context *, struct pipe_surface *);
72 uint32_t
73 nvc0_miptree_zslice_offset(struct nvc0_miptree *, unsigned l, unsigned z);
75 #endif