1b79235ae0d294d62c5329b99ccbc467dedc449b
[mesa.git] / src / gallium / drivers / nvfx / nvfx_screen.h
1 #ifndef __NVFX_SCREEN_H__
2 #define __NVFX_SCREEN_H__
3
4 #include "pipe/p_compiler.h"
5 #include "util/u_double_list.h"
6 #include "nouveau/nouveau_screen.h"
7
8 struct pipe_screen;
9
10 struct nvfx_screen {
11 struct nouveau_screen base;
12
13 struct nouveau_winsys *nvws;
14
15 struct nvfx_context *cur_ctx;
16
17 unsigned is_nv4x; /* either 0 or ~0 */
18 boolean force_swtnl;
19 boolean trace_draw;
20 unsigned vertex_buffer_reloc_flags;
21 unsigned index_buffer_reloc_flags;
22
23 /* HW graphics objects */
24 struct nouveau_grobj *eng3d;
25 struct nouveau_notifier *sync;
26
27 /* Query object resources */
28 struct nouveau_notifier *query;
29 struct nouveau_resource *query_heap;
30 struct list_head query_list;
31
32 /* Vtxprog resources */
33 struct nouveau_resource *vp_exec_heap;
34 struct nouveau_resource *vp_data_heap;
35
36 struct nv04_2d_context* eng2d;
37
38 /* Once the amount of bytes drawn from the buffer reaches the updated size times this value,
39 * we will assume that the buffer will be drawn an huge number of times before the
40 * next modification
41 */
42 float static_reuse_threshold;
43
44 /* Cost of allocating a buffer in terms of the cost of copying a byte to an hardware buffer */
45 unsigned buffer_allocation_cost;
46
47 /* inline_cost/hardware_cost conversion ration */
48 float inline_cost_per_hardware_cost;
49 };
50
51 static INLINE struct nvfx_screen *
52 nvfx_screen(struct pipe_screen *screen)
53 {
54 return (struct nvfx_screen *)screen;
55 }
56
57 int nvfx_screen_surface_init(struct pipe_screen *pscreen);
58 void nvfx_screen_surface_takedown(struct pipe_screen *pscreen);
59
60 #endif