gallium: add flags parameter to pipe_screen::context_create
[mesa.git] / src / gallium / drivers / svga / svga_context.h
index 5b04bb482a15dfb59d68425a373426fc2891ad97..2726346bc50653430c01b9d345492425cf49d90c 100644 (file)
@@ -32,7 +32,7 @@
 #include "pipe/p_state.h"
 
 #include "util/u_blitter.h"
-#include "util/u_double_list.h"
+#include "util/list.h"
 
 #include "tgsi/tgsi_scan.h"
 
@@ -200,6 +200,10 @@ struct svga_sampler_state {
 struct svga_velems_state {
    unsigned count;
    struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS];
+   SVGA3dDeclType decl_type[PIPE_MAX_ATTRIBS]; /**< vertex attrib formats */
+   unsigned adjust_attrib_range; /* bitmask of attrs needing range adjustment */
+   unsigned adjust_attrib_w_1;   /* bitmask of attrs needing w = 1 */
+   boolean need_swvfetch;
 };
 
 /* Use to calculate differences between state emitted to hardware and
@@ -219,7 +223,7 @@ struct svga_state
 
    struct pipe_vertex_buffer vb[PIPE_MAX_ATTRIBS];
    struct pipe_index_buffer ib;
-   struct pipe_resource *cb[PIPE_SHADER_TYPES];
+   struct pipe_constant_buffer cbufs[PIPE_SHADER_TYPES];
 
    struct pipe_framebuffer_state framebuffer;
    float depthscale;
@@ -287,6 +291,11 @@ struct svga_hw_draw_state
    unsigned ts[SVGA3D_PIXEL_SAMPLERREG_MAX][SVGA3D_TS_MAX];
    float cb[PIPE_SHADER_TYPES][SVGA3D_CONSTREG_MAX][4];
 
+   /**
+    * For guest backed shader constants only.
+    */
+   struct svga_winsys_surface *hw_cb[PIPE_SHADER_TYPES];
+
    struct svga_shader_variant *fs;
    struct svga_shader_variant *vs;
    struct svga_hw_view_state views[PIPE_MAX_SAMPLERS];
@@ -299,8 +308,6 @@ struct svga_hw_draw_state
  */
 struct svga_sw_state
 {
-   unsigned ve_format[PIPE_MAX_ATTRIBS]; /* NEW_VELEMENT */
-
    /* which parts we need */
    boolean need_swvfetch;
    boolean need_pipeline;
@@ -369,6 +376,8 @@ struct svga_context
    struct {
       unsigned rendertargets:1;
       unsigned texture_samplers:1;
+      unsigned vs:1;
+      unsigned fs:1;
    } rebind;
 
    struct svga_hwtnl *hwtnl;
@@ -469,27 +478,27 @@ void svga_surfaces_flush(struct svga_context *svga);
 
 struct pipe_context *
 svga_context_create(struct pipe_screen *screen,
-                   void *priv);
+                   void *priv, unsigned flags);
 
 
 /***********************************************************************
  * Inline conversion functions.  These are better-typed than the
  * macros used previously:
  */
-static INLINE struct svga_context *
+static inline struct svga_context *
 svga_context( struct pipe_context *pipe )
 {
    return (struct svga_context *)pipe;
 }
 
 
-static INLINE boolean
+static inline boolean
 svga_have_gb_objects(const struct svga_context *svga)
 {
    return svga_screen(svga->pipe.screen)->sws->have_gb_objects;
 }
 
-static INLINE boolean
+static inline boolean
 svga_have_gb_dma(const struct svga_context *svga)
 {
    return svga_screen(svga->pipe.screen)->sws->have_gb_dma;