Created
July 5, 2021 12:11
-
-
Save apriori/f1980bc2dfe5fea45159507a73f16976 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async fn maybe_watch_compute() -> wgpu::ShaderModuleDescriptor<'static> { | |
wgpu::include_spirv!(env!("some_shader.spv")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async fn maybe_watch_compute() -> wgpu::ShaderModuleDescriptor<'static> { | |
let data = std::fs::read(env!("some_shader.spv")).unwrap(); | |
let spirv = wgpu::util::make_spirv(&data); | |
let spirv = match spirv { | |
wgpu::ShaderSource::Wgsl(cow) => { | |
wgpu::ShaderSource::Wgsl(Cow::Owned(cow.into_owned())) | |
} | |
wgpu::ShaderSource::SpirV(cow) => { | |
wgpu::ShaderSource::SpirV(Cow::Owned(cow.into_owned())) | |
} | |
}; | |
wgpu::ShaderModuleDescriptor { | |
label: None, | |
source: spirv, | |
flags: wgpu::ShaderFlags::default(), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment