Merge fixes from trunk.
- better error CUDA checking. - eliminate compiler warnings. - fix end of lines.
This commit is contained in:
parent
21859216bc
commit
ebe47a0f78
|
@ -2,6 +2,7 @@ NVIDIA Texture Tools version 2.0.1
|
||||||
* Fix memory leaks.
|
* Fix memory leaks.
|
||||||
* Pre-allocate device memory for CUDA compressor.
|
* Pre-allocate device memory for CUDA compressor.
|
||||||
* Add single color compressor.
|
* Add single color compressor.
|
||||||
|
* Better CUDA error checking.
|
||||||
|
|
||||||
NVIDIA Texture Tools version 2.0.0
|
NVIDIA Texture Tools version 2.0.0
|
||||||
* Fixed PSNR formula in nvimgdiff.
|
* Fixed PSNR formula in nvimgdiff.
|
||||||
|
|
|
@ -96,6 +96,8 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
|
Description="Copying header files..."
|
||||||
|
CommandLine="xcopy /y /f /i $(SolutionDir)\..\..\src\nvtt\nvtt*.h $(SolutionDir)\$(ConfigurationName).$(PlatformName)\include\"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
|
@ -258,6 +260,8 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
|
Description="Copying header files..."
|
||||||
|
CommandLine="xcopy /y /f /i $(SolutionDir)\..\..\src\nvtt\nvtt*.h $(SolutionDir)\$(ConfigurationName).$(PlatformName)\include\"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
|
@ -420,6 +424,8 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
|
Description="Copying header files..."
|
||||||
|
CommandLine="xcopy /y /f /i $(SolutionDir)\..\..\src\nvtt\nvtt*.h $(SolutionDir)\$(ConfigurationName).$(PlatformName)\include\"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
|
@ -578,6 +584,8 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
|
Description="Copying header files..."
|
||||||
|
CommandLine="xcopy /y /f /i $(SolutionDir)\..\..\src\nvtt\nvtt*.h $(SolutionDir)\$(ConfigurationName).$(PlatformName)\include\"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
|
|
|
@ -212,6 +212,12 @@ Compressor::Compressor() : m(*new Compressor::Private())
|
||||||
if (m.cudaEnabled)
|
if (m.cudaEnabled)
|
||||||
{
|
{
|
||||||
m.cuda = new CudaCompressor();
|
m.cuda = new CudaCompressor();
|
||||||
|
|
||||||
|
if (!m.cuda->isValid())
|
||||||
|
{
|
||||||
|
m.cudaEnabled = false;
|
||||||
|
m.cuda = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,6 +238,12 @@ void Compressor::enableCudaAcceleration(bool enable)
|
||||||
if (m.cudaEnabled && m.cuda == NULL)
|
if (m.cudaEnabled && m.cuda == NULL)
|
||||||
{
|
{
|
||||||
m.cuda = new CudaCompressor();
|
m.cuda = new CudaCompressor();
|
||||||
|
|
||||||
|
if (!m.cuda->isValid())
|
||||||
|
{
|
||||||
|
m.cudaEnabled = false;
|
||||||
|
m.cuda = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,14 @@
|
||||||
|
|
||||||
#define NVTT_VERSION 200
|
#define NVTT_VERSION 200
|
||||||
|
|
||||||
|
#define NVTT_DECLARE_PIMPL(Class) \
|
||||||
|
private: \
|
||||||
|
Class(const Class &); \
|
||||||
|
void operator=(const Class &); \
|
||||||
|
public: \
|
||||||
|
struct Private; \
|
||||||
|
Private & m
|
||||||
|
|
||||||
|
|
||||||
// Public interface.
|
// Public interface.
|
||||||
namespace nvtt
|
namespace nvtt
|
||||||
|
@ -89,6 +97,8 @@ namespace nvtt
|
||||||
/// Compression options. This class describes the desired compression format and other compression settings.
|
/// Compression options. This class describes the desired compression format and other compression settings.
|
||||||
struct CompressionOptions
|
struct CompressionOptions
|
||||||
{
|
{
|
||||||
|
NVTT_DECLARE_PIMPL(CompressionOptions);
|
||||||
|
|
||||||
NVTT_API CompressionOptions();
|
NVTT_API CompressionOptions();
|
||||||
NVTT_API ~CompressionOptions();
|
NVTT_API ~CompressionOptions();
|
||||||
|
|
||||||
|
@ -104,10 +114,6 @@ namespace nvtt
|
||||||
NVTT_API void setPixelFormat(unsigned int bitcount, unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask);
|
NVTT_API void setPixelFormat(unsigned int bitcount, unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask);
|
||||||
|
|
||||||
NVTT_API void setQuantization(bool colorDithering, bool alphaDithering, bool binaryAlpha, int alphaThreshold = 127);
|
NVTT_API void setQuantization(bool colorDithering, bool alphaDithering, bool binaryAlpha, int alphaThreshold = 127);
|
||||||
|
|
||||||
//private:
|
|
||||||
struct Private;
|
|
||||||
Private & m;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,6 +176,8 @@ namespace nvtt
|
||||||
/// Input options. Specify format and layout of the input texture.
|
/// Input options. Specify format and layout of the input texture.
|
||||||
struct InputOptions
|
struct InputOptions
|
||||||
{
|
{
|
||||||
|
NVTT_DECLARE_PIMPL(InputOptions);
|
||||||
|
|
||||||
NVTT_API InputOptions();
|
NVTT_API InputOptions();
|
||||||
NVTT_API ~InputOptions();
|
NVTT_API ~InputOptions();
|
||||||
|
|
||||||
|
@ -214,10 +222,6 @@ namespace nvtt
|
||||||
// Set resizing options.
|
// Set resizing options.
|
||||||
NVTT_API void setMaxExtents(int d);
|
NVTT_API void setMaxExtents(int d);
|
||||||
NVTT_API void setRoundMode(RoundMode mode);
|
NVTT_API void setRoundMode(RoundMode mode);
|
||||||
|
|
||||||
//private:
|
|
||||||
struct Private;
|
|
||||||
Private & m;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,6 +262,8 @@ namespace nvtt
|
||||||
/// the compressor to the user.
|
/// the compressor to the user.
|
||||||
struct OutputOptions
|
struct OutputOptions
|
||||||
{
|
{
|
||||||
|
NVTT_DECLARE_PIMPL(OutputOptions);
|
||||||
|
|
||||||
NVTT_API OutputOptions();
|
NVTT_API OutputOptions();
|
||||||
NVTT_API ~OutputOptions();
|
NVTT_API ~OutputOptions();
|
||||||
|
|
||||||
|
@ -269,16 +275,14 @@ namespace nvtt
|
||||||
NVTT_API void setOutputHandler(OutputHandler * outputHandler);
|
NVTT_API void setOutputHandler(OutputHandler * outputHandler);
|
||||||
NVTT_API void setErrorHandler(ErrorHandler * errorHandler);
|
NVTT_API void setErrorHandler(ErrorHandler * errorHandler);
|
||||||
NVTT_API void setOutputHeader(bool outputHeader);
|
NVTT_API void setOutputHeader(bool outputHeader);
|
||||||
|
|
||||||
//private:
|
|
||||||
struct Private;
|
|
||||||
Private & m;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// Texture compressor.
|
/// Texture compressor.
|
||||||
struct Compressor
|
struct Compressor
|
||||||
{
|
{
|
||||||
|
NVTT_DECLARE_PIMPL(Compressor);
|
||||||
|
|
||||||
NVTT_API Compressor();
|
NVTT_API Compressor();
|
||||||
NVTT_API ~Compressor();
|
NVTT_API ~Compressor();
|
||||||
|
|
||||||
|
@ -290,10 +294,6 @@ namespace nvtt
|
||||||
|
|
||||||
// Estimate the size of compressing the input with the given options.
|
// Estimate the size of compressing the input with the given options.
|
||||||
NVTT_API int estimateSize(const InputOptions & inputOptions, const CompressionOptions & compressionOptions) const;
|
NVTT_API int estimateSize(const InputOptions & inputOptions, const CompressionOptions & compressionOptions) const;
|
||||||
|
|
||||||
//private:
|
|
||||||
struct Private;
|
|
||||||
Private & m;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,16 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vec4( const float * v )
|
||||||
|
{
|
||||||
|
union { vector float v; float c[4]; } u;
|
||||||
|
u.c[0] = v[0];
|
||||||
|
u.c[1] = v[1];
|
||||||
|
u.c[2] = v[2];
|
||||||
|
u.c[3] = v[3];
|
||||||
|
m_v = u.v;
|
||||||
|
}
|
||||||
|
|
||||||
Vec4( float x, float y, float z, float w )
|
Vec4( float x, float y, float z, float w )
|
||||||
{
|
{
|
||||||
union { vector float v; float c[4]; } u;
|
union { vector float v; float c[4]; } u;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user