1 /**********************************************************
2 * Copyright 2008-2009 VMware, Inc. All rights reserved.
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 **********************************************************/
30 #include "pipe/p_compiler.h"
31 #include "pipe/p_defines.h"
36 void svga_init_state( struct svga_context
*svga
);
37 void svga_destroy_state( struct svga_context
*svga
);
40 struct svga_tracked_state
{
43 enum pipe_error (*update
)( struct svga_context
*svga
, uint64_t dirty
);
48 extern struct svga_tracked_state svga_update_need_swvfetch
;
49 extern struct svga_tracked_state svga_update_need_pipeline
;
50 extern struct svga_tracked_state svga_update_need_swtnl
;
54 extern struct svga_tracked_state svga_hw_viewport
;
55 extern struct svga_tracked_state svga_hw_scissor
;
56 extern struct svga_tracked_state svga_hw_framebuffer
;
60 extern struct svga_tracked_state svga_need_tgsi_transform
;
61 extern struct svga_tracked_state svga_hw_vs
;
62 extern struct svga_tracked_state svga_hw_fs
;
63 extern struct svga_tracked_state svga_hw_gs
;
64 extern struct svga_tracked_state svga_hw_tcs
;
65 extern struct svga_tracked_state svga_hw_tes
;
66 extern struct svga_tracked_state svga_hw_rss
;
67 extern struct svga_tracked_state svga_hw_pstipple
;
68 extern struct svga_tracked_state svga_hw_sampler
;
69 extern struct svga_tracked_state svga_hw_sampler_bindings
;
70 extern struct svga_tracked_state svga_hw_tss
;
71 extern struct svga_tracked_state svga_hw_tss_binding
;
72 extern struct svga_tracked_state svga_hw_clip_planes
;
73 extern struct svga_tracked_state svga_hw_vdecl
;
74 extern struct svga_tracked_state svga_hw_fs_constants
;
75 extern struct svga_tracked_state svga_hw_gs_constants
;
76 extern struct svga_tracked_state svga_hw_vs_constants
;
77 extern struct svga_tracked_state svga_hw_tes_constants
;
78 extern struct svga_tracked_state svga_hw_tcs_constants
;
79 extern struct svga_tracked_state svga_hw_fs_constbufs
;
80 extern struct svga_tracked_state svga_hw_vs_constbufs
;
81 extern struct svga_tracked_state svga_hw_gs_constbufs
;
82 extern struct svga_tracked_state svga_hw_tcs_constbufs
;
83 extern struct svga_tracked_state svga_hw_tes_constbufs
;
87 extern struct svga_tracked_state svga_update_swtnl_draw
;
88 extern struct svga_tracked_state svga_update_swtnl_vdecl
;
90 /* Bring the hardware fully up-to-date so that we can emit draw
93 #define SVGA_STATE_NEED_SWTNL 0
94 #define SVGA_STATE_HW_CLEAR 1
95 #define SVGA_STATE_HW_DRAW 2
96 #define SVGA_STATE_SWTNL_DRAW 3
97 #define SVGA_STATE_MAX 4
100 enum pipe_error
svga_update_state( struct svga_context
*svga
,
103 bool svga_update_state_retry(struct svga_context
*svga
, unsigned level
);
105 enum pipe_error
svga_emit_initial_state( struct svga_context
*svga
);
107 enum pipe_error
svga_reemit_framebuffer_bindings( struct svga_context
*svga
);
109 enum pipe_error
svga_rebind_framebuffer_bindings( struct svga_context
*svga
);
111 enum pipe_error
svga_reemit_tss_bindings( struct svga_context
*svga
);
113 enum pipe_error
svga_reemit_vs_bindings(struct svga_context
*svga
);
115 enum pipe_error
svga_reemit_fs_bindings(struct svga_context
*svga
);
117 void svga_init_tracked_state(struct svga_context
*svga
);
120 svga_create_fs_state(struct pipe_context
*pipe
,
121 const struct pipe_shader_state
*templ
);
124 svga_bind_fs_state(struct pipe_context
*pipe
, void *shader
);
126 bool svga_update_compute_state(struct svga_context
*svga
);