Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub fn generate_module_for_cpu_usage(state: &ModuleTransformState) -> TokenStrea
let main_func = generate_main_func(state);
let consts = generate_module_level_consts(state);
quote!(
pub use on_cpu::*;
pub mod on_cpu {
use super::*;
use bevy_gpu_compute_core::wgsl_helpers::*;
Expand Down
2 changes: 1 addition & 1 deletion bevy_gpu_compute_macro/tests/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ fn test_functions_exposed_for_rust() {
}

// you can now use any helper functions in the module like this:
let f1_test = example_shader_module::on_cpu::calculate_distance_squared([1.0, 2.0], [3.0, 4.0]);
let f1_test = example_shader_module::calculate_distance_squared([1.0, 2.0], [3.0, 4.0]);
assert_eq!(f1_test, 8.0);

//* The main function is designed to mutate GPU buffers in WGSL, so we have to replicate this for a cpu version by requiring those same inputs to be passed as parameters to the main function */
Expand Down