gallium: Update calls to the simple shader functions
[mesa.git] / src / mesa / state_tracker / st_context.h
index 0f40f3ceee95afdb75bc54a064e27f25c6709cba..f235c194b7470d464c6bb346d7c7a4d7d9b24358 100644 (file)
@@ -40,6 +40,9 @@ struct draw_context;
 struct draw_stage;
 struct cso_cache;
 struct cso_blend;
+struct gen_mipmap_state;
+struct blit_state;
+
 
 #define ST_NEW_MESA                    0x1 /* Mesa state has changed */
 #define ST_NEW_FRAGMENT_PROGRAM        0x2
@@ -59,26 +62,6 @@ struct st_tracked_state {
 
 
 
-struct st_texture_image
-{
-   struct gl_texture_image base;
-
-   /* These aren't stored in gl_texture_image 
-    */
-   GLuint level;
-   GLuint face;
-
-   /* If stImage->pt != NULL, image data is stored here.
-    * Else if stImage->base.Data != NULL, image is stored there.
-    * Else there is no image data.
-    */
-   struct pipe_texture *pt;
-
-   struct pipe_surface *surface;
-};
-
-
-
 struct st_context
 {
    GLcontext *ctx;
@@ -94,15 +77,11 @@ struct st_context
     * Other state is just parameter values.
     */
    struct {
-      const struct cso_alpha_test      *alpha_test;
-      const struct cso_blend           *blend;
-      const struct cso_sampler         *sampler[PIPE_MAX_SAMPLERS];
-      const struct cso_depth_stencil_alpha   *depth_stencil;
-      const struct cso_rasterizer      *rasterizer;
-      const struct cso_fragment_shader *fs;
-      const struct cso_vertex_shader   *vs;
-
-      struct pipe_blend_color  blend_color;
+      struct pipe_blend_state               blend;
+      struct pipe_depth_stencil_alpha_state depth_stencil;
+      struct pipe_rasterizer_state          rasterizer;
+      struct pipe_sampler_state             samplers[PIPE_MAX_SAMPLERS];
+      struct pipe_sampler_state             *sampler_list[PIPE_MAX_SAMPLERS];
       struct pipe_clip_state clip;
       struct pipe_constant_buffer constants[2];
       struct pipe_framebuffer_state framebuffer;
@@ -110,6 +89,9 @@ struct st_context
       struct pipe_poly_stipple poly_stipple;
       struct pipe_scissor_state scissor;
       struct pipe_viewport_state viewport;
+
+      GLuint num_samplers;
+      GLuint num_textures;
    } state;
 
    struct {
@@ -143,6 +125,8 @@ struct st_context
 
    GLfloat polygon_offset_scale; /* ?? */
 
+   GLfloat bitmap_texcoord_bias;
+
    /** Mapping from VERT_RESULT_x to post-transformed vertex slot */
    const GLuint *vertex_result_to_slot;
 
@@ -158,20 +142,31 @@ struct st_context
       GLuint combined_prog_sn;
    } pixel_xfer;
 
+   /** for glBitmap */
    struct {
       struct st_fragment_program *program;  /**< bitmap tex/kil program */
       GLuint user_prog_sn;  /**< user fragment program serial no. */
       struct st_fragment_program *combined_prog;
+      struct pipe_shader_state vert_shader;
+      void *vs;
+      float vertices[4][3][4];  /**< vertex pos + color + texcoord */
+      struct pipe_buffer *vbuf;
    } bitmap;
 
-   /**
-    * Buffer object which stores the ctx->Current.Attrib[] values.
-    * Used for vertex array drawing when we we need an attribute for
-    * which there's no enabled array.
-    */
-   struct pipe_buffer_handle *default_attrib_buffer;
-
-   struct cso_cache *cache;
+   /** for glClear */
+   struct {
+      struct pipe_shader_state vert_shader;
+      struct pipe_shader_state frag_shader;
+      void *vs;
+      void *fs;
+      float vertices[4][2][4];  /**< vertex pos + color */
+      struct pipe_buffer *vbuf;
+   } clear;
+
+   struct gen_mipmap_state *gen_mipmap;
+   struct blit_state *blit;
+
+   struct cso_context *cso_context;
 };