mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-28 03:14:15 +01:00
Fix some KTX IO bugs
This commit is contained in:
parent
865239542a
commit
a51e63f5c0
@ -75,7 +75,7 @@ class ByteReader {
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
bool Advance(uint32 nBytes) {
|
bool Advance(uint32 nBytes) {
|
||||||
if(nBytes < m_BytesLeft) {
|
if(nBytes > m_BytesLeft) {
|
||||||
assert(!"Cannot read any more, unexpected bytes!");
|
assert(!"Cannot read any more, unexpected bytes!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -278,6 +278,7 @@ bool ImageLoaderKTX::ReadData() {
|
|||||||
switch(glInternalFormat) {
|
switch(glInternalFormat) {
|
||||||
case GL_COMPRESSED_RGBA_BPTC_UNORM:
|
case GL_COMPRESSED_RGBA_BPTC_UNORM:
|
||||||
m_Format = FasTC::eCompressionFormat_BPTC;
|
m_Format = FasTC::eCompressionFormat_BPTC;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "KTX loader - texture format (0x%x) unsupported!\n", glInternalFormat);
|
fprintf(stderr, "KTX loader - texture format (0x%x) unsupported!\n", glInternalFormat);
|
||||||
return false;
|
return false;
|
||||||
|
@ -123,7 +123,7 @@ bool ImageWriterKTX::WriteImage() {
|
|||||||
if(ci) {
|
if(ci) {
|
||||||
wtr.Write(0); // glType
|
wtr.Write(0); // glType
|
||||||
wtr.Write(1); // glTypeSize
|
wtr.Write(1); // glTypeSize
|
||||||
wtr.Write(GL_RGBA); // glFormat
|
wtr.Write(0); // glFormat must be zero for compressed images...
|
||||||
switch(ci->GetFormat()) {
|
switch(ci->GetFormat()) {
|
||||||
case FasTC::eCompressionFormat_BPTC:
|
case FasTC::eCompressionFormat_BPTC:
|
||||||
wtr.Write(GL_COMPRESSED_RGBA_BPTC_UNORM); // glInternalFormat
|
wtr.Write(GL_COMPRESSED_RGBA_BPTC_UNORM); // glInternalFormat
|
||||||
|
Loading…
Reference in New Issue
Block a user