More header optimizations.

pull/216/head
castano 13 years ago
parent d11d7a5f38
commit e98d795d2b

@ -189,7 +189,7 @@ NV_COMPILER_CHECK(sizeof(uint32) == 4);
#define NV_ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
#if 1
#if 0 // Disabled in The Witness.
#if NV_CC_MSVC
#define NV_MESSAGE(x) message(__FILE__ "(" NV_STRING(__LINE__) ") : " x)
#else

@ -6,7 +6,7 @@
#include "nvmath/Color.h"
#include "nvmath/Vector.inl"
#include "nvmath/Matrix.h"
#include "nvmath/Matrix.inl"
#include "nvcore/Utils.h" // max
#include "nvcore/Ptr.h"

@ -0,0 +1,4 @@
// This code is in the public domain -- castanyo@yahoo.es
#include "Matrix.h"
#include "Matrix.inl"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -2,7 +2,7 @@
#include "Plane.h"
#include "Plane.inl"
#include "Matrix.h"
#include "Matrix.inl"
namespace nv
{

@ -5,6 +5,8 @@
#include "Atomic.h"
#include "ThreadPool.h"
#include "nvcore/Utils.h" // toI32
using namespace nv;
#define ENABLE_PARALLEL_FOR 0
@ -52,7 +54,7 @@ void ParallelFor::run(uint count) {
nvDebugCheck(idx >= count);
#else
for (int i = 0; i < count; i++) {
for (int i = 0; i < toI32(count); i++) {
task(context, i);
}
#endif

@ -1,8 +1,8 @@
// This code is in the public domain -- castano@gmail.com
#pragma once
#ifndef NV_THREAD_THREADPOOL_H
#define NV_THREAD_THREADPOOL_H
// This code is in the public domain -- castano@gmail.com
#pragma once
#ifndef NV_THREAD_THREADPOOL_H
#define NV_THREAD_THREADPOOL_H
#include "nvthread.h"

@ -518,7 +518,7 @@ Vector3 CubeSurface::Private::applyCosinePowerFilter(const Vector3 & filterDir,
// Focal point in polar coordinates:
Vector2 Fp = toPolar(F);
nvCheck(Fp.y >= 0.0f); // top
nvCheck(Fp.y <= PI/2); // horizon
//nvCheck(Fp.y <= PI/2); // horizon
// If this is an ellipse:
if (Fp.y + coneAngle < PI/2) {

@ -29,7 +29,7 @@
#include "nvcore/Utils.h" // nextPowerOfTwo
#include "nvcore/Memory.h"
#include <string.h> // memcpy
#include <string.h> // memcpy, memset

@ -1,84 +1,82 @@
// Copyright (c) 2009-2011 Ignacio Castano <castano@gmail.com>
// Copyright (c) 2007-2009 NVIDIA Corporation -- Ignacio Castano <icastano@nvidia.com>
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#ifndef NVTT_INPUTOPTIONS_H
#define NVTT_INPUTOPTIONS_H
#include <nvcore/Ptr.h>
#include <nvmath/Vector.h>
#include <nvmath/Matrix.h>
#include <nvimage/Image.h>
#include <nvimage/FloatImage.h>
#include "nvtt.h"
namespace nvtt
{
struct InputOptions::Private
{
Private() : images(NULL) {}
WrapMode wrapMode;
TextureType textureType;
InputFormat inputFormat;
AlphaMode alphaMode;
uint width;
uint height;
uint depth;
uint faceCount;
uint mipmapCount;
uint imageCount;
void ** images;
// Gamma conversion.
float inputGamma;
float outputGamma;
// Mipmap generation options.
bool generateMipmaps;
int maxLevel;
MipmapFilter mipmapFilter;
// Kaiser filter parameters.
float kaiserWidth;
float kaiserAlpha;
float kaiserStretch;
// Normal map options.
bool isNormalMap;
bool normalizeMipmaps;
bool convertToNormalMap;
nv::Vector4 heightFactors;
nv::Vector4 bumpFrequencyScale;
// Adjust extents.
uint maxExtent;
RoundMode roundMode;
};
} // nvtt namespace
#endif // NVTT_INPUTOPTIONS_H
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#ifndef NVTT_INPUTOPTIONS_H
#define NVTT_INPUTOPTIONS_H
#include "nvtt.h"
#include "nvmath/Vector.h"
namespace nvtt
{
struct InputOptions::Private
{
Private() : images(NULL) {}
WrapMode wrapMode;
TextureType textureType;
InputFormat inputFormat;
AlphaMode alphaMode;
uint width;
uint height;
uint depth;
uint faceCount;
uint mipmapCount;
uint imageCount;
void ** images;
// Gamma conversion.
float inputGamma;
float outputGamma;
// Mipmap generation options.
bool generateMipmaps;
int maxLevel;
MipmapFilter mipmapFilter;
// Kaiser filter parameters.
float kaiserWidth;
float kaiserAlpha;
float kaiserStretch;
// Normal map options.
bool isNormalMap;
bool normalizeMipmaps;
bool convertToNormalMap;
nv::Vector4 heightFactors;
nv::Vector4 bumpFrequencyScale;
// Adjust extents.
uint maxExtent;
RoundMode roundMode;
};
} // nvtt namespace
#endif // NVTT_INPUTOPTIONS_H

@ -25,7 +25,7 @@
#include "Surface.h"
#include "nvmath/Vector.inl"
#include "nvmath/Matrix.h"
#include "nvmath/Matrix.inl"
#include "nvmath/Color.h"
#include "nvmath/Half.h"

Loading…
Cancel
Save