1 #include "draw/draw_context.h"
2 #include "pipe/p_defines.h"
3 #include "pipe/p_winsys.h"
5 #include "nv40_context.h"
6 #include "nv40_screen.h"
9 nv40_flush(struct pipe_context
*pipe
, unsigned flags
,
10 struct pipe_fence_handle
**fence
)
12 struct nv40_context
*nv40
= nv40_context(pipe
);
14 if (flags
& PIPE_FLUSH_TEXTURE_CACHE
) {
15 BEGIN_RING(curie
, 0x1fd8, 1);
17 BEGIN_RING(curie
, 0x1fd8, 1);
25 nv40_destroy(struct pipe_context
*pipe
)
27 struct nv40_context
*nv40
= nv40_context(pipe
);
30 draw_destroy(nv40
->draw
);
35 nv40_create(struct pipe_screen
*pscreen
, unsigned pctx_id
)
37 struct nv40_screen
*screen
= nv40_screen(pscreen
);
38 struct pipe_winsys
*ws
= pscreen
->winsys
;
39 struct nv40_context
*nv40
;
40 struct nouveau_winsys
*nvws
= screen
->nvws
;
42 nv40
= CALLOC(1, sizeof(struct nv40_context
));
45 nv40
->screen
= screen
;
46 nv40
->pctx_id
= pctx_id
;
50 nv40
->pipe
.winsys
= ws
;
51 nv40
->pipe
.screen
= pscreen
;
52 nv40
->pipe
.destroy
= nv40_destroy
;
53 nv40
->pipe
.draw_arrays
= nv40_draw_arrays
;
54 nv40
->pipe
.draw_elements
= nv40_draw_elements
;
55 nv40
->pipe
.clear
= nv40_clear
;
56 nv40
->pipe
.flush
= nv40_flush
;
58 nv40_init_query_functions(nv40
);
59 nv40_init_surface_functions(nv40
);
60 nv40_init_state_functions(nv40
);
62 /* Create, configure, and install fallback swtnl path */
63 nv40
->draw
= draw_create();
64 draw_wide_point_threshold(nv40
->draw
, 9999999.0);
65 draw_wide_line_threshold(nv40
->draw
, 9999999.0);
66 draw_enable_line_stipple(nv40
->draw
, FALSE
);
67 draw_enable_point_sprites(nv40
->draw
, FALSE
);
68 draw_set_rasterize_stage(nv40
->draw
, nv40_draw_render_stage(nv40
));