Closed javagl closed 3 months ago
These are bugs in texturetests, likely copy and paste errors. I'll fix them. They should be using KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT.
As for invalid operations I don't see any KTX_INVALID_OPERATION error returned by ktxTexture_CreateFromMemory and its calllees.
As for invalid operations I don't see any KTX_INVALID_OPERATION error returned by ktxTexture_CreateFromMemory and its calllees.
I still have to investigate why this is happening, but I added a comment about that in the PR at https://github.com/KhronosGroup/KTX-Software/pull/886#issuecomment-2050035880
The
ktxTexture2_CreateFromMemory
function has the following signature:It receives
ktxTextureCreateFlags
. These are typedef'ed toktx_uint32_t
, and there is an enumAnd this seems to be the one that is intended to be used there (because the documentation explicitly mentions
KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT
)But still, there are several places in the
texturetests.cc
where this function is called asThe
KTX_TEXTURE_CREATE_ALLOC_STORAGE
is not part of thektxTextureCreateFlagBits
. It is part of thektxTextureCreateStorageEnum
.I assume that the fact that this works is... only a coincidence, because
KTX_TEXTURE_CREATE_ALLOC_STORAGE
happens to have the same value asKTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT
. (And if that's the case: Hooray for C++'s helpless attempt to disguise arbitrary values as "types"...).But this is either a bug in the tests, or a case of a function being distressingly under-documented.
Some context: A build for the JNI improvements PR is failing in the test for
createFromMemory
, sayingSo I wanted to look up what I might have done wrong there. This failure happens only on Linux (and not on Windows), so maybe it's not even my fault, but I'll dig into it...