From 7719b939f961f35009efcbc39807e6e30b564c3e Mon Sep 17 00:00:00 2001 From: chyyran Date: Mon, 26 Feb 2024 19:04:40 -0500 Subject: [PATCH] rt(d3d11): upgrade to windows 0.52 --- Cargo.lock | 25 +++++----------- librashader-runtime-d3d11/Cargo.toml | 3 +- librashader-runtime-d3d11/src/draw_quad.rs | 2 +- librashader-runtime-d3d11/src/filter_chain.rs | 15 +++++----- librashader-runtime-d3d11/src/framebuffer.rs | 10 +++---- .../src/graphics_pipeline.rs | 4 +-- librashader-runtime-d3d11/src/texture.rs | 25 ++++++++-------- .../tests/hello_triangle/mod.rs | 20 ++++++------- .../tests/hello_triangle/texture.rs | 30 +++++++++---------- librashader-runtime-d3d12/Cargo.toml | 2 +- librashader-runtime-d3d12/src/filter_chain.rs | 2 +- librashader-runtime-d3d12/src/framebuffer.rs | 2 +- librashader-runtime/Cargo.toml | 2 +- 13 files changed, 65 insertions(+), 77 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69adb2a..9a80189 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1157,7 +1157,7 @@ dependencies = [ "presser", "thiserror", "winapi", - "windows 0.52.0", + "windows", ] [[package]] @@ -1482,7 +1482,7 @@ dependencies = [ "rayon", "wgpu", "wgpu-types", - "windows 0.52.0", + "windows", ] [[package]] @@ -1506,7 +1506,7 @@ dependencies = [ "platform-dirs", "serde", "thiserror", - "windows 0.52.0", + "windows", ] [[package]] @@ -1523,7 +1523,7 @@ dependencies = [ "rustc-hash", "sptr", "thiserror", - "windows 0.52.0", + "windows", ] [[package]] @@ -1537,7 +1537,7 @@ dependencies = [ "num-traits", "rustc-hash", "wgpu-types", - "windows 0.52.0", + "windows", ] [[package]] @@ -1620,8 +1620,7 @@ dependencies = [ "librashader-runtime", "rayon", "thiserror", - "windows 0.48.0", - "windows 0.52.0", + "windows", ] [[package]] @@ -1644,8 +1643,7 @@ dependencies = [ "rayon", "thiserror", "widestring", - "windows 0.48.0", - "windows 0.52.0", + "windows", ] [[package]] @@ -3399,15 +3397,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.52.0" diff --git a/librashader-runtime-d3d11/Cargo.toml b/librashader-runtime-d3d11/Cargo.toml index d900665..c840028 100644 --- a/librashader-runtime-d3d11/Cargo.toml +++ b/librashader-runtime-d3d11/Cargo.toml @@ -37,7 +37,7 @@ features = [ ] [target.'cfg(windows)'.dev-dependencies.windows] -version = "0.48.0" +workspace = true features = [ "Win32_Foundation", "Win32_Graphics_Dxgi_Common", @@ -49,6 +49,7 @@ features = [ "Win32_System_LibraryLoader", "Win32_System_Threading", "Win32_UI_WindowsAndMessaging", + "Win32_UI", ] [[test]] diff --git a/librashader-runtime-d3d11/src/draw_quad.rs b/librashader-runtime-d3d11/src/draw_quad.rs index ff3173c..6efbd0b 100644 --- a/librashader-runtime-d3d11/src/draw_quad.rs +++ b/librashader-runtime-d3d11/src/draw_quad.rs @@ -65,7 +65,7 @@ impl DrawQuad { &D3D11_BUFFER_DESC { ByteWidth: 2 * std::mem::size_of::<[VertexInput; 4]>() as u32, Usage: D3D11_USAGE_IMMUTABLE, - BindFlags: D3D11_BIND_VERTEX_BUFFER, + BindFlags: D3D11_BIND_VERTEX_BUFFER.0 as u32, CPUAccessFlags: Default::default(), MiscFlags: Default::default(), StructureByteStride: 0, diff --git a/librashader-runtime-d3d11/src/filter_chain.rs b/librashader-runtime-d3d11/src/filter_chain.rs index e1285a1..8b16b4f 100644 --- a/librashader-runtime-d3d11/src/filter_chain.rs +++ b/librashader-runtime-d3d11/src/filter_chain.rs @@ -36,9 +36,8 @@ use librashader_runtime::uniforms::UniformStorage; use rayon::prelude::*; use windows::Win32::Graphics::Direct3D11::{ ID3D11Buffer, ID3D11Device, ID3D11DeviceContext, D3D11_BIND_CONSTANT_BUFFER, D3D11_BUFFER_DESC, - D3D11_CPU_ACCESS_WRITE, D3D11_CREATE_DEVICE_SINGLETHREADED, D3D11_RESOURCE_MISC_FLAG, - D3D11_RESOURCE_MISC_GENERATE_MIPS, D3D11_TEXTURE2D_DESC, D3D11_USAGE_DEFAULT, - D3D11_USAGE_DYNAMIC, + D3D11_CPU_ACCESS_WRITE, D3D11_CREATE_DEVICE_SINGLETHREADED, D3D11_RESOURCE_MISC_GENERATE_MIPS, + D3D11_TEXTURE2D_DESC, D3D11_USAGE_DEFAULT, D3D11_USAGE_DYNAMIC, }; use windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R8G8B8A8_UNORM; @@ -216,9 +215,9 @@ impl FilterChainD3D11 { &D3D11_BUFFER_DESC { ByteWidth: size, Usage: D3D11_USAGE_DYNAMIC, - BindFlags: D3D11_BIND_CONSTANT_BUFFER, - CPUAccessFlags: D3D11_CPU_ACCESS_WRITE, - MiscFlags: D3D11_RESOURCE_MISC_FLAG(0), + BindFlags: D3D11_BIND_CONSTANT_BUFFER.0 as u32, + CPUAccessFlags: D3D11_CPU_ACCESS_WRITE.0 as u32, + MiscFlags: 0, StructureByteStride: 0, }, None, @@ -369,9 +368,9 @@ impl FilterChainD3D11 { Format: DXGI_FORMAT_R8G8B8A8_UNORM, Usage: D3D11_USAGE_DEFAULT, MiscFlags: if texture.mipmap { - D3D11_RESOURCE_MISC_GENERATE_MIPS + D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32 } else { - D3D11_RESOURCE_MISC_FLAG(0) + 0 }, ..Default::default() }; diff --git a/librashader-runtime-d3d11/src/framebuffer.rs b/librashader-runtime-d3d11/src/framebuffer.rs index 33b6d17..4c5c06f 100644 --- a/librashader-runtime-d3d11/src/framebuffer.rs +++ b/librashader-runtime-d3d11/src/framebuffer.rs @@ -10,7 +10,7 @@ use windows::Win32::Graphics::Direct3D::D3D_SRV_DIMENSION_TEXTURE2D; use windows::Win32::Graphics::Direct3D11::{ ID3D11Device, ID3D11DeviceContext, ID3D11RenderTargetView, ID3D11ShaderResourceView, ID3D11Texture2D, D3D11_BIND_RENDER_TARGET, D3D11_BIND_SHADER_RESOURCE, D3D11_BOX, - D3D11_CPU_ACCESS_FLAG, D3D11_FORMAT_SUPPORT_RENDER_TARGET, D3D11_FORMAT_SUPPORT_SHADER_SAMPLE, + D3D11_FORMAT_SUPPORT_RENDER_TARGET, D3D11_FORMAT_SUPPORT_SHADER_SAMPLE, D3D11_FORMAT_SUPPORT_TEXTURE2D, D3D11_RENDER_TARGET_VIEW_DESC, D3D11_RENDER_TARGET_VIEW_DESC_0, D3D11_RESOURCE_MISC_GENERATE_MIPS, D3D11_RTV_DIMENSION_TEXTURE2D, D3D11_SHADER_RESOURCE_VIEW_DESC, D3D11_SHADER_RESOURCE_VIEW_DESC_0, D3D11_TEX2D_RTV, @@ -100,7 +100,7 @@ impl OwnedImage { pub fn clear(&mut self, ctx: &ID3D11DeviceContext) -> error::Result<()> { let rtv = self.create_render_target_view()?; unsafe { - ctx.ClearRenderTargetView(&rtv, CLEAR.as_ptr()); + ctx.ClearRenderTargetView(&rtv, CLEAR); } Ok(()) } @@ -240,9 +240,9 @@ fn default_desc(size: Size, format: DXGI_FORMAT, mip_levels: u32) -> D3D11_ Quality: 0, }, Usage: D3D11_USAGE_DEFAULT, - BindFlags: D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET, - CPUAccessFlags: D3D11_CPU_ACCESS_FLAG(0), - MiscFlags: D3D11_RESOURCE_MISC_GENERATE_MIPS, + BindFlags: (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET).0 as u32, + CPUAccessFlags: 0, + MiscFlags: D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32, } } diff --git a/librashader-runtime-d3d11/src/graphics_pipeline.rs b/librashader-runtime-d3d11/src/graphics_pipeline.rs index 2162100..8272174 100644 --- a/librashader-runtime-d3d11/src/graphics_pipeline.rs +++ b/librashader-runtime-d3d11/src/graphics_pipeline.rs @@ -84,7 +84,7 @@ impl D3D11State { let mut saved_blend_mask = 0; context.OMGetBlendState( Some(&mut saved_blend), - Some(saved_blend_factor.as_mut_ptr()), + Some(&mut saved_blend_factor), Some(&mut saved_blend_mask), ); let saved_rs = context.RSGetState().ok(); @@ -113,7 +113,7 @@ impl Drop for D3D11StateSaveGuard<'_> { self.ctx.RSSetState(self.saved_rs.as_ref()); self.ctx.OMSetBlendState( self.saved_blend.as_ref(), - Some(self.saved_blend_factor.as_ptr()), + Some(&self.saved_blend_factor), self.saved_blend_mask, ); } diff --git a/librashader-runtime-d3d11/src/texture.rs b/librashader-runtime-d3d11/src/texture.rs index 5323496..539b45d 100644 --- a/librashader-runtime-d3d11/src/texture.rs +++ b/librashader-runtime-d3d11/src/texture.rs @@ -4,9 +4,8 @@ use librashader_runtime::scaling::MipmapSize; use windows::Win32::Graphics::Direct3D::D3D_SRV_DIMENSION_TEXTURE2D; use windows::Win32::Graphics::Direct3D11::{ ID3D11Device, ID3D11DeviceContext, ID3D11RenderTargetView, ID3D11ShaderResourceView, - ID3D11Texture2D, D3D11_BIND_FLAG, D3D11_BIND_RENDER_TARGET, D3D11_BIND_SHADER_RESOURCE, - D3D11_BOX, D3D11_CPU_ACCESS_FLAG, D3D11_CPU_ACCESS_WRITE, D3D11_RESOURCE_MISC_FLAG, - D3D11_RESOURCE_MISC_GENERATE_MIPS, D3D11_SHADER_RESOURCE_VIEW_DESC, + ID3D11Texture2D, D3D11_BIND_RENDER_TARGET, D3D11_BIND_SHADER_RESOURCE, D3D11_BOX, + D3D11_CPU_ACCESS_WRITE, D3D11_RESOURCE_MISC_GENERATE_MIPS, D3D11_SHADER_RESOURCE_VIEW_DESC, D3D11_SHADER_RESOURCE_VIEW_DESC_0, D3D11_SUBRESOURCE_DATA, D3D11_TEX2D_SRV, D3D11_TEXTURE2D_DESC, D3D11_USAGE_DYNAMIC, D3D11_USAGE_STAGING, }; @@ -96,7 +95,7 @@ impl LutTexture { Width: source.size.width, Height: source.size.height, // todo: set this to 0 - MipLevels: if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 { + MipLevels: if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32) != 0 { 0 } else { 1 @@ -107,17 +106,17 @@ impl LutTexture { Quality: 0, }, CPUAccessFlags: if desc.Usage == D3D11_USAGE_DYNAMIC { - D3D11_CPU_ACCESS_WRITE + D3D11_CPU_ACCESS_WRITE.0 as u32 } else { - D3D11_CPU_ACCESS_FLAG(0) + 0 }, ..desc }; - desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE; + desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE.0 as u32; // determine number of mipmaps required - if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 { - desc.BindFlags |= D3D11_BIND_RENDER_TARGET; + if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32) != 0 { + desc.BindFlags |= D3D11_BIND_RENDER_TARGET.0 as u32; desc.MipLevels = source.size.calculate_miplevels(); } @@ -134,10 +133,10 @@ impl LutTexture { device.CreateTexture2D( &D3D11_TEXTURE2D_DESC { MipLevels: 1, - BindFlags: D3D11_BIND_FLAG(0), - MiscFlags: D3D11_RESOURCE_MISC_FLAG(0), + BindFlags: 0, + MiscFlags: 0, Usage: D3D11_USAGE_STAGING, - CPUAccessFlags: D3D11_CPU_ACCESS_WRITE, + CPUAccessFlags: D3D11_CPU_ACCESS_WRITE.0 as u32, ..desc }, Some(&D3D11_SUBRESOURCE_DATA { @@ -184,7 +183,7 @@ impl LutTexture { )?; assume_d3d11_init!(srv, "CreateShaderResourceView"); - if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 { + if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32) != 0 { context.GenerateMips(&srv) } diff --git a/librashader-runtime-d3d11/tests/hello_triangle/mod.rs b/librashader-runtime-d3d11/tests/hello_triangle/mod.rs index 9402850..6a1ef9e 100644 --- a/librashader-runtime-d3d11/tests/hello_triangle/mod.rs +++ b/librashader-runtime-d3d11/tests/hello_triangle/mod.rs @@ -104,7 +104,7 @@ where cbSize: std::mem::size_of::() as u32, style: CS_HREDRAW | CS_VREDRAW, lpfnWndProc: Some(wndproc::), - hInstance: instance, + hInstance: HINSTANCE::from(instance), hCursor: unsafe { LoadCursorW(None, IDC_ARROW)? }, lpszClassName: s!("RustWindowClass"), ..Default::default() @@ -121,7 +121,7 @@ where right: size.0, bottom: size.1, }; - unsafe { AdjustWindowRect(&mut window_rect, WS_OVERLAPPEDWINDOW, false) }; + unsafe { AdjustWindowRect(&mut window_rect, WS_OVERLAPPEDWINDOW, false)? }; let mut title = sample.title(); @@ -310,7 +310,7 @@ pub mod d3d11_hello_triangle { Quality: 0, }, Usage: D3D11_USAGE_DYNAMIC, - BindFlags: D3D11_BIND_SHADER_RESOURCE, + BindFlags: D3D11_BIND_SHADER_RESOURCE.0 as u32, CPUAccessFlags: Default::default(), MiscFlags: Default::default(), }, @@ -382,7 +382,7 @@ pub mod d3d11_hello_triangle { let mut desc = Default::default(); backbuffer.GetDesc(&mut desc); - desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE; + desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE.0 as u32; self.device .CreateTexture2D(&desc, None, Some(&mut renderbuffer))?; @@ -501,7 +501,7 @@ pub mod d3d11_hello_triangle { unsafe { let color = [0.3, 0.4, 0.6, 1.0]; self.context - .ClearRenderTargetView(&resources.renderbufffer_rtv, color.as_ptr()); + .ClearRenderTargetView(&resources.renderbufffer_rtv, &color); self.context.ClearDepthStencilView( &resources.depth_stencil_view, D3D11_CLEAR_DEPTH.0, @@ -727,7 +727,7 @@ pub mod d3d11_hello_triangle { Quality: 0, }, Usage: D3D11_USAGE_DEFAULT, - BindFlags: D3D11_BIND_DEPTH_STENCIL, + BindFlags: D3D11_BIND_DEPTH_STENCIL.0 as u32, CPUAccessFlags: Default::default(), MiscFlags: Default::default(), }, @@ -764,8 +764,8 @@ pub mod d3d11_hello_triangle { &D3D11_BUFFER_DESC { ByteWidth: (std::mem::size_of::()) as u32, Usage: D3D11_USAGE_DYNAMIC, - BindFlags: D3D11_BIND_CONSTANT_BUFFER, - CPUAccessFlags: D3D11_CPU_ACCESS_WRITE, + BindFlags: D3D11_BIND_CONSTANT_BUFFER.0 as u32, + CPUAccessFlags: D3D11_CPU_ACCESS_WRITE.0 as u32, MiscFlags: Default::default(), StructureByteStride: 0, }, @@ -799,7 +799,7 @@ pub mod d3d11_hello_triangle { &D3D11_BUFFER_DESC { ByteWidth: (std::mem::size_of::() * vertices.len()) as u32, Usage: D3D11_USAGE_DEFAULT, - BindFlags: D3D11_BIND_VERTEX_BUFFER, + BindFlags: D3D11_BIND_VERTEX_BUFFER.0 as u32, CPUAccessFlags: Default::default(), MiscFlags: Default::default(), StructureByteStride: 0, @@ -817,7 +817,7 @@ pub mod d3d11_hello_triangle { &D3D11_BUFFER_DESC { ByteWidth: (std::mem::size_of::() * indices.len()) as u32, Usage: D3D11_USAGE_DEFAULT, - BindFlags: D3D11_BIND_INDEX_BUFFER, + BindFlags: D3D11_BIND_INDEX_BUFFER.0 as u32, CPUAccessFlags: Default::default(), MiscFlags: Default::default(), StructureByteStride: 0, diff --git a/librashader-runtime-d3d11/tests/hello_triangle/texture.rs b/librashader-runtime-d3d11/tests/hello_triangle/texture.rs index fb18020..662e37d 100644 --- a/librashader-runtime-d3d11/tests/hello_triangle/texture.rs +++ b/librashader-runtime-d3d11/tests/hello_triangle/texture.rs @@ -3,11 +3,11 @@ use librashader_runtime::image::Image; use librashader_runtime::scaling::MipmapSize; use windows::Win32::Graphics::Direct3D::D3D_SRV_DIMENSION_TEXTURE2D; use windows::Win32::Graphics::Direct3D11::{ - ID3D11Device, ID3D11DeviceContext, ID3D11ShaderResourceView, ID3D11Texture2D, D3D11_BIND_FLAG, - D3D11_BIND_RENDER_TARGET, D3D11_BIND_SHADER_RESOURCE, D3D11_BOX, D3D11_CPU_ACCESS_FLAG, - D3D11_CPU_ACCESS_WRITE, D3D11_RESOURCE_MISC_FLAG, D3D11_RESOURCE_MISC_GENERATE_MIPS, - D3D11_SHADER_RESOURCE_VIEW_DESC, D3D11_SHADER_RESOURCE_VIEW_DESC_0, D3D11_SUBRESOURCE_DATA, - D3D11_TEX2D_SRV, D3D11_TEXTURE2D_DESC, D3D11_USAGE_DYNAMIC, D3D11_USAGE_STAGING, + ID3D11Device, ID3D11DeviceContext, ID3D11ShaderResourceView, ID3D11Texture2D, + D3D11_BIND_RENDER_TARGET, D3D11_BIND_SHADER_RESOURCE, D3D11_BOX, D3D11_CPU_ACCESS_WRITE, + D3D11_RESOURCE_MISC_GENERATE_MIPS, D3D11_SHADER_RESOURCE_VIEW_DESC, + D3D11_SHADER_RESOURCE_VIEW_DESC_0, D3D11_SUBRESOURCE_DATA, D3D11_TEX2D_SRV, + D3D11_TEXTURE2D_DESC, D3D11_USAGE_DYNAMIC, D3D11_USAGE_STAGING, }; use windows::Win32::Graphics::Dxgi::Common::DXGI_SAMPLE_DESC; @@ -64,7 +64,7 @@ impl ExampleTexture { Width: source.size.width, Height: source.size.height, // todo: set this to 0 - MipLevels: if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 { + MipLevels: if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32) != 0 { 0 } else { 1 @@ -75,17 +75,17 @@ impl ExampleTexture { Quality: 0, }, CPUAccessFlags: if desc.Usage == D3D11_USAGE_DYNAMIC { - D3D11_CPU_ACCESS_WRITE + D3D11_CPU_ACCESS_WRITE.0 as u32 } else { - D3D11_CPU_ACCESS_FLAG(0) + 0 }, ..desc }; - desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE; + desc.BindFlags |= D3D11_BIND_SHADER_RESOURCE.0 as u32; // determine number of mipmaps required - if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 { - desc.BindFlags |= D3D11_BIND_RENDER_TARGET; + if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32) != 0 { + desc.BindFlags |= D3D11_BIND_RENDER_TARGET.0 as u32; desc.MipLevels = source.size.calculate_miplevels(); } @@ -102,10 +102,10 @@ impl ExampleTexture { device.CreateTexture2D( &D3D11_TEXTURE2D_DESC { MipLevels: 1, - BindFlags: D3D11_BIND_FLAG(0), - MiscFlags: D3D11_RESOURCE_MISC_FLAG(0), + BindFlags: 0, + MiscFlags: 0, Usage: D3D11_USAGE_STAGING, - CPUAccessFlags: D3D11_CPU_ACCESS_WRITE, + CPUAccessFlags: D3D11_CPU_ACCESS_WRITE.0 as u32, ..desc }, Some(&D3D11_SUBRESOURCE_DATA { @@ -152,7 +152,7 @@ impl ExampleTexture { )?; let srv = srv.unwrap(); - if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 { + if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS.0 as u32) != 0 { context.GenerateMips(&srv) } diff --git a/librashader-runtime-d3d12/Cargo.toml b/librashader-runtime-d3d12/Cargo.toml index d8c9390..3802800 100644 --- a/librashader-runtime-d3d12/Cargo.toml +++ b/librashader-runtime-d3d12/Cargo.toml @@ -44,7 +44,7 @@ features = [ ] [target.'cfg(windows)'.dev-dependencies.windows] -version = "0.48.0" +workspace = true features = [ "Win32_Foundation", "Win32_Graphics_Dxgi_Common", diff --git a/librashader-runtime-d3d12/src/filter_chain.rs b/librashader-runtime-d3d12/src/filter_chain.rs index c4defe1..98663e0 100644 --- a/librashader-runtime-d3d12/src/filter_chain.rs +++ b/librashader-runtime-d3d12/src/filter_chain.rs @@ -234,7 +234,7 @@ impl FilterChainD3D12 { if fence.GetCompletedValue() < 1 { fence.SetEventOnCompletion(1, fence_event)?; WaitForSingleObject(fence_event, INFINITE); - CloseHandle(fence_event); + CloseHandle(fence_event)?; } Ok(filter_chain) diff --git a/librashader-runtime-d3d12/src/framebuffer.rs b/librashader-runtime-d3d12/src/framebuffer.rs index b482d2f..896f691 100644 --- a/librashader-runtime-d3d12/src/framebuffer.rs +++ b/librashader-runtime-d3d12/src/framebuffer.rs @@ -231,7 +231,7 @@ impl OwnedImage { let rtv = self.create_render_target_view(heap)?; - unsafe { cmd.ClearRenderTargetView(*rtv.descriptor.as_ref(), CLEAR.as_ptr(), None) } + unsafe { cmd.ClearRenderTargetView(*rtv.descriptor.as_ref(), CLEAR, None) } util::d3d12_resource_transition( cmd, diff --git a/librashader-runtime/Cargo.toml b/librashader-runtime/Cargo.toml index 125c2bb..8c5fd59 100644 --- a/librashader-runtime/Cargo.toml +++ b/librashader-runtime/Cargo.toml @@ -16,7 +16,7 @@ librashader-common = { path = "../librashader-common", version = "0.2.3" } librashader-presets = { path = "../librashader-presets", version = "0.2.3" } librashader-preprocess = { path = "../librashader-preprocess", version = "0.2.3" } librashader-reflect = { path = "../librashader-reflect", version = "0.2.3" } -bytemuck = "1.12.3" +bytemuck = { version = "1.12.3", features = ["derive"] } num-traits = "0.2.15" array-concat = "0.5.2"