From 6e3da05b1ef30b0cf297c67d9b5fe0a711983130 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz <jakob@vmware.com>
Date: Tue, 19 Jan 2010 18:55:40 +0000
Subject: [PATCH] Remove all state that can be derived from the buffer_mask

---
 st_api.h |   66 ++++++++++++-------------------------------------------------
 1 files changed, 13 insertions(+), 53 deletions(-)

diff --git a/st_api.h b/st_api.h
index 6dd93c5..0b5ceb4 100644
--- a/st_api.h
+++ b/st_api.h
@@ -78,6 +78,15 @@ enum st_framebuffer_attachment {
    ST_FRAMEBUFFER_DEPTH_STENCIL,
    ST_FRAMEBUFFER_ACCUM,
    ST_FRAMEBUFFER_SAMPLE,
+
+   /* for buffer_mask in visual */
+   ST_FRAMEBUFFER_FRONT_LEFT_MASK = (1 << ST_FRAMEBUFFER_FRONT_LEFT),
+   ST_FRAMEBUFFER_BACK_LEFT_MASK = (1 << ST_FRAMEBUFFER_FRONT_RIGHT),
+   ST_FRAMEBUFFER_FRONT_RIGHT_MASK = (1 << ST_FRAMEBUFFER_FRONT_RIGHT),
+   ST_FRAMEBUFFER_BACK_RIGHT_MASK = (1 << ST_FRAMEBUFFER_BACK_RIGHT),
+   ST_FRAMEBUFFER_DEPTH_STENCIL = (1 << ST_FRAMEBUFFER_DEPTH_STENCIL),
+   ST_FRAMEBUFFER_ACCUM_MASK = (1 << ST_FRAMEBUFFER_ACCUM),
+   ST_FRAMEBUFFER_SAMPLE_MASK = (1 << ST_FRAMEBUFFER_SAMPLE),
 };
 
 enum st_manager_resource_type {
@@ -110,31 +119,11 @@ struct st_visual
    enum pipe_format color_format;
    enum pipe_format depth_stencil_format;
    enum pipe_format accum_format;
+   unsigned buffer_mask;
    int samples;
 };
 
 /**
- * Describe the config of a framebuffer.
- */
-struct st_framebuffer_config
-{
-   /**
-    * Available buffers.  Tested with (1 << attachment).
-    */
-   uint available_buffers;
-
-   /**
-    * The formats of the available buffers.
-    */
-   struct st_visual visual;
-
-   /**
-    * Desired render buffer.
-    */
-   enum st_framebuffer_attachment render_buffer;
-};
-
-/**
  * Represent a windowing system drawable.
  *
  * The framebuffer is implemented by the state tracker manager and
@@ -155,7 +144,7 @@ struct st_framebuffer_config
  */
 struct st_framebuffer
 {
-   const struct st_framebuffer_config *config;
+   const struct st_visual *visual;
 
    /**
     * Flush the front buffer.
@@ -180,11 +169,6 @@ struct st_framebuffer
                        const enum st_framebuffer_attachment *att,
                        unsigned count,
                        struct pipe_texture **out);
-
-   /**
-    * Available for the state tracker manager to use.
-    */
-   void *st_manager_private;
 };
 
 /**
@@ -208,30 +192,6 @@ struct st_context_resource
 };
 
 /**
- * Describe the config of a context.
- *
- * This entity is used by the state tracker manager to tell the state tracker
- * what kinds of rendering context to create.
- */
-struct st_context_config
-{
-   /**
-    * The formats the context must use.
-    */
-   struct st_visual visual;
-
-   /**
-    * True if the context must support rendering to front and back buffers.
-    */
-   boolean double_buffer;
-
-   /**
-    * True if the context must support rendering to left and right buffers.
-    */
-   boolean stereo;
-};
-
-/**
  * Represent a rendering context.
  *
  * This entity is created from st_api and used by the state tracker manager.
@@ -309,7 +269,7 @@ struct st_api
     * specified config.
     */
    boolean (*is_config_supported)(struct st_api *api,
-	                          const struct st_context_config *config);
+	                          const struct st_visual *visual);
 
    /**
     * Create a rendering context.
@@ -319,7 +279,7 @@ struct st_api
     */
    struct st_context *(*create_context)(struct st_api *api,
                                         struct pipe_context *pipe,
-                                        const struct st_context_config *config,
+                                        const struct st_visual *visual,
                                         struct st_context *share);
 
    /**
-- 
1.6.0.4

