summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common/spantmp2.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-11-02 18:25:45 +0000
committerIan Romanick <[email protected]>2004-11-02 18:25:45 +0000
commitbdd53efe8302e85fd1be4ceda0aa576e0119b14e (patch)
tree6d53a3f0f23fd2438f83a67b93fea28ac6845427 /src/mesa/drivers/dri/common/spantmp2.h
parent2302cc1a25f7ab55b7e7d6647175308cd64ab7f1 (diff)
Added MMX optimized version of the RGB565 ReadRGBASpan routine.
Diffstat (limited to 'src/mesa/drivers/dri/common/spantmp2.h')
-rw-r--r--src/mesa/drivers/dri/common/spantmp2.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h
index 5a161b11ddf..ce48257836d 100644
--- a/src/mesa/drivers/dri/common/spantmp2.h
+++ b/src/mesa/drivers/dri/common/spantmp2.h
@@ -377,8 +377,10 @@ static void TAG(ReadRGBASpan)( const GLcontext *ctx,
#if defined(USE_MMX_ASM) && \
- (SPANTMP_PIXEL_FMT == GL_BGRA) && \
- (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
+ (((SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
+ ((SPANTMP_PIXEL_FMT == GL_RGB) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
GLubyte rgba[][4])
@@ -406,7 +408,12 @@ static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx,
{
const char * src = GET_SRC_PTR( x1, y );
+#if (SPANTMP_PIXEL_FMT == GL_RGB) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)
+ _generic_read_RGBA_span_RGB565_MMX( src, rgba[i], n1 );
+#else
_generic_read_RGBA_span_BGRA8888_REV_MMX( src, rgba[i], n1 );
+#endif
}
}
HW_ENDCLIPLOOP();
@@ -539,30 +546,35 @@ static void TAG(InitPointers)(struct swrast_device_driver *swdd)
swdd->WriteMonoRGBAPixels = TAG(WriteMonoRGBAPixels);
swdd->ReadRGBAPixels = TAG(ReadRGBAPixels);
-#if (SPANTMP_PIXEL_FMT == GL_BGRA) && \
+#if defined(USE_SSE_ASM) && \
+ (SPANTMP_PIXEL_FMT == GL_BGRA) && \
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
-#if defined(USE_SSE_ASM)
if ( cpu_has_xmm2 ) {
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "SSE2" );
swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _SSE2);
}
else
#endif
-#if defined(USE_SSE_ASM)
+#if defined(USE_SSE_ASM) && \
+ (SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
if ( cpu_has_xmm ) {
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "SSE" );
swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _SSE);
}
else
#endif
-#if defined(USE_MMX_ASM)
+#if defined(USE_MMX_ASM) && \
+ (((SPANTMP_PIXEL_FMT == GL_BGRA) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
+ ((SPANTMP_PIXEL_FMT == GL_RGB) && \
+ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
if ( cpu_has_mmx ) {
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "MMX" );
swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _MMX);
}
else
#endif
-#endif
{
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "C" );
swdd->ReadRGBASpan = TAG(ReadRGBASpan);