Comments (2)
I was considering this point as well.
What I see with this "commit" approach is some added complexity of the code that needs to take care about the management of uncommitted data. The advantage of the commit approach is easy API design - you can have many object parameters, set them one by one, and commit them at the end. In the process, the object data might be in inconsistent state, but it does not matter as long as they are consistent at the moment of commit. The disadvantage of this approach is additional code complexity and increased memory consumption because the uncommitted data needs to be kept by Anari implementation until the commit.
An alternative approach that would remove these disadvantages would replace setParameter+setParameter+...+commit sequence by setParametersAndCommit call. The setParametersAndCommit would take list of all changed parameters and list of new data for each parameter being updated. This way, the user will provide consistent object data in a single call and these data can be applied immediately to the object without any need of temporary management of uncommitted data.
My preference is clearly with this setAllParametersAndCommit over setParameter+setParameter+...+commit approach although I understand that you might have reasons to use your approach. But even if Anari would use setParameter...commit approach, it would be nice to have setAllParametersAndCommit as an extension to avoid associated overhead and resource consumption of setParameter...commit.
Going back to original question, if we would use setParameter...commit approach, I see benefits of what @jeffamstutz suggested. Commit would not update the object data immediately. Instead, the object update would be performed on the start of the next frame. As management of uncommitted data is already there, postponing the update shall not add much to the code complexity, hopefully. One disadvantage is that we cannot already start the object update immediately (scheduling already data transfers, etc.), unless we introduce additional complexity of keeping of two copies of the object for the current and the next frame.
All in all, I am friend with such change as @jeffamstutz proposed while my hopes turn also for a performance extension that would provide setParametersAndCommit functionality as well.
from anari-docs.
Closed via #7.
from anari-docs.
Related Issues (20)
- Per-instance materials HOT 5
- Uniform geometry attributes
- The double use of primitiveID HOT 1
- Incorrect table caption in section 5.10.5. (Transform sampler) HOT 1
- Define implicit iso-surface Geometry
- The ANARI_KHR_GEOMETRY_GLYPH extension for glyphs/oriented shapes HOT 3
- Two-sided Surface extension HOT 3
- Device target spec version property
- Massive spatial fields HOT 3
- Compressed Texture Formats
- Add visibility parameter to Surface
- Add colormap sampler
- Combine transferFunction1D color + opacity arrays HOT 1
- Confusing description of transform sampler HOT 1
- Unclear/missing description of primitive sampler HOT 1
- depth of field own extension?
- Generate latest spec via GitHub actions
- Sampler Transform Offset
- Combine `intensityDistribution` and `intensity` for lights? HOT 2
- Add anariUnsetAllParameters() API function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anari-docs.