Compare commits

...

13 commits

Author SHA1 Message Date
Alex Janka 2d0dd5909d fix double free 2024-01-25 09:38:23 +11:00
Alex Janka 03546153ff shaders can be either a path or a string 2024-01-25 09:38:23 +11:00
chyyran fa3b6bf5fc chore: Release 2023-11-30 02:11:33 -05:00
chyyran ee0587310c chore: Release 2023-11-30 02:07:12 -05:00
chyyran 2bd6f8f80f build: prefer static linking of shaderc 2023-11-30 02:03:43 -05:00
chyyran d17503be71 build: unify ash version 2023-11-30 02:03:43 -05:00
chyyran 2be2178502 build: allow aarch64-linux-unknown-gnu build of librashader-capi 2023-11-29 03:26:58 -05:00
chyyran f4bdf160ab build: only build dxil on windows 2023-11-29 03:26:58 -05:00
chyyran c0a1b56f4e build: use build deps for linux 2023-11-29 03:26:58 -05:00
chyyran 43c0f3d676 build: fix python 3.11 2023-11-29 03:26:58 -05:00
chyyran 25bf4904e1 build: use install-vulkan-sdk 2023-11-29 03:26:58 -05:00
chyyran 7ce02014d4 build: upgrade python first 2023-11-29 03:26:58 -05:00
chyyran 6e071138dc build: update spirv-to-dxil-sys to reduce mesa build reqs 2023-11-29 03:26:58 -05:00
27 changed files with 576 additions and 524 deletions

47
.github/workflows/build-linux-arm64.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: build librashader-capi for ARM64 Linux
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "0 0 * * 6"
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
profile: ['debug', 'release', 'optimized']
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install nightly Rust
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: nightly
override: true
target: aarch64-unknown-linux-gnu
- uses: actions/setup-python@v1
name: Setup Python 3.11
with:
python-version: '3.11.6'
- name: Install ARM64 cross-compilation dependencies
continue-on-error: true
run: |
sudo dpkg --add-architecture arm64
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
sudo apt-get update || true
sudo apt-get -y install libvulkan-dev:arm64 g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Build dynamic library
run: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo run -p librashader-build-script -- --profile ${{ matrix.profile }} --target aarch64-unknown-linux-gnu
- name: Upload build artifacts
uses: actions/upload-artifact@v3.1.2
with:
name: ${{ format('build-outputs-aarch64-unknown-linux-gnu-{0}', matrix.profile) }}
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}

View file

@ -1,4 +1,4 @@
name: build librashader-capi name: build librashader-capi for x86_64
on: on:
push: push:
@ -26,21 +26,18 @@ jobs:
with: with:
toolchain: nightly toolchain: nightly
override: true override: true
- name: Setup Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Cross, SPIRV-Headers, SPIRV-Reflect, SPIRV-Tools, Glslang
vulkan-use-cache: true
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
name: Setup Python name: Setup Python 3.11
with: with:
python-version: '3.x' python-version: '3.11.6'
- run: pip install meson ninja mako - name: Install Vulkan SDK
name: Install Meson for spirv-to-dxil-sys uses: humbletim/install-vulkan-sdk@v1.1.1
with:
version: latest
cache: true
- if: runner.os == 'Windows' - if: runner.os == 'Windows'
name: Install winflexbison run: pip install meson ninja mako
run: choco install winflexbison3 name: Install Meson for spirv-to-dxil-sys
- name: Build dynamic library - name: Build dynamic library
run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }} run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
- name: Upload build artifacts - name: Upload build artifacts

View file

@ -2,7 +2,6 @@
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" /> <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/test/shaders_slang" vcs="Git" /> <mapping directory="$PROJECT_DIR$/test/shaders_slang" vcs="Git" />
</component> </component>
</project> </project>

834
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -90,13 +90,15 @@ static GL_DEFAULT_MVP: &[f32; 16] = &[
librashader requires the following build time dependencies librashader requires the following build time dependencies
* The [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) * The [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/)
* [Meson](https://mesonbuild.com/)
* [CMake 3.8 or later](https://cmake.org/) * [CMake 3.8 or later](https://cmake.org/)
For DXIL support on Windows, the following is also needed
* [Meson](https://mesonbuild.com/)
* [Python 3.6 or later](https://www.python.org/) * [Python 3.6 or later](https://www.python.org/)
--- ---
For Rust projects, simply add the crate to your `Cargo.toml`. For Rust projects, simply add the crate tofil your `Cargo.toml`.
``` ```
cargo add librashader cargo add librashader

View file

@ -10,6 +10,8 @@ use std::{env, fs};
struct Args { struct Args {
#[arg(long, default_value = "debug", global = true)] #[arg(long, default_value = "debug", global = true)]
profile: String, profile: String,
#[arg(long, global = true)]
target: Option<String>,
} }
pub fn main() { pub fn main() {
@ -32,12 +34,26 @@ pub fn main() {
"--profile={}", "--profile={}",
if profile == "debug" { "dev" } else { &profile } if profile == "debug" { "dev" } else { &profile }
)); ));
if let Some(target) = &args.target {
cmd.arg(format!(
"--target={}",
&target
));
}
Some(cmd.status().expect("Failed to build librashader-capi")); Some(cmd.status().expect("Failed to build librashader-capi"));
let output_dir = PathBuf::from(format!("target/{}", profile)) let mut output_dir = PathBuf::from(format!("target/{}", profile));
if let Some(target) = &args.target {
output_dir = PathBuf::from(format!("target/{}/{}", target, profile));
}
let output_dir = output_dir
.canonicalize() .canonicalize()
.expect("Could not find output directory."); .expect("Could not find output directory.");
println!("Generating C headers..."); println!("Generating C headers...");
// Create headers. // Create headers.

View file

@ -2,7 +2,7 @@
name = "librashader-cache" name = "librashader-cache"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -12,8 +12,8 @@ description = "RetroArch shaders for all."
[dependencies] [dependencies]
serde = { version = "1.0" } serde = { version = "1.0" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["serialize", "dxil"] } librashader-reflect = { path = "../librashader-reflect", version = "0.2.0-beta.2", features = ["serialize"] }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
platform-dirs = "0.3.0" platform-dirs = "0.3.0"
blake3 = { version = "1.3.3" } blake3 = { version = "1.3.3" }
thiserror = "1.0.38" thiserror = "1.0.38"
@ -32,7 +32,7 @@ features = [
optional = true optional = true
[features] [features]
d3d = ["windows"] d3d = ["windows", "librashader-reflect/dxil"]
# hack to get building on docsrs # hack to get building on docsrs
docsrs = ["blake3/pure", "rusqlite/in_gecko"] docsrs = ["blake3/pure", "rusqlite/in_gecko"]

View file

@ -56,6 +56,7 @@ impl<T: ShaderCompilation + for<'de> serde::Deserialize<'de> + serde::Serialize
} }
} }
#[cfg(all(target_os = "windows", feature = "d3d"))]
impl FromCompilation<CachedCompilation<GlslangCompilation>> for DXIL { impl FromCompilation<CachedCompilation<GlslangCompilation>> for DXIL {
type Target = <DXIL as FromCompilation<GlslangCompilation>>::Target; type Target = <DXIL as FromCompilation<GlslangCompilation>>::Target;
type Options = <DXIL as FromCompilation<GlslangCompilation>>::Options; type Options = <DXIL as FromCompilation<GlslangCompilation>>::Options;

View file

@ -3,7 +3,7 @@ name = "librashader-capi"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -23,12 +23,12 @@ runtime-d3d12 = ["windows", "librashader/runtime-d3d12", "windows/Win32_Graphics
runtime-vulkan = ["ash", "librashader/runtime-vk"] runtime-vulkan = ["ash", "librashader/runtime-vk"]
[dependencies] [dependencies]
librashader = { path = "../librashader", version = "0.1.4", features = ["internal"] } librashader = { path = "../librashader", version = "0.2.0-beta.2", features = ["internal"] }
thiserror = "1.0.37" thiserror = "1.0.37"
paste = "1.0.9" paste = "1.0.9"
gl = { version = "0.14.0", optional = true } gl = { version = "0.14.0", optional = true }
rustc-hash = "1.1.0" rustc-hash = "1.1.0"
ash = { version = "0.37.2+1.3.238", optional = true } ash = { version = "0.37", optional = true }
spirv_cross = { package = "librashader-spirv-cross", version = "0.23" } spirv_cross = { package = "librashader-spirv-cross", version = "0.23" }
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]

View file

@ -3,7 +3,7 @@ name = "librashader-common"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -21,7 +21,7 @@ vulkan = ["ash"]
[dependencies] [dependencies]
gl = { version = "0.14.0", optional = true } gl = { version = "0.14.0", optional = true }
ash = { version = "0.37.1+1.3.235", optional = true } ash = { version = "0.37", optional = true }
num-traits = "0.2.15" num-traits = "0.2.15"

View file

@ -27,6 +27,12 @@ use num_traits::AsPrimitive;
use std::convert::Infallible; use std::convert::Infallible;
use std::str::FromStr; use std::str::FromStr;
#[derive(Debug, Clone)]
pub enum ShaderStorage {
Path(std::path::PathBuf),
String(String),
}
#[repr(u32)] #[repr(u32)]
#[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)] #[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)]
/// Supported image formats for textures. /// Supported image formats for textures.

View file

@ -3,7 +3,7 @@ name = "librashader-preprocess"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -14,7 +14,7 @@ description = "RetroArch shaders for all."
[dependencies] [dependencies]
thiserror = "1.0.37" thiserror = "1.0.37"
nom = "7.1.1" nom = "7.1.1"
librashader-common = { path = "../librashader-common", version = "0.1.4" } librashader-common = { path = "../librashader-common", version = "0.2.0-beta.2" }
rustc-hash = "1.1.0" rustc-hash = "1.1.0"
encoding_rs = "0.8.31" encoding_rs = "0.8.31"

View file

@ -17,7 +17,6 @@ use crate::include::read_source;
pub use error::*; pub use error::*;
use librashader_common::ImageFormat; use librashader_common::ImageFormat;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use std::path::Path;
/// The source file for a single shader pass. /// The source file for a single shader pass.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
@ -58,8 +57,8 @@ pub struct ShaderParameter {
impl ShaderSource { impl ShaderSource {
/// Load the source file at the given path, resolving includes relative to the location of the /// Load the source file at the given path, resolving includes relative to the location of the
/// source file. /// source file.
pub fn load(path: impl AsRef<Path>) -> Result<ShaderSource, PreprocessError> { pub fn load(file: &librashader_common::ShaderStorage) -> Result<ShaderSource, PreprocessError> {
load_shader_source(path) load_shader_source(file)
} }
} }
@ -78,8 +77,14 @@ impl SourceOutput for String {
} }
} }
pub(crate) fn load_shader_source(path: impl AsRef<Path>) -> Result<ShaderSource, PreprocessError> { pub(crate) fn load_shader_source(
let source = read_source(path)?; file: &librashader_common::ShaderStorage,
) -> Result<ShaderSource, PreprocessError> {
let source = match file {
librashader_common::ShaderStorage::Path(path) => read_source(path)?,
librashader_common::ShaderStorage::String(s) => s.to_string(),
};
let meta = pragma::parse_pragma_meta(&source)?; let meta = pragma::parse_pragma_meta(&source)?;
let text = stage::process_stages(&source)?; let text = stage::process_stages(&source)?;
let parameters = FxHashMap::from_iter(meta.parameters.into_iter().map(|p| (p.id.clone(), p))); let parameters = FxHashMap::from_iter(meta.parameters.into_iter().map(|p| (p.id.clone(), p)));

View file

@ -3,7 +3,7 @@ name = "librashader-presets"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -15,7 +15,7 @@ description = "RetroArch shaders for all."
thiserror = "1.0.37" thiserror = "1.0.37"
nom = "7.1.1" nom = "7.1.1"
nom_locate = "4.0.0" nom_locate = "4.0.0"
librashader-common = { path = "../librashader-common", version = "0.1.4" } librashader-common = { path = "../librashader-common", version = "0.2.0-beta.2" }
num-traits = "0.2" num-traits = "0.2"
[features] [features]

View file

@ -114,7 +114,7 @@ pub fn resolve_values(mut values: Vec<Value>) -> ShaderPreset {
let shader = ShaderPassConfig { let shader = ShaderPassConfig {
id, id,
name, name: librashader_common::ShaderStorage::Path(name),
alias: shader_values.iter().find_map(|f| match f { alias: shader_values.iter().find_map(|f| match f {
Value::Alias(_, value) => Some(value.to_string()), Value::Alias(_, value) => Some(value.to_string()),
_ => None, _ => None,

View file

@ -10,7 +10,7 @@ pub struct ShaderPassConfig {
/// The index of the shader pass relative to its parent preset. /// The index of the shader pass relative to its parent preset.
pub id: i32, pub id: i32,
/// The fully qualified path to the shader pass source file. /// The fully qualified path to the shader pass source file.
pub name: PathBuf, pub name: librashader_common::ShaderStorage,
/// The alias of the shader pass if available. /// The alias of the shader pass if available.
pub alias: Option<String>, pub alias: Option<String>,
/// The filtering mode that this shader pass should expect. /// The filtering mode that this shader pass should expect.

View file

@ -3,7 +3,7 @@ name = "librashader-reflect"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -12,28 +12,32 @@ keywords = ["shader", "retroarch", "SPIR-V"]
description = "RetroArch shaders for all." description = "RetroArch shaders for all."
[dependencies] [dependencies]
shaderc = { version = "0.8.2", features = [] } shaderc = { version = "0.8.3", features = [] }
bytemuck = "1.13.0" bytemuck = "1.13.0"
thiserror = "1.0.37" thiserror = "1.0.37"
bitflags = "1.3.2" bitflags = "1.3.2"
rustc-hash = "1.1.0" rustc-hash = "1.1.0"
librashader-common = { path = "../librashader-common", version = "0.1.4" } librashader-common = { path = "../librashader-common", version = "0.2.0-beta.2" }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.2.0-beta.2" }
spirv_cross = { package = "librashader-spirv-cross", version = "0.23", optional = true } spirv_cross = { package = "librashader-spirv-cross", version = "0.23", optional = true }
spirv-to-dxil = { version = "0.4", optional = true }
naga = { version = "0.11.0", features = ["glsl-in", "spv-in", "spv-out", "glsl-out", "wgsl-out"], optional = true } naga = { version = "0.11.0", features = ["glsl-in", "spv-in", "spv-out", "glsl-out", "wgsl-out"], optional = true }
rspirv = { version = "0.11.0+1.5.4", optional = true } rspirv = { version = "0.11.0+1.5.4", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true } serde = { version = "1.0", features = ["derive"], optional = true }
[target.'cfg(windows)'.dependencies.spirv-to-dxil]
version = "0.4"
optional = true
[features] [features]
default = ["cross", "serialize"] default = ["cross", "serialize"]
unstable-naga = [ "naga", "rspirv" ] unstable-naga = [ "naga", "rspirv" ]
standalone = ["shaderc/build-from-source"] standalone = ["shaderc/build-from-source", "shaderc/prefer-static-linking"]
dxil = ["cross", "spirv-to-dxil"] dxil = ["cross", "spirv-to-dxil"]
cross = [ "spirv_cross", "spirv_cross/glsl", "spirv_cross/hlsl" ] cross = [ "spirv_cross", "spirv_cross/glsl", "spirv_cross/hlsl" ]
serialize = [ "serde" ] serialize = [ "serde" ]

View file

@ -1,5 +1,5 @@
pub mod cross; pub mod cross;
#[cfg(feature = "dxil")] #[cfg(all(target_os = "windows", feature = "dxil"))]
pub mod dxil; pub mod dxil;
mod spirv; mod spirv;
pub mod targets; pub mod targets;

View file

@ -23,7 +23,7 @@ pub enum ShaderCompileError {
SpirvCrossCompileError(#[from] spirv_cross::ErrorCode), SpirvCrossCompileError(#[from] spirv_cross::ErrorCode),
/// Error when transpiling from spirv-to-dxil /// Error when transpiling from spirv-to-dxil
#[cfg(feature = "dxil")] #[cfg(all(target_os = "windows", feature = "dxil"))]
#[error("spirv-to-dxil")] #[error("spirv-to-dxil")]
SpirvToDxilCompileError(#[from] spirv_to_dxil::SpirvToDxilError), SpirvToDxilCompileError(#[from] spirv_to_dxil::SpirvToDxilError),
} }

View file

@ -3,7 +3,7 @@ name = "librashader-runtime-d3d11"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -12,13 +12,13 @@ keywords = ["shader", "retroarch", "SPIR-V"]
description = "RetroArch shaders for all." description = "RetroArch shaders for all."
[dependencies] [dependencies]
librashader-common = { path = "../librashader-common", features = ["d3d11"], version = "0.1.4" } librashader-common = { path = "../librashader-common", features = ["d3d11"], version = "0.2.0-beta.2" }
librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.2.0-beta.2" }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["standalone"] } librashader-reflect = { path = "../librashader-reflect", version = "0.2.0-beta.2", features = ["standalone"] }
librashader-runtime = { path = "../librashader-runtime", version = "0.1.4" } librashader-runtime = { path = "../librashader-runtime", version = "0.2.0-beta.2" }
spirv_cross = { package = "librashader-spirv-cross", version = "0.23" } spirv_cross = { package = "librashader-spirv-cross", version = "0.23" }
librashader-cache = { path = "../librashader-cache", version = "0.1.4", features = ["d3d"] } librashader-cache = { path = "../librashader-cache", version = "0.2.0-beta.2", features = ["d3d"] }
thiserror = "1.0.37" thiserror = "1.0.37"
rustc-hash = "1.1.0" rustc-hash = "1.1.0"

View file

@ -3,7 +3,7 @@ name = "librashader-runtime-d3d12"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -12,12 +12,12 @@ keywords = ["shader", "retroarch", "SPIR-V"]
description = "RetroArch shaders for all." description = "RetroArch shaders for all."
[dependencies] [dependencies]
librashader-common = { path = "../librashader-common", features = ["d3d12"], version = "0.1.4" } librashader-common = { path = "../librashader-common", features = ["d3d12"], version = "0.2.0-beta.2" }
librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.2.0-beta.2" }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["dxil", "standalone"] } librashader-reflect = { path = "../librashader-reflect", version = "0.2.0-beta.2", features = ["dxil", "standalone"] }
librashader-runtime = { path = "../librashader-runtime", version = "0.1.4" } librashader-runtime = { path = "../librashader-runtime", version = "0.2.0-beta.2" }
librashader-cache = { path = "../librashader-cache", version = "0.1.4", features = ["d3d"] } librashader-cache = { path = "../librashader-cache", version = "0.2.0-beta.2", features = ["d3d"] }
thiserror = "1.0.37" thiserror = "1.0.37"
spirv_cross = { package = "librashader-spirv-cross", version = "0.23" } spirv_cross = { package = "librashader-spirv-cross", version = "0.23" }

View file

@ -3,7 +3,7 @@ name = "librashader-runtime-gl"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -12,12 +12,12 @@ keywords = ["shader", "retroarch", "SPIR-V"]
description = "RetroArch shaders for all." description = "RetroArch shaders for all."
[dependencies] [dependencies]
librashader-common = { path = "../librashader-common", features = ["opengl"], version = "0.1.4" } librashader-common = { path = "../librashader-common", features = ["opengl"], version = "0.2.0-beta.2" }
librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.2.0-beta.2" }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["standalone"] } librashader-reflect = { path = "../librashader-reflect", version = "0.2.0-beta.2", features = ["standalone"] }
librashader-runtime = { path = "../librashader-runtime" , version = "0.1.4" } librashader-runtime = { path = "../librashader-runtime" , version = "0.2.0-beta.2" }
librashader-cache = { path = "../librashader-cache", version = "0.1.4" } librashader-cache = { path = "../librashader-cache", version = "0.2.0-beta.2" }
spirv_cross = { package = "librashader-spirv-cross", version = "0.23" } spirv_cross = { package = "librashader-spirv-cross", version = "0.23" }
rustc-hash = "1.1.0" rustc-hash = "1.1.0"

View file

@ -3,7 +3,7 @@ name = "librashader-runtime-vk"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -14,12 +14,12 @@ description = "RetroArch shaders for all."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
librashader-common = { path = "../librashader-common", features = ["vulkan"], version = "0.1.4" } librashader-common = { path = "../librashader-common", features = ["vulkan"], version = "0.2.0-beta.2" }
librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.2.0-beta.2" }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = [] } librashader-reflect = { path = "../librashader-reflect", version = "0.2.0-beta.2", features = [] }
librashader-runtime = { path = "../librashader-runtime" , version = "0.1.4" } librashader-runtime = { path = "../librashader-runtime" , version = "0.2.0-beta.2" }
librashader-cache = { path = "../librashader-cache", version = "0.1.4" } librashader-cache = { path = "../librashader-cache", version = "0.2.0-beta.2" }
spirv_cross = { package = "librashader-spirv-cross", version = "0.23" } spirv_cross = { package = "librashader-spirv-cross", version = "0.23" }
rustc-hash = "1.1.0" rustc-hash = "1.1.0"

View file

@ -186,9 +186,6 @@ impl Drop for RawVulkanBuffer {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
ManuallyDrop::drop(&mut self.buffer); ManuallyDrop::drop(&mut self.buffer);
if self.buffer.handle != vk::Buffer::null() {
self.buffer.device.destroy_buffer(self.buffer.handle, None);
}
} }
} }
} }

View file

@ -3,7 +3,7 @@ name = "librashader-runtime"
edition = "2021" edition = "2021"
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -12,10 +12,10 @@ keywords = ["shader", "retroarch", "SPIR-V"]
description = "RetroArch shaders for all." description = "RetroArch shaders for all."
[dependencies] [dependencies]
librashader-common = { path = "../librashader-common", version = "0.1.4" } librashader-common = { path = "../librashader-common", version = "0.2.0-beta.2" }
librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.2.0-beta.2" }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4" } librashader-reflect = { path = "../librashader-reflect", version = "0.2.0-beta.2" }
bytemuck = "1.12.3" bytemuck = "1.12.3"
rustc-hash = "1.1.0" rustc-hash = "1.1.0"
num-traits = "0.2.15" num-traits = "0.2.15"

View file

@ -4,7 +4,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
license = "MPL-2.0 OR GPL-3.0-only" license = "MPL-2.0 OR GPL-3.0-only"
version = "0.1.4" version = "0.2.0-beta.2"
authors = ["Ronny Chan <ronny@ronnychan.ca>"] authors = ["Ronny Chan <ronny@ronnychan.ca>"]
repository = "https://github.com/SnowflakePowered/librashader" repository = "https://github.com/SnowflakePowered/librashader"
readme = "../README.md" readme = "../README.md"
@ -13,19 +13,19 @@ keywords = ["shader", "retroarch", "SPIR-V"]
description = "RetroArch shaders for all." description = "RetroArch shaders for all."
[dependencies] [dependencies]
librashader-common = { path = "../librashader-common", version = "0.1.4" } librashader-common = { path = "../librashader-common", version = "0.2.0-beta.2" }
librashader-presets = { path = "../librashader-presets", version = "0.1.4" } librashader-presets = { path = "../librashader-presets", version = "0.2.0-beta.2" }
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.4" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.0-beta.2" }
librashader-reflect = { path = "../librashader-reflect", version = "0.1.4", features = ["standalone"] } librashader-reflect = { path = "../librashader-reflect", version = "0.2.0-beta.2", features = ["standalone"] }
librashader-runtime = { path = "../librashader-runtime", version = "0.1.4" } librashader-runtime = { path = "../librashader-runtime", version = "0.2.0-beta.2" }
librashader-runtime-d3d11 = { path = "../librashader-runtime-d3d11", version = "0.1.4", optional = true } librashader-runtime-d3d11 = { path = "../librashader-runtime-d3d11", version = "0.2.0-beta.2", optional = true }
librashader-runtime-d3d12 = { path = "../librashader-runtime-d3d12", version = "0.1.4", optional = true } librashader-runtime-d3d12 = { path = "../librashader-runtime-d3d12", version = "0.2.0-beta.2", optional = true }
librashader-runtime-gl = { path = "../librashader-runtime-gl", version = "0.1.4", optional = true } librashader-runtime-gl = { path = "../librashader-runtime-gl", version = "0.2.0-beta.2", optional = true }
librashader-runtime-vk = { path = "../librashader-runtime-vk", version = "0.1.4", optional = true } librashader-runtime-vk = { path = "../librashader-runtime-vk", version = "0.2.0-beta.2", optional = true }
librashader-cache = { path = "../librashader-cache", version = "0.1.4" } librashader-cache = { path = "../librashader-cache", version = "0.2.0-beta.2" }
ash = { version = "0.37.1+1.3.235", optional = true } ash = { version = "0.37", optional = true }
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.48.0" version = "0.48.0"

View file

@ -170,8 +170,8 @@ pub mod reflect {
} }
/// DXIL reflection via spirv-to-dxil. /// DXIL reflection via spirv-to-dxil.
#[cfg(feature = "reflect-dxil")] #[cfg(all(target_os = "windows", feature = "reflect-dxil"))]
#[doc(cfg(feature = "reflect-dxil"))] #[doc(cfg(all(target_os = "windows", feature = "reflect-dxil")))]
pub mod dxil { pub mod dxil {
/// The maximum shader model to use when compiling the DXIL blob. /// The maximum shader model to use when compiling the DXIL blob.
pub use librashader_reflect::back::dxil::ShaderModel; pub use librashader_reflect::back::dxil::ShaderModel;