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

Vertex buffer allocation uses illegal argument combination #3295

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Vertex buffer allocation uses illegal argument combination #3295

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Windows 10, x86_64

Comments on the original bug report:

On 2019-06-21 04:14:59 +0000, Cameron Gutman wrote:

The fix for bug # 4537 causes IDirect3DDevice9::CreateVertexBuffer() to fail consistently, and thus VBOs are not used. The combination of D3DUSAGE_DYNAMIC and D3DPOOL_MANAGED is illegal, as noted by warnings from the debug D3D9 runtime each time we try to render:

Direct3D9: (ERROR) :D3DUSAGE_DYNAMIC cannot be used with managed vertex buffers
Direct3D9: (ERROR) :Failure trying to create Vertex Buffer

and MSDN says:

"D3DUSAGE_DYNAMIC and D3DPOOL_MANAGED are incompatible and should not be used together." - https://docs.microsoft.com/en-us/windows/desktop/direct3d9/d3dusage

VBOs work again after reverting https://hg.libsdl.org/SDL/rev/412a6f2078d4

On 2019-06-21 04:15:56 +0000, Cameron Gutman wrote:

Oops, the correct rev to revert is: https://hg.libsdl.org/SDL/rev/706e38de05c9

On 2019-06-21 18:14:49 +0000, Ryan C. Gordon wrote:

Ah, well, shoot.

--ryan.

On 2019-06-21 19:12:01 +0000, Ryan C. Gordon wrote:

Okay, so the actual problem in Bug # 4537 was that we weren't releasing the vertex buffers on renderer shutdown, so I fixed that and put this back to D3DPOOL_DEFAULT.

I am a little concerned that immediate mode is turning out to be slightly faster than using a vertex buffer, but we're talking about a few FPS when drawing 30,000 sprites. Maybe that's less true at normal usage patterns, if it were enough to lose sleep over in the first place. Maybe I'll revisit that for 2.0.11.

At any rate, this is fixed by https://hg.libsdl.org/SDL/rev/9d3f245739f8, thanks!

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant