summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/radeon_span.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_span.c')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_span.c68
1 files changed, 66 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c
index b0cddbb1d3..53a3210679 100644
--- a/src/mesa/drivers/dri/r300/radeon_span.c
+++ b/src/mesa/drivers/dri/r300/radeon_span.c
@@ -336,11 +336,11 @@ static void radeonSetBuffer(GLcontext * ctx,
int buffer;
switch (bufferBit) {
- case DD_FRONT_LEFT_BIT:
+ case BUFFER_BIT_FRONT_LEFT:
buffer = 0;
break;
- case DD_BACK_LEFT_BIT:
+ case BUFFER_BIT_BACK_LEFT:
buffer = 1;
break;
@@ -432,6 +432,7 @@ void radeonInitSpanFuncs(GLcontext * ctx)
switch (radeon->radeonScreen->cpp) {
case 2:
+#if 0
swdd->WriteRGBASpan = radeonWriteRGBASpan_RGB565;
swdd->WriteRGBSpan = radeonWriteRGBSpan_RGB565;
swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_RGB565;
@@ -439,9 +440,11 @@ void radeonInitSpanFuncs(GLcontext * ctx)
swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_RGB565;
swdd->ReadRGBASpan = radeonReadRGBASpan_RGB565;
swdd->ReadRGBAPixels = radeonReadRGBAPixels_RGB565;
+#endif
break;
case 4:
+#if 0
swdd->WriteRGBASpan = radeonWriteRGBASpan_ARGB8888;
swdd->WriteRGBSpan = radeonWriteRGBSpan_ARGB8888;
swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_ARGB8888;
@@ -449,6 +452,7 @@ void radeonInitSpanFuncs(GLcontext * ctx)
swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_ARGB8888;
swdd->ReadRGBASpan = radeonReadRGBASpan_ARGB8888;
swdd->ReadRGBAPixels = radeonReadRGBAPixels_ARGB8888;
+#endif
break;
default:
@@ -459,14 +463,17 @@ void radeonInitSpanFuncs(GLcontext * ctx)
{
switch (radeon->glCtx->Visual.depthBits) {
case 16:
+#if 0
swdd->ReadDepthSpan = radeonReadDepthSpan_16_LINEAR;
swdd->WriteDepthSpan = radeonWriteDepthSpan_16_LINEAR;
swdd->WriteMonoDepthSpan = radeonWriteMonoDepthSpan_16_LINEAR;
swdd->ReadDepthPixels = radeonReadDepthPixels_16_LINEAR;
swdd->WriteDepthPixels = radeonWriteDepthPixels_16_LINEAR;
+#endif
break;
case 24:
+#if 0
swdd->ReadDepthSpan = radeonReadDepthSpan_24_8_LINEAR;
swdd->WriteDepthSpan = radeonWriteDepthSpan_24_8_LINEAR;
swdd->WriteMonoDepthSpan = radeonWriteMonoDepthSpan_24_8_LINEAR;
@@ -477,6 +484,7 @@ void radeonInitSpanFuncs(GLcontext * ctx)
swdd->WriteStencilSpan = radeonWriteStencilSpan_24_8_LINEAR;
swdd->ReadStencilPixels = radeonReadStencilPixels_24_8_LINEAR;
swdd->WriteStencilPixels = radeonWriteStencilPixels_24_8_LINEAR;
+#endif
break;
default:
@@ -487,14 +495,17 @@ void radeonInitSpanFuncs(GLcontext * ctx)
{
switch (radeon->glCtx->Visual.depthBits) {
case 16:
+#if 0
swdd->ReadDepthSpan = radeonReadDepthSpan_16_TILE;
swdd->WriteDepthSpan = radeonWriteDepthSpan_16_TILE;
swdd->WriteMonoDepthSpan = radeonWriteMonoDepthSpan_16_TILE;
swdd->ReadDepthPixels = radeonReadDepthPixels_16_TILE;
swdd->WriteDepthPixels = radeonWriteDepthPixels_16_TILE;
+#endif
break;
case 24:
+#if 0
swdd->ReadDepthSpan = radeonReadDepthSpan_24_8_TILE;
swdd->WriteDepthSpan = radeonWriteDepthSpan_24_8_TILE;
swdd->WriteMonoDepthSpan = radeonWriteMonoDepthSpan_24_8_TILE;
@@ -505,6 +516,7 @@ void radeonInitSpanFuncs(GLcontext * ctx)
swdd->WriteStencilSpan = radeonWriteStencilSpan_24_8_TILE;
swdd->ReadStencilPixels = radeonReadStencilPixels_24_8_TILE;
swdd->WriteStencilPixels = radeonWriteStencilPixels_24_8_TILE;
+#endif
break;
default:
@@ -515,3 +527,55 @@ void radeonInitSpanFuncs(GLcontext * ctx)
swdd->SpanRenderStart = radeonSpanRenderStart;
swdd->SpanRenderFinish = radeonSpanRenderFinish;
}
+
+/**
+ * Plug in the Get/Put routines for the given driRenderbuffer.
+ */
+void radeonSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
+{
+ if (drb->Base.InternalFormat == GL_RGBA) {
+ if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
+ drb->Base.GetRow = radeonReadRGBASpan_RGB565;
+ drb->Base.GetValues = radeonReadRGBAPixels_RGB565;
+ drb->Base.PutRow = radeonWriteRGBASpan_RGB565;
+ drb->Base.PutRowRGB = radeonWriteRGBSpan_RGB565;
+ drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_RGB565;
+ drb->Base.PutValues = radeonWriteRGBAPixels_RGB565;
+ drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_RGB565;
+ }
+ else {
+ drb->Base.GetRow = radeonReadRGBASpan_ARGB8888;
+ drb->Base.GetValues = radeonReadRGBAPixels_ARGB8888;
+ drb->Base.PutRow = radeonWriteRGBASpan_ARGB8888;
+ drb->Base.PutRowRGB = radeonWriteRGBSpan_ARGB8888;
+ drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_ARGB8888;
+ drb->Base.PutValues = radeonWriteRGBAPixels_ARGB8888;
+ drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_ARGB8888;
+ }
+ }
+ else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
+ drb->Base.GetRow = radeonReadDepthSpan_16_LINEAR;
+ drb->Base.GetValues = radeonReadDepthPixels_16_LINEAR;
+ drb->Base.PutRow = radeonWriteDepthSpan_16_LINEAR;
+ drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_16_LINEAR;
+ drb->Base.PutValues = radeonWriteDepthPixels_16_LINEAR;
+ drb->Base.PutMonoValues = NULL;
+ }
+ else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
+ drb->Base.GetRow = radeonReadDepthSpan_24_8_LINEAR;
+ drb->Base.GetValues = radeonReadDepthPixels_24_8_LINEAR;
+ drb->Base.PutRow = radeonWriteDepthSpan_24_8_LINEAR;
+ drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_24_8_LINEAR;
+ drb->Base.PutValues = radeonWriteDepthPixels_24_8_LINEAR;
+ drb->Base.PutMonoValues = NULL;
+ }
+ else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
+ drb->Base.GetRow = radeonReadStencilSpan_24_8_LINEAR;
+ drb->Base.GetValues = radeonReadStencilPixels_24_8_LINEAR;
+ drb->Base.PutRow = radeonWriteStencilSpan_24_8_LINEAR;
+ drb->Base.PutMonoRow = radeonWriteMonoStencilSpan_24_8_LINEAR;
+ drb->Base.PutValues = radeonWriteStencilPixels_24_8_LINEAR;
+ drb->Base.PutMonoValues = NULL;
+ }
+}
+