[SOLVED] Direct3D 8 error
- rolfba
- Topic Author
Less
More
Im trying to apply SweetFX to a pretty old game.
"Earth and Beyond", and since its a d3d8 game i installed reshade as such.
Its working until the game is force closed and the d3d8.log file contains the line:
"Failed to translate 'IDirect3DDevice8::CreateImageSurface' call for '[128, 128, 20]'!"
/Rolf
"Earth and Beyond", and since its a d3d8 game i installed reshade as such.
Its working until the game is force closed and the d3d8.log file contains the line:
"Failed to translate 'IDirect3DDevice8::CreateImageSurface' call for '[128, 128, 20]'!"
/Rolf
Please Log in or Create an account to join the conversation.
- crosire
Less
More
There should be more errors, please check if something related to vertex/pixel shader translation fails .
Please Log in or Create an account to join the conversation.
- rolfba
- Topic Author
Less
More
Please Log in or Create an account to join the conversation.
- crosire
Less
More
9 years 2 weeks ago - 9 years 2 weeks ago #4
by crosire
Replied by crosire on topic Direct3D 8 error
That's interesting, so it's indeed that texture creation failure that forces the game to close. It tries to create a texture of format "D3DFMT_R8G8B8", which explains why it doesn't work, there is little D3D9+ hardware supporting that format, I'm guessing it works under default D3D8 because the game then might runs on software emulation instead of on the GPU.
I can force replace that format with something working, but that would probably mess up the image saved in that texture ...
I can force replace that format with something working, but that would probably mess up the image saved in that texture ...
Last edit: 9 years 2 weeks ago by crosire.
Please Log in or Create an account to join the conversation.
- rolfba
- Topic Author
Less
More
It might work to switch it out with D3DFMT_X8R8G8B8 instead, i dont think they use many shaders that would be to confused by this.
I mean, its not working as it is now, so might as well try to fix it, if it messes the texture up, ill report back any errors i see.
/Rolf
I mean, its not working as it is now, so might as well try to fix it, if it messes the texture up, ill report back any errors i see.
/Rolf
Last edit: 9 years 2 weeks ago by rolfba.
Please Log in or Create an account to join the conversation.
- crosire
Less
More
9 years 2 weeks ago - 9 years 2 weeks ago #6
by crosire
Replied by crosire on topic Direct3D 8 error
That's what I would have done. Problem is not the shaders, they don't see a difference between the two, problem is loading the image from memory into the texture. D3DFMT_X8R8G8B8 expects image data aligned to 32bpp (bits per pixel), whereas D3DFMT_R8G8B8 expects 24bpp data.
Those are not compatible (obviously) and it thus would look wrong or worse actually, it would simply crash, because the game provides far less data than D3D8 tries to read from memory:
Those are not compatible (obviously) and it thus would look wrong or worse actually, it would simply crash, because the game provides far less data than D3D8 tries to read from memory:
- 100px * 100px * 24bpp = 240kB < This is what the game provides in case of a 100x100 texture
- 100px * 100px * 32bpp = 320kB < This is what D3D8 expects
Last edit: 9 years 2 weeks ago by crosire.
Please Log in or Create an account to join the conversation.
- crosire
Less
More
So tried a game which had similar issues because of missing D3DFMT_R8G8B8 and replacing it with D3DFMT_X8R8G8B8 without much further doing works surprisingly well, the affected textures were correct. Looks like even D3DFMT_R8G8B8 took 32bpp data?
Anyway, fixed in 0.16.0 now.
Anyway, fixed in 0.16.0 now.
Please Log in or Create an account to join the conversation.
- rolfba
- Topic Author
Less
More
Great, i cant wait to test it out in my old game Earth and Beyond, i think it will be very cool to get some SweetFX going on that one
Thanks alot for adding this in.
Thanks alot for adding this in.
Please Log in or Create an account to join the conversation.