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

Library Forwarding: Don't map float/double to fixed-size integers #3494

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

neobrain
Copy link
Member

d04c94f unintentionally changed behavior on 64-bit applications: In particular, the apitraces attached to #3488 (comment) show that the LOD bias passed to glTexParameterf differs before and after the change:

< 12916 glTexParameterf(target = GL_TEXTURE_2D, pname = GL_TEXTURE_LOD_BIAS, param = 0)
> 12916 glTexParameterf(target = GL_TEXTURE_2D, pname = GL_TEXTURE_LOD_BIAS, param = -4184224)

It turns out GetTypeNameWithFixedSizeIntegers erroneously mapped float/double types to fixed-size integers, which led to wrong semantics (presumably bitcasting followed by rounding conversion, instead of plain copying). This mapping was done consistently for both host and guest, so this issue escaped my initial attempt at finding differences.

By fixing GetTypeNameWithFixedSizeIntegers, thunkgen now emits GuestWrapperForHostFunction<void(uint32_t, uint32_t, float), uint32_t, uint32_t, float>::Call for glTexParameterf, where previously the floats would have been replaced by uint32_t. Similar type checks have been updated to use builtin && integer for consistency without functional change.

Fixes #3455.
Supersedes #3488.

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.

Vulkan thunks rendering issue with Detroit Become Human.
2 participants