Merge branch 'mesa_7_6_branch'
[mesa.git] / src / gallium / state_trackers / xorg / xorg_exa.h
1 #ifndef XORG_EXA_H
2 #define XORG_EXA_H
3
4 #include "xorg_tracker.h"
5
6 #include <pipe/p_state.h>
7
8 struct cso_context;
9 struct xorg_shaders;
10
11 /* src + mask + dst */
12 #define MAX_EXA_SAMPLERS 3
13
14 struct exa_context
15 {
16 ExaDriverPtr pExa;
17 struct pipe_context *pipe;
18 struct pipe_screen *scrn;
19 struct cso_context *cso;
20 struct xorg_shaders *shaders;
21
22 struct pipe_constant_buffer vs_const_buffer;
23 struct pipe_constant_buffer fs_const_buffer;
24
25 struct pipe_texture *bound_textures[MAX_EXA_SAMPLERS];
26 int num_bound_samplers;
27
28 float solid_color[4];
29 boolean has_solid_color;
30
31 struct {
32 struct exa_pixmap_priv *src;
33 struct exa_pixmap_priv *dst;
34 } copy;
35
36 /* we should combine these two */
37 float vertices2[4][2][4];
38 float vertices3[4][3][4];
39 };
40
41 struct exa_pixmap_priv
42 {
43 int flags;
44 int tex_flags;
45
46 struct pipe_texture *tex;
47 struct pipe_texture *depth_stencil_tex;
48
49 struct pipe_transfer *map_transfer;
50 unsigned map_count;
51 };
52
53 #define XORG_FALLBACK(s, arg...) \
54 do { \
55 if (ms->debug_fallback) { \
56 xf86DrvMsg(pScrn->scrnIndex, X_INFO, \
57 "fallback: " s "\n", ##arg); \
58 } \
59 return FALSE; \
60 } while(0)
61
62 struct pipe_surface *
63 exa_gpu_surface(struct exa_context *exa, struct exa_pixmap_priv *priv);
64
65 void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
66 struct pipe_fence_handle **fence);
67 void xorg_exa_finish(struct exa_context *exa);
68
69 #endif