diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-05-04 20:11:35 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-05-04 20:11:35 +0000 |
commit | e4b2356c07d31fbeeabb13b2fb47db703b473080 (patch) | |
tree | d8b7f1c7c9e7c84d84349485f942dd205dd4c16d /src/mesa/drivers/dri/unichrome/via_span.c | |
parent | ebef61f5c0950572f9c6a81b08f447957461675c (diff) |
Major check-in of changes for GL_EXT_framebuffer_object extension.
Main driver impacts:
- new code for creating the Mesa GLframebuffer
- new span/pixel read/write code
Some drivers not yet updated/tested.
Diffstat (limited to 'src/mesa/drivers/dri/unichrome/via_span.c')
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_span.c | 64 |
1 files changed, 60 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index e5e25f08c1..0fbac9b506 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -178,10 +178,10 @@ static void viaSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, { struct via_context *vmesa = VIA_CONTEXT(ctx); - if (bufferBit == DD_FRONT_LEFT_BIT) { + if (bufferBit == BUFFER_BIT_FRONT_LEFT) { vmesa->drawBuffer = vmesa->readBuffer = &vmesa->front; } - else if (bufferBit == DD_BACK_LEFT_BIT) { + else if (bufferBit == BUFFER_BIT_BACK_LEFT) { vmesa->drawBuffer = vmesa->readBuffer = &vmesa->back; } else { @@ -207,10 +207,13 @@ void viaSpanRenderFinish( GLcontext *ctx ) void viaInitSpanFuncs(GLcontext *ctx) { +#if 0 struct via_context *vmesa = VIA_CONTEXT(ctx); +#endif struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); swdd->SetBuffer = viaSetBuffer; +#if 0 if (vmesa->viaScreen->bitsPerPixel == 16) { viaInitPointers_565( swdd ); } @@ -220,7 +223,8 @@ void viaInitSpanFuncs(GLcontext *ctx) else { assert(0); } - +#endif +#if 0 if (vmesa->glCtx->Visual.depthBits == 16) { swdd->ReadDepthSpan = viaReadDepthSpan_16; swdd->WriteDepthSpan = viaWriteDepthSpan_16; @@ -247,11 +251,12 @@ void viaInitSpanFuncs(GLcontext *ctx) swdd->ReadDepthPixels = viaReadDepthPixels_32; swdd->WriteDepthPixels = viaWriteDepthPixels_32; } +#endif swdd->SpanRenderStart = viaSpanRenderStart; swdd->SpanRenderFinish = viaSpanRenderFinish; - +#if 0 swdd->WriteCI8Span = NULL; swdd->WriteCI32Span = NULL; swdd->WriteMonoCISpan = NULL; @@ -259,4 +264,55 @@ void viaInitSpanFuncs(GLcontext *ctx) swdd->WriteMonoCIPixels = NULL; swdd->ReadCI32Span = NULL; swdd->ReadCI32Pixels = NULL; +#endif +} + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +viaSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + viaInitPointers_565(&drb->Base); + } + else { + viaInitPointers_8888(&drb->Base); + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = viaReadDepthSpan_16; + drb->Base.GetValues = viaReadDepthPixels_16; + drb->Base.PutRow = viaWriteDepthSpan_16; + drb->Base.PutMonoRow = viaWriteMonoDepthSpan_16; + drb->Base.PutValues = viaWriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = viaReadDepthSpan_24_8; + drb->Base.GetValues = viaReadDepthPixels_24_8; + drb->Base.PutRow = viaWriteDepthSpan_24_8; + drb->Base.PutMonoRow = viaWriteMonoDepthSpan_24_8; + drb->Base.PutValues = viaWriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + drb->Base.GetRow = viaReadDepthSpan_32; + drb->Base.GetValues = viaReadDepthPixels_32; + drb->Base.PutRow = viaWriteDepthSpan_32; + drb->Base.PutMonoRow = viaWriteMonoDepthSpan_32; + drb->Base.PutValues = viaWriteDepthPixels_32; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = viaReadStencilSpan_24_8; + drb->Base.GetValues = viaReadStencilPixels_24_8; + drb->Base.PutRow = viaWriteStencilSpan_24_8; + drb->Base.PutMonoRow = viaWriteMonoStencilSpan_24_8; + drb->Base.PutValues = viaWriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } } |