Comments (3)
This ties into a larger discussion about requirements on state when calling API functions. I think it makes sense to impose some sensible restrictions to clarify expected behavior to both implementers and API users.
ANARI is required to observe state on anariRenderFrame
and may observe parameter state any time after anariCommitParameters
. While commits have no prescribed behavior is reasonable to expect commits to indicate meaningful state transitions and indicating the involved object is in a "usable" state. Therefore it makes sense to impose the same requirements for both anariRenderFrame
and anariCommitParameters
,
The requirements for both calls would be:
- Parameters must not be in a mapped state
- Array objects set as parameters must not be in a mapped state
- Required parameters are set
- All of the above apply recursively to objects set as parameters
For anariRenderFrame
:
- Contributing objects must not have set but uncommitted (hanging?) parameters
Failing to meet these requirements leads to undefined behavior but the implementations are strongly encouraged to not crash and recover once the requirements are fulfilled again.
from anari-docs.
More thoughts.
An implementation that wants to eagerly prepare data structures which (also) depend on a Geometry has to react on the commit of the Geometry. There is no benefit in doing that preparation connected to a commit of the Surface, assuming the Geometry is already defined and enforcing that assumption in the spec, on the application. There may only be a single commit of the Surface, but many commits of the Geometry.
Going further, we have the same situation for Array objects (handle) as parameters. Information dependent on the content of the array (e.g., bounding box of vertex positions) needs to be (re)calculated on the unmap of the array.
One could argue, that the difference between directly mapped arrays parameters (first bullet) and array objects (handle as parameter, second bullet) is the owner of the array content, which is the parent object in the first case and the array object in the second. Yet, a re-commit of the parent object is not required when a directly mapped array changes its content, the signal of changed data from the application is again unmap (actually unmapParameterArray).
This all leads to relaxed requirements on commit. For renderFrame all involved objects need to be valid and all arrays unmapped.
from anari-docs.
Per the 5/24/23 WG call discussion, anariCommitParameters
in between direct map/unmap calls is OK (though warnings ought to be emitted by the debug layer) and current spec wording is sufficient.
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.