[SOLVED] nGlide + ReShade

More
5 years 2 months ago #1 by Zeus
nGlide + ReShade was created by Zeus
Hi Crosire,

it's Zeus, nGlide developer.
Recently I received couple reports that our programs don't work together (crash to desktop).

nGlide is a 3Dfx Glide API wrapper to Direct3D 9 so maybe one of IDirect3DDevice9 methods is unimplemented or something...

Could you please take a look?

I created a test package here:
www.zeus-software.com/files/nglide/nglide_reshade_test.zip

All you have to do is to launch test25.exe and see if it ctd (it does with my Radeon HD 5670 and Win7 x64/Win8.1 x64).

Let me know if you'll need some more info.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #2 by Kleio420
Replied by Kleio420 on topic nGlide + ReShade

Zeus wrote: Hi Crosire,

it's Zeus, nGlide developer.
Recently I received couple reports that our programs don't work together (crash to desktop).

nGlide is a 3Dfx Glide API wrapper to Direct3D 9 so maybe one of IDirect3DDevice9 methods is unimplemented or something...

Could you please take a look?

I created a test package here:
www.zeus-software.com/files/nglide/nglide_reshade_test.zip

All you have to do is to launch test25.exe and see if it ctd (it does with my Radeon HD 5670 and Win7 x64/Win8.1 x64).

Let me know if you'll need some more info.

yea cause this doesnt scream out virus right now seriously

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #3 by piltrafus
Replied by piltrafus on topic nGlide + ReShade
Dear Kleio,
is often good doing some research before going around throwing wild accusations.
www.zeus-software.com/downloads/nglide
Mr Zeus, very much like Mr Crosire here, has been providing gamers with great tools to improve our favorite games. for free.

I personally would love to see Nglide and Reshade working better together.
Regards.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #4 by crosire
Replied by crosire on topic nGlide + ReShade

Zeus wrote: Let me know if you'll need some more info.

Hi =)

I was able to run the test without crash and all features working on a NVIDIA GeForce GTX540M and a GeForce GTX970, both with Windows 7 64bit.

Is it possible to narrow down the crash position? By attaching a debugger and with debug symbols for NGlide and the test app the stacktrace should provide some useful information.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #5 by Zeus
Replied by Zeus on topic nGlide + ReShade
Ok, I debugged the issue and here's what I found:

D3D9 devices created with a D3DCREATE_SOFTWARE_VERTEXPROCESSING or D3DCREATE_HARDWARE_VERTEXPROCESSING flag work properly in conjunction with ReShade.

ReShade will cause a crash if the device will be created with a D3DCREATE_MIXED_VERTEXPROCESSING flag (a mode that allows switching between SWVP and HWVP at runtime without recreating the device) and if vertex processing will be switched to SWVP by calling IDirect3DDevice9->SetSoftwareVertexProcessing(TRUE).

The crash occurs at system d3d9.dll:IDirect3DDevice9->DrawPrimitive(), which is called by ReShade at 0x100AC8D0 (0.19.2). 0x100AC8D0 is part of ReShade's IDirect3DDevice9->Present().

This explains why you didn't have a crash with GeForce cards as they don't require D3DUSAGE_SOFTWAREPROCESSING flag when creating vertex buffers for mixed mode devices after switching to SWVP (Radeons do!).

I updated test package and instead of nGlide I included DXSDK9 vertices sample along with pdb and source code so now it should be easier to debug in case you'll still need it.

But the fix should be easy. Monitor whether vertex processing has been set to software by CreateDevice() or SetSoftwareVertexProcessing(TRUE) and if that's the case set D3DUSAGE_SOFTWAREPROCESSING flag when creating vertex buffer for your additional DrawPrimitive call in IDirect3DDevice9->Present() (ReShade overlay?).

Another question I have is that intentional that right half of the screen is black with default ReShade package?

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #6 by crosire
Replied by crosire on topic nGlide + ReShade
It still doesn't crash for me, but the drawing fails at least.

If I may ask, I'm wondering why you use software vertex processing? It's very slow and basically every computer supports hardware vertex processing these days (even if they don't have a separate GPU, modern CPUs have onboard graphics units). So I'm thinking about simply forcing it instead.

Zeus wrote: Another question I have is that intentional that right half of the screen is black with default ReShade package?

The core package only contains an example shader, which fills the right half of the screen with the depth buffer content (see ReShade.fx).
Last edit: 5 years 2 months ago by crosire.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #7 by Zeus
Replied by Zeus on topic nGlide + ReShade

crosire wrote: I'm wondering why you use software vertex processing? It's very slow and basically every computer supports hardware vertex processing these days (even if they don't have a separate GPU, modern CPUs have onboard graphics units).

Radeons do not support primitive clipping so the fastest method to clip them with this hardware is to switch to SWVP. Performance wise, there is no difference as a typical scene in a Glide API game consists of no more than 10k triangles (already pre-transformed verts).

crosire wrote: So I'm thinking about simply forcing it instead.

Setting D3DUSAGE_SOFTWAREPROCESSING flag for CreateVertexBuffer() for programs that already use SWVP should have zero impact on performance. No matter if you set 0 or D3DUSAGE_SOFTWAREPROCESSING, the vertices will be processed in software. The only difference is the program won't crash. You won't be setting this flag for HWVP, so I'm suggesting trying this option first.

Forcing HWVP should also fix the crash, it's just the clipping won't work on AMD hardware.

crosire wrote: The core package only contains an example shader, which fills the right half of the screen with the depth buffer content (see ReShade.fx).

Ok, thanks.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #8 by crosire
Replied by crosire on topic nGlide + ReShade
I need ReShade to use hardware rendering, because the shaders can get quite complex. For that reason I now simply turn off software vertex processing before ReShade kicks in and turn it back on afterwards (if it was enabled before). And to get support for switching the D3DCREATE_SOFTWARE_VERTEXPROCESSING flag is replaced with D3DCREATE_MIXED_VERTEXPROCESSING on device creation if specified. Seems to work.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #9 by Zeus
Replied by Zeus on topic nGlide + ReShade
Excellent idea. Will be waiting for the next release.

Thanks again.

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago #10 by crosire
Replied by crosire on topic nGlide + ReShade
This should no longer be an issue with version 1.0.
The following user(s) said Thank You: Zeus

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago #11 by Zeus
Replied by Zeus on topic nGlide + ReShade
Tested new version today and I can confirm it works properly. :)
The following user(s) said Thank You: crosire

Please Log in or Create an account to join the conversation.