Comments (6)
Hi - The current design has some state in the basisu_transcoder object. There's m_lowlevel_decoder (the m_pFile_data/m_file_data_size members are dead code and I'll remove them on the next checkin). There's also m_block_endpoint_preds[], which is only temporarily used while transcoding.
m_lowlevel_decoder doesn't became valid until you call start_transcoding(), which signals your intention to start decoding texture slices. So you can use a single global instance of basisu_transcoder to query for basic file information (like get_file_info() etc.), and that would be thread safe in the current design. But once you call start_transcoding(), the local state becomes valid, and is used during transcoding.
So you can't have a single global object and call start_transcoding() on it from multiple threads. If you have multiple .basis files that you want to transcode simultaneously, you'll need multiple basisu_transcoder's.
Right now, you can't call transcode_image_level() from multiple threads on the same object, because m_block_endpoint_preds[] (which is used during transcoding) is per-object state. I will fix this this week. The intention is that you can transcode multiple images or mipmaps from the same .basis file on multiple threads.
Does this make sense?
-Rich
from basis_universal.
Thanks Rich, this is exactly what I wanted to know!
from basis_universal.
Thanks, I'll update this issue once it's possible to transcode multiple slices of a single .basis file from multiple threads.
from basis_universal.
I'm adding an optional pointer to a transcoding state struct to all the transcoding API's. For video, this state struct needs to stay persistent as it holds the last frame's indices. I'll have this checked in hopefully tomorrow or Sat.
from basis_universal.
I have checked in an optional state struct that you can use during transcoding for threading purposes.
from basis_universal.
Great stuff, thanks!
from basis_universal.
Related Issues (20)
- How to encode HDR format resource? HOT 2
- Webssembly version does not support jpg format HOT 1
- rename HOT 2
- Selecting which transcoders to use
- Is it possible ETC1S without lossy compression ?
- RuntimeError when encoding to UASTC with WASM HOT 1
- Transcode failure on iOS 17 HOT 3
- shrinking wasm for glTF extension support HOT 1
- build_emscripen.sh script error
- Error when I cross compile for arm64 under Windows HOT 2
- Does this project with WebGPU (web)? HOT 1
- Add prefix to cmake options
- losinglena.com domain expired HOT 1
- Setup documentation to remove etc1 global codebook selector
- Compile error in cppspmd_sse.h with C++23 HOT 1
- Remove reference to etc1_global_selector_codebook from transcoder wiki page HOT 2
- Balck Textures on android HOT 11
- Question about conversion from PNG to KTX2 and BC1-7 HOT 1
- build variations from number of cores HOT 1
- ETC1S Texture Video Specification (wiki page) says flip bit = 1 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 basis_universal.