From dbfa822f7cd15de3d13a747bda9db0d3f76db0e2 Mon Sep 17 00:00:00 2001 From: chyyran Date: Wed, 25 Sep 2024 00:29:08 -0400 Subject: [PATCH] rt(d3d9): disable alpha blending --- librashader-runtime-d3d9/src/draw_quad.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/librashader-runtime-d3d9/src/draw_quad.rs b/librashader-runtime-d3d9/src/draw_quad.rs index 2962e52..3af5a8e 100644 --- a/librashader-runtime-d3d9/src/draw_quad.rs +++ b/librashader-runtime-d3d9/src/draw_quad.rs @@ -4,14 +4,15 @@ use array_concat::concat_arrays; use bytemuck::offset_of; use librashader_runtime::quad::{QuadType, VertexInput}; -use windows::Win32::Foundation::FALSE; +use windows::Win32::Foundation::{FALSE, TRUE}; use windows::Win32::Graphics::Direct3D9::{ IDirect3DDevice9, IDirect3DVertexBuffer9, IDirect3DVertexDeclaration9, D3DCMP_ALWAYS, D3DCULL_NONE, D3DDECLMETHOD_DEFAULT, D3DDECLTYPE_FLOAT2, D3DDECLTYPE_FLOAT3, D3DDECLTYPE_UNUSED, D3DDECLUSAGE_TEXCOORD, D3DPOOL_DEFAULT, D3DPT_TRIANGLESTRIP, - D3DRS_CLIPPING, D3DRS_COLORWRITEENABLE, D3DRS_CULLMODE, D3DRS_LIGHTING, D3DRS_ZENABLE, - D3DRS_ZFUNC, D3DTRANSFORMSTATETYPE, D3DTS_PROJECTION, D3DTS_VIEW, D3DVERTEXELEMENT9, + D3DRS_ALPHABLENDENABLE, D3DRS_CLIPPING, D3DRS_COLORWRITEENABLE, D3DRS_CULLMODE, D3DRS_LIGHTING, + D3DRS_ZENABLE, D3DRS_ZFUNC, D3DTRANSFORMSTATETYPE, D3DTS_PROJECTION, D3DTS_VIEW, + D3DVERTEXELEMENT9, }; const OFFSCREEN_VBO_DATA: [VertexInput; 4] = [ @@ -112,6 +113,7 @@ impl DrawQuad { device.SetRenderState(D3DRS_LIGHTING, FALSE.0 as u32)?; device.SetRenderState(D3DRS_COLORWRITEENABLE, 0xfu32)?; + device.SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE.0 as u32)?; device.BeginScene()?; device.SetStreamSource(0, &self.vbo, 0, std::mem::size_of::() as u32)?; // device.SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1)?;