rt: add stable feature to build ShaderPassArtifacts via Box<dyn CompileReflectShader>
This commit is contained in:
parent
e0a5c90103
commit
2f988d5b1d
|
@ -26,6 +26,7 @@ runtime-vulkan = ["ash", "librashader/runtime-vk"]
|
|||
runtime-metal = ["__cbindgen_internal_objc", "librashader/runtime-metal"]
|
||||
|
||||
reflect-unstable = []
|
||||
stable = ["librashader/stable"]
|
||||
|
||||
__cbindgen_internal = ["runtime-all"]
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
//! librashader-reflect is designed to be compiler-agnostic. [naga](https://docs.rs/naga/latest/naga/index.html),
|
||||
//! a pure-Rust shader compiler, as well as SPIRV-Cross via [SpirvCompilation](crate::front::SpirvCompilation)
|
||||
//! is supported.
|
||||
#![cfg_attr(not(feature="stable"), feature(impl_trait_in_assoc_type))]
|
||||
#![cfg_attr(not(feature = "stable"), feature(impl_trait_in_assoc_type))]
|
||||
#![allow(stable_features)]
|
||||
#![cfg_attr(not(feature="stable"), feature(c_str_literals))]
|
||||
#![cfg_attr(not(feature = "stable"), feature(c_str_literals))]
|
||||
/// Shader codegen backends.
|
||||
pub mod back;
|
||||
/// Error types.
|
||||
|
|
|
@ -26,6 +26,7 @@ array-concat = "0.5.2"
|
|||
|
||||
[features]
|
||||
debug-shader = []
|
||||
stable = ["librashader-reflect/stable"]
|
||||
|
||||
[target.'cfg(windows)'.dependencies.windows]
|
||||
workspace = true
|
||||
|
|
|
@ -73,9 +73,16 @@ pub(crate) struct FilterCommon {
|
|||
|
||||
mod compile {
|
||||
use super::*;
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<HLSL, SpirvCompilation, SpirvCross> + Send>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type ShaderPassMeta = ShaderPassArtifact<
|
||||
Box<dyn CompileReflectShader<HLSL, SpirvCompilation, SpirvCross> + Send>,
|
||||
>;
|
||||
|
||||
pub fn compile_passes(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
|
|
@ -33,6 +33,9 @@ gpu-allocator = { version = "0.27.0", features = ["d3d12"], default-features = f
|
|||
parking_lot = "0.12.3"
|
||||
d3d12-descriptor-heap = "0.1.0"
|
||||
|
||||
[features]
|
||||
stable = ["librashader-reflect/stable"]
|
||||
|
||||
[target.'cfg(windows)'.dependencies.windows]
|
||||
workspace = true
|
||||
features = [
|
||||
|
|
|
@ -169,9 +169,16 @@ impl Drop for FrameResiduals {
|
|||
|
||||
mod compile {
|
||||
use super::*;
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type DxilShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<DXIL, SpirvCompilation, SpirvCross> + Send>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type DxilShaderPassMeta = ShaderPassArtifact<
|
||||
Box<dyn CompileReflectShader<DXIL, SpirvCompilation, SpirvCross> + Send>,
|
||||
>;
|
||||
|
||||
pub fn compile_passes_dxil(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
@ -192,9 +199,15 @@ mod compile {
|
|||
Ok((passes, semantics))
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type HlslShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<HLSL, SpirvCompilation, SpirvCross> + Send>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type HlslShaderPassMeta = ShaderPassArtifact<
|
||||
Box<dyn CompileReflectShader<HLSL, SpirvCompilation, SpirvCross> + Send>,
|
||||
>;
|
||||
|
||||
pub fn compile_passes_hlsl(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#![cfg(target_os = "windows")]
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![cfg_attr(not(feature = "stable"), feature(type_alias_impl_trait))]
|
||||
|
||||
mod buffer;
|
||||
mod descriptor_heap;
|
||||
|
|
|
@ -26,6 +26,9 @@ num-traits = "0.2.18"
|
|||
|
||||
windows-core = "0.58.0"
|
||||
|
||||
[features]
|
||||
stable = ["librashader-reflect/stable"]
|
||||
|
||||
[target.'cfg(windows)'.dependencies.windows]
|
||||
workspace = true
|
||||
features = [
|
||||
|
|
|
@ -60,9 +60,16 @@ pub struct FilterChainD3D9 {
|
|||
|
||||
mod compile {
|
||||
use super::*;
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<HLSL, SpirvCompilation, SpirvCross> + Send>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type ShaderPassMeta = ShaderPassArtifact<
|
||||
Box<dyn CompileReflectShader<HLSL, SpirvCompilation, SpirvCross> + Send>,
|
||||
>;
|
||||
|
||||
pub fn compile_passes(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#![cfg(target_os = "windows")]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![cfg_attr(not(feature = "stable"), feature(type_alias_impl_trait))]
|
||||
|
||||
mod binding;
|
||||
mod d3dx;
|
||||
mod draw_quad;
|
||||
|
|
|
@ -27,6 +27,9 @@ rayon = "1.6.1"
|
|||
|
||||
sptr = "0.3"
|
||||
|
||||
[features]
|
||||
stable = ["librashader-reflect/stable"]
|
||||
|
||||
[dev-dependencies]
|
||||
glfw = "0.47.0"
|
||||
|
||||
|
|
|
@ -89,9 +89,16 @@ impl<T: GLInterface> FilterChainImpl<T> {
|
|||
|
||||
mod compile {
|
||||
use super::*;
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<GLSL, SpirvCompilation, SpirvCross>>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type ShaderPassMeta = ShaderPassArtifact<
|
||||
Box<dyn CompileReflectShader<GLSL, SpirvCompilation, SpirvCross> + Send>,
|
||||
>;
|
||||
|
||||
pub fn compile_passes(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//! This crate should not be used directly.
|
||||
//! See [`librashader::runtime::gl`](https://docs.rs/librashader/latest/librashader/runtime/gl/index.html) instead.
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![cfg_attr(not(feature = "stable"), feature(type_alias_impl_trait))]
|
||||
|
||||
mod binding;
|
||||
mod filter_chain;
|
||||
|
|
|
@ -39,7 +39,7 @@ objc2-metal = { workspace = true, features = ["all"] }
|
|||
objc2 = { workspace = true, features = ["apple"] }
|
||||
|
||||
[features]
|
||||
# run_test = ["icrate/AppKit", "i "icrate/Foundation_all", "icrate/MetalKit", "icrate/MetalKit_all"]
|
||||
stable = ["librashader-reflect/stable"]
|
||||
|
||||
[target.'cfg(target_vendor="apple")'.dev-dependencies]
|
||||
objc2-metal-kit = { version = "0.2", features = ["all"]}
|
||||
|
|
|
@ -41,9 +41,15 @@ use std::path::Path;
|
|||
|
||||
mod compile {
|
||||
use super::*;
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<MSL, SpirvCompilation, SpirvCross> + Send>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<Box<dyn CompileReflectShader<MSL, SpirvCompilation, SpirvCross> + Send>>;
|
||||
|
||||
pub fn compile_passes(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
//! librashader Metal runtime
|
||||
//!
|
||||
//! This crate should not be used directly.
|
||||
//! See [`librashader::runtime::mtl`](https://docs.rs/librashader/latest/aarch64-apple-darwin/librashader/runtime/mtl/index.html) instead.
|
||||
|
||||
#![cfg(target_vendor = "apple")]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![cfg_attr(not(feature = "stable"), feature(type_alias_impl_trait))]
|
||||
|
||||
mod buffer;
|
||||
mod draw_quad;
|
||||
|
|
|
@ -30,6 +30,9 @@ array-concat = "0.5.2"
|
|||
|
||||
ash = { workspace = true, features = ["debug"] }
|
||||
|
||||
[features]
|
||||
stable = ["librashader-reflect/stable"]
|
||||
|
||||
[dev-dependencies]
|
||||
num = "0.4.0"
|
||||
glfw = "0.49.0"
|
||||
|
|
|
@ -206,9 +206,16 @@ impl Drop for FrameResiduals {
|
|||
|
||||
mod compile {
|
||||
use super::*;
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<SPIRV, SpirvCompilation, SpirvCross> + Send>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type ShaderPassMeta = ShaderPassArtifact<
|
||||
Box<dyn CompileReflectShader<SPIRV, SpirvCompilation, SpirvCross> + Send>,
|
||||
>;
|
||||
|
||||
pub fn compile_passes(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//! This crate should not be used directly.
|
||||
//! See [`librashader::runtime::vk`](https://docs.rs/librashader/latest/librashader/runtime/vk/index.html) instead.
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![cfg_attr(not(feature = "stable"), feature(type_alias_impl_trait))]
|
||||
|
||||
mod draw_quad;
|
||||
mod filter_chain;
|
||||
|
|
|
@ -33,6 +33,8 @@ wgpu_dx12 = ["wgpu/dx12"]
|
|||
wgpu_metal = ["wgpu/metal"]
|
||||
wgpu_webgpu = ["wgpu/webgpu"]
|
||||
|
||||
stable = ["librashader-reflect/stable"]
|
||||
|
||||
[target.'cfg(not(target_arch="wasm32"))'.dependencies]
|
||||
rayon = "1.8.1"
|
||||
|
||||
|
|
|
@ -40,9 +40,15 @@ use crate::texture::{InputImage, OwnedImage};
|
|||
|
||||
mod compile {
|
||||
use super::*;
|
||||
|
||||
#[cfg(not(feature = "stable"))]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<impl CompileReflectShader<WGSL, SpirvCompilation, Naga> + Send>;
|
||||
|
||||
#[cfg(feature = "stable")]
|
||||
pub type ShaderPassMeta =
|
||||
ShaderPassArtifact<Box<dyn CompileReflectShader<WGSL, SpirvCompilation, Naga> + Send>>;
|
||||
|
||||
pub fn compile_passes(
|
||||
shaders: Vec<ShaderPassConfig>,
|
||||
textures: &[TextureConfig],
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//! This crate should not be used directly.
|
||||
//! See [`librashader::runtime::wgpu`](https://docs.rs/librashader/latest/librashader/runtime/wgpu/index.html) instead.
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![cfg_attr(not(feature = "stable"), feature(type_alias_impl_trait))]
|
||||
|
||||
mod buffer;
|
||||
mod draw_quad;
|
||||
|
|
|
@ -47,7 +47,15 @@ runtime = []
|
|||
reflect = []
|
||||
preprocess = []
|
||||
presets = []
|
||||
|
||||
stable = [ "librashader-reflect/stable",
|
||||
"librashader-runtime-d3d9?/stable",
|
||||
"librashader-runtime-d3d11?/stable",
|
||||
"librashader-runtime-d3d12?/stable",
|
||||
"librashader-runtime-gl?/stable",
|
||||
"librashader-runtime-vk?/stable",
|
||||
"librashader-runtime-mtl?/stable",
|
||||
"librashader-runtime-wgpu?/stable"
|
||||
]
|
||||
# runtimes
|
||||
|
||||
runtime-gl = [ "runtime", "reflect-cross", "librashader-common/opengl", "librashader-runtime-gl" ]
|
||||
|
|
Loading…
Reference in a new issue