Comments (7)
According to both the D3D8 and D3D9 documentation, D3DLOCK_DISCARD
may only be used on vertex buffers created with the D3DUSAGE_DYNAMIC
flag. However it is too invalid to create a D3DPOOL_MANAGED
buffer with that flag. It is valid only with D3DPOOL_DEFAULT
(this too is true for both D3D8 and D3D9). I cannot remember which game it was that attempted to use the discard flag on a managed buffer, but it refused to launch unless the workaround was applied, which is why it was added. Probably because the call returned an error (which should be the case in native D3D8 as well, so I have no idea why it works there). The game did not pass D3DUSAGE_DYNAMIC
either.
A better idea might be to remove the D3DLOCK_DISCARD
flag from the lock call if the buffer usage does not match D3DPOOL_DEFAULT
. That would invoke different behaviour, but at least should allow the call to succeed. And since it is the application's fault for using invalid flags, I'd expect undefined behaviour in native D3D8 here as well.
from d3d8to9.
I pushed a proposition to the fix_issue_1 branch. Please check if that works for you.
from d3d8to9.
6d95711 is causing the game in question (original 2004 Sonic Adventure DX PC) to crash sometime after creating IDirect3DDevice8
, so I can't say. Somehow it's returning from a function call to some non-executable memory. It's calling IDirect3D8::GetDeviceCaps
followed by IDirect3D8::CreateDevice
. If the device is still null by this point, it tries again with different parameters.
from d3d8to9.
That commit changed exactly nothing, I only moved some code around ...
from d3d8to9.
That's what I figured, which made things all the more confusing. But alas, reverting to the revision right before that fixes it. I have no idea what's going on there...
from d3d8to9.
Found the problem here. This should be sizeof(output)
not sizeof(input)
. The pointer the game passes in is to a structure on the stack, and this stomps all over it and messes up the return address.
(Edit: and yeah, the intended change did fix the vertex buffer issue)
from d3d8to9.
Ohhhhh .... So I did change one thing and of course had to mistake that one thing. Great. Anyway. Will fix that and merge it back into master then.
from d3d8to9.
Related Issues (20)
- Question about use HOT 4
- Popup message upon starting the game HOT 2
- How to use d3d8to9 with Gentool ? HOT 5
- Dear Crosire!Please help with Correcting/Remove night pixelshader effect of Operation Flashpoint 1.96 HOT 53
- Mafia The City Lost Heaven HOT 2
- [Crash] Pro Evolution Soccer 3 HOT 2
- Max Payne - WS Fix not working HOT 3
- .
- Consider collaborating with the d8vk project? HOT 1
- Consider recommending D3DX from NuGet instead of an old DirectX SDK HOT 3
- Ballistics (2001) - Junk polygons in menus
- C:\Microsoft\Cpp\Default\props not found HOT 1
- Rome Total War - Campaign Map Texture Issue HOT 6
- D3D8.1 Pixel and Vertex Shader Lifetimes Seem To Be Incorrect HOT 1
- Problems with character models. Pangya
- Latest update crashes Silent Hill 2 in SetVertexShader() HOT 4
- v1.11.1 - Max Payne - Loading Screen Errors / Missing Sounds
- Fellowship of the Ring black screen on startup/uncapped frame rate HOT 1
- uhh
- NVCP multi sampling anti-aliasing doesn't work. I tried everything. Metin2 is the game. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3d8to9.