Enable support for DXT3 and DXT5 accelerated compressors.

This commit is contained in:
castano 2007-07-09 10:31:54 +00:00
parent 31c9ef0413
commit 1548c2ed80

View File

@ -186,17 +186,17 @@ static bool compressMipmap(const Image * image, const OutputOptions & outputOpti
} }
else else
#endif #endif
if (compressionOptions.useCuda && nv::cuda::isHardwarePresent())
{
cudaCompressDXT1(image, outputOptions, compressionOptions);
}
else
{
if (compressionOptions.quality == Quality_Fastest) if (compressionOptions.quality == Quality_Fastest)
{ {
fastCompressDXT1(image, outputOptions); fastCompressDXT1(image, outputOptions);
} }
else else
{
if (compressionOptions.useCuda && nv::cuda::isHardwarePresent())
{
cudaCompressDXT1(image, outputOptions, compressionOptions);
}
else
{ {
compressDXT1(image, outputOptions, compressionOptions); compressDXT1(image, outputOptions, compressionOptions);
} }
@ -209,10 +209,17 @@ static bool compressMipmap(const Image * image, const OutputOptions & outputOpti
fastCompressDXT3(image, outputOptions); fastCompressDXT3(image, outputOptions);
} }
else else
{
if (compressionOptions.useCuda && nv::cuda::isHardwarePresent())
{
cudaCompressDXT3(image, outputOptions, compressionOptions);
}
else
{ {
compressDXT3(image, outputOptions, compressionOptions); compressDXT3(image, outputOptions, compressionOptions);
} }
} }
}
else if (compressionOptions.format == Format_DXT5) else if (compressionOptions.format == Format_DXT5)
{ {
if (compressionOptions.quality == Quality_Fastest) if (compressionOptions.quality == Quality_Fastest)
@ -220,10 +227,17 @@ static bool compressMipmap(const Image * image, const OutputOptions & outputOpti
fastCompressDXT5(image, outputOptions); fastCompressDXT5(image, outputOptions);
} }
else else
{
if (compressionOptions.useCuda && nv::cuda::isHardwarePresent())
{
cudaCompressDXT5(image, outputOptions, compressionOptions);
}
else
{ {
compressDXT5(image, outputOptions, compressionOptions); compressDXT5(image, outputOptions, compressionOptions);
} }
} }
}
else if (compressionOptions.format == Format_DXT5n) else if (compressionOptions.format == Format_DXT5n)
{ {
if (compressionOptions.quality == Quality_Fastest) if (compressionOptions.quality == Quality_Fastest)