mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Allow examples to run from any dir
This commit is contained in:
parent
855bcfe176
commit
038e49aa25
5
Makefile
5
Makefile
@ -30,7 +30,7 @@ else
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: all check test doc clear lib-native lib-rust examples-native examples-rust
|
||||
.PHONY: all check test doc clear lib-native lib-rust examples-native examples-rust gfx-cube
|
||||
|
||||
all: examples-native examples-rust examples-gfx
|
||||
|
||||
@ -64,3 +64,6 @@ examples-rust: lib-rust examples/Cargo.toml $(wildcard wgpu-native/**/*.rs)
|
||||
|
||||
examples-gfx: lib-rust gfx-examples/Cargo.toml $(wildcard gfx-examples/*.rs)
|
||||
cargo build --manifest-path gfx-examples/Cargo.toml --features $(FEATURE_RUST)
|
||||
|
||||
gfx-cube:
|
||||
cargo run --manifest-path gfx-examples/Cargo.toml --bin cube --features $(FEATURE_RUST)
|
||||
|
@ -27,7 +27,9 @@ pub fn load_glsl(name: &str, stage: ShaderStage) -> Vec<u8> {
|
||||
ShaderStage::Fragment => glsl_to_spirv::ShaderType::Fragment,
|
||||
ShaderStage::Compute => glsl_to_spirv::ShaderType::Compute,
|
||||
};
|
||||
let path = PathBuf::from("data").join(name);
|
||||
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("data")
|
||||
.join(name);
|
||||
let code = read_to_string(path).unwrap();
|
||||
let mut output = glsl_to_spirv::compile(&code, ty).unwrap();
|
||||
let mut spv = Vec::new();
|
||||
|
@ -696,4 +696,4 @@ WGPUTextureViewId wgpu_texture_create_view(WGPUTextureId texture_id,
|
||||
|
||||
void wgpu_texture_destroy(WGPUTextureId texture_id);
|
||||
|
||||
void wgpu_texture_view_destroy(WGPUTextureViewId _texture_view_id);
|
||||
void wgpu_texture_view_destroy(WGPUTextureViewId texture_view_id);
|
||||
|
Loading…
Reference in New Issue
Block a user