nvtt
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations | Functions
nvtt_lowlevel.h File Reference
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  nvtt::RefImage
 Use this structure to reference each of the input images. More...
 
struct  nvtt::CPUInputBuffer
 Structure containing all the input images from host memory. The image data is reordered by tiles. More...
 
struct  nvtt::GPUInputBuffer
 Structure containing all the input images from device memory. The image data is reordered by tiles. More...
 
struct  nvtt::EncodeSettings
 

Namespaces

namespace  nvtt
 Namespace for all public non-macro NVTT fields.
 

Macros

#define NVTT_API
 Functions with this macro are accessible via the NVTT DLL.
 
#define NVTT_DEPRECATED_API
 These functions are accessible via the NVTT DLL, but there are better replacements for them, and they may be removed in a future major version.
 

Enumerations

enum  nvtt::ValueType { nvtt::UINT8 , nvtt::SINT8 , nvtt::FLOAT32 , nvtt::FLOAT16 }
 
enum  nvtt::ChannelOrder {
  Red = 0 , Green = 1 , Blue = 2 , Alpha = 3 ,
  Zero = 4 , One = 5
}
 Name of channels for defining a swizzling.
 
enum  nvtt::Format {
  nvtt::Format_RGB , nvtt::Format_RGBA = Format_RGB , nvtt::Format_DXT1 , nvtt::Format_DXT1a ,
  nvtt::Format_DXT3 , nvtt::Format_DXT5 , nvtt::Format_DXT5n , nvtt::Format_BC1 = Format_DXT1 ,
  nvtt::Format_BC1a = Format_DXT1a , nvtt::Format_BC2 = Format_DXT3 , nvtt::Format_BC3 = Format_DXT5 , nvtt::Format_BC3n = Format_DXT5n ,
  nvtt::Format_BC4 , nvtt::Format_BC4S , nvtt::Format_ATI2 , nvtt::Format_BC5 ,
  nvtt::Format_BC5S , nvtt::Format_DXT1n , nvtt::Format_CTX1 , nvtt::Format_BC6U ,
  nvtt::Format_BC6S , nvtt::Format_BC7 , nvtt::Format_BC3_RGBM , nvtt::Format_ASTC_LDR_4x4 ,
  nvtt::Format_ASTC_LDR_5x4 , nvtt::Format_ASTC_LDR_5x5 , nvtt::Format_ASTC_LDR_6x5 , nvtt::Format_ASTC_LDR_6x6 ,
  nvtt::Format_ASTC_LDR_8x5 , nvtt::Format_ASTC_LDR_8x6 , nvtt::Format_ASTC_LDR_8x8 , nvtt::Format_ASTC_LDR_10x5 ,
  nvtt::Format_ASTC_LDR_10x6 , nvtt::Format_ASTC_LDR_10x8 , nvtt::Format_ASTC_LDR_10x10 , nvtt::Format_ASTC_LDR_12x10 ,
  nvtt::Format_ASTC_LDR_12x12 , Format_Count , nvtt::Format_Unset = 255
}
 Supported block-compression formats, including compressor variants. More...
 
enum  nvtt::PixelType {
  nvtt::PixelType_UnsignedNorm = 0 , nvtt::PixelType_SignedNorm = 1 , nvtt::PixelType_UnsignedInt = 2 , nvtt::PixelType_SignedInt = 3 ,
  nvtt::PixelType_Float = 4 , nvtt::PixelType_UnsignedFloat = 5 , nvtt::PixelType_SharedExp = 6
}
 Pixel value types. More...
 
enum  nvtt::Quality { Quality_Fastest , Quality_Normal , Quality_Production , Quality_Highest }
 Quality modes. More...
 
enum  nvtt::EncodeFlags : uint32_t { EncodeFlags_None = 0 , nvtt::EncodeFlags_UseGPU = 1 << 0 , nvtt::EncodeFlags_OutputToGPUMem = 1 << 1 , nvtt::EncodeFlags_Opaque = 1 << 2 }
 Encode flags for EncodeSettings. More...
 

Functions

NVTT_API bool nvtt::isCudaSupported ()
 Check if CUDA is supported by the run-time environment.
 
NVTT_API void nvtt::useCurrentDevice ()
 Tells NVTT to always use an application-set device rather than selecting its own.
 
NVTT_API bool nvtt::nvtt_encode (const CPUInputBuffer &input, void *output, const EncodeSettings &settings)
 
NVTT_API bool nvtt::nvtt_encode (const GPUInputBuffer &input, void *output, const EncodeSettings &settings)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc1 (const CPUInputBuffer &input, bool fast_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc1 (const GPUInputBuffer &input, bool fast_mode, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc1a (const CPUInputBuffer &input, bool fast_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc1a (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc2 (const CPUInputBuffer &input, bool fast_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc2 (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc3 (const CPUInputBuffer &input, bool fast_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc3 (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc3n (const CPUInputBuffer &input, int qualityLevel, void *output, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc3_rgbm (const CPUInputBuffer &input, void *output, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc4 (const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc4 (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc4s (const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc4s (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_ati2 (const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_ati2 (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc5 (const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc5 (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc5s (const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc5s (const GPUInputBuffer &input, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc7 (const CPUInputBuffer &input, bool slow_mode, bool imageHasAlpha, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc7 (const GPUInputBuffer &input, bool imageHasAlpha, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc6h (const CPUInputBuffer &input, bool slow_mode, bool is_signed, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_bc6h (const GPUInputBuffer &input, bool is_signed, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_astc (const CPUInputBuffer &input, int qualityLevel, bool imageHasAlpha, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
 
NVTT_DEPRECATED_API void nvtt::nvtt_encode_astc (const GPUInputBuffer &input, int qualityLevel, bool imageHasAlpha, void *output, bool to_device_mem=true, nvtt::TimingContext *tc=nullptr)
 

Detailed Description

Header of the low-level interface of NVTT.

This contains functions for compressing to each of the formats NVTT supports, as well as different ways of specifying the input and output. For instance, the low-level API allows both compression input and output to exist on the GPU, removing the need for any CPU-to-GPU or GPU-to-CPU copies.

Here are some general notes on the low-level compression functions.

These functions often support "fast-mode" and "slow-mode" compression. These switch between two compression algorithms: fast-mode algorithms are faster but lower-quality, while slow-mode algorithms are slower but higher-quality. Other functions support multiple quality levels.

Sometimes, the fast-mode or slow-mode algorithm isn't available on the GPU. In that case, that compression will be done on the CPU instead. In this case, slow-mode compression on the GPU may be faster than fast-mode compression on the CPU.

To use GPU compression, there must be a GPU that supports CUDA. See nvtt::isCudaSupported().