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 dc7a80744afd3498be8febcdcff213d4c3b89573..5c9b9b14fe02bd7a0ced4c6d9905b7c863301bdd 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 7264f253d94292dc6b62e26c56ce0eef6e852325..dba1e11715e3e077b735aacf74d8dab36961ce05 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 da6c17aaf6ecde7503ba74ddcea52d65173029f3..9050b59f77c1a4ca94ef1d80a883771a2f5eef4c 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 af8d678878f83834bd0156c14e62adc49c18257e..1aef2f76eb1733b050060aa9457f1e255a664903 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 6d9460e2f08a44082a6342f0afce6d97bccae0ab..b43fc0925b4bea3457d1d5c32da6fcbc8af5264e 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;