mirror of
https://github.com/italicsjenga/spirv-to-dxil-rs.git
synced 2024-12-23 11:31:31 +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]]
|
||||
name = "spirv-to-dxil"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"bytemuck",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "spirv-to-dxil"
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
edition = "2021"
|
||||
description = "Rust bindings to spirv-to-dxil"
|
||||
license = "MIT"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use bitflags::bitflags;
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum ShaderStage {
|
||||
None,
|
||||
Vertex,
|
||||
|
@ -40,6 +41,7 @@ impl From<ShaderStage> for spirv_to_dxil_sys::dxil_spirv_shader_stage {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[non_exhaustive]
|
||||
pub enum ShaderModel {
|
||||
ShaderModel6_0,
|
||||
|
@ -67,6 +69,7 @@ impl From<ShaderModel> for spirv_to_dxil_sys::dxil_shader_model {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[non_exhaustive]
|
||||
pub enum ValidatorVersion {
|
||||
None,
|
||||
|
|
|
@ -161,4 +161,18 @@ mod tests {
|
|||
RuntimeConfig::default())
|
||||
.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