Merge commit 'origin/7.8'
[mesa.git] / src / gallium / drivers / svga / svga_context.h
index ba86256eb268d507fbadc07b4735e152a7b0d015..9a46de643fd20b1c1d159a7996b5ca63390506bf 100644 (file)
@@ -37,6 +37,7 @@
 
 
 #define SVGA_TEX_UNITS 8
+#define SVGA_MAX_POINTSIZE 80.0
 
 struct draw_vertex_shader;
 struct svga_shader_result;
@@ -115,7 +116,6 @@ struct svga_depth_stencil_state {
    /* SVGA3D has one ref/mask/writemask triple shared between front &
     * back face stencil.  We really need two:
     */
-   unsigned stencil_ref:8;
    unsigned stencil_mask:8;
    unsigned stencil_writemask:8;
 
@@ -145,8 +145,6 @@ struct svga_rasterizer_state {
    float slopescaledepthbias;
    float depthbias;
    float pointsize;
-   float pointsize_min;
-   float pointsize_max;
    
    unsigned hw_unfilled:16;         /* PIPE_POLYGON_MODE_x */
    unsigned need_pipeline:16;    /* which prims do we need help for? */
@@ -171,6 +169,11 @@ struct svga_sampler_state {
    unsigned view_max_lod;
 };
 
+struct svga_velems_state {
+   unsigned count;
+   struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
+};
+
 /* Use to calculate differences between state emitted to hardware and
  * current driver-calculated state.  
  */
@@ -180,14 +183,14 @@ struct svga_state
    const struct svga_depth_stencil_state *depth;
    const struct svga_rasterizer_state *rast;
    const struct svga_sampler_state *sampler[PIPE_MAX_SAMPLERS];
+   const struct svga_velems_state *velems;
 
-   struct pipe_texture *texture[PIPE_MAX_SAMPLERS]; /* or texture ID's? */
+   struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; /* or texture ID's? */
    struct svga_fragment_shader *fs;
    struct svga_vertex_shader *vs;
 
    struct pipe_vertex_buffer vb[PIPE_MAX_ATTRIBS];
-   struct pipe_vertex_element ve[PIPE_MAX_ATTRIBS];
-   struct pipe_buffer *cb[PIPE_SHADER_TYPES];
+   struct pipe_resource *cb[PIPE_SHADER_TYPES];
 
    struct pipe_framebuffer_state framebuffer;
    float depthscale;
@@ -200,12 +203,12 @@ struct svga_state
    struct pipe_poly_stipple poly_stipple;
    struct pipe_scissor_state scissor;
    struct pipe_blend_color blend_color;
+   struct pipe_stencil_ref stencil_ref;
    struct pipe_clip_state clip;
    struct pipe_viewport_state viewport;
 
    unsigned num_samplers;
-   unsigned num_textures;
-   unsigned num_vertex_elements;
+   unsigned num_sampler_views;
    unsigned num_vertex_buffers;
    unsigned reduced_prim;
 
@@ -251,7 +254,7 @@ struct svga_hw_clear_state
 
 struct svga_hw_view_state
 {
-   struct pipe_texture *texture;
+   struct pipe_resource *texture;
    struct svga_sampler_view *v;
    unsigned min_lod;
    unsigned max_lod;
@@ -377,6 +380,7 @@ struct svga_context
 #define SVGA_NEW_VS_RESULT           0x1000000
 #define SVGA_NEW_ZERO_STRIDE         0x2000000
 #define SVGA_NEW_TEXTURE_FLAGS       0x4000000
+#define SVGA_NEW_STENCIL_REF         0x8000000
 
 
 
@@ -426,6 +430,10 @@ void svga_context_flush( struct svga_context *svga,
 
 void svga_hwtnl_flush_retry( struct svga_context *svga );
 
+struct pipe_context *
+svga_context_create(struct pipe_screen *screen,
+                   void *priv);
+
 
 /***********************************************************************
  * Inline conversion functions.  These are better-typed than the