Skip to content

Commit

Permalink
deps: upgrade to windows 0.48.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Apr 23, 2023
1 parent 70aa409 commit 020fac8
Show file tree
Hide file tree
Showing 25 changed files with 243 additions and 123 deletions.
69 changes: 63 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion librashader-cache/Cargo.toml
Expand Up @@ -23,7 +23,7 @@ rusqlite = { version = "0.28.0", features = ["bundled"] }
bytemuck = "1.13.0"

[target.'cfg(windows)'.dependencies.windows]
version = "0.44.0"
version = "0.48.0"
features = [
"Win32_Graphics_Direct3D",
"Win32_Graphics_Direct3D_Fxc",
Expand Down
3 changes: 2 additions & 1 deletion librashader-cache/src/d3d.rs
Expand Up @@ -2,6 +2,7 @@
//! here because of the orphan rule.

use crate::{CacheKey, Cacheable};
use windows::core::ComInterface;

impl CacheKey for windows::Win32::Graphics::Direct3D::ID3DBlob {
fn hash_bytes(&self) -> &[u8] {
Expand Down Expand Up @@ -52,7 +53,7 @@ impl Cacheable for windows::Win32::Graphics::Direct3D::Dxc::IDxcBlob {
return None;
};

Some(blob.into())
Some(blob.cast().ok()?)
}

fn to_bytes(&self) -> Option<Vec<u8>> {
Expand Down
2 changes: 1 addition & 1 deletion librashader-capi/Cargo.toml
Expand Up @@ -32,7 +32,7 @@ ash = { version = "0.37.2+1.3.238", optional = true }
spirv_cross = { package = "librashader-spirv-cross", version = "0.23" }

[target.'cfg(windows)'.dependencies.windows]
version = "0.44.0"
version = "0.48.0"
optional = true

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion librashader-capi/build.rs
Expand Up @@ -5,4 +5,4 @@ pub fn main() {
println!("cargo:rustc-link-arg=/DELAYLOAD:dxcompiler.dll");
println!("cargo:rustc-link-arg=/DELAYLOAD:d3d12.dll");
}
}
}
2 changes: 1 addition & 1 deletion librashader-common/Cargo.toml
Expand Up @@ -27,7 +27,7 @@ num-traits = "0.2.15"

[target.'cfg(windows)'.dependencies.windows]
optional = true
version = "0.44.0"
version = "0.48.0"
features = [
"Win32_Foundation",
"Win32_Graphics_Dxgi_Common",
Expand Down
14 changes: 9 additions & 5 deletions librashader-presets/src/parse/token.rs
@@ -1,15 +1,18 @@
use std::ops::RangeFrom;
use crate::error::ParsePresetError;
use crate::parse::Span;
use nom::branch::alt;
use nom::bytes::complete::{is_not, take_until};
use nom::character::complete::{char, line_ending, multispace1, not_line_ending};
use std::ops::RangeFrom;

use nom::combinator::{eof, map_res, value};
use nom::error::{ErrorKind, ParseError};

use nom::sequence::delimited;
use nom::{bytes::complete::tag, character::complete::multispace0, IResult, InputIter, InputLength, InputTake, Slice, AsChar};
use nom::{
bytes::complete::tag, character::complete::multispace0, AsChar, IResult, InputIter,
InputLength, InputTake, Slice,
};

#[derive(Debug)]
pub struct Token<'a> {
Expand Down Expand Up @@ -51,9 +54,10 @@ fn parse_assignment(input: Span) -> IResult<Span, ()> {
}

fn unbalanced_quote<I>(input: I) -> IResult<I, ()>
where I: Slice<RangeFrom<usize>> + InputIter + InputLength,
<I as InputIter>::Item: AsChar,
I: Copy
where
I: Slice<RangeFrom<usize>> + InputIter + InputLength,
<I as InputIter>::Item: AsChar,
I: Copy,
{
if let Ok((input, _)) = eof::<_, ()>(input) {
Ok((input, ()))
Expand Down
1 change: 0 additions & 1 deletion librashader-presets/src/parse/value.rs
Expand Up @@ -530,7 +530,6 @@ pub fn parse_values(
param_val,
));
}

// very last resort, assume undeclared texture (must have extension)
else if Path::new(token.value.fragment()).extension().is_some()
&& ["_mipmap", "_linear", "_wrap_mode", "_repeat_mode"]
Expand Down
4 changes: 1 addition & 3 deletions librashader-presets/tests/parse_all.rs
Expand Up @@ -15,7 +15,5 @@ fn parses_all_slang_presets() {
#[test]
fn parses_problematic() {
let path = "../test/Mega_Bezel_Packs/Duimon-Mega-Bezel/Presets/Advanced/Nintendo_NDS_DREZ/NDS-[DREZ]-[Native]-[ADV]-[Guest]-[Night].slangp";
ShaderPreset::try_parse(path)
.expect(&format!("Failed to parse {}", path));

ShaderPreset::try_parse(path).expect(&format!("Failed to parse {}", path));
}
6 changes: 2 additions & 4 deletions librashader-runtime-d3d11/Cargo.toml
Expand Up @@ -27,20 +27,19 @@ rayon = "1.6.1"
array-concat = "0.5.2"

[target.'cfg(windows)'.dependencies.windows]
version = "0.44.0"
version = "0.48.0"
features = [
"Win32_Foundation",
"Win32_Graphics_Dxgi_Common",
"Win32_Graphics_Direct3D",
"Win32_Graphics_Direct3D11",
"Win32_Graphics_Direct3D_Fxc",
"Win32_System_Threading",
"Win32_System_WindowsProgramming",
"Win32_Security",
]

[target.'cfg(windows)'.dev-dependencies.windows]
version = "0.44.0"
version = "0.48.0"
features = [
"Win32_Foundation",
"Win32_Graphics_Dxgi_Common",
Expand All @@ -51,7 +50,6 @@ features = [
"Win32_Security",
"Win32_System_LibraryLoader",
"Win32_System_Threading",
"Win32_System_WindowsProgramming",
"Win32_UI_WindowsAndMessaging",
]

Expand Down
14 changes: 9 additions & 5 deletions librashader-runtime-d3d11/src/filter_pass.rs
Expand Up @@ -190,10 +190,10 @@ impl FilterPass {
}

if ubo.stage_mask.contains(BindingStage::VERTEX) {
unsafe { ctx.VSSetConstantBuffers(ubo.binding, Some(&[ubo.buffer.clone()])) }
unsafe { ctx.VSSetConstantBuffers(ubo.binding, Some(&[Some(ubo.buffer.clone())])) }
}
if ubo.stage_mask.contains(BindingStage::FRAGMENT) {
unsafe { ctx.PSSetConstantBuffers(ubo.binding, Some(&[ubo.buffer.clone()])) }
unsafe { ctx.PSSetConstantBuffers(ubo.binding, Some(&[Some(ubo.buffer.clone())])) }
}
}

Expand All @@ -211,10 +211,14 @@ impl FilterPass {
}

if push.stage_mask.contains(BindingStage::VERTEX) {
unsafe { ctx.VSSetConstantBuffers(push.binding, Some(&[push.buffer.clone()])) }
unsafe {
ctx.VSSetConstantBuffers(push.binding, Some(&[Some(push.buffer.clone())]))
}
}
if push.stage_mask.contains(BindingStage::FRAGMENT) {
unsafe { ctx.PSSetConstantBuffers(push.binding, Some(&[push.buffer.clone()])) }
unsafe {
ctx.PSSetConstantBuffers(push.binding, Some(&[Some(push.buffer.clone())]))
}
}
}

Expand All @@ -233,7 +237,7 @@ impl FilterPass {
ctx.PSSetShaderResources(0, Some(std::mem::transmute(textures.as_ref())));
ctx.PSSetSamplers(0, Some(std::mem::transmute(samplers.as_ref())));

ctx.OMSetRenderTargets(Some(&[output.output.handle.clone()]), None);
ctx.OMSetRenderTargets(Some(&[Some(output.output.handle.clone())]), None);
ctx.RSSetViewports(Some(&[D3D11_VIEWPORT {
TopLeftX: output.x,
TopLeftY: output.y,
Expand Down
2 changes: 1 addition & 1 deletion librashader-runtime-d3d11/src/framebuffer.rs
Expand Up @@ -5,7 +5,7 @@ use crate::{error, D3D11OutputView};
use librashader_common::{ImageFormat, Size};
use librashader_presets::Scale2D;
use librashader_runtime::scaling::{MipmapSize, ScaleFramebuffer, ViewportSize};
use windows::core::Interface;
use windows::core::ComInterface;
use windows::Win32::Graphics::Direct3D::D3D_SRV_DIMENSION_TEXTURE2D;
use windows::Win32::Graphics::Direct3D11::{
ID3D11Device, ID3D11DeviceContext, ID3D11RenderTargetView, ID3D11ShaderResourceView,
Expand Down
2 changes: 1 addition & 1 deletion librashader-runtime-d3d11/src/util.rs
Expand Up @@ -145,7 +145,7 @@ pub fn d3d11_compile_bound_shader<'a, T, L>(
factory: ShaderFactory<'a, L, T>,
) -> error::Result<T>
where
L: Into<windows::core::InParam<ID3D11ClassLinkage>>,
L: windows::core::IntoParam<ID3D11ClassLinkage>,
{
unsafe {
// SAFETY: slice as valid for as long as vs_blob is alive.
Expand Down
6 changes: 3 additions & 3 deletions librashader-runtime-d3d11/tests/hello_triangle/mod.rs
Expand Up @@ -489,10 +489,10 @@ pub mod d3d11_hello_triangle {
unsafe {
self.context.VSSetConstantBuffers(
buffer_number,
Some(&[resources.triangle_uniforms.clone()]),
Some(&[Some(resources.triangle_uniforms.clone())]),
);
self.context.OMSetRenderTargets(
Some(&[resources.renderbufffer_rtv.clone()]),
Some(&[Some(resources.renderbufffer_rtv.clone())]),
&resources.depth_stencil_view,
);
self.context.RSSetViewports(Some(&[resources.viewport]))
Expand Down Expand Up @@ -845,7 +845,7 @@ pub mod d3d11_hello_triangle {
D3D11CreateDevice(
None,
D3D_DRIVER_TYPE_HARDWARE,
HINSTANCE::default(),
HMODULE::default(),
D3D11_CREATE_DEVICE_DEBUG,
Some(&feature_levels),
D3D11_SDK_VERSION,
Expand Down
6 changes: 2 additions & 4 deletions librashader-runtime-d3d12/Cargo.toml
Expand Up @@ -33,20 +33,19 @@ array-concat = "0.5.2"
rayon = "1.6.1"

[target.'cfg(windows)'.dependencies.windows]
version = "0.44.0"
version = "0.48.0"
features = [
"Win32_Foundation",
"Win32_Graphics_Dxgi_Common",
"Win32_Graphics_Direct3D",
"Win32_Graphics_Direct3D12",
"Win32_Graphics_Direct3D_Dxc",
"Win32_System_Threading",
"Win32_System_WindowsProgramming",
"Win32_Security",
]

[target.'cfg(windows)'.dev-dependencies.windows]
version = "0.44.0"
version = "0.48.0"
features = [
"Win32_Foundation",
"Win32_Graphics_Dxgi_Common",
Expand All @@ -60,7 +59,6 @@ features = [
"Win32_System_Threading",
"Win32_UI_WindowsAndMessaging",
"Win32_System_Threading",
"Win32_System_WindowsProgramming",
]

[[test]]
Expand Down

0 comments on commit 020fac8

Please sign in to comment.