Comments (6)
Does your machine natively support ASTC?
One of the issues with the loader is how we decode ASTC inline which may be adding to your excessive memory usage. Some of the scenes are also 4x duplicates to simulate load on a device which doesn't help the loader.
In some samples the goal is to demonstrate the performance delta when using a specific technique - hence the large inefficient scenes. The goal is not to make every sample 100% efficient in all aspects (although an efficient GLTF Loader is definitely a goal)
The loader is on the chopping block soon and will likely be refactored. This includes sorting out the image loading a decoding phase (see framework/scene_graph/images/* if you are interested in those issues)
Completely agree with your assessment though, it is currently not in the best state!
from vulkan-samples.
See #860. ASTC is mobile only, so pretty much all desktop platforms take ages to load larger assets using ASTC compressed textures.
from vulkan-samples.
I get that the ASTC conversion exacerbates memory overhead, and that this code may be a target for refactoring at some point, but I still think it would be a relatively small engineering challenge to not potentially load every image into memory while still allowing it to use threading to pre-load the assets for better performance. I'll probably try to make a small PR for this.
from vulkan-samples.
@jherico apologies, I wasn't trying to dismiss improvements. Just letting you know what we know at this point
More than happy for you to take a shot at it!
from vulkan-samples.
My initial work did a little to improve the memory footprint, but not as much as I expected, and it drastically slowed down the load time.
I did some profiling and found a lot of memory being allocated and not released in surprising places deep inside the astc library. I'm not 100% certain that this accounts for the amount of memory being consumed, but the astc code, at least the version in use by this repo, is very not thread safe, and it leaves a ton of performance on the table by not having any SIMD support.
I've started working on a branch to at least update astc to a recent version, but getting it set up properly will probably be a chunk of work. It does, however, fix the threading issue and also includes support for NEON, SSE2, SSE4.1 and AVX2 instruction sets, but I would need to find a cmake friendly method of determining which one to enable for a given build environment, but the "native" ISA is always available so there's a fallback for people working in obscure environments.
Alternatively, I could put some effort into refactoring the assets to convert he astc assets to basisu, and include the mips in the files so they don't have to be generated at runtime.
Yet another option for improving performance would be to use a temp directory and whenever an astc resource is uncompressed, write the uncompressed version and its mips to the temp folder, so that the next time they could be loaded directly.
from vulkan-samples.
We've been discussing this several times, and we should replace the astc files. basisu is the way to go, I already did a sample for it, so we could leverage the code from that. Will discuss this on our next meeting. It's probably best to have the original asset authors update them for basisu instead of converting the astc (which would probably result in a quality loss).
from vulkan-samples.
Related Issues (20)
- Add new sample for VK_KHR_ray_tracing_position_fetch
- clang-format script fails due to objective C files HOT 1
- Disable copyright checks for moved files
- Profiles sample no longer working
- OpenCL interop sample no longer working
- Linux build error of ‘exchange’ is not a member of ‘std’ HOT 2
- Tracking Issue for HLSL shaders
- hello_triangle sample references a retired swapchain
- Code isn't CPP14 compatible anymore
- Link in Command buffers usage readme broken HOT 1
- 16 bit arithmetic sample crashes at startup HOT 3
- Multithreading render passes sample crashes at startup HOT 1
- Missing screenshot is causing error in Antora site build HOT 1
- wait_idle is failing at startup with ERROR_NATIVE_WINDOW_IN_USE_KHR HOT 1
- Validation errors on Subpass example HOT 4
- Add CI step for Antora documentation build
- Clarify or update ARM/vendor specific information
- Build issue: filesystem/src/legacy.cpp no matching function for call to find() HOT 3
- Build Failure (Windows 11, VS 2022) HOT 3
- Missing error handling for unsupported samples on Android
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 vulkan-samples.