iXit / Mesa-3D

Please use official https://gitlab.freedesktop.org/mesa/mesa/ !
https://github.com/iXit/Mesa-3D/wiki
66 stars 13 forks source link

WOLF RPG Editor (Game.exe): Black screen in GPU rendering mode #65

Open kakurasan opened 9 years ago

kakurasan commented 9 years ago

In GPU rendering mode, nothing displayed. keyboard and sound work. If native Direct3D 9 is disabled, this program almost works fine (font rendering is broken in version 2.10, see https://bugs.winehq.org/show_bug.cgi?id=35205).

WOLF RPG Editor download page (Japanese): http://www.vector.co.jp/soft/dl/winnt/game/se475870.html

WOLF RPG Editor uses a DirectX wrapper library called "DX Library" (open source). The latest version (2.10) uses DX Library 3.10f (development version, not available). version 3.10e and 3.11 are available at http://dxlib.o.oo7.jp/dxolddload.html (exe files are 7-Zip archives, 7z can extract them).

axeldavy commented 9 years ago

It seems to use ff pipeline with a custom ps shader. Probably a bug we still have there

tizbac commented 9 years ago

No, if you trace it with nine and replay trace it works Il 24/gen/2015 15:35 "axeldavy" notifications@github.com ha scritto:

It seems to use ff pipeline with a custom ps shader. Probably a bug we still have there

— Reply to this email directly or view it on GitHub https://github.com/iXit/Mesa-3D/issues/65#issuecomment-71319675.

kakurasan commented 9 years ago

I wrote a small test program which uses DX Library (version 3.11). The program has the same problem.

ppa:oibaf/graphics-drivers + ppa:commendsarnex/winedri3 + iXit/Mesa-3D e660f9bd44

siro20 commented 8 years ago

Is this still an issue ? The example program you provided crashes with latest wine at startup. Looks like a regression in wine. Does WOLF RPG work on latest wine ?

kakurasan commented 8 years ago

The issue still remains.

ppa:oibaf/graphics-drivers + ppa:commendsarnex/winedri3 (1.7.55) + ppa:oibaf/gallium-nine (0085cd5)

The example program you provided crashes with latest wine at startup. Looks like a regression in wine. Does WOLF RPG work on latest wine ?

Some versions (1.7.49 - 1.7.53) crash if builtin version of xaudio2_8.dll is used (workaround: "WINEDLLOVERRIDES=xaudio2_8="), but it seems to be already fixed.

The example program and Game.exe don't crash as of Wine git-97ac9d4 (built from latest source).

If it still crashes, would you try this (rebuilt against DX Library 3.15e) ?

siro20 commented 8 years ago

One issue I found in nine that it rejects vertexdeclarations with more than 16 elements. Wine allows up to 128 elements for one vertexdeclaration.

kakurasan commented 7 years ago

"DX Library" calls IDirectDraw7::SetCooperativeLevel() in Windows/DxGraphicsAPIWin.cpp (function OldGraphicsInterface_Create()). I found that nothing rendered when D_DDSCL_NORMAL is specified (if the flag is removed, the rendering works).

// Doesn't work (original code)
GAPIWin.DirectDraw7Object->SetCooperativeLevel( NS_GetMainWindowHandle(), D_DDSCL_NORMAL | ( WinData.UseFPUPreserve ? D_DDSCL_FPUPRESERVE : 0 ) ) ;

// Works (modified code, incorrect cooplevel flag specified)
GAPIWin.DirectDraw7Object->SetCooperativeLevel( NS_GetMainWindowHandle(), ( WinData.UseFPUPreserve ? D_DDSCL_FPUPRESERVE : 0 ) ) ;

So, a workaround is to insert return DD_OK; to the beginning of the function ddraw_set_cooperative_level() in dlls/ddraw/ddraw.c (WOLF RPG Editor also works).

siro20 commented 7 years ago

Thank you for you interest in fixing nine. Your patch is wrong as it will break ddraw. Calling SetCooperativeLevel without D_DDSCL_NORMAL flag should return an error. The question rises why does it work with nine when ddraw is "disabled" ?

siro20 commented 7 years ago

The problem is simple: There's nothing wrong with nine. It renders a yellow quad to the window. The Library uses ddraw to wait for vsync. ddraw will be emulated by wined3d, which will create another X drawable and it's placed on top of nine X drawable. As ddraw is never used to render anything it's always black. I'm note sure how to deal with ddraw <-> nine interop.

axeldavy commented 7 years ago

is GetDC called ?

That's supposed to be the entry point for nine and ddraw to interoperate, and we don't implement it. I don't know enough for directdraw to do it, and I'm not sure it's even possible given how nine is designed.