Skip to content

Commit

Permalink
fix asset loading on windows (bevyengine/bevy#10377)
Browse files Browse the repository at this point in the history
  • Loading branch information
ria8651 committed Feb 1, 2024
1 parent 6edb3f3 commit d596015
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
21 changes: 16 additions & 5 deletions src/voxel_pipeline/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,22 @@ pub struct ComputeResourcesPlugin;

impl Plugin for ComputeResourcesPlugin {
fn build(&self, app: &mut App) {
embedded_asset!(app, "src/", "animation.wgsl");
embedded_asset!(app, "src/", "automata.wgsl");
embedded_asset!(app, "src/", "clear.wgsl");
embedded_asset!(app, "src/", "physics.wgsl");
embedded_asset!(app, "src/", "rebuild.wgsl");
#[cfg(any(not(target_family = "windows"), target_env = "gnu"))]
{
embedded_asset!(app, "src/", "animation.wgsl");
embedded_asset!(app, "src/", "automata.wgsl");
embedded_asset!(app, "src/", "clear.wgsl");
embedded_asset!(app, "src/", "physics.wgsl");
embedded_asset!(app, "src/", "rebuild.wgsl");
}
#[cfg(all(target_family = "windows", not(target_env = "gnu")))]
{
embedded_asset!(app, "src\\", "animation.wgsl");
embedded_asset!(app, "src\\", "automata.wgsl");
embedded_asset!(app, "src\\", "clear.wgsl");
embedded_asset!(app, "src\\", "physics.wgsl");
embedded_asset!(app, "src\\", "rebuild.wgsl");
}
}

fn finish(&self, app: &mut App) {
Expand Down
9 changes: 8 additions & 1 deletion src/voxel_pipeline/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ pub struct TracePlugin;

impl Plugin for TracePlugin {
fn build(&self, app: &mut App) {
embedded_asset!(app, "src/", "trace.wgsl");
#[cfg(any(not(target_family = "windows"), target_env = "gnu"))]
{
embedded_asset!(app, "src/", "trace.wgsl");
}
#[cfg(all(target_family = "windows", not(target_env = "gnu")))]
{
embedded_asset!(app, "src\\", "trace.wgsl");
}

load_internal_asset!(app, COMMON_HANDLE, "common.wgsl", Shader::from_wgsl);
load_internal_asset!(app, BINDINGS_HANDLE, "bindings.wgsl", Shader::from_wgsl);
Expand Down

0 comments on commit d596015

Please sign in to comment.