dep: update glslang
This commit is contained in:
parent
7c03a7e3fe
commit
742a1c8658
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -1151,14 +1151,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glslang"
|
name = "glslang"
|
||||||
version = "0.5.3"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e058f69c0b36dc2ce7e5243f440d186ae65ab7aa9e76cd4c5b953ea4b43286d"
|
checksum = "ca195de172c94a69ab142424542f421cf8f7f14555ebbd82c6e8089a8cb318f7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.6.0",
|
"bitflags 2.6.0",
|
||||||
"glslang-sys",
|
"glslang-sys",
|
||||||
"once_cell",
|
|
||||||
"rustc-hash 2.0.0",
|
"rustc-hash 2.0.0",
|
||||||
|
"smartstring",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ keywords = ["shader", "retroarch", "SPIR-V"]
|
||||||
description = "RetroArch shaders for all."
|
description = "RetroArch shaders for all."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
glslang = "0.5"
|
glslang = "0.6.0"
|
||||||
bytemuck = "1.13.0"
|
bytemuck = "1.13.0"
|
||||||
|
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
|
|
|
@ -29,11 +29,17 @@ pub(crate) fn compile_spirv(source: &ShaderSource) -> Result<SpirvCompilation, S
|
||||||
};
|
};
|
||||||
|
|
||||||
let vertex = glslang::ShaderSource::from(source.vertex.as_str());
|
let vertex = glslang::ShaderSource::from(source.vertex.as_str());
|
||||||
let vertex = ShaderInput::new(&vertex, glslang::ShaderStage::Vertex, &options, None)?;
|
let vertex = ShaderInput::new(&vertex, glslang::ShaderStage::Vertex, &options, None, None)?;
|
||||||
let vertex = compiler.create_shader(vertex)?;
|
let vertex = compiler.create_shader(vertex)?;
|
||||||
|
|
||||||
let fragment = glslang::ShaderSource::from(source.fragment.as_str());
|
let fragment = glslang::ShaderSource::from(source.fragment.as_str());
|
||||||
let fragment = ShaderInput::new(&fragment, glslang::ShaderStage::Fragment, &options, None)?;
|
let fragment = ShaderInput::new(
|
||||||
|
&fragment,
|
||||||
|
glslang::ShaderStage::Fragment,
|
||||||
|
&options,
|
||||||
|
None,
|
||||||
|
None,
|
||||||
|
)?;
|
||||||
let fragment = compiler.create_shader(fragment)?;
|
let fragment = compiler.create_shader(fragment)?;
|
||||||
|
|
||||||
let vertex = vertex.compile()?;
|
let vertex = vertex.compile()?;
|
||||||
|
|
|
@ -5,8 +5,8 @@ use std::marker::PhantomData;
|
||||||
use image::error::{LimitError, LimitErrorKind};
|
use image::error::{LimitError, LimitErrorKind};
|
||||||
use image::DynamicImage;
|
use image::DynamicImage;
|
||||||
use librashader_pack::{TextureBuffer, TextureData};
|
use librashader_pack::{TextureBuffer, TextureData};
|
||||||
use std::path::Path;
|
|
||||||
use librashader_presets::TextureMeta;
|
use librashader_presets::TextureMeta;
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
/// An uncompressed raw image ready to upload to GPU buffers.
|
/// An uncompressed raw image ready to upload to GPU buffers.
|
||||||
pub struct Image<P: PixelFormat = RGBA8> {
|
pub struct Image<P: PixelFormat = RGBA8> {
|
||||||
|
@ -122,10 +122,10 @@ pub struct LoadedTexture<P: PixelFormat = RGBA8> {
|
||||||
/// The loaded image data
|
/// The loaded image data
|
||||||
pub image: Image<P>,
|
pub image: Image<P>,
|
||||||
/// Meta information about the texture
|
/// Meta information about the texture
|
||||||
pub meta: TextureMeta
|
pub meta: TextureMeta,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl <P: PixelFormat> LoadedTexture<P> {
|
impl<P: PixelFormat> LoadedTexture<P> {
|
||||||
/// Load the texture with the given UV direction and subpixel ordering.
|
/// Load the texture with the given UV direction and subpixel ordering.
|
||||||
pub fn from_texture(texture: TextureData, direction: UVDirection) -> Result<Self, ImageError> {
|
pub fn from_texture(texture: TextureData, direction: UVDirection) -> Result<Self, ImageError> {
|
||||||
Ok(LoadedTexture {
|
Ok(LoadedTexture {
|
||||||
|
@ -135,7 +135,6 @@ impl <P: PixelFormat> LoadedTexture<P> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// load-bearing #[inline(always)], without it llvm will not vectorize.
|
// load-bearing #[inline(always)], without it llvm will not vectorize.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn swizzle_pixels(pixels: &mut Vec<u8>, swizzle: &'static [usize; 32]) {
|
fn swizzle_pixels(pixels: &mut Vec<u8>, swizzle: &'static [usize; 32]) {
|
||||||
|
|
Loading…
Reference in a new issue