diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-11-05 09:52:14 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-11-05 09:52:14 -0700 |
commit | 616bf3556939d94852b1dfe73f92ef94b10782c4 (patch) | |
tree | 948ba9f332ff9db490cdfd4f295f33f371611ec0 /src/mesa/state_tracker/st_framebuffer.c | |
parent | f221ea658b8aabefb419ad19826906a3afa3e806 (diff) |
added st_get_framebuffer_surface() and ST_SURFACE_x tokens
Diffstat (limited to 'src/mesa/state_tracker/st_framebuffer.c')
-rw-r--r-- | src/mesa/state_tracker/st_framebuffer.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 54ae175e60..326773c505 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -112,3 +112,23 @@ void st_unreference_framebuffer( struct st_framebuffer **stfb ) } + +/** + * Return the pipe_surface for the given renderbuffer. + */ +struct pipe_surface * +st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex) +{ + struct st_renderbuffer *strb; + + assert(surfIndex <= ST_SURFACE_BACK_RIGHT); + + /* sanity checks, ST tokens should match Mesa tokens */ + assert(ST_SURFACE_FRONT_LEFT == BUFFER_FRONT_LEFT); + assert(ST_SURFACE_BACK_RIGHT == BUFFER_BACK_RIGHT); + + strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer); + if (strb) + return strb->surface; + return NULL; +} |