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

Use dynamic vertex buffers for increased performance #19

Open
dbozan99 opened this issue Apr 6, 2020 · 3 comments
Open

Use dynamic vertex buffers for increased performance #19

dbozan99 opened this issue Apr 6, 2020 · 3 comments

Comments

@dbozan99
Copy link

dbozan99 commented Apr 6, 2020

If you start cranking up the settings in some of the mods that change draw distances, the FPS starts dropping off dramatically and seems to be severely single-thread CPU-bottlenecked. I compiled SkyGFX with debugging symbols enabled (the .pdb file) so I could get a better look at it's performance with ETW Event Tracing. From what I can tell, the renderer spends very long periods of time locked. According to this page from MS, that seems to be what's happening here.

RW seems to offer support for Dynamic Vertex buffers with the use of
RwD3D9DynamicVertexBufferCreate
RwD3D9DynamicVertexBufferDestroy
RwD3D9DynamicVertexBufferLock
RwD3D9DynamicVertexBufferUnlock

I'd test this myself and send a Pull Request but my graphics programming knowledge is basically nonexistent so I'm not sure how to implement this correctly, or if this would even help the performance at all.

@native-m
Copy link

skygfx doesn't seem to touch the vertex buffer data

@native-m
Copy link

native-m commented Apr 14, 2020

it might need an additional hook for GTA streaming function in order to do that

@dbozan99
Copy link
Author

Take a look at the DNInstance_PS2 function in buildingPipe.cpp. It's named vertBuffer . There's also vertexBuffer which is a pointer.

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

2 participants