VOGONS


First post, by BEEN_Nath_58

User metadata
Rank l33t
Rank
l33t

Basically, I am trying to find a way to use the Reference Direct3D device to render 3DMark and other games. The HAL device has been buggy on certain games and I would like to see how better they work with the REF device. Additionally, DxWnd is trying to implement a feature to utilise the Reference device over HAL which has failed in every application I tried. Maybe there is something missing? I must add that each application was Direct3D5-7.

Can anyone assist in these matters?

previously known as Discrete_BOB_058

Reply 1 of 2, by Narzoul

User metadata
Rank Newbie
Rank
Newbie

I experimented with something like this a couple years ago (Re: dgVoodoo 2 for DirectX 11)
It shouldn't be too difficult, from what I remember. Besides the obvious (replacing IID_IDirect3DHALDevice/IID_IDirect3DTnLHalDevice with IID_IDirect3DRefDevice), I think you need to make sure to create all 3D-related surfaces (textures, render targets, depth buffers) in system memory. HAL devices generally require the opposite, so just replacing the device probably won't work. A copy of d3dref.dll is also needed, which can be obtained e.g. from the DirectX 7 SDK. The DX7 DDK even has the source code for it.

If you expect to have somewhat decent performance though, then IID_IDirect3DRGBDevice might be a better choice, though it supports fewer features. No TnL for example, so I'd assume it can only work with transformed and lit vertices, unlike the reference rasterizer (at least based on the caps in dxcapsviewer). From what I remember, the reference rasterizer had like 1-2 fps in Combat Missions.

It might also be worth checking how caps are reported. I seem to recall SW devices don't report any caps in the HAL structs, but I may be wrong.

Reply 2 of 2, by BEEN_Nath_58

User metadata
Rank l33t
Rank
l33t
Narzoul wrote on 2022-08-31, 18:54:

I experimented with something like this a couple years ago (Re: dgVoodoo 2 for DirectX 11)
It shouldn't be too difficult, from what I remember. Besides the obvious (replacing IID_IDirect3DHALDevice/IID_IDirect3DTnLHalDevice with IID_IDirect3DRefDevice), I think you need to make sure to create all 3D-related surfaces (textures, render targets, depth buffers) in system memory. HAL devices generally require the opposite, so just replacing the device probably won't work. A copy of d3dref.dll is also needed, which can be obtained e.g. from the DirectX 7 SDK. The DX7 DDK even has the source code for it.

Ok I got some things from here. First I didn't completely know if there was a separate REF dll for old DirectX, I know d3d11ref.dll exists for D3D11 but now I got the old d3dref.dll as well.

I am quite sure @ghotik_2002 only changed the interface to IID_IDirect3DRefDevice. I put the d3dref.dll of DirectX7 beside the game. There are quite a number options considering graphics and system memory, I am confused as to which will create the 3D surfaces on system memory.

Narzoul wrote on 2022-08-31, 18:54:

If you expect to have somewhat decent performance though, then IID_IDirect3DRGBDevice might be a better choice, though it supports fewer features. No TnL for example, so I'd assume it can only work with transformed and lit vertices, unlike the reference rasterizer (at least based on the caps in dxcapsviewer). From what I remember, the reference rasterizer had like 1-2 fps in Combat Missions.

It might also be worth checking how caps are reported. I seem to recall SW devices don't report any caps in the HAL structs, but I may be wrong.

Thanks, we checked the RGB device for Ramp games because Ramp didn't work well on Windows 10/11. There were some graphical differences observed for using it, but in this case as the main goal is trying to get the "most-perfect" scene to render, the REF rasterizer is probably a better options (and also it should resemble HAL more than RGB).

Narzoul wrote on 2022-08-31, 18:54:

It might also be worth checking how caps are reported. I seem to recall SW devices don't report any caps in the HAL structs, but I may be wrong.

I checked the caps in DxCapsViewer and some NO with HAL device are YES in REF device. So that could be better than HAL in many cases, such as the support of ATI TruForm is possible with REF device on a current NV GPU. Reading from the link, I see the memory problem with Thief, this probably can be fixed easily (in DxWnd) by faking this check.

previously known as Discrete_BOB_058