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

FrameGraph: optimize texture allocation #16096

Merged
merged 38 commits into from
Jan 24, 2025

Conversation

Popov72
Copy link
Contributor

@Popov72 Popov72 commented Jan 22, 2025

This PR adds texture allocation optimization by aliasing existing textures where possible, i.e. by reusing textures that are no longer used in the frame graph.

NRGE displays some figures about the process:
image

Additional changes in the PR:

  • I moved the texture helper functions from internalTexture.ts to a new textureHelper.functions.ts file, as I needed to add a new helper (GetTextureBlockInformation).
  • I've updated the _retryWithInterval tool function to be able to cancel the timer (the function now returns a function you can call to cancel the timer) - discussed with @RaananW

Popov72 added 29 commits January 9, 2025 17:29
@bjsplat
Copy link
Collaborator

bjsplat commented Jan 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 22, 2025

Graph tools CI has failed you can find the test results at:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/TOOLS/refs/pull/16096/merge/testResults/

@sebavan sebavan enabled auto-merge (squash) January 23, 2025 00:26
@bjsplat
Copy link
Collaborator

bjsplat commented Jan 23, 2025

Graph tools CI has failed you can find the test results at:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/TOOLS/refs/pull/16096/merge/testResults/

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 23, 2025

Graph tools CI has failed you can find the test results at:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/TOOLS/refs/pull/16096/merge/testResults/

@Popov72
Copy link
Contributor Author

Popov72 commented Jan 24, 2025

The GraphTools-CI fails first with:
image

I'm not sure why, as NRGE starts correctly locally.

There's also this error:
image

I guess it's related to the first error?

cc @RaananW

@RaananW
Copy link
Member

RaananW commented Jan 24, 2025

I guess it's related to the first error?

cc @RaananW

There is an error when starting it. you can see it in the trace of the failed tests. The error is TypeError: e.computeTotalTextureSize is not a function . does it make sense to you?

This is the full stacktracte

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/TOOLS/refs/pull/16096/merge/testResults/trace/index.html?trace=https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/TOOLS/refs/pull/16096/merge/testResults/data/115d7d8022d120718d4c84384482b22ad4c286a0.zip

Link to the snapshot, if it helps - https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/TOOLS/refs/pull/16096/merge/nodeRenderGraphEditor/

@RaananW
Copy link
Member

RaananW commented Jan 24, 2025

Oh, following up on this, I think I know what the issue is! Interesting. Let me dig in a bit

#16107 will solve this issue.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16096/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16096/merge/?snapshot=refs/pull/16096/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16096/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 24, 2025

@sebavan sebavan merged commit a453499 into BabylonJS:master Jan 24, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants