st_cb_fbo.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  st_renderbuffer
 Derived renderbuffer class. More...

Defines

#define DEFAULT_ACCUM_PIPE_FORMAT   PIPE_FORMAT_R16G16B16A16_SNORM

Functions

static struct st_renderbufferst_renderbuffer (struct gl_renderbuffer *rb)
struct gl_renderbuffer * st_new_renderbuffer_fb (enum pipe_format format, int samples)
 Allocate a renderbuffer for a an on-screen window (not a user-created renderbuffer).
void st_init_fbo_functions (struct dd_function_table *functions)


Define Documentation

#define DEFAULT_ACCUM_PIPE_FORMAT   PIPE_FORMAT_R16G16B16A16_SNORM

Definition at line 33 of file st_cb_fbo.h.


Function Documentation

void st_init_fbo_functions ( struct dd_function_table *  functions  ) 

Definition at line 448 of file st_cb_fbo.c.

References st_bind_framebuffer(), st_finish_render_texture(), st_framebuffer_renderbuffer(), st_new_framebuffer(), st_new_renderbuffer(), and st_render_texture().

00449 {
00450    functions->NewFramebuffer = st_new_framebuffer;
00451    functions->NewRenderbuffer = st_new_renderbuffer;
00452    functions->BindFramebuffer = st_bind_framebuffer;
00453    functions->FramebufferRenderbuffer = st_framebuffer_renderbuffer;
00454    functions->RenderTexture = st_render_texture;
00455    functions->FinishRenderTexture = st_finish_render_texture;
00456    /* no longer needed by core Mesa, drivers handle resizes...
00457    functions->ResizeBuffers = st_resize_buffers;
00458    */
00459 }

struct gl_renderbuffer* st_new_renderbuffer_fb ( enum pipe_format  format,
int  samples 
) [read]

Allocate a renderbuffer for a an on-screen window (not a user-created renderbuffer).

The window system code determines the format.

Definition at line 254 of file st_cb_fbo.c.

References st_renderbuffer::Base, CALLOC_STRUCT, DEFAULT_ACCUM_PIPE_FORMAT, st_renderbuffer::format, null_get_pointer(), PIPE_FORMAT_A1R5G5B5_UNORM, PIPE_FORMAT_A4R4G4B4_UNORM, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_B8G8R8A8_UNORM, PIPE_FORMAT_B8G8R8X8_UNORM, PIPE_FORMAT_R5G6B5_UNORM, PIPE_FORMAT_S8_UNORM, PIPE_FORMAT_S8Z24_UNORM, PIPE_FORMAT_X8R8G8B8_UNORM, PIPE_FORMAT_X8Z24_UNORM, PIPE_FORMAT_Z16_UNORM, PIPE_FORMAT_Z24S8_UNORM, PIPE_FORMAT_Z24X8_UNORM, PIPE_FORMAT_Z32_UNORM, st_renderbuffer_alloc_storage(), st_renderbuffer_delete(), and st_renderbuffer::surface.

00255 {
00256    struct st_renderbuffer *strb;
00257 
00258    strb = CALLOC_STRUCT(st_renderbuffer);
00259    if (!strb) {
00260       _mesa_error(NULL, GL_OUT_OF_MEMORY, "creating renderbuffer");
00261       return NULL;
00262    }
00263 
00264    _mesa_init_renderbuffer(&strb->Base, 0);
00265    strb->Base.ClassID = 0x4242; /* just a unique value */
00266    strb->Base.Samples = samples;
00267    strb->format = format;
00268 
00269    switch (format) {
00270    case PIPE_FORMAT_A8R8G8B8_UNORM:
00271    case PIPE_FORMAT_B8G8R8A8_UNORM:
00272    case PIPE_FORMAT_X8R8G8B8_UNORM:
00273    case PIPE_FORMAT_B8G8R8X8_UNORM:
00274    case PIPE_FORMAT_A1R5G5B5_UNORM:
00275    case PIPE_FORMAT_A4R4G4B4_UNORM:
00276    case PIPE_FORMAT_R5G6B5_UNORM:
00277       strb->Base.InternalFormat = GL_RGBA;
00278       strb->Base._BaseFormat = GL_RGBA;
00279       break;
00280    case PIPE_FORMAT_Z16_UNORM:
00281       strb->Base.InternalFormat = GL_DEPTH_COMPONENT16;
00282       strb->Base._BaseFormat = GL_DEPTH_COMPONENT;
00283       break;
00284    case PIPE_FORMAT_Z32_UNORM:
00285       strb->Base.InternalFormat = GL_DEPTH_COMPONENT32;
00286       strb->Base._BaseFormat = GL_DEPTH_COMPONENT;
00287       break;
00288    case PIPE_FORMAT_S8Z24_UNORM:
00289    case PIPE_FORMAT_Z24S8_UNORM:
00290    case PIPE_FORMAT_X8Z24_UNORM:
00291    case PIPE_FORMAT_Z24X8_UNORM:
00292       strb->Base.InternalFormat = GL_DEPTH24_STENCIL8_EXT;
00293       strb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT;
00294       break;
00295    case PIPE_FORMAT_S8_UNORM:
00296       strb->Base.InternalFormat = GL_STENCIL_INDEX8_EXT;
00297       strb->Base._BaseFormat = GL_STENCIL_INDEX;
00298       break;
00299    case DEFAULT_ACCUM_PIPE_FORMAT: /*PIPE_FORMAT_R16G16B16A16_SNORM*/
00300       strb->Base.InternalFormat = GL_RGBA16;
00301       strb->Base._BaseFormat = GL_RGBA;
00302       break;
00303    default:
00304       _mesa_problem(NULL,
00305                     "Unexpected format in st_new_renderbuffer_fb");
00306       return NULL;
00307    }
00308 
00309    /* st-specific methods */
00310    strb->Base.Delete = st_renderbuffer_delete;
00311    strb->Base.AllocStorage = st_renderbuffer_alloc_storage;
00312    strb->Base.GetPointer = null_get_pointer;
00313 
00314    /* surface is allocated in st_renderbuffer_alloc_storage() */
00315    strb->surface = NULL;
00316 
00317    return &strb->Base;
00318 }

static struct st_renderbuffer* st_renderbuffer ( struct gl_renderbuffer *  rb  )  [static, read]

Definition at line 58 of file st_cb_fbo.h.

00059 {
00060    return (struct st_renderbuffer *) rb;
00061 }


Generated on Tue Sep 29 06:25:53 2009 for Gallium3D by  doxygen 1.5.4