Restored generic (non-SIMD) code

This commit is contained in:
Brian Harris
2013-05-29 13:12:13 -05:00
parent be311f42e1
commit 9c37079c16
23 changed files with 3328 additions and 24 deletions

View File

@@ -43,6 +43,7 @@ static void R_TracePointCullStatic( byte *cullBits, byte &totalOr, const float r
assert_16_byte_aligned( cullBits );
assert_16_byte_aligned( verts );
#ifdef ID_WIN_X86_SSE2_INTRIN
idODSStreamedArray< idDrawVert, 16, SBT_DOUBLE, 4 > vertsODS( verts, numVerts );
@@ -164,6 +165,54 @@ static void R_TracePointCullStatic( byte *cullBits, byte &totalOr, const float r
totalOr = (byte) _mm_cvtsi128_si32( vecTotalOrByte );
#else
idODSStreamedArray< idDrawVert, 16, SBT_DOUBLE, 1 > vertsODS( verts, numVerts );
byte tOr = 0;
for ( int i = 0; i < numVerts; ) {
const int nextNumVerts = vertsODS.FetchNextBatch() - 1;
for ( ; i <= nextNumVerts; i++ ) {
const idVec3 & v = vertsODS[i].xyz;
const float d0 = planes[0].Distance( v );
const float d1 = planes[1].Distance( v );
const float d2 = planes[2].Distance( v );
const float d3 = planes[3].Distance( v );
const float t0 = d0 + radius;
const float t1 = d1 + radius;
const float t2 = d2 + radius;
const float t3 = d3 + radius;
const float s0 = d0 - radius;
const float s1 = d1 - radius;
const float s2 = d2 - radius;
const float s3 = d3 - radius;
byte bits;
bits = IEEE_FLT_SIGNBITSET( t0 ) << 0;
bits |= IEEE_FLT_SIGNBITSET( t1 ) << 1;
bits |= IEEE_FLT_SIGNBITSET( t2 ) << 2;
bits |= IEEE_FLT_SIGNBITSET( t3 ) << 3;
bits |= IEEE_FLT_SIGNBITSET( s0 ) << 4;
bits |= IEEE_FLT_SIGNBITSET( s1 ) << 5;
bits |= IEEE_FLT_SIGNBITSET( s2 ) << 6;
bits |= IEEE_FLT_SIGNBITSET( s3 ) << 7;
bits ^= 0x0F; // flip lower four bits
tOr |= bits;
cullBits[i] = bits;
}
}
totalOr = tOr;
#endif
}
/*
@@ -175,6 +224,7 @@ static void R_TracePointCullSkinned( byte *cullBits, byte &totalOr, const float
assert_16_byte_aligned( cullBits );
assert_16_byte_aligned( verts );
#ifdef ID_WIN_X86_SSE2_INTRIN
idODSStreamedArray< idDrawVert, 16, SBT_DOUBLE, 4 > vertsODS( verts, numVerts );
@@ -296,6 +346,54 @@ static void R_TracePointCullSkinned( byte *cullBits, byte &totalOr, const float
totalOr = (byte) _mm_cvtsi128_si32( vecTotalOrByte );
#else
idODSStreamedArray< idDrawVert, 16, SBT_DOUBLE, 1 > vertsODS( verts, numVerts );
byte tOr = 0;
for ( int i = 0; i < numVerts; ) {
const int nextNumVerts = vertsODS.FetchNextBatch() - 1;
for ( ; i <= nextNumVerts; i++ ) {
const idVec3 v = Scalar_LoadSkinnedDrawVertPosition( vertsODS[i], joints );
const float d0 = planes[0].Distance( v );
const float d1 = planes[1].Distance( v );
const float d2 = planes[2].Distance( v );
const float d3 = planes[3].Distance( v );
const float t0 = d0 + radius;
const float t1 = d1 + radius;
const float t2 = d2 + radius;
const float t3 = d3 + radius;
const float s0 = d0 - radius;
const float s1 = d1 - radius;
const float s2 = d2 - radius;
const float s3 = d3 - radius;
byte bits;
bits = IEEE_FLT_SIGNBITSET( t0 ) << 0;
bits |= IEEE_FLT_SIGNBITSET( t1 ) << 1;
bits |= IEEE_FLT_SIGNBITSET( t2 ) << 2;
bits |= IEEE_FLT_SIGNBITSET( t3 ) << 3;
bits |= IEEE_FLT_SIGNBITSET( s0 ) << 4;
bits |= IEEE_FLT_SIGNBITSET( s1 ) << 5;
bits |= IEEE_FLT_SIGNBITSET( s2 ) << 6;
bits |= IEEE_FLT_SIGNBITSET( s3 ) << 7;
bits ^= 0x0F; // flip lower four bits
tOr |= bits;
cullBits[i] = bits;
}
}
totalOr = tOr;
#endif
}
/*