Skip to content

Commit

Permalink
rt(d3d9): disable alpha blending
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Sep 25, 2024
1 parent e39c50f commit d26d113
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions librashader-runtime-d3d9/src/draw_quad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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] = [
Expand Down Expand Up @@ -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::<VertexInput>() as u32)?;
// device.SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1)?;
Expand Down

0 comments on commit d26d113

Please sign in to comment.