#include "tgsi/tgsi_scan.h"
+#include "svga_state.h"
+#include "svga_hw_reg.h"
+#include "svga3d_shaderdefs.h"
+
#define SVGA_TEX_UNITS 8
#define SVGA_MAX_POINTSIZE 80.0
unsigned multisampleantialias:1;
unsigned antialiasedlineenable:1;
unsigned lastpixel:1;
+ unsigned pointsprite:1;
unsigned linepattern;
float pointsize;
unsigned hw_unfilled:16; /* PIPE_POLYGON_MODE_x */
- unsigned need_pipeline:16; /* which prims do we need help for? */
+
+ /** Which prims do we need help for? Bitmask of (1 << PIPE_PRIM_x) flags */
+ unsigned need_pipeline:16;
+
+ /** For debugging: */
+ const char* need_pipeline_tris_str;
+ const char* need_pipeline_lines_str;
+ const char* need_pipeline_points_str;
};
struct svga_sampler_state {
struct svga_vertex_shader *vs;
struct pipe_vertex_buffer vb[PIPE_MAX_ATTRIBS];
+ struct pipe_index_buffer ib;
struct pipe_resource *cb[PIPE_SHADER_TYPES];
struct pipe_framebuffer_state framebuffer;
float zero_stride_constants[PIPE_MAX_ATTRIBS*4];
};
-#define RS_MAX 97
-#define TS_MAX 30
-#define CB_MAX 256
-
struct svga_prescale {
float translate[4];
float scale[4];
};
-/* Updated by calling svga_update_state( SVGA_STATE_HW_VIEWPORT )
+/* Updated by calling svga_update_state( SVGA_STATE_HW_CLEAR )
*/
struct svga_hw_clear_state
{
*/
struct svga_hw_draw_state
{
- unsigned rs[RS_MAX];
- unsigned ts[16][TS_MAX];
- float cb[PIPE_SHADER_TYPES][CB_MAX][4];
+ unsigned rs[SVGA3D_RS_MAX];
+ unsigned ts[SVGA3D_PIXEL_SAMPLERREG_MAX][SVGA3D_TS_MAX];
+ float cb[PIPE_SHADER_TYPES][SVGA3D_CONSTREG_MAX][4];
struct svga_shader_result *fs;
struct svga_shader_result *vs;
boolean need_swvfetch;
boolean need_pipeline;
boolean need_swtnl;
+
+ /* Flag to make sure that need sw is on while
+ * updating state within a swtnl call.
+ */
+ boolean in_swtnl_draw;
};
unsigned shader_id;
unsigned disable_shader;
+
+ boolean no_line_width;
+ boolean force_hw_line_stipple;
} debug;
struct {
struct util_bitmask *vs_bm;
struct {
- unsigned dirty[4];
+ unsigned dirty[SVGA_STATE_MAX];
unsigned texture_timestamp;
struct svga_state curr; /* state from the state tracker */
unsigned dirty; /* statechanges since last update_state() */
+ struct {
+ unsigned rendertargets:1;
+ unsigned texture_samplers:1;
+ } rebind;
+
struct u_upload_mgr *upload_ib;
struct u_upload_mgr *upload_vb;
struct svga_hwtnl *hwtnl;
*/
void svga_clear(struct pipe_context *pipe,
unsigned buffers,
- const float *rgba,
+ const union pipe_color_union *color,
double depth,
unsigned stencil);
void svga_init_constbuffer_functions( struct svga_context *svga );
void svga_init_draw_functions( struct svga_context *svga );
void svga_init_query_functions( struct svga_context *svga );
+void svga_init_surface_functions(struct svga_context *svga);
void svga_cleanup_vertex_state( struct svga_context *svga );
void svga_cleanup_tss_binding( struct svga_context *svga );
struct pipe_fence_handle **pfence );
void svga_hwtnl_flush_retry( struct svga_context *svga );
+void svga_hwtnl_flush_buffer( struct svga_context *svga,
+ struct pipe_resource *buffer );
+
+void svga_surfaces_flush(struct svga_context *svga);
struct pipe_context *
svga_context_create(struct pipe_screen *screen,