revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / gallium / drivers / nv50 / nv50_resource.h
blob0e9f0a2557e22d24e1b82461fa3e6bbbe818c576
2 #ifndef __NV50_RESOURCE_H__
3 #define __NV50_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_buffer.h"
10 #undef NOUVEAU_NVC0
12 void
13 nv50_init_resource_functions(struct pipe_context *pcontext);
15 void
16 nv50_screen_init_resource_functions(struct pipe_screen *pscreen);
18 #define NV50_TILE_DIM_SHIFT(m, d) (((m) >> (d * 4)) & 0xf)
20 #define NV50_TILE_PITCH(m) (64 << 0)
21 #define NV50_TILE_HEIGHT(m) ( 4 << NV50_TILE_DIM_SHIFT(m, 0))
22 #define NV50_TILE_DEPTH(m) ( 1 << NV50_TILE_DIM_SHIFT(m, 1))
24 #define NV50_TILE_SIZE_2D(m) ((64 * 4) << \
25 NV50_TILE_DIM_SHIFT(m, 0))
27 #define NV50_TILE_SIZE(m) (NV50_TILE_SIZE_2D(m) << NV50_TILE_DIM_SHIFT(m, 1))
29 struct nv50_miptree_level {
30 uint32_t offset;
31 uint32_t pitch;
32 uint32_t tile_mode;
35 #define NV50_MAX_TEXTURE_LEVELS 16
37 struct nv50_miptree {
38 struct nv04_resource base;
39 struct nv50_miptree_level level[NV50_MAX_TEXTURE_LEVELS];
40 uint32_t total_size;
41 uint32_t layer_stride;
42 boolean layout_3d; /* TRUE if layer count varies with mip level */
45 static INLINE struct nv50_miptree *
46 nv50_miptree(struct pipe_resource *pt)
48 return (struct nv50_miptree *)pt;
51 /* Internal functions:
53 struct pipe_resource *
54 nv50_miptree_create(struct pipe_screen *pscreen,
55 const struct pipe_resource *tmp);
57 struct pipe_resource *
58 nv50_miptree_from_handle(struct pipe_screen *pscreen,
59 const struct pipe_resource *template,
60 struct winsys_handle *whandle);
62 struct pipe_surface *
63 nv50_miptree_surface_new(struct pipe_context *,
64 struct pipe_resource *,
65 const struct pipe_surface *templ);
67 void
68 nv50_miptree_surface_del(struct pipe_context *, struct pipe_surface *);
70 #endif