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

Enable ResourceLoader::load_threaded_* with experimental-threads #856

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions godot-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ codegen-rustfmt = []
double-precision = []
api-custom = ["godot-bindings/api-custom"]
experimental-godot-api = []
experimental-threads = []

[dependencies]
godot-bindings = { path = "../godot-bindings", version = "=0.1.3" }
Expand Down
16 changes: 9 additions & 7 deletions godot-codegen/src/special_cases/special_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ pub fn is_class_method_deleted(class_name: &TyName, method: &JsonClassMethod, ct
| ("GDExtension", "initialize_library")
| ("GDExtension", "close_library")

// Thread APIs
| ("ResourceLoader", "load_threaded_get")
| ("ResourceLoader", "load_threaded_get_status")
| ("ResourceLoader", "load_threaded_request")
// also: enum ThreadLoadStatus

// TODO: Godot exposed methods that are unavailable, bug reported in https://github.com/godotengine/godot/issues/90303.
| ("OpenXRHand", "set_hand_skeleton")
| ("OpenXRHand", "get_hand_skeleton")
Expand All @@ -66,8 +60,16 @@ pub fn is_class_method_deleted(class_name: &TyName, method: &JsonClassMethod, ct
| ("VisualShaderNodeComment", "get_title")
| ("VisualShaderNodeComment", "set_description")
| ("VisualShaderNodeComment", "get_description")
=> true,

=> true, _ => false
// Thread APIs
#[cfg(not(feature = "experimental-threads"))]
| ("ResourceLoader", "load_threaded_get")
| ("ResourceLoader", "load_threaded_get_status")
| ("ResourceLoader", "load_threaded_request") => true,
// also: enum ThreadLoadStatus

_ => false
}
}

Expand Down
2 changes: 1 addition & 1 deletion godot-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ codegen-lazy-fptrs = [
]
double-precision = ["godot-codegen/double-precision"]
experimental-godot-api = ["godot-codegen/experimental-godot-api"]
experimental-threads = ["godot-ffi/experimental-threads"]
experimental-threads = ["godot-ffi/experimental-threads", "godot-codegen/experimental-threads"]
experimental-wasm-nothreads = ["godot-ffi/experimental-wasm-nothreads"]
debug-log = ["godot-ffi/debug-log"]
trace = []
Expand Down
2 changes: 1 addition & 1 deletion godot-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ homepage = "https://godot-rust.github.io"
codegen-rustfmt = ["godot-codegen/codegen-rustfmt"]
codegen-lazy-fptrs = ["godot-codegen/codegen-lazy-fptrs"]
experimental-godot-api = ["godot-codegen/experimental-godot-api"]
experimental-threads = []
experimental-threads = ["godot-codegen/experimental-threads"]
experimental-wasm-nothreads = ["godot-bindings/experimental-wasm-nothreads"]
debug-log = []

Expand Down
Loading