Comments (4)
Yes I think you're right. IIRC this was changed slightly when support was added for the wasm backend. I guess we haven't hit this issue yet because most shaders only have a single entry point.
check!
just catches all exceptions, so it should be fine if sc_internal_free_pointer
will never actually throw anything.
from spirv_cross.
check! has the side effect of making functions that can never return with failure be prototyped as if they can. I could see a case for wanting the future proof the API, but I think that's ill advised.
from spirv_cross.
Right, but the issue is that exceptions can be thrown by almost anywhere we interact with SPIRV-Cross, and unwinding across the Rust/C++ boundary is undefined behavior (i.e. see catch_unwind
). So even if check!
isn't needed for free
here, some other call in the same function body might require it anyway, so the Result
in the API is still necessary.
Although I think we're going to move to using assertions instead of exceptions anyway, through use of the assertions flag in SPIRV-Cross (some other codebases which use spirv_cross require C++ exceptions be disabled). This isn't great for making errors recoverable, but we could probably later split this into checked/unchecked variants later (where the checked variants could do some simple checking like validating IDs and still return Result
).
from spirv_cross.
I'd PM instead of cluttering the issue, but github sigh.
I don't understand C++. I managed to add support for get_active_buffer_ranges() without any consideration for exceptions, didn't even realize they were part of C++ until now.
from spirv_cross.
Related Issues (20)
- Running examples from `master` fails HOT 1
- Release updated version to crates.io HOT 2
- Texture data, arrayed/depth? HOT 5
- Remove `cdylib` in crate-type section? HOT 2
- Wasm32 Example HOT 4
- Cross-compiled windows binary won't work because of missing libstdc++-6.dll HOT 3
- Expose SamplerAddress::MirrorClampToEdge HOT 2
- stage_inputs format HOT 4
- Rerun spirv_cross/wasm and commit changes
- Broken docs.rs builds on Windows HOT 1
- Expose `{get,set}_common_options`
- Make compiler options non-exhaustive HOT 2
- Implement sc_internal_compiler_set_entry_point for WASM HOT 1
- Add GLSL ES 3.10 and 3.20 versions
- Support for wasm32-wasi HOT 1
- Support msl::Version::V2_3
- Update to more recent upstream? HOT 2
- Migrate to GitHub Actions
- Unable to build on MacOS HOT 1
- Support for ray tracing shaders
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 spirv_cross.