-
Notifications
You must be signed in to change notification settings - Fork 94
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
KTX roundng #29
Comments
Have a look at imageSaveKtx(): Line 5231 in a8c246a
Unpack alignment is taken into account when writing data: Line 5293 in a8c246a
but Line 5298 in a8c246a
Try recalculating faceSize with rounding and see if that solves the problem. |
Thanks, Dario.
I would suggest changing
const uint32_t pitch = width * bytesPerPixel;
const uint32_t faceSize = pitch * height;
For
const uint32_t pitch = width * bytesPerPixel;
const uint32_t roundedPitch = (width * bytesPerPixel +
KTX_UNPACK_ALIGNMENT-1) & ~(KTX_UNPACK_ALIGNMENT-1);
const uint32_t faceSize = roundedPitch * height;
As you suggest.
I'll try this the next time I am at home with my Linux machine.
…On Sun, Apr 9, 2017 at 11:35 PM, Dario Manesku ***@***.***> wrote:
Have a look at imageSaveKtx():
https://github.com/dariomanesku/cmft/blob/a8c246a4b59670092f34209bf8247f
79337526ed/src/cmft/image.cpp#L5231
Unpack alignment is taken into account when writing data:
https://github.com/dariomanesku/cmft/blob/a8c246a4b59670092f34209bf8247f
79337526ed/src/cmft/image.cpp#L5293
but faceSize is not affected by that: https://github.com/
dariomanesku/cmft/blob/a8c246a4b59670092f34209bf8247f
79337526ed/src/cmft/image.cpp#L5298
Try recalculating faceSize with rounding and see if that solves the
problem.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABe_XFNIF99qfFThWAkdIQ2CIBvrhgacks5ruV0VgaJpZM4M1h9z>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for an excellent tool. I am using it in the cubemap examples for my Vulkan helper library, Vookoo.
I have seen a potential bug in the KTX write code when rounding is following
GL_UNPACK_ALIGNMENT
The image size does not seem to take account of the change in row pitch due to rounding and reports a smaller value that required. This may just be a misunderstanding of the KTX format, so please ignore
this if it is an incorrect assumption.
The text was updated successfully, but these errors were encountered: