Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite shader cache #27

Merged
merged 30 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e3e0a4b
Rewrite cache manager to be general purpose
stuarthayhurst Jun 29, 2024
0b160b3
Move shader cache validator into its own file
stuarthayhurst Jun 29, 2024
ea0421c
Reimplement strtok_r and strtok, use goto for clean up
stuarthayhurst Jun 29, 2024
445a38d
Sanity check binary cache size
stuarthayhurst Jun 29, 2024
d134726
Avoid extra sysclass while reading shader cache
stuarthayhurst Jun 29, 2024
43ba7a4
Use core/fileManager to read shader source code
stuarthayhurst Jun 29, 2024
d381c7a
Remove unused <algorithm> include
stuarthayhurst Jun 29, 2024
af5da11
Warn if posix_fadvise fails
stuarthayhurst Jun 29, 2024
d371a5b
Add writeFile() to file manager, use it for shader caching
stuarthayhurst Jun 30, 2024
5a45ab3
Bail out if the open / creat call fails
stuarthayhurst Jun 30, 2024
e653d04
Remove <fstream> from shader loader
stuarthayhurst Jun 30, 2024
1a5c776
Check permissions of cache directory before use
stuarthayhurst Jun 30, 2024
96ac0f4
Drop extra whitespace
stuarthayhurst Jun 30, 2024
9d636d7
Add trailing slash to cache directory for consistency
stuarthayhurst Jun 30, 2024
cec25ce
Handle no available program log, ignore written length
stuarthayhurst Jun 30, 2024
f6ad16a
Apply logging fixed from program linking to shader compilation
stuarthayhurst Jun 30, 2024
60f89ec
Share program and shader checking code
stuarthayhurst Jun 30, 2024
54a9429
Fix shader cache being enabled regardless of OpenGL support
stuarthayhurst Jul 2, 2024
e01b221
Describe exposed shader functions
stuarthayhurst Jul 2, 2024
70ccdfd
Directly return results of createProgram and createProgramCached
stuarthayhurst Jul 2, 2024
842ee46
Do shader cache writes using the thread pool
stuarthayhurst Jul 2, 2024
c6c0106
Optimise shader cache string generation
stuarthayhurst Jul 4, 2024
b970313
Order shaders before caching to avoid re-caching due to order changes
stuarthayhurst Jul 4, 2024
911a0a6
Align hash output buffer with uint64_t to ensure safe conversions
stuarthayhurst Jul 5, 2024
307f03c
Move shader load reordering to loadDirectory()
stuarthayhurst Jul 5, 2024
31452b6
Debug log which shader is being compiled
stuarthayhurst Jul 5, 2024
2abfe17
Use external success pointer to test shader compilation success
stuarthayhurst Jul 5, 2024
9d577c1
Document shader caching support and 64-bit requirement
stuarthayhurst Jul 5, 2024
1c88358
Move cache writing and validation entirely within the file manager
stuarthayhurst Jul 7, 2024
b45a5c3
Share shader extension and string identification tables
stuarthayhurst Jul 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
## Features:
- Model loading, using `libassimp`
- Internal thread pool
- Shader program caching
- Keyboard and mouse input handling

## Requirements:
- A `c++23` compatible compiler (`g++ 12+` / `clang 17+`)
- All build and runtime dependencies installed
- A 64-bit Linux system
- An OpenGL 4.5+ compatible driver
- Alternatively, an OpenGL 3.2+ driver supporting the following extensions can be used
- `ARB_direct_state_access`
Expand Down
1 change: 0 additions & 1 deletion src/ammonite/ammonite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "models/modelInterface.hpp"
#include "models/modelStorage.hpp"

#include "utils/cacheManager.hpp"
#include "utils/controls.hpp"
#include "utils/debug.hpp"
#include "utils/logging.hpp"
Expand Down
Loading