#include "clip.h"
#include "tilemgr.h"
#include "tessellator.h"
+#include <limits>
//////////////////////////////////////////////////////////////////////////
/// @brief Helper macro to generate a bitmask
}
}
}
-
+nextPrimitive:
triMask &= ~(1 << triIndex);
}
}
INLINE
-bool vIsNaN(const __m128& vec)
+bool vHasNaN(const __m128& vec)
{
const __m128 result = _mm_cmpunord_ps(vec, vec);
const int32_t mask = _mm_movemask_ps(result);
const WCHAR *pFilename,
void *pBuffer,
uint32_t width,
- uint32_t height)
+ uint32_t height,
+ bool broadcastRed = false)
{
// dump pixels to a png
// Initialize GDI+.
Bitmap *bitmap = new Bitmap(width, height);
BYTE *pBytes = (BYTE*)pBuffer;
- static const uint32_t bytesPerPixel = 4;
+ const uint32_t bytesPerPixel = (broadcastRed ? 1 : 4);
for (uint32_t y = 0; y < height; ++y)
for (uint32_t x = 0; x < width; ++x)
{
- uint32_t pixel = *(uint32_t*)pBytes;
- if (pixel == 0xcdcdcdcd)
+ uint32_t pixel = 0;
+ if (broadcastRed)
{
- pixel = 0xFFFF00FF;
- }
- else if (pixel == 0xdddddddd)
- {
- pixel = 0x80FF0000;
+ pixel = *(uint8_t*)pBytes;
+ pixel = pixel | (pixel << 8) | (pixel << 16) | 0xFF000000;
}
else
{
- pixel |= 0xFF000000;
+ pixel = *(uint32_t*)pBytes;
+ if (pixel == 0xcdcdcdcd)
+ {
+ pixel = 0xFFFF00FF;
+ }
+ else if (pixel == 0xdddddddd)
+ {
+ pixel = 0x80FF0000;
+ }
+ else
+ {
+ pixel |= 0xFF000000;
+ }
}
+
Color color(pixel);
bitmap->SetPixel(x, y, color);
pBytes += bytesPerPixel;
const WCHAR *pFilename,
void *pBuffer,
uint32_t width,
- uint32_t height);
+ uint32_t height,
+ bool broadcastRed);
void OpenBitmapFromFile(
const WCHAR *pFilename,
CreateDirectory(SWR_OUTPUT_DIR, NULL);
CreateDirectory(JITTER_OUTPUT_DIR, NULL);
}
-
- ///@todo Figure out a better solution for this.
- // Redirect stdin, stdout, and stderr to attached console.
- freopen("CONIN$", "r", stdin);
- freopen("CONOUT$", "w", stdout);
- freopen("CONOUT$", "w", stderr);
#endif
}
#include "streamout_jit.h"
#include "blend_jit.h"
+#include <stdlib.h>
+
#if defined(_WIN32)
#define EXCEPTION_PRINT_STACK(ret) ret
#endif // _WIN32
bool enableJitSampler;
};
+
//////////////////////////////////////////////////////////////////////////
/// @brief Create JIT context.
HANDLE JITCALL JitCreateContext(uint32_t targetSimdWidth, const char* arch);
void InitStoreTilesTableStencil(
PFN_STORE_TILES(&table)[NumTileModes][ArraySizeT])
{
- table[TileModeT][R32_UINT] = StoreMacroTile<TilingTraits<TileModeT, 32>, R8_UINT, R32_UINT>::Store;
table[TileModeT][R8_UINT] = StoreMacroTile<TilingTraits<TileModeT, 8>, R8_UINT, R8_UINT>::Store;
}