#else
-#if SWR_ENABLE_ASSERTS
-#if defined(assert)
-#undef assert
-#endif
-#define assert(exp) SWR_ASSERT(exp)
-#endif
-
bool SwrAssert(
bool chkDebugger,
bool& enabled,
#if SWR_ENABLE_ASSERTS
#define SWR_ASSERT(e, ...) _SWR_ASSERT(true, e, ##__VA_ARGS__)
+
+#if defined(assert)
+#undef assert
+#endif
+#define assert(exp) SWR_ASSERT(exp)
+
#endif
#if SWR_ENABLE_REL_ASSERTS
#endif // SWR_ENABLE_ASSERTS || SWR_ENABLE_REL_ASSERTS
#if !SWR_ENABLE_ASSERTS
-#define SWR_ASSERT(e, ...)
+#define SWR_ASSERT(e, ...) (void)(0)
#endif
#if !SWR_ENABLE_REL_ASSERTS
-#define SWR_REL_ASSERT(e, ...)
+#define SWR_REL_ASSERT(e, ...) (void)(0)
#endif
#define SWR_NOT_IMPL SWR_ASSERT(0, "%s not implemented", __FUNCTION__)
#include <algorithm>
-const __m128 vTileOffsetsX = {0.5, KNOB_TILE_X_DIM - 0.5, 0.5, KNOB_TILE_X_DIM - 0.5};
-const __m128 vTileOffsetsY = {0.5, 0.5, KNOB_TILE_Y_DIM - 0.5, KNOB_TILE_Y_DIM - 0.5};
-
-/// @todo move to common lib
-#define MASKTOVEC(i3,i2,i1,i0) {-i0,-i1,-i2,-i3}
-static const __m128 gMaskToVec[] = {
- MASKTOVEC(0,0,0,0),
- MASKTOVEC(0,0,0,1),
- MASKTOVEC(0,0,1,0),
- MASKTOVEC(0,0,1,1),
- MASKTOVEC(0,1,0,0),
- MASKTOVEC(0,1,0,1),
- MASKTOVEC(0,1,1,0),
- MASKTOVEC(0,1,1,1),
- MASKTOVEC(1,0,0,0),
- MASKTOVEC(1,0,0,1),
- MASKTOVEC(1,0,1,0),
- MASKTOVEC(1,0,1,1),
- MASKTOVEC(1,1,0,0),
- MASKTOVEC(1,1,0,1),
- MASKTOVEC(1,1,1,0),
- MASKTOVEC(1,1,1,1),
-};
-
typedef void(*PFN_CLEAR_TILES)(DRAW_CONTEXT*, SWR_RENDERTARGET_ATTACHMENT rt, uint32_t, DWORD[4]);
static PFN_CLEAR_TILES sClearTilesTable[NUM_SWR_FORMATS];
static const uint32_t HALF_EXP_BITS = 5;
static const uint32_t HALF_MANTISSA_BITS = 10;
- static const uint32_t HALF_MANTISSA_MASK = (1U << HALF_MANTISSA_BITS) - 1;
static const uint32_t HALF_EXP_MASK = ((1U << HALF_EXP_BITS) - 1) << HALF_MANTISSA_BITS;
// minimum exponent required, exponents below this are flushed to 0.
{
simdvector prim[3]; // Only deal with triangles, lines, or points
RDTSC_START(FEPAAssemble);
-#if SWR_ENABLE_ASSERTS
- bool assemble =
-#endif
- tessPa.Assemble(VERTEX_POSITION_SLOT, prim);
+ bool assemble = tessPa.Assemble(VERTEX_POSITION_SLOT, prim);
RDTSC_STOP(FEPAAssemble, 1, 0);
SWR_ASSERT(assemble);
}
}
}
-nextPrimitive:
triMask &= ~(1 << triIndex);
}
simdvector& GetSimdVector(uint32_t index, uint32_t slot)
{
SWR_ASSERT(0, "%s NOT IMPLEMENTED", __FUNCTION__);
- static simdvector junk = { 0 };
+ static simdvector junk;
return junk;
}
uint32_t colorRowStep, uint32_t depthRowStep, uint32_t stencilRowStep);
#define MASKTOVEC(i3,i2,i1,i0) {-i0,-i1,-i2,-i3}
-const __m128 gMaskToVec[] = {
- MASKTOVEC(0,0,0,0),
- MASKTOVEC(0,0,0,1),
- MASKTOVEC(0,0,1,0),
- MASKTOVEC(0,0,1,1),
- MASKTOVEC(0,1,0,0),
- MASKTOVEC(0,1,0,1),
- MASKTOVEC(0,1,1,0),
- MASKTOVEC(0,1,1,1),
- MASKTOVEC(1,0,0,0),
- MASKTOVEC(1,0,0,1),
- MASKTOVEC(1,0,1,0),
- MASKTOVEC(1,0,1,1),
- MASKTOVEC(1,1,0,0),
- MASKTOVEC(1,1,0,1),
- MASKTOVEC(1,1,1,0),
- MASKTOVEC(1,1,1,1),
-};
-
const __m256d gMaskToVecpd[] =
{
MASKTOVEC(0, 0, 0, 0),
// initialize rasterizer function table
PFN_WORK_FUNC gRasterizerTable[2][SWR_MULTISAMPLE_TYPE_MAX] =
{
- RasterizeTriangle<false, SWR_MULTISAMPLE_1X>,
- RasterizeTriangle<false, SWR_MULTISAMPLE_2X>,
- RasterizeTriangle<false, SWR_MULTISAMPLE_4X>,
- RasterizeTriangle<false, SWR_MULTISAMPLE_8X>,
- RasterizeTriangle<false, SWR_MULTISAMPLE_16X>,
- RasterizeTriangle<true, SWR_MULTISAMPLE_1X>,
- RasterizeTriangle<true, SWR_MULTISAMPLE_2X>,
- RasterizeTriangle<true, SWR_MULTISAMPLE_4X>,
- RasterizeTriangle<true, SWR_MULTISAMPLE_8X>,
- RasterizeTriangle<true, SWR_MULTISAMPLE_16X>
+ {
+ RasterizeTriangle<false, SWR_MULTISAMPLE_1X>,
+ RasterizeTriangle<false, SWR_MULTISAMPLE_2X>,
+ RasterizeTriangle<false, SWR_MULTISAMPLE_4X>,
+ RasterizeTriangle<false, SWR_MULTISAMPLE_8X>,
+ RasterizeTriangle<false, SWR_MULTISAMPLE_16X>
+ },
+ {
+ RasterizeTriangle<true, SWR_MULTISAMPLE_1X>,
+ RasterizeTriangle<true, SWR_MULTISAMPLE_2X>,
+ RasterizeTriangle<true, SWR_MULTISAMPLE_4X>,
+ RasterizeTriangle<true, SWR_MULTISAMPLE_8X>,
+ RasterizeTriangle<true, SWR_MULTISAMPLE_16X>
+ }
};
void RasterizeLine(DRAW_CONTEXT *pDC, uint32_t workerId, uint32_t macroTile, void *pData)
return (numEnqueued == mNumEntries);
}
- INLINE volatile uint64_t GetTail() { return mRingTail; }
- INLINE volatile uint64_t GetHead() { return mRingHead; }
+ INLINE uint64_t GetTail() volatile { return mRingTail; }
+ INLINE uint64_t GetHead() volatile { return mRingHead; }
protected:
T* mpRingBuffer;
// only works if pixel size is <= 32bits
SWR_ASSERT(info.bpp <= 32);
- uint32_t numComps = info.numComps;
-
Value* gather = VUNDEF_I();
// assign defaults
/// float
/// @param val - 16-bit float
/// @todo Maybe move this outside of this file into a header?
-static float ConvertSmallFloatTo32(UINT val)
+static INLINE float ConvertSmallFloatTo32(UINT val)
{
UINT result;
if ((val & 0x7fff) == 0)