mirror of
https://github.com/italicsjenga/spirv-to-dxil-rs.git
synced 2024-12-23 19:41:29 +11:00
rs: mark enums as copy/clone/debug
This commit is contained in:
parent
1a5625d57a
commit
4837b3c7d7
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -207,7 +207,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spirv-to-dxil"
|
name = "spirv-to-dxil"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "spirv-to-dxil"
|
name = "spirv-to-dxil"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Rust bindings to spirv-to-dxil"
|
description = "Rust bindings to spirv-to-dxil"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum ShaderStage {
|
pub enum ShaderStage {
|
||||||
None,
|
None,
|
||||||
Vertex,
|
Vertex,
|
||||||
|
@ -40,6 +41,7 @@ impl From<ShaderStage> for spirv_to_dxil_sys::dxil_spirv_shader_stage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum ShaderModel {
|
pub enum ShaderModel {
|
||||||
ShaderModel6_0,
|
ShaderModel6_0,
|
||||||
|
@ -67,6 +69,7 @@ impl From<ShaderModel> for spirv_to_dxil_sys::dxil_shader_model {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum ValidatorVersion {
|
pub enum ValidatorVersion {
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -161,4 +161,18 @@ mod tests {
|
||||||
RuntimeConfig::default())
|
RuntimeConfig::default())
|
||||||
.expect("failed to compile");
|
.expect("failed to compile");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_validate() {
|
||||||
|
let fragment: &[u8] = include_bytes!("../test/vertex.spv");
|
||||||
|
let fragment = Vec::from(fragment);
|
||||||
|
let fragment = bytemuck::cast_slice(&fragment);
|
||||||
|
|
||||||
|
super::spirv_to_dxil(&fragment,
|
||||||
|
None, "main",
|
||||||
|
ShaderStage::Vertex,
|
||||||
|
ShaderModel::ShaderModel6_0, ValidatorVersion::None,
|
||||||
|
RuntimeConfig::default())
|
||||||
|
.expect("failed to compile");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue