From 16108838b15e3e4253cd3916a34db538f37d4db9 Mon Sep 17 00:00:00 2001 From: chyyran Date: Wed, 21 Aug 2024 20:40:01 -0400 Subject: [PATCH] rt(d3d11): remove unneeded transmutes --- librashader-runtime-d3d11/src/filter_pass.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/librashader-runtime-d3d11/src/filter_pass.rs b/librashader-runtime-d3d11/src/filter_pass.rs index ad19757..92fe036 100644 --- a/librashader-runtime-d3d11/src/filter_pass.rs +++ b/librashader-runtime-d3d11/src/filter_pass.rs @@ -240,15 +240,8 @@ impl FilterPass { } unsafe { - // SAFETY: Niche optimization for Option> - // Assumes that IUnknown is defined as IUnknown(std::ptr::NonNull) - const _: () = assert!( - std::mem::size_of::>() - == std::mem::size_of::() - ); - - ctx.PSSetShaderResources(0, Some(std::mem::transmute(textures.as_ref()))); - ctx.PSSetSamplers(0, Some(std::mem::transmute(samplers.as_ref()))); + ctx.PSSetShaderResources(0, Some(&textures)); + ctx.PSSetSamplers(0, Some(&samplers)); ctx.OMSetRenderTargets(Some(&[Some(output.output.clone())]), None); ctx.RSSetViewports(Some(&[D3D11_VIEWPORT {