Some bug fixes and more progress toward BC6-7 support.
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
namespace nv
|
||||
{
|
||||
struct ColorBlock;
|
||||
struct Tile;
|
||||
|
||||
struct FixedBlockCompressor : public CompressorInterface
|
||||
{
|
||||
@ -38,6 +39,14 @@ namespace nv
|
||||
virtual uint blockSize() const = 0;
|
||||
};
|
||||
|
||||
struct TileCompressor : public CompressorInterface
|
||||
{
|
||||
virtual void compress(nvtt::InputFormat inputFormat, nvtt::AlphaMode alphaMode, uint w, uint h, const void * data, const nvtt::CompressionOptions::Private & compressionOptions, const nvtt::OutputOptions::Private & outputOptions);
|
||||
|
||||
virtual void compressBlock(Tile & tile, nvtt::AlphaMode alphaMode, const nvtt::CompressionOptions::Private & compressionOptions, void * output) = 0;
|
||||
virtual uint blockSize() const = 0;
|
||||
};
|
||||
|
||||
} // nv namespace
|
||||
|
||||
|
||||
|
@ -455,25 +455,32 @@ bool Compressor::Private::outputHeader(const InputOptions::Private & inputOption
|
||||
else
|
||||
{
|
||||
if (compressionOptions.format == Format_DXT1 || compressionOptions.format == Format_DXT1a || compressionOptions.format == Format_DXT1n) {
|
||||
header.setDX10Format(71);
|
||||
header.setDX10Format(70); // DXGI_FORMAT_BC1_TYPELESS
|
||||
if (compressionOptions.format == Format_DXT1a) header.setHasAlphaFlag(true);
|
||||
if (inputOptions.isNormalMap) header.setNormalFlag(true);
|
||||
}
|
||||
else if (compressionOptions.format == Format_DXT3) {
|
||||
header.setDX10Format(74);
|
||||
header.setDX10Format(73); // DXGI_FORMAT_BC2_TYPELESS
|
||||
}
|
||||
else if (compressionOptions.format == Format_DXT5) {
|
||||
header.setDX10Format(77);
|
||||
header.setDX10Format(76); // DXGI_FORMAT_BC3_TYPELESS
|
||||
}
|
||||
else if (compressionOptions.format == Format_DXT5n) {
|
||||
header.setDX10Format(77);
|
||||
header.setDX10Format(76); // DXGI_FORMAT_BC3_TYPELESS
|
||||
if (inputOptions.isNormalMap) header.setNormalFlag(true);
|
||||
}
|
||||
else if (compressionOptions.format == Format_BC4) {
|
||||
header.setDX10Format(80);
|
||||
header.setDX10Format(79); // DXGI_FORMAT_BC4_TYPELESS
|
||||
}
|
||||
else if (compressionOptions.format == Format_BC5) {
|
||||
header.setDX10Format(83);
|
||||
header.setDX10Format(82); // DXGI_FORMAT_BC5_TYPELESS
|
||||
if (inputOptions.isNormalMap) header.setNormalFlag(true);
|
||||
}
|
||||
else if (compressionOptions.format == Format_BC6) {
|
||||
header.setDX10Format(94); // DXGI_FORMAT_BC6H_TYPELESS
|
||||
}
|
||||
else if (compressionOptions.format == Format_BC7) {
|
||||
header.setDX10Format(97); // DXGI_FORMAT_BC7_TYPELESS
|
||||
if (inputOptions.isNormalMap) header.setNormalFlag(true);
|
||||
}
|
||||
else {
|
||||
@ -581,6 +588,13 @@ bool Compressor::Private::outputHeader(const InputOptions::Private & inputOption
|
||||
header.setSwizzleCode('A', '2', 'X', 'Y');
|
||||
}
|
||||
}
|
||||
else if (compressionOptions.format == Format_BC6) {
|
||||
header.setFourCC('Z', 'O', 'H', ' ');
|
||||
}
|
||||
else if (compressionOptions.format == Format_BC7) {
|
||||
header.setFourCC('Z', 'O', 'L', 'A');
|
||||
if (inputOptions.isNormalMap) header.setNormalFlag(true);
|
||||
}
|
||||
else if (compressionOptions.format == Format_CTX1) {
|
||||
header.setFourCC('C', 'T', 'X', '1');
|
||||
if (inputOptions.isNormalMap) header.setNormalFlag(true);
|
||||
|
@ -93,7 +93,7 @@ namespace nvtt
|
||||
|
||||
Format_DXT1n,// Not supported on CPU yet.
|
||||
Format_CTX1, // Not supported on CPU yet.
|
||||
Format_YCoCg_DXT5, // Not supported yet.
|
||||
//Format_YCoCg_DXT5, // Not supported yet.
|
||||
|
||||
Format_BC6, // Not supported yet.
|
||||
Format_BC7, // Not supported yet.
|
||||
@ -101,7 +101,7 @@ namespace nvtt
|
||||
Format_RGBE,
|
||||
};
|
||||
|
||||
/// Pixel types.
|
||||
/// Pixel types. These basically indicate how the output should be interpreted, but do not have any influence over the input.
|
||||
enum PixelType
|
||||
{
|
||||
PixelType_UnsignedNorm,
|
||||
@ -109,6 +109,7 @@ namespace nvtt
|
||||
PixelType_UnsignedInt, // Not supported yet.
|
||||
PixelType_SignedInt, // Not supported yet.
|
||||
PixelType_Float,
|
||||
PixelType_UnsignedFloat,
|
||||
};
|
||||
|
||||
/// Quality modes.
|
||||
|
Reference in New Issue
Block a user