Add SwiftShader dump from Feb 6 2013
diff --git a/src/Common/Math.cpp b/src/Common/Math.cpp
index 08a3fcc..d0e488c 100644
--- a/src/Common/Math.cpp
+++ b/src/Common/Math.cpp
@@ -1,6 +1,6 @@
// SwiftShader Software Renderer
//
-// Copyright(c) 2005-2011 TransGaming Inc.
+// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
@@ -15,20 +15,18 @@
namespace sw
{
- const float M_PI = 3.14159265e+0f;
- const float M_PI_180 = 1.74532925e-2f;
- const float M_180_PI = 5.72957795e+1f;
- const float M_2PI = 6.28318530e+0f;
- const float M_PI_2 = 1.57079632e+0f;
+ inline uint64_t FNV_1a(uint64_t hash, unsigned char data)
+ {
+ return (hash ^ data) * 1099511628211;
+ }
- int64_t FNV_1(const unsigned char *data, int size)
+ uint64_t FNV_1a(const unsigned char *data, int size)
{
int64_t hash = 0xCBF29CE484222325;
for(int i = 0; i < size; i++)
{
- hash = hash * 1099511628211;
- hash = hash ^ data[i];
+ hash = FNV_1a(hash, data[i]);
}
return hash;