-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libktx: update ktxTexture2_setImageFromStream to allow setting the entire level's data in one call #794
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. See my small comments.
lib/writer2.c
Outdated
return result; | ||
|
||
imageByteLength = ktxTexture_GetImageSize(ktxTexture(This), level); | ||
if (faceSlice == (ktx_uint32_t)(-1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this does not change the type of the faceSlice parameter, which I agree with, let's document this as specify UINT_MAX (i.e. the value of -1 cast to uint32_t) instead of -1 to set the entire level. Consider making a define to be used, e.g. KTX_ENTIRE_LEVEL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, I did it that way to avoid including limits.h
…tire level's data in one call Fixes: #792
…tire level's data in one call (KhronosGroup#794) This change updates `ktxTexture2_setImageFromStream` to allow setting `faceSlice` to `KTX_FACESLICE_WHOLE_LEVEL`. This allows setting the entire level's data in one call rather having to do a loop setting each slice individually. Fixes: KhronosGroup#792
…tire level's data in one call (KhronosGroup#794) This change updates `ktxTexture2_setImageFromStream` to allow setting `faceSlice` to `KTX_FACESLICE_WHOLE_LEVEL`. This allows setting the entire level's data in one call rather having to do a loop setting each slice individually. Fixes: KhronosGroup#792
…tire level's data in one call (KhronosGroup#794) This change updates `ktxTexture2_setImageFromStream` to allow setting `faceSlice` to `KTX_FACESLICE_WHOLE_LEVEL`. This allows setting the entire level's data in one call rather having to do a loop setting each slice individually. Fixes: KhronosGroup#792
…tire level's data in one call (KhronosGroup#794) This change updates `ktxTexture2_setImageFromStream` to allow setting `faceSlice` to `KTX_FACESLICE_WHOLE_LEVEL`. This allows setting the entire level's data in one call rather having to do a loop setting each slice individually. Fixes: KhronosGroup#792
…tire level's data in one call (KhronosGroup#794) This change updates `ktxTexture2_setImageFromStream` to allow setting `faceSlice` to `KTX_FACESLICE_WHOLE_LEVEL`. This allows setting the entire level's data in one call rather having to do a loop setting each slice individually. Fixes: KhronosGroup#792
This change updates
ktxTexture2_setImageFromStream
to allow settingfaceSlice
to-1
,This allows setting the entire level's data in one call rather having to do a loop and setting each slice individually.
Fixes: #792