Skip to content

Commit

Permalink
rt(d3d9): accept input image by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Sep 25, 2024
1 parent 7a5036a commit a14642f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion librashader-capi/src/runtime/d3d9/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use librashader::runtime::d3d9::{FilterChain, FilterChainOptions, FrameOptions};
use std::ffi::c_char;
use std::ffi::CStr;
use std::mem::{ManuallyDrop, MaybeUninit};
use std::ops::Deref;
use std::ptr::NonNull;
use std::slice;
use windows::Win32::Graphics::Direct3D9::{IDirect3DDevice9, IDirect3DSurface9, IDirect3DTexture9};
Expand Down Expand Up @@ -179,7 +180,7 @@ extern_fn! {


unsafe {
chain.frame(ManuallyDrop::into_inner(image.clone()), &viewport, frame_count, options.as_ref())?;
chain.frame(image.deref(), &viewport, frame_count, options.as_ref())?;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion librashader-runtime-d3d9/src/draw_quad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use array_concat::concat_arrays;
use bytemuck::offset_of;
use librashader_runtime::quad::{QuadType, VertexInput};

use windows::Win32::Foundation::{FALSE, TRUE};
use windows::Win32::Foundation::FALSE;

use windows::Win32::Graphics::Direct3D9::{
IDirect3DDevice9, IDirect3DVertexBuffer9, IDirect3DVertexDeclaration9, D3DCMP_ALWAYS,
Expand Down
4 changes: 2 additions & 2 deletions librashader-runtime-d3d9/src/filter_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use librashader_reflect::reflect::semantics::ShaderSemantics;
use librashader_reflect::reflect::ReflectShader;
use librashader_runtime::binding::{BindingUtil, TextureInput};
use librashader_runtime::framebuffer::FramebufferInit;
use librashader_runtime::image::{Image, ImageError, UVDirection, ARGB8, BGRA8};
use librashader_runtime::image::{Image, ImageError, UVDirection, BGRA8};
use librashader_runtime::quad::QuadType;
use librashader_runtime::render_target::RenderTarget;
use librashader_runtime::scaling::ScaleFramebuffer;
Expand Down Expand Up @@ -288,7 +288,7 @@ impl FilterChainD3D9 {
/// * `input` must be in `D3DPOOL_DEFAULT`.
pub unsafe fn frame(
&mut self,
input: IDirect3DTexture9,
input: &IDirect3DTexture9,
viewport: &Viewport<IDirect3DSurface9>,
frame_count: usize,
options: Option<&FrameOptionsD3D9>,
Expand Down
2 changes: 1 addition & 1 deletion librashader-runtime-d3d9/src/luts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::error::assume_d3d_init;
use crate::texture::D3D9InputTexture;

use librashader_presets::TextureConfig;
use librashader_runtime::image::{Image, ARGB8, BGRA8};
use librashader_runtime::image::{Image, BGRA8};

use windows::Win32::Graphics::Direct3D9::{
IDirect3DDevice9, D3DFMT_A8R8G8B8, D3DLOCKED_RECT, D3DPOOL_MANAGED,
Expand Down

0 comments on commit a14642f

Please sign in to comment.