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

excessive GPU uploads #480

Open
Trass3r opened this issue Feb 3, 2025 · 0 comments
Open

excessive GPU uploads #480

Trass3r opened this issue Feb 3, 2025 · 0 comments

Comments

@Trass3r
Copy link
Collaborator

Trass3r commented Feb 3, 2025

https://gistpreview.github.io/?1fb5e7be7110dfd381f0307924bc3e57/recording.html
https://gistpreview.github.io/?1fb5e7be7110dfd381f0307924bc3e57/allocations.html

A lot of performance goes down the drain due to unnecessary GPU buffer uploads.

It originates from:

  • nifty UI uploading buffers every frame: Nifty uploads a lot of data jMonkeyEngine/jmonkeyengine#2358
  • animations since PoseFrame overwrites parts of the positions buffer all the time (still the whole buffer is uploaded)
    BufferUtils.setInBuffer(interpOffset, vertexBuffer, vertIndex);
  • excessive calls of MapViewController.updateTiles even for just tagging or digging, which brute-force updates surrounding tiles as well and triggers complete re-batchings
  • torch flame billboard rotation causing updates of the whole batch
  • mesh cloning in AnimationLoader.playAnimation just for start and end animations, which leads to temporary buffers being created (glGenBuffers/glDeleteBuffers):
NativeObject.setUpdateNeeded()
VertexBuffer.updateData(Buffer)
VertexBuffer.clone()
Mesh.cloneForAnim()
Geometry.cloneFields(Cloner,Object)
MorphTrack.cloneFields(Cloner,Object)
AnimClip.cloneFields(Cloner,Object)
AnimComposer.cloneFields(Cloner,Object)
Spatial.cloneFields(Cloner,Object)
Node.cloneFields(Cloner,Object)
Spatial.clone(boolean)
Spatial.clone()
AssetUtils.loadModel(AssetManager,String,ArtResource,boolean,boolean)
AnimationLoader.loadModel(AssetManager,String,ArtResource,Node)
AnimationLoader.attachResource(Node,AnimationControl,ArtResource,AssetManager)
AnimationLoader.playAnimation(Spatial,ArtResource,AssetManager,boolean)
CreatureViewControl.playAnimation(Creature$AnimationType)
CreatureViewControl.setTargetState(Creature$AnimationType)
PlayerEntityViewState.updateCreatureModelAnimation(Spatial,Entity)
PlayerEntityViewState$CreatureModelContainer.updateObject(Spatial,Entity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant