initial framebuffer state
authorBrian <brian.paul@tungstengraphics.com>
Fri, 15 Jun 2007 15:51:53 +0000 (09:51 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 15 Jun 2007 15:51:53 +0000 (09:51 -0600)
src/mesa/pipe/p_context.h
src/mesa/pipe/p_state.h
src/mesa/pipe/softpipe/sp_context.h
src/mesa/sources
src/mesa/state_tracker/st_context.h

index dc7a807..5c9b9b1 100644 (file)
@@ -59,6 +59,9 @@ struct pipe_context {
    void (*set_blend_state)( struct pipe_context *,
                             const struct pipe_blend_state * );
 
+   void (*set_framebuffer_state)( struct pipe_context *,
+                                  const struct pipe_framebuffer_state * );
+
    void (*set_cbuf_state)( struct pipe_context *,
                           const struct pipe_surface * );
 
index 7264f25..dba1e11 100644 (file)
@@ -149,7 +149,9 @@ struct pipe_stencil_state {
 
 /* This will change for hardware pipes...
  */
-struct pipe_surface {
+struct pipe_surface
+{
+   GLuint width, height;
    GLubyte *ptr;
    GLint stride;
    GLuint cpp;
@@ -157,6 +159,17 @@ struct pipe_surface {
 };
 
 
+struct pipe_framebuffer_state
+{
+   GLuint num_cbufs;               /**< Number of color bufs to draw to */
+   struct pipe_surface *cbufs[4];  /**< OpenGL can write to as many as
+                                        4 color buffers at once */
+   struct pipe_surface *zbuf;      /**< Z buffer */
+   struct pipe_surface *sbuf;      /**< Stencil buffer */
+   struct pipe_surface *abuf;      /**< Accum buffer */
+};
+
+
 /**
  * Texture sampler state.
  */
index da6c17a..9050b59 100644 (file)
@@ -67,6 +67,7 @@ struct softpipe_context {
 
    /* The most recent drawing state as set by the driver:
     */
+   struct pipe_framebuffer_state framebuffer;
    struct pipe_viewport     viewport;
    struct pipe_setup_state  setup;
    struct pipe_fs_state     fs;
index af8d678..1aef2f7 100644 (file)
@@ -180,6 +180,7 @@ STATETRACKER_SOURCES = \
        state_tracker/st_atom_clip.c \
        state_tracker/st_atom_depth.c \
        state_tracker/st_atom_fs.c \
+       state_tracker/st_atom_framebuffer.c \
        state_tracker/st_atom_scissor.c \
        state_tracker/st_atom_stencil.c \
        state_tracker/st_atom_setup.c \
index 6d9460e..b43fc09 100644 (file)
@@ -65,6 +65,7 @@ struct st_context
     * though, we just shove random objects across the interface.  
     */
    struct {
+      struct pipe_framebuffer_state framebuffer;
       struct pipe_viewport     viewport;
       struct pipe_setup_state  setup;
       struct pipe_fs_state     fs;