aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/builders/shader.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:23 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:23 +0100
commit0353181306702c40ad0fe482b5c2b159b46794a4 (patch)
tree33acc6a9e8ea4705884cf93b78cf869008f71832 /stockton-render/src/builders/shader.rs
parent664f0b0777ba96298b29f0c753d52a81cbb233f1 (diff)
refactor(all): rename some crates
Diffstat (limited to 'stockton-render/src/builders/shader.rs')
-rw-r--r--stockton-render/src/builders/shader.rs35
1 files changed, 0 insertions, 35 deletions
diff --git a/stockton-render/src/builders/shader.rs b/stockton-render/src/builders/shader.rs
deleted file mode 100644
index fde185d..0000000
--- a/stockton-render/src/builders/shader.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-use crate::types::*;
-
-use anyhow::{Context, Result};
-use hal::pso::Specialization;
-use shaderc::{Compiler, ShaderKind};
-
-#[derive(Debug, Clone)]
-pub struct ShaderDesc {
- pub source: String,
- pub entry: String,
- pub kind: ShaderKind,
-}
-
-impl ShaderDesc {
- pub fn compile(&self, compiler: &mut Compiler, device: &mut DeviceT) -> Result<ShaderModuleT> {
- let artifact = compiler
- .compile_into_spirv(&self.source, self.kind, "shader", &self.entry, None)
- .context("Shader compilation failed")?;
-
- // Make into shader module
- Ok(unsafe {
- device
- .create_shader_module(artifact.as_binary())
- .context("Shader module creation failed")?
- })
- }
-
- pub fn as_entry<'a>(&'a self, module: &'a ShaderModuleT) -> EntryPoint<'a> {
- EntryPoint {
- entry: &self.entry,
- module,
- specialization: Specialization::default(),
- }
- }
-}