renderling/linkage/
skybox_vertex.rs1#![allow(dead_code)]
2use crate::linkage::ShaderLinkage;
4#[cfg(not(target_arch = "wasm32"))]
5mod target {
6 pub const ENTRY_POINT: &str = "skybox::shader::skybox_vertex";
7 pub fn descriptor() -> wgpu::ShaderModuleDescriptor<'static> {
8 wgpu::include_spirv!("../../shaders/skybox-shader-skybox_vertex.spv")
9 }
10 pub fn linkage(device: &wgpu::Device) -> super::ShaderLinkage {
11 log::debug!("creating native linkage for {}", "skybox_vertex");
12 super::ShaderLinkage {
13 entry_point: ENTRY_POINT,
14 module: device.create_shader_module(descriptor()).into(),
15 }
16 }
17}
18#[cfg(target_arch = "wasm32")]
19mod target {
20 pub const ENTRY_POINT: &str = "skyboxshaderskybox_vertex";
21 pub fn descriptor() -> wgpu::ShaderModuleDescriptor<'static> {
22 wgpu::include_wgsl!("../../shaders/skybox-shader-skybox_vertex.wgsl")
23 }
24 pub fn linkage(device: &wgpu::Device) -> super::ShaderLinkage {
25 log::debug!("creating web linkage for {}", "skybox_vertex");
26 super::ShaderLinkage {
27 entry_point: ENTRY_POINT,
28 module: device.create_shader_module(descriptor()).into(),
29 }
30 }
31}
32pub fn linkage(device: &wgpu::Device) -> ShaderLinkage {
33 target::linkage(device)
34}