Skip to content

Conversation

@bruvzg
Copy link
Member

@bruvzg bruvzg commented Mar 20, 2022

Adds double precision build support (using float=64 build flag). Fix config selection for 32-bit builds (was hard-coded to 64-bit).

@bruvzg bruvzg added enhancement This is an enhancement on the current functionality needs testing topic:gdextension This relates to the new Godot 4 extension implementation labels Mar 20, 2022
@bruvzg bruvzg added this to the 4.0 milestone Mar 20, 2022
@bruvzg bruvzg marked this pull request as ready for review March 21, 2022 08:48
@bruvzg
Copy link
Member Author

bruvzg commented Mar 21, 2022

Tested with the demo project, seems to be working fine.

64-bit float engine crashes when 32-bit float library is loaded. 32-bit float engine seems to be able to load 64-bit float version, but some values probably will be corrupted. Seems like there's no easy way to check engine / library float size in the runtime (might be worth adding a function to do so, and reject library loading if size do not match).

@bruvzg bruvzg force-pushed the double_pr_build branch 2 times, most recently from f155198 to 4bec82e Compare May 4, 2022 11:05
CMakeLists.txt Outdated
# godot-cpp cmake arguments
# GODOT_HEADERS_DIR: This is where the gdnative include folder is (godot_source/modules/gdnative/include)
# GODOT_CUSTOM_API_FILE: This is if you have another path for the godot_api.json
# FLOAT_TYPE Floating-point precision (float, double)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this should be tab aligned to match the above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should this be 32/64 to match the SCons option?

shutil.rmtree(target_dir, ignore_errors=True)
target_dir.mkdir(parents=True)

print("Built-in type config: " + double + "_" + bits)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need to get rid of this bits thing and properly use arch, this it pretty confusing IMO.
@Faless has some WIP for it IINM, pending on reviewing/approving godotengine/godot#55778

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akien-mga Here's a PR for the godot-cpp repo for master: #759

@bruvzg bruvzg force-pushed the double_pr_build branch from 4bec82e to e06d5cd Compare May 4, 2022 12:56
@akien-mga akien-mga merged commit d00e469 into godotengine:master May 4, 2022
@akien-mga
Copy link
Member

Thanks!

@bruvzg bruvzg deleted the double_pr_build branch May 4, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an enhancement on the current functionality needs testing topic:gdextension This relates to the new Godot 4 extension implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants