From: Brian Date: Fri, 15 Jun 2007 15:51:53 +0000 (-0600) Subject: initial framebuffer state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f6b6eed35832733674372dea7bd5ce69a965c4e;p=mesa.git initial framebuffer state --- diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h index dc7a80744af..5c9b9b14fe0 100644 --- a/src/mesa/pipe/p_context.h +++ b/src/mesa/pipe/p_context.h @@ -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 * ); diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h index 7264f253d94..dba1e11715e 100644 --- a/src/mesa/pipe/p_state.h +++ b/src/mesa/pipe/p_state.h @@ -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. */ diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h index da6c17aaf6e..9050b59f77c 100644 --- a/src/mesa/pipe/softpipe/sp_context.h +++ b/src/mesa/pipe/softpipe/sp_context.h @@ -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; diff --git a/src/mesa/sources b/src/mesa/sources index af8d678878f..1aef2f76eb1 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -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 \ diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 6d9460e2f08..b43fc0925b4 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -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;