D3D11: Proper fix for DXT5 crash. May also help #9134.

This commit is contained in:
Henrik Rydgard 2017-02-18 02:41:17 +01:00
parent badd3669ca
commit b0cdcfca3c
5 changed files with 22 additions and 26 deletions

View file

@ -354,7 +354,7 @@ inline static Nearest4 SampleNearest(int level, int u[N], int v[N], const u8 *sr
for (int i = 0; i < N; ++i) {
const DXT1Block *block = (const DXT1Block *)srcptr + (v[i] / 4) * (texbufwidthbits / 8 / 4) + (u[i] / 4);
u32 data[4 * 4];
DecodeDXT1Block(data, block, 4);
DecodeDXT1Block(data, block, 4, 4, false);
res.v[i] = data[4 * (v[i] % 4) + (u[i] % 4)];
}
return res;
@ -363,7 +363,7 @@ inline static Nearest4 SampleNearest(int level, int u[N], int v[N], const u8 *sr
for (int i = 0; i < N; ++i) {
const DXT3Block *block = (const DXT3Block *)srcptr + (v[i] / 4) * (texbufwidthbits / 8 / 4) + (u[i] / 4);
u32 data[4 * 4];
DecodeDXT3Block(data, block, 4);
DecodeDXT3Block(data, block, 4, 4);
res.v[i] = data[4 * (v[i] % 4) + (u[i] % 4)];
}
return res;
@ -372,7 +372,7 @@ inline static Nearest4 SampleNearest(int level, int u[N], int v[N], const u8 *sr
for (int i = 0; i < N; ++i) {
const DXT5Block *block = (const DXT5Block *)srcptr + (v[i] / 4) * (texbufwidthbits / 8 / 4) + (u[i] / 4);
u32 data[4 * 4];
DecodeDXT5Block(data, block, 4);
DecodeDXT5Block(data, block, 4, 4);
res.v[i] = data[4 * (v[i] % 4) + (u[i] % 4)];
}
return res;