Apply second half of [#21590] .dds textures: fix for DXT1n format + sync with upstrea...
[blender.git] / source / blender / imbuf / intern / dds / Common.h
index 9cf1de3644a7eb706fcbcfa7f3175e7620be4f36..a6dcf69febf755dc6c0e9f799e3428441b5aeffe 100644 (file)
@@ -55,4 +55,10 @@ typedef unsigned int       uint;
 typedef unsigned int       uint32;
 typedef unsigned long long uint64;
 
+// copied from nvtt src/nvimage/nvimage.h
+inline uint computePitch(uint w, uint bitsize, uint alignment)
+{
+       return ((w * bitsize +  8 * alignment - 1) / (8 * alignment)) * alignment;
+}
+
 #endif