From 358bd0296eb6ff07238f8846e7dd9634fdfd4c6f Mon Sep 17 00:00:00 2001 From: castano Date: Fri, 1 Feb 2013 23:19:58 +0000 Subject: [PATCH] Fix issue 181. --- cmake/OptimalOptions.cmake | 2 +- src/nvmath/Half.cpp | 5 ++++- src/nvtt/tests/hdrtest.cpp | 6 +++--- src/nvtt/tests/process_alpha_map.cpp | 2 +- src/nvtt/tools/assemble.cpp | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmake/OptimalOptions.cmake b/cmake/OptimalOptions.cmake index 350a138..74fe80d 100644 --- a/cmake/OptimalOptions.cmake +++ b/cmake/OptimalOptions.cmake @@ -40,7 +40,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX) ADD_DEFINITIONS(-D_DEBUG) ENDIF(CMAKE_BUILD_TYPE STREQUAL "debug") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} -fPIC") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") ENDIF(CMAKE_COMPILER_IS_GNUCXX) IF(MSVC) diff --git a/src/nvmath/Half.cpp b/src/nvmath/Half.cpp index d73f64a..52c4bf4 100644 --- a/src/nvmath/Half.cpp +++ b/src/nvmath/Half.cpp @@ -74,6 +74,9 @@ // #include "Half.h" + +#include "nvcore/Memory.h" + #include #if NV_CC_GNUC @@ -494,7 +497,7 @@ nv::half_to_float( uint16 h ) static __m128 half_to_float4_SSE2(__m128i h) { -#define SSE_CONST4(name, val) static const __declspec(align(16)) uint name[4] = { (val), (val), (val), (val) } +#define SSE_CONST4(name, val) static const NV_ALIGN_16 uint name[4] = { (val), (val), (val), (val) } #define CONST(name) *(const __m128i *)&name SSE_CONST4(mask_nosign, 0x7fff); diff --git a/src/nvtt/tests/hdrtest.cpp b/src/nvtt/tests/hdrtest.cpp index 8c98582..b2814f2 100644 --- a/src/nvtt/tests/hdrtest.cpp +++ b/src/nvtt/tests/hdrtest.cpp @@ -224,7 +224,7 @@ Surface process(const Surface & src, int method) { dst = src; // @@ Experiment with log/exp transform! - float gamma = 2.2; + float gamma = 2.2f; dst.scaleBias(0, 1.0f / rMax, 0); dst.scaleBias(1, 1.0f / gMax, 0); @@ -323,7 +323,7 @@ int main(int argc, char *argv[]) Array exposures; for (int i = 0; i < 48; i++) { //exposures.append(8 * float(i)/63); - exposures.append(lerp(0.22, 22, float(i)/47)); + exposures.append(lerp(0.22f, 22, float(i)/47)); } Surface src = loadInput("hdr/34017_03.dds"); @@ -345,7 +345,7 @@ int main(int argc, char *argv[]) compare(src, process(src, 3), exposures, errors); updatePointSet(exposures, errors, chart.pointSetArray[1]); chart.pointSetArray[1].legend = "Log + Gamma 2.2"; - chart.pointSetArray[1].lineColor = Vector3(0.19, 0.45, 0.95); + chart.pointSetArray[1].lineColor = Vector3(0.19f, 0.45f, 0.95f); chart.autoScale(); diff --git a/src/nvtt/tests/process_alpha_map.cpp b/src/nvtt/tests/process_alpha_map.cpp index 425122e..18da3a3 100644 --- a/src/nvtt/tests/process_alpha_map.cpp +++ b/src/nvtt/tests/process_alpha_map.cpp @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) const float gamma = 2.2f; colorMap.toLinear(gamma); - const float alphaRef = 0.95; + const float alphaRef = 0.95f; const float coverage = colorMap.alphaTestCoverage(alphaRef); // Build and output mipmaps. diff --git a/src/nvtt/tools/assemble.cpp b/src/nvtt/tools/assemble.cpp index 27e56e5..f086d64 100644 --- a/src/nvtt/tools/assemble.cpp +++ b/src/nvtt/tools/assemble.cpp @@ -59,13 +59,13 @@ int main(int argc, char *argv[]) assembleVolume = false; assembleTextureArray = false; } - /*if (strcmp("-volume", argv[i]) == 0) + if (strcmp("-volume", argv[i]) == 0) { assembleCubeMap = false; assembleVolume = true; assembleTextureArray = false; } - if (strcmp("-array", argv[i]) == 0) + /*if (strcmp("-array", argv[i]) == 0) { assembleCubeMap = false; assembleVolume = false;