diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt index 499a407..47e3f9d 100644 --- a/src/nvtt/CMakeLists.txt +++ b/src/nvtt/CMakeLists.txt @@ -61,7 +61,7 @@ ELSE(NVTT_SHARED) ADD_LIBRARY(nvtt ${NVTT_SRCS}) ENDIF(NVTT_SHARED) -TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvmath nvimage squish) +TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvmath nvimage squish bc6h) INSTALL(TARGETS nvtt RUNTIME DESTINATION bin diff --git a/src/nvtt/CompressorDX11.cpp b/src/nvtt/CompressorDX11.cpp index ba388c8..4b61dfb 100644 --- a/src/nvtt/CompressorDX11.cpp +++ b/src/nvtt/CompressorDX11.cpp @@ -29,6 +29,9 @@ #include "bc6h/zoh.h" #include "bc6h/utils.h" +//#include "bc7/avpcl.h" +//#include "bc7/utils.h" + using namespace nv; using namespace nvtt; @@ -52,3 +55,7 @@ void CompressorBC6::compressBlock(Tile & tile, AlphaMode alphaMode, const Compre } +void CompressorBC7::compressBlock(Tile & tile, AlphaMode alphaMode, const CompressionOptions::Private & compressionOptions, void * output) +{ + // @@ TODO +} diff --git a/src/nvtt/CompressorDX11.h b/src/nvtt/CompressorDX11.h index 3b97415..9aef3a1 100644 --- a/src/nvtt/CompressorDX11.h +++ b/src/nvtt/CompressorDX11.h @@ -29,16 +29,16 @@ namespace nv { struct CompressorBC6 : public TileCompressor - { + { virtual void compressBlock(Tile & tile, nvtt::AlphaMode alphaMode, const nvtt::CompressionOptions::Private & compressionOptions, void * output); - virtual uint blockSize() const { return 16; } - }; + virtual uint blockSize() const { return 16; } + }; struct CompressorBC7 : public TileCompressor - { + { virtual void compressBlock(Tile & tile, nvtt::AlphaMode alphaMode, const nvtt::CompressionOptions::Private & compressionOptions, void * output); - virtual uint blockSize() const { return 16; } - }; + virtual uint blockSize() const { return 16; } + }; } // nv namespace diff --git a/src/nvtt/bc6h/utils.cpp b/src/nvtt/bc6h/utils.cpp index e0fb607..b41d15d 100644 --- a/src/nvtt/bc6h/utils.cpp +++ b/src/nvtt/bc6h/utils.cpp @@ -20,6 +20,8 @@ using namespace nv; static int denom7_weights_64[] = {0, 9, 18, 27, 37, 46, 55, 64}; // divided by 64 static int denom15_weights_64[] = {0, 4, 9, 13, 17, 21, 26, 30, 34, 38, 43, 47, 51, 55, 60, 64}; // divided by 64 +/*static*/ Format Utils::FORMAT; + int Utils::lerp(int a, int b, int i, int denom) { nvDebugCheck (denom == 3 || denom == 7 || denom == 15); diff --git a/src/nvtt/bc6h/utils.h b/src/nvtt/bc6h/utils.h index f4c0d5a..605ceb6 100644 --- a/src/nvtt/bc6h/utils.h +++ b/src/nvtt/bc6h/utils.h @@ -44,7 +44,7 @@ enum Format { UNSIGNED_F16, SIGNED_F16 }; class Utils { public: - static ::Format FORMAT; // this is a global -- we're either handling unsigned or unsigned half values + static ::Format FORMAT; // this is a global -- we're either handling unsigned or unsigned half values // error metrics static double norm(const nv::Vector3 &a, const nv::Vector3 &b); diff --git a/src/nvtt/bc6h/zohtwo.cpp b/src/nvtt/bc6h/zohtwo.cpp index 5f97b32..52fd03e 100644 --- a/src/nvtt/bc6h/zohtwo.cpp +++ b/src/nvtt/bc6h/zohtwo.cpp @@ -465,7 +465,7 @@ void ZOH::decompresstwo(const char *block, Tile &t) // lookup for (int y = 0; y < Tile::TILE_H; y++) for (int x = 0; x < Tile::TILE_W; x++) - t.data[y][x] = palette[REGION(x,y,shapeindex)][indices[y][x]]; + t.data[y][x] = palette[REGION(x,y,shapeindex)][indices[y][x]]; } // given a collection of colors and quantized endpoints, generate a palette, choose best entries, and return a single toterr