48#ifndef nvtt_lowlevel_h
49#define nvtt_lowlevel_h
60#define NVTT_DEPRECATED_API
66#if defined _WIN32 || defined WIN32 || defined __NT__ || defined __WIN32__ || defined __MINGW32__
68# define NVTT_API __declspec(dllexport)
70# define NVTT_API __declspec(dllimport)
74#if defined __GNUC__ >= 4
76# define NVTT_API __attribute__((visibility("default")))
86#if !defined NVTT_DEPRECATED_API
87# define NVTT_DEPRECATED_API [[deprecated]] NVTT_API
155 float WeightR=1.0f,
float WeightG=1.0f,
float WeightB=1.0f,
float WeightA=1.0f,
nvtt::TimingContext *tc =
nullptr,
unsigned* num_tiles =
nullptr);
186 float WeightR = 1.0f,
float WeightG = 1.0f,
float WeightB = 1.0f,
float WeightA = 1.0f,
nvtt::TimingContext *tc =
nullptr,
unsigned* num_tiles =
nullptr);
338 static const uint32_t EncodeSettings_Version_1 = 1;
343 EncodeFlags_None = 0,
393 uint32_t
sType = EncodeSettings_Version_1;
Namespace for all public non-macro NVTT fields.
Definition nvtt.h:52
NVTT_DEPRECATED_API void nvtt_encode_bc3_rgbm(const CPUInputBuffer &input, void *output, nvtt::TimingContext *tc=nullptr)
ChannelOrder
Name of channels for defining a swizzling.
Definition nvtt_lowlevel.h:124
NVTT_API bool isCudaSupported()
Check if CUDA is supported by the run-time environment.
NVTT_DEPRECATED_API void 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_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_encode_bc5(const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
NVTT_API void useCurrentDevice()
Tells NVTT to always use an application-set device rather than selecting its own.
Quality
Quality modes.
Definition nvtt_lowlevel.h:329
NVTT_DEPRECATED_API void nvtt_encode_bc3n(const CPUInputBuffer &input, int qualityLevel, void *output, nvtt::TimingContext *tc=nullptr)
NVTT_DEPRECATED_API void nvtt_encode_bc3(const CPUInputBuffer &input, bool fast_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
Format
Supported block-compression formats, including compressor variants.
Definition nvtt_lowlevel.h:218
@ Format_BC2
DX10 - BC2 (DXT3) format.
Definition nvtt_lowlevel.h:233
@ Format_RGBA
Linear RGBA format.
Definition nvtt_lowlevel.h:221
@ Format_BC3_RGBM
Definition nvtt_lowlevel.h:270
@ Format_ASTC_LDR_8x5
ASTC - LDR - format, tile size 8x5.
Definition nvtt_lowlevel.h:279
@ Format_ASTC_LDR_10x8
ASTC - LDR - format, tile size 10x8.
Definition nvtt_lowlevel.h:284
@ Format_BC6U
DX10 - BC6 format (three-channel HDR, unsigned)
Definition nvtt_lowlevel.h:245
@ Format_BC6S
DX10 - BC6 format (three-channel HDR, signed)
Definition nvtt_lowlevel.h:246
@ Format_ASTC_LDR_10x5
ASTC - LDR - format, tile size 10x5.
Definition nvtt_lowlevel.h:282
@ Format_ASTC_LDR_5x5
ASTC - LDR - format, tile size 5x5.
Definition nvtt_lowlevel.h:276
@ Format_BC7
DX10 - BC7 format (four channels, UNORM)
Definition nvtt_lowlevel.h:248
@ Format_ASTC_LDR_10x6
ASTC - LDR - format, tile size 10x6.
Definition nvtt_lowlevel.h:283
@ Format_BC5
DX10 - BC5U format (two channels, unsigned)
Definition nvtt_lowlevel.h:239
@ Format_ASTC_LDR_6x6
ASTC - LDR - format, tile size 6x6.
Definition nvtt_lowlevel.h:278
@ Format_BC1
DX10 - BC1 (DXT1) format.
Definition nvtt_lowlevel.h:231
@ Format_BC3n
DX10 - BC3 (DXT5) normal format for improved compression, storing a normal (x, y, z) as (1,...
Definition nvtt_lowlevel.h:235
@ Format_ASTC_LDR_12x10
ASTC - LDR - format, tile size 12x10.
Definition nvtt_lowlevel.h:286
@ Format_DXT1
DX9 - DXT1 format.
Definition nvtt_lowlevel.h:224
@ Format_DXT5
DX9 - DXT5 format.
Definition nvtt_lowlevel.h:227
@ Format_ASTC_LDR_5x4
ASTC - LDR - format, tile size 5x4.
Definition nvtt_lowlevel.h:275
@ Format_ATI2
DX10 - ATI2 format, similar to BC5U, channel order GR instead of RG.
Definition nvtt_lowlevel.h:238
@ Format_ASTC_LDR_8x6
ASTC - LDR - format, tile size 8x6.
Definition nvtt_lowlevel.h:280
@ Format_DXT1n
Not supported.
Definition nvtt_lowlevel.h:242
@ Format_ASTC_LDR_12x12
ASTC - LDR - format, tile size 12x12.
Definition nvtt_lowlevel.h:287
@ Format_DXT3
DX9 - DXT3 format.
Definition nvtt_lowlevel.h:226
@ Format_BC3
DX10 - BC3 (DXT5) format.
Definition nvtt_lowlevel.h:234
@ Format_ASTC_LDR_4x4
ASTC - LDR - format, tile size 4x4.
Definition nvtt_lowlevel.h:274
@ Format_DXT1a
DX9 - DXT1 with binary alpha.
Definition nvtt_lowlevel.h:225
@ Format_BC1a
DX10 - BC1 (DXT1) format.
Definition nvtt_lowlevel.h:232
@ Format_RGB
Linear RGB format.
Definition nvtt_lowlevel.h:220
@ Format_Unset
Definition nvtt_lowlevel.h:293
@ Format_BC4
DX10 - BC4U (ATI1) format (one channel, unsigned)
Definition nvtt_lowlevel.h:236
@ Format_BC5S
DX10 - BC5S format (two channels, signed)
Definition nvtt_lowlevel.h:240
@ Format_DXT5n
DX9 - DXT5 normal format. Stores a normal (x, y, z) as (R, G, B, A) = (1, y, 0, x).
Definition nvtt_lowlevel.h:228
@ Format_ASTC_LDR_6x5
ASTC - LDR - format, tile size 6x5.
Definition nvtt_lowlevel.h:277
@ Format_ASTC_LDR_8x8
ASTC - LDR - format, tile size 8x8.
Definition nvtt_lowlevel.h:281
@ Format_BC4S
DX10 - BC4S format (one channel, signed)
Definition nvtt_lowlevel.h:237
@ Format_ASTC_LDR_10x10
ASTC - LDR - format, tile size 10x10.
Definition nvtt_lowlevel.h:285
@ Format_CTX1
Not supported.
Definition nvtt_lowlevel.h:243
NVTT_DEPRECATED_API void 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_encode_bc4s(const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
EncodeFlags
Encode flags for EncodeSettings.
Definition nvtt_lowlevel.h:342
@ EncodeFlags_OutputToGPUMem
Definition nvtt_lowlevel.h:349
@ EncodeFlags_Opaque
Definition nvtt_lowlevel.h:353
@ EncodeFlags_UseGPU
Compress on the GPU if CUDA is available, instead of the CPU.
Definition nvtt_lowlevel.h:345
NVTT_DEPRECATED_API void 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_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_encode_bc5s(const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
PixelType
Pixel value types.
Definition nvtt_lowlevel.h:302
@ PixelType_UnsignedNorm
Used to indicate a DXGI_..._UNORM format.
Definition nvtt_lowlevel.h:303
@ PixelType_UnsignedInt
Not supported yet.
Definition nvtt_lowlevel.h:305
@ PixelType_Float
Used to indicate a DXGI_..._FLOAT format.
Definition nvtt_lowlevel.h:307
@ PixelType_SignedInt
Not supported yet.
Definition nvtt_lowlevel.h:306
@ PixelType_UnsignedFloat
Used to indicate a DXGI_..._UF16 format. Unused.
Definition nvtt_lowlevel.h:308
@ PixelType_SharedExp
Shared exponent. Only supported for DXGI_FORMAT_R9G9B9E5_SHAREDEXP.
Definition nvtt_lowlevel.h:309
@ PixelType_SignedNorm
Not supported yet.
Definition nvtt_lowlevel.h:304
NVTT_DEPRECATED_API void 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)
ValueType
Definition nvtt_lowlevel.h:115
@ SINT8
8-bit signed integer. Can be casted to float by dividing by 127, with the exception that both -128 an...
Definition nvtt_lowlevel.h:117
@ UINT8
8-bit unsigned integer.
Definition nvtt_lowlevel.h:116
@ FLOAT16
IEEE 754 half-precision floating-point: 1 sign bit, 5 exponent bits, and 10 mantissa bits.
Definition nvtt_lowlevel.h:119
@ FLOAT32
IEEE 754 single-precision floating-point: 1 sign bit, 8 exponent bits, and 23 mantissa bits.
Definition nvtt_lowlevel.h:118
NVTT_DEPRECATED_API void nvtt_encode_ati2(const CPUInputBuffer &input, bool slow_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
NVTT_API bool nvtt_encode(const CPUInputBuffer &input, void *output, const EncodeSettings &settings)
NVTT_DEPRECATED_API void nvtt_encode_bc1(const CPUInputBuffer &input, bool fast_mode, void *output, bool useGpu=false, bool to_device_mem=false, nvtt::TimingContext *tc=nullptr)
#define NVTT_DEPRECATED_API
These functions are accessible via the NVTT DLL, but there are better replacements for them,...
Definition nvtt_lowlevel.h:60
#define NVTT_API
Functions with this macro are accessible via the NVTT DLL.
Definition nvtt_lowlevel.h:56
Definition nvtt_lowlevel.h:388
Format format
The desired compression format.
Definition nvtt_lowlevel.h:395
TimingContext * timing_context
Definition nvtt_lowlevel.h:402
NVTT_API EncodeSettings & SetFormat(Format _format)
NVTT_API EncodeSettings & SetOutputToGPUMem(bool _to_device_mem)
Quality quality
The desired compression quality.
Definition nvtt_lowlevel.h:397
uint32_t sType
Definition nvtt_lowlevel.h:393
uint32_t encode_flags
Definition nvtt_lowlevel.h:406
NVTT_API EncodeSettings & SetIsOpaque(bool _is_opaque)
NVTT_API EncodeSettings & SetUseGPU(bool _use_gpu)
PixelType rgb_pixel_type
Definition nvtt_lowlevel.h:400
Use this structure to reference each of the input images.
Definition nvtt_lowlevel.h:135
bool channel_interleave
Whether the rgba channels are interleaved (r0, g0, b0, a0, r1, g1, b1, a1, ...)
Definition nvtt_lowlevel.h:142
const void * data
For CPUInputBuffer, this should point to host memory; for GPUInputBuffer, this should point to device...
Definition nvtt_lowlevel.h:136
int num_channels
Number of channels the image has.
Definition nvtt_lowlevel.h:140
int width
Width of the image. This can be arbitrary, up to 65535.
Definition nvtt_lowlevel.h:137
int height
Height of the image. This can be arbitrary, up to 65535.
Definition nvtt_lowlevel.h:138
ChannelOrder channel_swizzle[4]
Channels order how the image is stored.
Definition nvtt_lowlevel.h:141
int depth
Z-dimension of the images, usually 1.
Definition nvtt_lowlevel.h:139
A TimingContext is a way to collect timing data from a number of functions, and report how much time ...
Definition nvtt.h:1722