Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3DDevice_CreatePixelShader issue #794

Closed
PatrickvL opened this issue Nov 11, 2017 · 5 comments
Closed

D3DDevice_CreatePixelShader issue #794

PatrickvL opened this issue Nov 11, 2017 · 5 comments
Labels
graphics GPU and/or game graphics related HLE High Level Emulation

Comments

@PatrickvL
Copy link
Member

PatrickvL commented Nov 11, 2017

At least two games suffer from an issue with CreatePixelShader;
Cold Fear - see Cxbx-Reloaded/game-compatibility#434
and Dino Crisis 3 : see Cxbx-Reloaded/game-compatibility#114 (comment)

Cold Fear crashes due to expecting the HANDLE returned by CreatePixelShader to be a pointer to valid memory, containing the pixel shader definition. Currently, our implementation of CreatePixelShader returns a handle to the host pixel shader, which is not correct behavior.

Cold Fear crashes while executing the following code (located at 0x0004F0F0 within the .text segment)

   D3DDevice_CreatePixelShader(&pPSDef, &pHandle);
    for ( i = dword_37D198; memcmp((const void *)(pHandle + i), &pPSDef, 0xF0u); dword_37D198 = i )
      i += 4;
@PatrickvL PatrickvL changed the title CreatePixelShader issue D3DDevice_CreatePixelShader issue Nov 11, 2017
@PatrickvL
Copy link
Member Author

According to some feedback, "it's not only Cold Fear and Dino Crisis 3 that have this problem, Panzer Dragoon Orta and Jet Set Radio Future also have this (actually putting the CreatePixelShader = 0 in the .ini of JSRF fix the tag problem and make the game fully playable (no more glitch, other than the character legs, everything else look fine), PDO have the same problem after pushing the start button in the mission, everything become white and impossible to play, modifying this line again, fix this issue."

@Meowson
Copy link

Meowson commented Dec 12, 2017

When you say to insert "CreatePixelShader = 0" in the .ini of JSRF, where does one find the .ini? Ive tried looking through the files of JSRF but couldn't find it. Thank you.

@PatrickvL
Copy link
Member Author

You'll find it in the "%appdata%/Cxbx-Reloaded/HLECache" folder

@PatrickvL PatrickvL added graphics GPU and/or game graphics related HLE High Level Emulation labels Jan 4, 2018
@LukeUsher
Copy link
Member

The fix for this issue would be to stop patching CreatePixelShader completely, and instead move shader conversion to the SetPixelShader functions instead. (Or better yet, at draw time)

@PatrickvL
Copy link
Member Author

PatrickvL commented Mar 19, 2018

All PixelShader related patches are gone, except for SetPixelShader, which uses a trampoline. Commit 4637f4d resolves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graphics GPU and/or game graphics related HLE High Level Emulation
Projects
None yet
Development

No branches or pull requests

3 participants