2 #ifndef NV50_RESOURCE_H
3 #define NV50_RESOURCE_H
5 #include "util/u_transfer.h"
11 /* This gets further specialized into either buffer or texture
12 * structures. In the future we'll want to remove much of that
13 * distinction, but for now try to keep as close to the existing code
14 * as possible and use the vtbl struct to choose between the two
15 * underlying implementations.
17 struct nv50_resource
{
18 struct pipe_resource base
;
19 const struct u_resource_vtbl
*vtbl
;
20 struct nouveau_bo
*bo
;
23 struct nv50_miptree_level
{
29 #define NV50_MAX_TEXTURE_LEVELS 16
32 struct nv50_resource base
;
34 struct nv50_miptree_level level
[NV50_MAX_TEXTURE_LEVELS
];
39 static INLINE
struct nv50_miptree
*
40 nv50_miptree(struct pipe_resource
*pt
)
42 return (struct nv50_miptree
*)pt
;
47 struct nv50_resource
*nv50_resource(struct pipe_resource
*resource
)
49 return (struct nv50_resource
*)resource
;
54 nv50_init_resource_functions(struct pipe_context
*pcontext
);
57 nv50_screen_init_resource_functions(struct pipe_screen
*pscreen
);
61 struct pipe_resource
*
62 nv50_miptree_create(struct pipe_screen
*pscreen
,
63 const struct pipe_resource
*tmp
);
65 struct pipe_resource
*
66 nv50_miptree_from_handle(struct pipe_screen
*pscreen
,
67 const struct pipe_resource
*template,
68 struct winsys_handle
*whandle
);
70 struct pipe_resource
*
71 nv50_buffer_create(struct pipe_screen
*pscreen
,
72 const struct pipe_resource
*template);
74 struct pipe_resource
*
75 nv50_user_buffer_create(struct pipe_screen
*screen
,
82 nv50_miptree_surface_new(struct pipe_screen
*pscreen
, struct pipe_resource
*pt
,
83 unsigned face
, unsigned level
, unsigned zslice
,
87 nv50_miptree_surface_del(struct pipe_surface
*ps
);