Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5564 serge 1
 
2
#define __NV50_RESOURCE_H__
3
4
 
5
#include "util/list.h"
6
7
 
8
#include "nouveau_buffer.h"
9
10
 
11
12
 
13
nv50_init_resource_functions(struct pipe_context *pcontext);
14
15
 
16
nv50_screen_init_resource_functions(struct pipe_screen *pscreen);
17
18
 
19
#define NV50_RESOURCE_FLAG_NOALLOC (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 1)
20
21
 
22
#define NV50_TILE_SHIFT_Y(m) ((((m) >> 4) & 0xf) + 2)
23
#define NV50_TILE_SHIFT_Z(m) ((((m) >> 8) & 0xf) + 0)
24
25
 
26
#define NV50_TILE_SIZE_Y(m) ( 4 << (((m) >> 4) & 0xf))
27
#define NV50_TILE_SIZE_Z(m) ( 1 << (((m) >> 8) & 0xf))
28
29
 
30
31
 
32
33
 
34
35
 
36
nv50_tex_choose_tile_dims_helper(unsigned nx, unsigned ny, unsigned nz,
37
                                 boolean is_3d);
38
39
 
40
   uint32_t offset;
41
   uint32_t pitch;
42
   uint32_t tile_mode;
43
};
44
45
 
46
47
 
48
   struct nv04_resource base;
49
   struct nv50_miptree_level level[NV50_MAX_TEXTURE_LEVELS];
50
   uint32_t total_size;
51
   uint32_t layer_stride;
52
   boolean layout_3d; /* TRUE if layer count varies with mip level */
53
   uint8_t ms_x;      /* log2 of number of samples in x/y dimension */
54
   uint8_t ms_y;
55
   uint8_t ms_mode;
56
};
57
58
 
59
nv50_miptree(struct pipe_resource *pt)
60
{
61
   return (struct nv50_miptree *)pt;
62
}
63
64
 
65
 
66
#define NV50_TEXVIEW_FILTER_MSAA8      (1 << 1)
67
#define NV50_TEXVIEW_ACCESS_RESOLVE    (1 << 2)
68
69
 
70
 
71
 */
72
boolean
73
nv50_miptree_init_layout_linear(struct nv50_miptree *mt, unsigned pitch_align);
74
75
 
76
nv50_miptree_create(struct pipe_screen *pscreen,
77
                    const struct pipe_resource *tmp);
78
79
 
80
nv50_miptree_destroy(struct pipe_screen *pscreen, struct pipe_resource *pt);
81
82
 
83
nv50_miptree_from_handle(struct pipe_screen *pscreen,
84
                         const struct pipe_resource *template,
85
                         struct winsys_handle *whandle);
86
87
 
88
nv50_miptree_get_handle(struct pipe_screen *pscreen,
89
                        struct pipe_resource *pt,
90
                        struct winsys_handle *whandle);
91
92
 
93
   struct pipe_surface base;
94
   uint32_t offset;
95
   uint32_t width;
96
   uint16_t height;
97
   uint16_t depth;
98
};
99
100
 
101
nv50_surface(struct pipe_surface *ps)
102
{
103
   return (struct nv50_surface *)ps;
104
}
105
106
 
107
nv50_zs_to_s_format(enum pipe_format format)
108
{
109
   switch (format) {
110
   case PIPE_FORMAT_Z24_UNORM_S8_UINT: return PIPE_FORMAT_X24S8_UINT;
111
   case PIPE_FORMAT_S8_UINT_Z24_UNORM: return PIPE_FORMAT_S8X24_UINT;
112
   case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: return PIPE_FORMAT_X32_S8X24_UINT;
113
   default:
114
      return format;
115
   }
116
}
117
118
 
119
120
 
121
nv50_mt_zslice_offset(const struct nv50_miptree *mt, unsigned l, unsigned z);
122
123
 
124
nv50_miptree_surface_new(struct pipe_context *,
125
                         struct pipe_resource *,
126
                         const struct pipe_surface *templ);
127
128
 
129
nv50_miptree_transfer_map(struct pipe_context *pctx,
130
                          struct pipe_resource *res,
131
                          unsigned level,
132
                          unsigned usage,
133
                          const struct pipe_box *box,
134
                          struct pipe_transfer **ptransfer);
135
void
136
nv50_miptree_transfer_unmap(struct pipe_context *pcontext,
137
                            struct pipe_transfer *ptx);
138
139
 
140
141
 
142
nv50_surface_from_miptree(struct nv50_miptree *mt,
143
                          const struct pipe_surface *templ);
144
145
 
146
nv50_surface_from_buffer(struct pipe_context *pipe,
147
                         struct pipe_resource *pt,
148
                         const struct pipe_surface *templ);
149
150
 
151
nv50_surface_destroy(struct pipe_context *, struct pipe_surface *);
152
153
 
154