Skip to content

Commit

Permalink
Enable ResourceLoader::load_threaded_* with experimental-threads
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanNano committed Aug 13, 2024
1 parent 6bcaa3c commit 9e9bfb3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
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

0 comments on commit 9e9bfb3

Please sign in to comment.