Skip to content
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

vkreplay: Fix issues replaying 32-bit large file #577

Conversation

justuswang
Copy link

On 32-bit Linux/Android, fseek and ftell only works well for trace file
smaller than 2GB which will cause problem when geting file length and
using portability table on a large trace file.

This change fixes the issue by:

  • x86 version:
    ** Use fseeko and ftello instead of fseek and ftell.
    "-D_FILE_OFFSET_BITS=64" has been defined in vktrace's CMakeList.txt to
    make those functions support large file.

  • 32-bit Android version:
    ** Implement vktrace_fseek and vktrace_ftell using lseek64 which is
    available in NDK.

For the NDK problem of using fseeko and ftello, refer to
android/ndk#480

On 32-bit Linux/Android, fseek and ftell only works well for trace file
smaller than 2GB which will cause problem when geting file length and
using portability table on a large trace file.

This change fixes the issue by:

* x86 version:
** Use fseeko and ftello instead of fseek and ftell.
"-D_FILE_OFFSET_BITS=64" has been defined in vktrace's CMakeList.txt to
make those functions support large file.

* 32-bit Android version:
** Implement vktrace_fseek and vktrace_ftell using lseek64 which is
available in NDK.

For the NDK problem of using fseeko and ftello, refer to
android/ndk#480
@davidlunarg
Copy link
Contributor

The builds in this pull request failed because of a process problem - the Vulkan-Tools build was broken when this pull request was submitted. Now that the Vulkan-Tools build has been fixed, I have verified that this pull request in fact does build successfully.

I merged this change to master.

@justuswang justuswang deleted the fix_Fseek_Ftell_large_tracefile_32bit branch July 19, 2018 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants