Code Monkey home page Code Monkey logo

Comments (7)

rbertin-aso avatar rbertin-aso commented on May 28, 2024 1

Okay ! Thanks a lot for those answers !
I'm closing until next questions :D

from d3d12memoryallocator.

adam-sawicki-a avatar adam-sawicki-a commented on May 28, 2024

You are right. Just as the documentation says, allocations that can be defragmented shouldn't be released since the moment a call to BeginPass starts. I recommend to store the list of allocations to be released and defer this release to the time after the defragmentation pass is complete.

I think calling AddRef and Release to manage reference counter of all the defragmented allocations would add too much of unnecessary performance overhead.

from d3d12memoryallocator.

rbertin-aso avatar rbertin-aso commented on May 28, 2024

Thanks for those answer. I will then prefer the list of allocations.

from d3d12memoryallocator.

rbertin-aso avatar rbertin-aso commented on May 28, 2024

Hello again Adam. Sorry for reopening this ticket. After reading again the documentation to be sure, I noticed this sentence :

Otherwise, a thread performing the allocation->Release() would block for the time BeginPass executes and then free the allocation when it finishes, while the allocation could have ended up on the list of allocations to move.

Is it okay to keep every allocation that need to be release into a list (that will be released after the EndPass) between the beginning and the end of BeginPass and after the end of BeginPass to keep in the list only allocations that are into the pass movements ?
To rephrase, is releasing allocations that aren't pass movements an issue if BeginPass is done ?
(I'm trying to optimize the number of allocations that go into that list because between Begin and End, it can be a lot ! )

Have a nice day !

from d3d12memoryallocator.

adam-sawicki-a avatar adam-sawicki-a commented on May 28, 2024

You are right, this optimization is correct. After BeginPass call finishes, only allocations that ended up on the list of movements should not be released. Other allocations can be released and new allocations can be made between BeginPass and EndPass.

from d3d12memoryallocator.

rbertin-aso avatar rbertin-aso commented on May 28, 2024

Okay thanks a lot !

new allocations can be made

I'm afraid of this :). Do you mean allocations must not be made during BeginPass or just that they will be blocked by the mutex ?

from d3d12memoryallocator.

adam-sawicki-a avatar adam-sawicki-a commented on May 28, 2024

They will just be blocked by the mutex and then execute after BeginPass, which is fine.

from d3d12memoryallocator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.