driNewRenderbuffer().
* this function.
* \param format Either GL_RGBA, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24,
* GL_DEPTH_COMPONENT32, or GL_STENCIL_INDEX8_EXT (for now).
+ * \param addr address in main memory of the buffer. Probably a memory
+ * mapped region.
* \param cpp chars or bytes per pixel
* \param offset start of renderbuffer with respect to start of framebuffer
* \param pitch pixels per row
*/
driRenderbuffer *
-driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch)
+driNewRenderbuffer(GLenum format, GLvoid *addr,
+ GLint cpp, GLint offset, GLint pitch,
+ __DRIdrawablePrivate *dPriv)
{
driRenderbuffer *drb;
drb->Base.AllocStorage = driRenderbufferStorage;
drb->Base.Delete = driDeleteRenderbuffer;
+ drb->Base.Data = addr;
+
/* DRI renderbuffer-specific fields: */
+ drb->dPriv = dPriv;
drb->offset = offset;
drb->pitch = pitch;
drb->cpp = cpp;
/* may be changed if page flipping is active: */
drb->flippedOffset = offset;
drb->flippedPitch = pitch;
+ drb->flippedData = addr;
}
return drb;
}
#define DRIRENDERBUFFER_H
#include "mtypes.h"
+#include "dri_util.h"
+
typedef struct {
struct gl_renderbuffer Base;
*/
GLint flippedOffset;
GLint flippedPitch;
- GLubyte *flippedData; /* mmap'd memory, if used */
+ GLvoid *flippedData; /* mmap'd address of buffer memory, if used */
+
+ /* Pointer to corresponding __DRIdrawablePrivate. This is used to compute
+ * the window's position within the framebuffer.
+ */
+ __DRIdrawablePrivate *dPriv;
/* XXX this is for radeon/r200 only. We should really create a new
* r200Renderbuffer class, derived from this class... not a huge deal.
extern driRenderbuffer *
-driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch);
+driNewRenderbuffer(GLenum format, GLvoid *addr,
+ GLint cpp, GLint offset, GLint pitch,
+ __DRIdrawablePrivate *dPriv);
extern void
driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped);
/* XXX double-check these parameters (bpp vs cpp, etc) */
{
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, driScrnPriv->fbBPP / 8,
- driScrnPriv->fbOrigin,
- driScrnPriv->fbStride);
+ driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA,
+ driScrnPriv->pFB,
+ driScrnPriv->fbBPP / 8,
+ driScrnPriv->fbOrigin,
+ driScrnPriv->fbStride,
+ driDrawPriv);
fbSetSpanFunctions(drb, mesaVis);
- drb->Base.Data = driScrnPriv->pFB;
_mesa_add_renderbuffer(mesa_framebuffer,
BUFFER_FRONT_LEFT, &drb->Base);
}
if (mesaVis->doubleBufferMode) {
/* XXX what are the correct origin/stride values? */
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, driScrnPriv->fbBPP /8,
- driScrnPriv->fbOrigin,
- driScrnPriv->fbStride);
+ GLvoid *backBuf = _mesa_malloc(driScrnPriv->fbStride
+ * driScrnPriv->fbHeight);
+ driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA,
+ backBuf,
+ driScrnPriv->fbBPP /8,
+ driScrnPriv->fbOrigin,
+ driScrnPriv->fbStride,
+ driDrawPriv);
fbSetSpanFunctions(drb, mesaVis);
- drb->Base.Data = _mesa_malloc(driScrnPriv->fbStride * driScrnPriv->fbHeight);
_mesa_add_renderbuffer(mesa_framebuffer,
BUFFER_BACK_LEFT, &drb->Base);
}
/* front color renderbuffer */
{
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, bytesPerPixel,
- origin, stride);
+ driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, display->pFB,
+ bytesPerPixel,
+ origin, stride, NULL);
fbSetSpanFunctions(drb, &vis);
- drb->Base.Data = display->pFB;
_mesa_add_renderbuffer(surface->mesa_framebuffer,
BUFFER_FRONT_LEFT, &drb->Base);
}
/* back color renderbuffer */
if (vis.doubleBufferMode) {
- driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, bytesPerPixel,
- origin, stride);
+ GLubyte *backBuf = _mesa_malloc(stride * height);
+ driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, backBuf,
+ bytesPerPixel,
+ origin, stride, NULL);
fbSetSpanFunctions(drb, &vis);
- drb->Base.Data = _mesa_malloc(stride * height);
_mesa_add_renderbuffer(surface->mesa_framebuffer,
BUFFER_BACK_LEFT, &drb->Base);
}
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
+ = driNewRenderbuffer(GL_RGBA, NULL, bpp, offset, bogusPitch,
+ driDrawPriv);
ffbSetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, bpp, offset, bogusPitch);
+ = driNewRenderbuffer(GL_RGBA, NULL, bpp, offset, bogusPitch,
+ driDrawPriv);
ffbSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
}
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, bpp, offset, bogusPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, bpp, offset,
+ bogusPitch, driDrawPriv);
ffbSetDepthFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, bpp, offset,bogusPitch);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, bpp, offset,
+ bogusPitch, driDrawPriv);
ffbSetStencilFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
return GL_FALSE; /* not implemented */
}
else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* s/w alpha planes */);
-#else
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- /*screen->frontOffset*/0, screen->backPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ driScrnPriv->pFB,
+ screen->cpp,
+ /*screen->frontOffset*/0, screen->backPitch,
+ driDrawPriv);
i810SetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- frontRb->Base.Data = driScrnPriv->pFB;
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ screen->back.map,
+ screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
i810SetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- backRb->Base.Data = (GLubyte *) screen->back.map;
}
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ screen->depth.map,
+ screen->cpp,
+ screen->depthOffset, screen->backPitch,
+ driDrawPriv);
i810SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- depthRb->Base.Data = (GLubyte *) screen->depth.map;
}
_mesa_add_soft_renderbuffers(fb,
GL_FALSE, /* alpha */
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
+
return (driDrawPriv->driverPrivate != NULL);
}
}
GLboolean swStencil = mesaVis->stencilBits > 0;
#endif
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* s/w alpha planes */);
-#else
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- /*screen->frontOffset*/0, screen->backPitch);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ /*screen->frontOffset*/0, screen->backPitch,
+ driDrawPriv);
i830SetSpanFunctions(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);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
i830SetSpanFunctions(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->backPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp,
+ screen->depthOffset, screen->backPitch,
+ driDrawPriv);
i830SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else if (mesaVis->depthBits == 24) {
if (mesaVis->stencilBits == 8) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp,
+ screen->depthOffset, screen->backPitch,
+ driDrawPriv);
i830SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else {
/* not really 32-bit Z, but use GL_DEPTH_COMPONENT32 anyway */
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- screen->depthOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT32, NULL, screen->cpp,
+ screen->depthOffset, screen->backPitch,
+ driDrawPriv);
i830SetSpanFunctions(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->backPitch);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, screen->cpp,
+ screen->depthOffset, screen->backPitch,
+ driDrawPriv);
i830SetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
GL_FALSE, /* alpha */
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
return (driDrawPriv->driverPrivate != NULL);
}
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ driScrnPriv->pFB,
+ screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
intelSetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- frontRb->Base.Data = driScrnPriv->pFB;
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ screen->back.map,
+ screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
intelSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- backRb->Base.Data = screen->back.map;
}
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ screen->depth.map,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
intelSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- depthRb->Base.Data = screen->depth.map;
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ screen->depth.map,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
intelSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- depthRb->Base.Data = screen->depth.map;
}
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ screen->depth.map,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
intelSetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
- stencilRb->Base.Data = screen->depth.map;
}
_mesa_add_soft_renderbuffers(fb,
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ NULL,
+ screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
mach64SetSpanFunctions(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);
+ = driNewRenderbuffer(GL_RGBA,
+ NULL,
+ screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
mach64SetSpanFunctions(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);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ NULL, screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
mach64SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else if (mesaVis->depthBits == 24) {
/* XXX I don't think 24-bit Z is supported - so this isn't used */
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
mach64SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ NULL,
+ screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
mgaSetSpanFunctions(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);
+ = driNewRenderbuffer(GL_RGBA,
+ NULL,
+ screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
mgaSetSpanFunctions(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);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
mgaSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
/* XXX is this right? */
if (mesaVis->stencilBits) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
mgaSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT32,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
mgaSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
}
else if (mesaVis->depthBits == 32) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT32,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
mgaSetSpanFunctions(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);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
mgaSetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ NULL,
+ screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
r128SetSpanFunctions(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);
+ = driNewRenderbuffer(GL_RGBA,
+ NULL,
+ screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
r128SetSpanFunctions(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);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
r128SetSpanFunctions(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);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ NULL,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
r128SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
/* front color renderbuffer */
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ driScrnPriv->pFB + screen->frontOffset,
+ screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
r200SetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
/* back color renderbuffer */
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ driScrnPriv->pFB + screen->backOffset,
+ screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
r200SetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
}
/* depth renderbuffer */
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ driScrnPriv->pFB + screen->depthOffset,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
r200SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
depthRb->depthHasSurface = screen->depthHasSurface;
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ driScrnPriv->pFB + screen->depthOffset,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
r200SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
depthRb->depthHasSurface = screen->depthHasSurface;
/* stencil renderbuffer */
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ driScrnPriv->pFB + screen->depthOffset,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
r200SetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
stencilRb->depthHasSurface = screen->depthHasSurface;
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);
+ = driNewRenderbuffer(GL_RGBA, NULL,
+ screen->cpp,
+ screen->frontOffset,
+ screen->frontPitch,
+ driDrawPriv);
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);
+ = driNewRenderbuffer(GL_RGBA, NULL,
+ screen->cpp,
+ screen->backOffset,
+ screen->backPitch,
+ driDrawPriv);
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);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ NULL,
+ screen->cpp,
+ screen->depthOffset,
+ screen->depthPitch,
+ driDrawPriv);
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);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ NULL,
+ screen->cpp,
+ screen->depthOffset,
+ screen->depthPitch,
+ driDrawPriv);
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);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ NULL,
+ screen->cpp,
+ screen->depthOffset,
+ screen->depthPitch,
+ driDrawPriv);
radeonSetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
swAlpha,
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
+
return (driDrawPriv->driverPrivate != NULL);
}
}
/* front color renderbuffer */
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ driScrnPriv->pFB + screen->frontOffset,
+ screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
radeonSetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
/* back color renderbuffer */
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_RGBA,
+ driScrnPriv->pFB + screen->backOffset,
+ screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
radeonSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
}
/* depth renderbuffer */
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ driScrnPriv->pFB + screen->depthOffset,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
radeonSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
depthRb->depthHasSurface = screen->depthHasSurface;
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ driScrnPriv->pFB + screen->depthOffset,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
radeonSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
depthRb->depthHasSurface = screen->depthHasSurface;
/* stencil renderbuffer */
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ driScrnPriv->pFB + screen->depthOffset,
+ screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
radeonSetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
stencilRb->depthHasSurface = screen->depthHasSurface;
return GL_FALSE; /* not implemented */
}
else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0
- );
-#else
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
s3vSetSpanFunctions(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);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
s3vSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
backRb->backBuffer = GL_TRUE;
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
s3vSetSpanFunctions(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);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
s3vSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
/* no h/w stencil yet?
if (mesaVis->stencilBits > 0) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL,
+ screen->cpp, screen->depthOffset,
+ screen->depthPitch, driDrawPriv);
s3vSetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
GL_FALSE, /* alpha */
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
+
return (driDrawPriv->driverPrivate != NULL);
}
}
return GL_FALSE; /* not implemented */
}
else {
- GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24;
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- swStencil,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0 );
-#else
+ GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24;
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
/*
* XXX: this value needs to be set according to the config file
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->aperturePitch);
+ = driNewRenderbuffer(GL_RGBA,
+ (GLubyte *) screen->aperture.map
+ + 0x01000000 * TARGET_FRONT,
+ screen->cpp,
+ screen->frontOffset, screen->aperturePitch,
+ driDrawPriv);
savageSetSpanFunctions(frontRb, mesaVis, float_depth);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
- frontRb->Base.Data = frontRb->flippedData
- = (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_FRONT;
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->aperturePitch);
+ = driNewRenderbuffer(GL_RGBA,
+ (GLubyte *) screen->aperture.map
+ + 0x01000000 * TARGET_BACK,
+ screen->cpp,
+ screen->backOffset, screen->aperturePitch,
+ driDrawPriv);
savageSetSpanFunctions(backRb, mesaVis, float_depth);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
- backRb->Base.Data = backRb->flippedData
- = (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_BACK;
}
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->zpp,
- screen->depthOffset, screen->aperturePitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ (GLubyte *) screen->aperture.map
+ + 0x01000000 * TARGET_DEPTH,
+ screen->zpp,
+ screen->depthOffset, screen->aperturePitch,
+ driDrawPriv);
savageSetSpanFunctions(depthRb, mesaVis, float_depth);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- depthRb->Base.Data = depthRb->flippedData
- = (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_DEPTH;
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->zpp,
- screen->depthOffset, screen->aperturePitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ (GLubyte *) screen->aperture.map
+ + 0x01000000 * TARGET_DEPTH,
+ screen->zpp,
+ screen->depthOffset, screen->aperturePitch,
+ driDrawPriv);
savageSetSpanFunctions(depthRb, mesaVis, float_depth);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
- depthRb->Base.Data = depthRb->flippedData
- = (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_DEPTH;
}
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->zpp,
- screen->depthOffset, screen->aperturePitch);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ (GLubyte *) screen->aperture.map
+ + 0x01000000 * TARGET_DEPTH,
+ screen->zpp,
+ screen->depthOffset, screen->aperturePitch,
+ driDrawPriv);
savageSetSpanFunctions(stencilRb, mesaVis, float_depth);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
GL_FALSE, /* alpha */
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
- return (driDrawPriv->driverPrivate != NULL);
+
+ return (driDrawPriv->driverPrivate != NULL);
}
}
/* XXX double-check the Offset/Pitch parameters! */
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- 0, driScrnPriv->fbStride);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ 0, driScrnPriv->fbStride, driDrawPriv);
sisSetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- 0, driScrnPriv->fbStride);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ 0, driScrnPriv->fbStride, driDrawPriv);
sisSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
}
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- 0, driScrnPriv->fbStride);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp,
+ 0, driScrnPriv->fbStride, driDrawPriv);
sisSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- 0, driScrnPriv->fbStride);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp,
+ 0, driScrnPriv->fbStride, driDrawPriv);
sisSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else if (mesaVis->depthBits == 32) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp,
- 0, driScrnPriv->fbStride);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT32, NULL, screen->cpp,
+ 0, driScrnPriv->fbStride, driDrawPriv);
sisSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
return GL_FALSE; /* not implemented */
}
else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer( mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- GL_FALSE /* software alpha channel? */ );
-#else
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->fbOffset, screen->width);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ screen->fbOffset, screen->width, driDrawPriv);
tdfxSetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->width);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ screen->backOffset, screen->width,
+ driDrawPriv);
tdfxSetSpanFunctions(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->width);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp,
+ screen->depthOffset, screen->width,
+ driDrawPriv);
tdfxSetSpanFunctions(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->width);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp,
+ screen->depthOffset, screen->width,
+ driDrawPriv);
tdfxSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
if (mesaVis->stencilBits > 0) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
- screen->depthOffset, screen->width);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, screen->cpp,
+ screen->depthOffset, screen->width,
+ driDrawPriv);
tdfxSetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}
GL_FALSE, /* alpha */
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
+
return (driDrawPriv->driverPrivate != NULL);
}
}
return GL_FALSE; /* not implemented */
}
else {
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer(mesaVis,
- GL_FALSE, /* software depth buffer? */
- mesaVis->stencilBits > 0,
- mesaVis->accumRedBits > 0,
- mesaVis->alphaBits > 0
- );
-#else
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->frontOffset, screen->frontPitch);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ screen->frontOffset, screen->frontPitch,
+ driDrawPriv);
/*
tridentSetSpanFunctions(frontRb, mesaVis);
*/
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->cpp,
- screen->backOffset, screen->backPitch);
+ = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp,
+ screen->backOffset, screen->backPitch,
+ driDrawPriv);
/*
tridentSetSpanFunctions(backRb, mesaVis);
*/
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
/*
tridentSetSpanFunctions(depthRb, mesaVis);
*/
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
- screen->depthOffset, screen->depthPitch);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp,
+ screen->depthOffset, screen->depthPitch,
+ driDrawPriv);
/*
tridentSetSpanFunctions(depthRb, mesaVis);
*/
GL_FALSE, /* alpha */
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
+
return (driDrawPriv->driverPrivate != NULL);
}
}
#include "via_dri.h"
#include "GL/internal/dri_interface.h"
+#include "drirenderbuffer.h"
/* Radeon configuration
*/
*/
#if 000
+ /* This code _should_ be put to use. We have to move the
+ * viaRenderbuffer members out of the via_context structure.
+ * Those members should just be the renderbuffers hanging off the
+ * gl_framebuffer object.
+ */
/* XXX check/fix the offset/pitch parameters! */
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, screen->bytesPerPixel,
- 0, screen->width);
+ = driNewRenderbuffer(GL_RGBA, NULL,
+ screen->bytesPerPixel,
+ 0, screen->width, driDrawPriv);
viaSetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, screen->bytesPerPixel,
- 0, screen->width);
+ = driNewRenderbuffer(GL_RGBA, NULL,
+ screen->bytesPerPixel,
+ 0, screen->width, driDrawPriv);
viaSetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
}
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->bytesPerPixel,
- 0, screen->width);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL,
+ screen->bytesPerPixel,
+ 0, screen->width, driDrawPriv);
viaSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->bytesPerPixel,
- 0, screen->width);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL,
+ screen->bytesPerPixel,
+ 0, screen->width, driDrawPriv);
viaSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
else if (mesaVis->depthBits == 32) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->bytesPerPixel,
- 0, screen->width);
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT32, NULL,
+ screen->bytesPerPixel,
+ 0, screen->width, driDrawPriv);
viaSetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
}
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->bytesPerPixel,
- 0, screen->width);
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL,
+ screen->bytesPerPixel,
+ 0, screen->width, driDrawPriv);
viaSetSpanFunctions(stencilRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
}