deactivated SSE for now

cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18778 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-09-08 12:56:41 +00:00
parent 14b15d4423
commit 1b6515a714
4 changed files with 144 additions and 140 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ if $(TARGET_PLATFORM) != haiku {
defines = BEOS_THREADS GNU_ASSEMBLER ; defines = BEOS_THREADS GNU_ASSEMBLER ;
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ; defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM ; #USE_SSE_ASM ;
} else { } else {
# Not yet supported, as current Mesa3D PPC assembly is Linux-dependent! # Not yet supported, as current Mesa3D PPC assembly is Linux-dependent!
# defines += USE_PPC_ASM ; # defines += USE_PPC_ASM ;
+141 -137
View File
@@ -9,7 +9,7 @@
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*/ */
#define CALLED() printf("CALLED %s\n",__PRETTY_FUNCTION__) #define CALLED() //printf("CALLED %s\n",__PRETTY_FUNCTION__)
#include "MesaSoftRenderer.h" #include "MesaSoftRenderer.h"
extern "C" { extern "C" {
@@ -182,6 +182,7 @@ MesaSoftRenderer::SwapBuffers(bool VSync = false)
_mesa_notifySwapBuffers(fContext); _mesa_notifySwapBuffers(fContext);
if (fBitmap) { if (fBitmap) {
CALLED();
GLView()->LockLooper(); GLView()->LockLooper();
GLView()->DrawBitmap(fBitmap); GLView()->DrawBitmap(fBitmap);
GLView()->UnlockLooper(); GLView()->UnlockLooper();
@@ -332,16 +333,15 @@ MesaSoftRenderer::Clear(GLcontext *ctx, GLbitfield mask,
GLboolean all, GLint x, GLint y, GLboolean all, GLint x, GLint y,
GLint width, GLint height) GLint width, GLint height)
{ {
if (mask & DD_FRONT_LEFT_BIT) CALLED();
if (mask & DD_FRONT_LEFT_BIT)
ClearFront(ctx, all, x, y, width, height); ClearFront(ctx, all, x, y, width, height);
if (mask & DD_BACK_LEFT_BIT) if (mask & DD_BACK_LEFT_BIT)
ClearBack(ctx, all, x, y, width, height); ClearBack(ctx, all, x, y, width, height);
mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT);
if (mask) if (mask)
_swrast_Clear( ctx, mask, all, x, y, width, height ); _swrast_Clear( ctx, mask, all, x, y, width, height );
return;
} }
@@ -352,42 +352,41 @@ MesaSoftRenderer::ClearFront(GLcontext *ctx,
{ {
CALLED(); CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BGLView *bglview = mr->GLView(); BGLView *bglview = mr->GLView();
assert(bglview); assert(bglview);
bglview->SetHighColor(mr->fClearColor[BE_RCOMP], bglview->SetHighColor(mr->fClearColor[BE_RCOMP],
mr->fClearColor[BE_GCOMP], mr->fClearColor[BE_GCOMP],
mr->fClearColor[BE_BCOMP], mr->fClearColor[BE_BCOMP],
mr->fClearColor[BE_ACOMP]); mr->fClearColor[BE_ACOMP]);
bglview->SetLowColor(mr->fClearColor[BE_RCOMP], bglview->SetLowColor(mr->fClearColor[BE_RCOMP],
mr->fClearColor[BE_GCOMP], mr->fClearColor[BE_GCOMP],
mr->fClearColor[BE_BCOMP], mr->fClearColor[BE_BCOMP],
mr->fClearColor[BE_ACOMP]); mr->fClearColor[BE_ACOMP]);
if (all) { if (all) {
BRect b = bglview->Bounds(); BRect b = bglview->Bounds();
bglview->FillRect(b); bglview->FillRect(b);
} } else {
else { // XXX untested
// XXX untested BRect b;
BRect b; b.left = x;
b.left = x; b.right = x + width;
b.right = x + width; b.bottom = mr->fHeight - y - 1;
b.bottom = mr->fHeight - y - 1; b.top = b.bottom - height;
b.top = b.bottom - height; bglview->FillRect(b);
bglview->FillRect(b); }
}
// restore drawing color // restore drawing color
#if 0 #if 0
bglview->SetHighColor(md->mColor[BE_RCOMP], bglview->SetHighColor(md->mColor[BE_RCOMP],
md->mColor[BE_GCOMP], md->mColor[BE_GCOMP],
md->mColor[BE_BCOMP], md->mColor[BE_BCOMP],
md->mColor[BE_ACOMP]); md->mColor[BE_ACOMP]);
bglview->SetLowColor(md->mColor[BE_RCOMP], bglview->SetLowColor(md->mColor[BE_RCOMP],
md->mColor[BE_GCOMP], md->mColor[BE_GCOMP],
md->mColor[BE_BCOMP], md->mColor[BE_BCOMP],
md->mColor[BE_ACOMP]); md->mColor[BE_ACOMP]);
#endif #endif
} }
@@ -408,27 +407,25 @@ MesaSoftRenderer::ClearBack(GLcontext *ctx,
const GLuint *clearPixelPtr = (const GLuint *) mr->fClearColor; const GLuint *clearPixelPtr = (const GLuint *) mr->fClearColor;
const GLuint clearPixel = B_LENDIAN_TO_HOST_INT32(*clearPixelPtr); const GLuint clearPixel = B_LENDIAN_TO_HOST_INT32(*clearPixelPtr);
if (all) { if (all) {
const int numPixels = mr->fWidth * mr->fHeight; const int numPixels = mr->fWidth * mr->fHeight;
if (clearPixel == 0) { if (clearPixel == 0) {
memset(start, 0, numPixels * 4); memset(start, 0, numPixels * 4);
} } else {
else { for (int i = 0; i < numPixels; i++) {
for (int i = 0; i < numPixels; i++) { start[i] = clearPixel;
start[i] = clearPixel; }
} }
} } else {
} // XXX untested
else { start += y * mr->fWidth + x;
// XXX untested for (int i = 0; i < height; i++) {
start += y * mr->fWidth + x; for (int j = 0; j < width; j++) {
for (int i = 0; i < height; i++) { start[j] = clearPixel;
for (int j = 0; j < width; j++) { }
start[j] = clearPixel; start += mr->fWidth;
} }
start += mr->fWidth; }
}
}
} }
@@ -527,9 +524,9 @@ MesaSoftRenderer::SetBuffer(GLcontext *ctx, GLframebuffer *buffer,
// This is only used when drawing to the front buffer. // This is only used when drawing to the front buffer.
inline void Plot(BGLView *bglview, int x, int y) inline void Plot(BGLView *bglview, int x, int y)
{ {
// XXX There's got to be a better way! // XXX There's got to be a better way!
BPoint p(x, y), q(x+1, y); BPoint p(x, y), q(x+1, y);
bglview->StrokeLine(p, q); bglview->StrokeLine(p, q);
} }
@@ -621,6 +618,7 @@ MesaSoftRenderer::WriteRGBAPixelsFront(const GLcontext *ctx,
CONST GLubyte rgba[][4], CONST GLubyte rgba[][4],
const GLubyte mask[] ) const GLubyte mask[] )
{ {
CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BGLView *bglview = mr->GLView(); BGLView *bglview = mr->GLView();
assert(bglview); assert(bglview);
@@ -646,6 +644,7 @@ MesaSoftRenderer::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n,
const GLchan color[4], const GLchan color[4],
const GLubyte mask[]) const GLubyte mask[])
{ {
CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BGLView *bglview = mr->GLView(); BGLView *bglview = mr->GLView();
assert(bglview); assert(bglview);
@@ -756,6 +755,7 @@ MesaSoftRenderer::WriteRGBASpanBack(const GLcontext *ctx, GLuint n,
CONST GLubyte rgba[][4], CONST GLubyte rgba[][4],
const GLubyte mask[]) const GLubyte mask[])
{ {
//CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BBitmap *bitmap = mr->fBitmap; BBitmap *bitmap = mr->fBitmap;
@@ -787,6 +787,7 @@ MesaSoftRenderer::WriteRGBSpanBack(const GLcontext *ctx, GLuint n,
CONST GLubyte rgb[][3], CONST GLubyte rgb[][3],
const GLubyte mask[]) const GLubyte mask[])
{ {
CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BBitmap *bitmap = mr->fBitmap; BBitmap *bitmap = mr->fBitmap;
@@ -819,6 +820,7 @@ MesaSoftRenderer::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n,
GLint x, GLint y, GLint x, GLint y,
const GLchan color[4], const GLubyte mask[]) const GLchan color[4], const GLubyte mask[])
{ {
CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BBitmap *bitmap = mr->fBitmap; BBitmap *bitmap = mr->fBitmap;
@@ -849,6 +851,7 @@ MesaSoftRenderer::WriteRGBAPixelsBack(const GLcontext *ctx,
CONST GLubyte rgba[][4], CONST GLubyte rgba[][4],
const GLubyte mask[] ) const GLubyte mask[] )
{ {
//CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BBitmap *bitmap = mr->fBitmap; BBitmap *bitmap = mr->fBitmap;
@@ -865,28 +868,27 @@ MesaSoftRenderer::WriteRGBAPixelsBack(const GLcontext *ctx,
rgba++; rgba++;
}; };
#else #else
if (mask) { if (mask) {
for (GLuint i = 0; i < n; i++) { for (GLuint i = 0; i < n; i++) {
if (mask[i]) { if (mask[i]) {
GLubyte *pixel = (GLubyte *) bitmap->Bits() GLubyte *pixel = (GLubyte *) bitmap->Bits()
+ ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4;
pixel[BE_RCOMP] = rgba[i][RCOMP]; pixel[BE_RCOMP] = rgba[i][RCOMP];
pixel[BE_GCOMP] = rgba[i][GCOMP]; pixel[BE_GCOMP] = rgba[i][GCOMP];
pixel[BE_BCOMP] = rgba[i][BCOMP]; pixel[BE_BCOMP] = rgba[i][BCOMP];
pixel[BE_ACOMP] = rgba[i][ACOMP]; pixel[BE_ACOMP] = rgba[i][ACOMP];
} }
} }
} } else {
else { for (GLuint i = 0; i < n; i++) {
for (GLuint i = 0; i < n; i++) { GLubyte *pixel = (GLubyte *) bitmap->Bits()
GLubyte *pixel = (GLubyte *) bitmap->Bits() + ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4;
+ ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; pixel[BE_RCOMP] = rgba[i][RCOMP];
pixel[BE_RCOMP] = rgba[i][RCOMP]; pixel[BE_GCOMP] = rgba[i][GCOMP];
pixel[BE_GCOMP] = rgba[i][GCOMP]; pixel[BE_BCOMP] = rgba[i][BCOMP];
pixel[BE_BCOMP] = rgba[i][BCOMP]; pixel[BE_ACOMP] = rgba[i][ACOMP];
pixel[BE_ACOMP] = rgba[i][ACOMP]; }
} }
}
#endif #endif
} }
@@ -897,6 +899,7 @@ MesaSoftRenderer::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n,
const GLchan color[4], const GLchan color[4],
const GLubyte mask[]) const GLubyte mask[])
{ {
CALLED();
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
BBitmap *bitmap = mr->fBitmap; BBitmap *bitmap = mr->fBitmap;
@@ -915,22 +918,21 @@ MesaSoftRenderer::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n,
y++; y++;
}; };
#else #else
if (mask) { if (mask) {
for (GLuint i = 0; i < n; i++) { for (GLuint i = 0; i < n; i++) {
if (mask[i]) { if (mask[i]) {
GLubyte * ptr = (GLubyte *) bitmap->Bits() GLubyte * ptr = (GLubyte *) bitmap->Bits()
+ ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4;
*((uint32 *) ptr) = pixel_color; *((uint32 *) ptr) = pixel_color;
} }
} }
} } else {
else { for (GLuint i = 0; i < n; i++) {
for (GLuint i = 0; i < n; i++) { GLubyte * ptr = (GLubyte *) bitmap->Bits()
GLubyte * ptr = (GLubyte *) bitmap->Bits() + ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4;
+ ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; *((uint32 *) ptr) = pixel_color;
*((uint32 *) ptr) = pixel_color; }
} }
}
#endif #endif
} }
@@ -995,20 +997,21 @@ void
MesaSoftRenderer::ReadRGBASpanBack( const GLcontext *ctx, GLuint n, MesaSoftRenderer::ReadRGBASpanBack( const GLcontext *ctx, GLuint n,
GLint x, GLint y, GLubyte rgba[][4] ) GLint x, GLint y, GLubyte rgba[][4] )
{ {
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; CALLED();
const BBitmap *bitmap = mr->fBitmap; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
assert(bitmap); const BBitmap *bitmap = mr->fBitmap;
int row = mr->fBottom - y; assert(bitmap);
const GLubyte *pixel = (GLubyte *) bitmap->Bits() int row = mr->fBottom - y;
+ (row * bitmap->BytesPerRow()) + x * 4; const GLubyte *pixel = (GLubyte *) bitmap->Bits()
+ (row * bitmap->BytesPerRow()) + x * 4;
for (GLuint i = 0; i < n; i++) { for (GLuint i = 0; i < n; i++) {
rgba[i][RCOMP] = pixel[BE_RCOMP]; rgba[i][RCOMP] = pixel[BE_RCOMP];
rgba[i][GCOMP] = pixel[BE_GCOMP]; rgba[i][GCOMP] = pixel[BE_GCOMP];
rgba[i][BCOMP] = pixel[BE_BCOMP]; rgba[i][BCOMP] = pixel[BE_BCOMP];
rgba[i][ACOMP] = pixel[BE_ACOMP]; rgba[i][ACOMP] = pixel[BE_ACOMP];
pixel += 4; pixel += 4;
} }
} }
@@ -1027,30 +1030,31 @@ MesaSoftRenderer::ReadRGBAPixelsBack( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[], GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[] ) GLubyte rgba[][4], const GLubyte mask[] )
{ {
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx; CALLED();
const BBitmap *bitmap = mr->fBitmap; MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
assert(bitmap); const BBitmap *bitmap = mr->fBitmap;
assert(bitmap);
if (mask) { if (mask) {
for (GLuint i = 0; i < n; i++) { for (GLuint i = 0; i < n; i++) {
if (mask[i]) { if (mask[i]) {
GLubyte *pixel = (GLubyte *) bitmap->Bits() GLubyte *pixel = (GLubyte *) bitmap->Bits()
+ ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4;
rgba[i][RCOMP] = pixel[BE_RCOMP]; rgba[i][RCOMP] = pixel[BE_RCOMP];
rgba[i][GCOMP] = pixel[BE_GCOMP]; rgba[i][GCOMP] = pixel[BE_GCOMP];
rgba[i][BCOMP] = pixel[BE_BCOMP]; rgba[i][BCOMP] = pixel[BE_BCOMP];
rgba[i][ACOMP] = pixel[BE_ACOMP]; rgba[i][ACOMP] = pixel[BE_ACOMP];
}; };
}; };
} else { } else {
for (GLuint i = 0; i < n; i++) { for (GLuint i = 0; i < n; i++) {
GLubyte *pixel = (GLubyte *) bitmap->Bits() GLubyte *pixel = (GLubyte *) bitmap->Bits()
+ ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + ((mr->fBottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4;
rgba[i][RCOMP] = pixel[BE_RCOMP]; rgba[i][RCOMP] = pixel[BE_RCOMP];
rgba[i][GCOMP] = pixel[BE_GCOMP]; rgba[i][GCOMP] = pixel[BE_GCOMP];
rgba[i][BCOMP] = pixel[BE_BCOMP]; rgba[i][BCOMP] = pixel[BE_BCOMP];
rgba[i][ACOMP] = pixel[BE_ACOMP]; rgba[i][ACOMP] = pixel[BE_ACOMP];
}; };
}; };
} }
+1 -1
View File
@@ -24,7 +24,7 @@ UseHeaders [ FDirName $(SUBDIR) mesa swrast_setup ] ;
defines = BEOS_THREADS GNU_ASSEMBLER ; defines = BEOS_THREADS GNU_ASSEMBLER ;
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ; defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM ; #USE_SSE_ASM ;
} else if $(TARGET_ARCH) = ppc { } else if $(TARGET_ARCH) = ppc {
# Not yet supported, as current Mesa3D PPC assembly is Linux-dependent! # Not yet supported, as current Mesa3D PPC assembly is Linux-dependent!
# defines += USE_PPC_ASM ; # defines += USE_PPC_ASM ;
+1 -1
View File
@@ -32,7 +32,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) tnl ] ;
defines = BEOS_THREADS GNU_ASSEMBLER ; defines = BEOS_THREADS GNU_ASSEMBLER ;
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM USE_SSE_ASM ; defines += USE_X86_ASM USE_MMX_ASM USE_3DNOW_ASM ; #USE_SSE_ASM ;
} else { } else {
# Not yet supported, as current Mesa3D PPC assembly is Linux-dependent! # Not yet supported, as current Mesa3D PPC assembly is Linux-dependent!
# defines += USE_PPC_ASM ; # defines += USE_PPC_ASM ;