diff options
author | Ben Skeggs <[email protected]> | 2005-05-06 08:41:50 +0000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2005-05-06 08:41:50 +0000 |
commit | e133984f517f2273236ca8b22c2a94276c950c55 (patch) | |
tree | ad5d5678e68cf405fd585d179e7a166f32db1a2f /src/mesa/drivers/dri/r300/radeon_screen.c | |
parent | bd8162aaac225fdbdc228c4419d08fa3751b9af6 (diff) |
Updated for EXT_framebuffer_object changes. I don't know if this is correct, but it seems to work
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_screen.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/radeon_screen.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c index 436fa76c46f..394b6b099d2 100644 --- a/src/mesa/drivers/dri/r300/radeon_screen.c +++ b/src/mesa/drivers/dri/r300/radeon_screen.c @@ -39,6 +39,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" #include "imports.h" #include "context.h" +#include "mtypes.h" +#include "framebuffer.h" +#include "renderbuffer.h" #define STANDALONE_MMIO #include "radeon_screen.h" @@ -48,10 +51,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_ioctl.h" #include "radeon_macros.h" #include "radeon_reg.h" +#include "radeon_span.h" #include "utils.h" #include "vblank.h" #include "GL/internal/dri_interface.h" +#include "drirenderbuffer.h" /* R200 configuration */ @@ -662,6 +667,8 @@ radeonCreateBuffer(__DRIscreenPrivate * driScrnPriv, __DRIdrawablePrivate * driDrawPriv, const __GLcontextModes * mesaVis, GLboolean isPixmap) { + radeonScreenPtr screen = (radeonScreenPtr)driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { @@ -670,10 +677,59 @@ radeonCreateBuffer(__DRIscreenPrivate * driScrnPriv, const GLboolean swAccum = mesaVis->accumRedBits > 0; const GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24; +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, swDepth, swStencil, swAccum, swAlpha); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + radeonSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + radeonSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + radeonSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + radeonSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->depthPitch); + radeonSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + swDepth, + swStencil, + swAccum, + swAlpha, + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } |