You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, there is a bug in how swizzling is handled in CompressTexture() in compress.cpp. The code snippet around line 388 that has the comment "GPUOpen issue # 59 fix", is misplaced inside the if() statement that checks to see if the options are provided. This prevents swizzling from being activated unless the user provides a pointer to CMP_CompressOptions, which most people won't. The swizzling check should be moved outside the if(), so that it is always executed.
Second, swizzling is not even implemented in several buffer formats. For instance, RGB-888 data (no alpha) is not swizzled. This means that if I try to compress RGB data to DXT1, for example, that the resulting texture comes out with red and blue channels swapped because the internal system expects BGR ordering, and swizzling is not there to fix it. This means that the only way to compress 8-bit RGB data is to manually swizzle it before passing to the API.
It's simple to add the swizzling to CCodecBuffer_RGB888::ReadBlockRGBA(), by just checking the m_bSwizzle member and reversing the bytes if true:
I can't believe how many bugs/problems I've found with this code, just in basic usage. It seems like only certain special code paths are tested, and everything else is full of bugs and issues.
The text was updated successfully, but these errors were encountered:
Using the Compressinator SDK, I am experiencing this bug when converting textures from both of the following scenarios: CMP_FORMAT_RGB_888 to CMP_FORMAT_ETC2_RGB CMP_FORMAT_RGBA_8888 to CMP_FORMAT_ETC2_RGBA
First, there is a bug in how swizzling is handled in CompressTexture() in compress.cpp. The code snippet around line 388 that has the comment "GPUOpen issue # 59 fix", is misplaced inside the if() statement that checks to see if the options are provided. This prevents swizzling from being activated unless the user provides a pointer to CMP_CompressOptions, which most people won't. The swizzling check should be moved outside the if(), so that it is always executed.
Second, swizzling is not even implemented in several buffer formats. For instance, RGB-888 data (no alpha) is not swizzled. This means that if I try to compress RGB data to DXT1, for example, that the resulting texture comes out with red and blue channels swapped because the internal system expects BGR ordering, and swizzling is not there to fix it. This means that the only way to compress 8-bit RGB data is to manually swizzle it before passing to the API.
It's simple to add the swizzling to CCodecBuffer_RGB888::ReadBlockRGBA(), by just checking the m_bSwizzle member and reversing the bytes if true:
if ( m_bSwizzle )
{
for(i = 0; i < dwWidth; i++) {
*pDestData++ = pSrcData[2];
*pDestData++ = pSrcData[1];
*pDestData++ = pSrcData[0];
*pDestData++ = 0xff;
pSrcData += nChannelCount;
}
}
else
{
for(i = 0; i < dwWidth; i++) {
*pDestData++ = *pSrcData++;
*pDestData++ = *pSrcData++;
*pDestData++ = *pSrcData++;
*pDestData++ = 0xff;
}
}
I can't believe how many bugs/problems I've found with this code, just in basic usage. It seems like only certain special code paths are tested, and everything else is full of bugs and issues.
The text was updated successfully, but these errors were encountered: