]> git.nega.tv - josh/narcissus/log
josh/narcissus
14 months agoshark: Enable RUST_BACKTRACE by default
Joshua Simmons [Fri, 5 Apr 2024 22:18:05 +0000 (00:18 +0200)]
shark: Enable RUST_BACKTRACE by default

In debug builds we always want to enable backtraces if they're not
explicitly disabled by the environment variable.

15 months agonarcissus-core: Improve float random generation
Joshua Simmons [Sun, 31 Mar 2024 03:22:24 +0000 (05:22 +0200)]
narcissus-core: Improve float random generation

Change `next_f32` to output in the range `[0.0,1.0)`.
Add `next_f64`.
Add very basic smoke test.

15 months agonarcissus-core: Fix clippy lint
Joshua Simmons [Sun, 31 Mar 2024 02:56:39 +0000 (04:56 +0200)]
narcissus-core: Fix clippy lint

15 months agonarcissus-gpu: Fix clippy lint
Joshua Simmons [Sun, 31 Mar 2024 02:55:15 +0000 (04:55 +0200)]
narcissus-gpu: Fix clippy lint

19 months agometa: Rename ext to external
Joshua Simmons [Mon, 20 Nov 2023 20:21:05 +0000 (21:21 +0100)]
meta: Rename ext to external

19 months agonarcissus-sqlite: Fix clippy lint
Joshua Simmons [Sun, 5 Nov 2023 19:39:17 +0000 (20:39 +0100)]
narcissus-sqlite: Fix clippy lint

19 months agonarcissus-core: Fix clippy lint
Joshua Simmons [Sun, 5 Nov 2023 19:38:54 +0000 (20:38 +0100)]
narcissus-core: Fix clippy lint

19 months agonarcissus-app: Fix clippy lint
Joshua Simmons [Sun, 5 Nov 2023 19:38:25 +0000 (20:38 +0100)]
narcissus-app: Fix clippy lint

19 months agoblake3-smol: Add minimal blake3 dependency
Joshua Simmons [Sun, 5 Nov 2023 18:39:01 +0000 (19:39 +0100)]
blake3-smol: Add minimal blake3 dependency

19 months agosqlite-sys: Add sqlite dependency
Joshua Simmons [Sun, 5 Nov 2023 16:43:12 +0000 (17:43 +0100)]
sqlite-sys: Add sqlite dependency

19 months agometa: Re-organize crates
Joshua Simmons [Sun, 5 Nov 2023 11:56:13 +0000 (12:56 +0100)]
meta: Re-organize crates

19 months agonarcissus-core: Fix clippy lints
Joshua Simmons [Sun, 5 Nov 2023 11:35:37 +0000 (12:35 +0100)]
narcissus-core: Fix clippy lints

19 months agovulkan-sys: Use macro to generate flags impls
Joshua Simmons [Sun, 5 Nov 2023 11:33:43 +0000 (12:33 +0100)]
vulkan-sys: Use macro to generate flags impls

Replace find-and-replace "we've got macros at home" with actual macros,
and additionally fix a minor clippy lint about the structure of the
clone impl.

22 months agonarcissus-core: Remove `cstr_from_bytes_until_nul`
Joshua Simmons [Sun, 20 Aug 2023 16:01:02 +0000 (18:01 +0200)]
narcissus-core: Remove `cstr_from_bytes_until_nul`

The standard verison is stablilized as of Rust 1.69.

22 months agonarcissus-gpu: Use std from_bytes_until_nul
Joshua Simmons [Sun, 20 Aug 2023 16:00:27 +0000 (18:00 +0200)]
narcissus-gpu: Use std from_bytes_until_nul

22 months agonarcissus-gpu: Fix link in barrier documentation
Joshua Simmons [Sun, 20 Aug 2023 15:53:27 +0000 (17:53 +0200)]
narcissus-gpu: Fix link in barrier documentation

22 months agonarcissus-core: Add helpers to fetch important directories
Joshua Simmons [Sun, 20 Aug 2023 15:46:50 +0000 (17:46 +0200)]
narcissus-core: Add helpers to fetch important directories

22 months agostb_image: Suppress camel case warning
Joshua Simmons [Mon, 7 Aug 2023 21:53:17 +0000 (23:53 +0200)]
stb_image: Suppress camel case warning

22 months agonarcissus-gpu: Renaming and lifetime cleanups
Joshua Simmons [Mon, 7 Aug 2023 19:09:32 +0000 (21:09 +0200)]
narcissus-gpu: Renaming and lifetime cleanups

Rename CmdBuffer to CmdEncoder.
Rename MappedBuffer to PersistentBuffer.

22 months agonarcissus-gpu: Add new API for mapped buffers
Joshua Simmons [Sun, 6 Aug 2023 13:05:16 +0000 (15:05 +0200)]
narcissus-gpu: Add new API for mapped buffers

Add new functionality for persistent and transient buffers that allows
easy copying from Rust data types.

Replace code in narcissus with the new APIs.

Fix some GPU read - CPU write synchronisation issues by switching some
persistent buffers into automatically managed transient buffers.

22 months agonarcissus: Avoid using draw indexed for glyphs
Joshua Simmons [Sat, 5 Aug 2023 09:00:20 +0000 (11:00 +0200)]
narcissus: Avoid using draw indexed for glyphs

In preparation for being able to draw different types of primitive from
the same system, stop using indexed drawing for glyphs. Instead pack
information into the index buffer.

23 months agonarcissus-gpu: Remove unnecessary mut
Joshua Simmons [Sat, 29 Jul 2023 16:43:35 +0000 (18:43 +0200)]
narcissus-gpu: Remove unnecessary mut

23 months agocargo: Enable resolver 2 for workspace
Joshua Simmons [Sat, 29 Jul 2023 16:42:48 +0000 (18:42 +0200)]
cargo: Enable resolver 2 for workspace

23 months agovulkan-sys: Use a simpler alignment check for SPV
Joshua Simmons [Sat, 29 Jul 2023 13:12:41 +0000 (15:12 +0200)]
vulkan-sys: Use a simpler alignment check for SPV

23 months agonarcissus-gpu: Add basic randomised test for Tlsf
Joshua Simmons [Sat, 29 Jul 2023 13:12:05 +0000 (15:12 +0200)]
narcissus-gpu: Add basic randomised test for Tlsf

23 months agonarcissus-core: Add `array_select` to Pcg64
Joshua Simmons [Sat, 29 Jul 2023 08:27:39 +0000 (10:27 +0200)]
narcissus-core: Add `array_select` to Pcg64

23 months agonarcissus-gpu: Simplify allocator stats tracking
Joshua Simmons [Thu, 27 Jul 2023 09:36:06 +0000 (11:36 +0200)]
narcissus-gpu: Simplify allocator stats tracking

23 months agonarcissus-gpu: Fix old naming
Joshua Simmons [Wed, 26 Jul 2023 18:00:32 +0000 (20:00 +0200)]
narcissus-gpu: Fix old naming

23 months agonarcissus-gpu: Always call them super-blocks
Joshua Simmons [Tue, 25 Jul 2023 13:35:47 +0000 (15:35 +0200)]
narcissus-gpu: Always call them super-blocks

23 months agonarcissus-gpu: Add emergency deallocation to allocator
Joshua Simmons [Tue, 25 Jul 2023 13:32:26 +0000 (15:32 +0200)]
narcissus-gpu: Add emergency deallocation to allocator

23 months agonarcissus-gpu: Free unused TLSF super blocks
Joshua Simmons [Tue, 25 Jul 2023 12:20:26 +0000 (14:20 +0200)]
narcissus-gpu: Free unused TLSF super blocks

23 months agonarcissus-gpu: Add Default bound to Tlsf super blocks
Joshua Simmons [Tue, 25 Jul 2023 07:43:18 +0000 (09:43 +0200)]
narcissus-gpu: Add Default bound to Tlsf super blocks

23 months agonarcissus-gpu: Fix bufferImageGranularity support
Joshua Simmons [Thu, 20 Jul 2023 11:09:59 +0000 (13:09 +0200)]
narcissus-gpu: Fix bufferImageGranularity support

bufferImageGranularity applies to linear resources and non-linear
resources - not to images and buffers generally.

23 months agonarcissus-gpu: Support large bufferImageGranularity
Joshua Simmons [Wed, 19 Jul 2023 20:27:00 +0000 (22:27 +0200)]
narcissus-gpu: Support large bufferImageGranularity

Add support for bufferImageGranularity that's larger than the TLSF
minimum alignment by segregating image and buffer allocators in that
case.

23 months agonarcissus-gpu: Fix typo in tlsf docs
Joshua Simmons [Wed, 19 Jul 2023 20:25:51 +0000 (22:25 +0200)]
narcissus-gpu: Fix typo in tlsf docs

23 months agonarcissus-gpu: Track allocation metrics per-heap
Joshua Simmons [Wed, 19 Jul 2023 18:55:21 +0000 (20:55 +0200)]
narcissus-gpu: Track allocation metrics per-heap

Add tracking for per-heap memory usage.
Calculate per-heap TLSF super block size based on heap size.

23 months agonarcissus-gpu: Improve allocator behavior
Joshua Simmons [Wed, 19 Jul 2023 08:34:01 +0000 (10:34 +0200)]
narcissus-gpu: Improve allocator behavior

Add support for falling back to other memory types after allocation
failure.

Add support for falling back to dedicated allocations after TLSF
super-block allocation failure.

23 months agonarcissus-core: Add u32 support to BitIter
Joshua Simmons [Wed, 19 Jul 2023 08:32:47 +0000 (10:32 +0200)]
narcissus-core: Add u32 support to BitIter

23 months agonarcissus-gpu: Explicit flag for host mapped memory
Joshua Simmons [Mon, 17 Jul 2023 18:57:01 +0000 (20:57 +0200)]
narcissus-gpu: Explicit flag for host mapped memory

23 months agonarcissus-gpu: Move allocator into its own module
Joshua Simmons [Mon, 17 Jul 2023 17:01:29 +0000 (19:01 +0200)]
narcissus-gpu: Move allocator into its own module

23 months agonarcissus-gpu: Remove tlsf svg output
Joshua Simmons [Mon, 17 Jul 2023 17:01:00 +0000 (19:01 +0200)]
narcissus-gpu: Remove tlsf svg output

23 months agonarcissus-gpu: Move conversion functions into their own module
Joshua Simmons [Mon, 17 Jul 2023 16:14:23 +0000 (18:14 +0200)]
narcissus-gpu: Move conversion functions into their own module

23 months agonarcissus-gpu: Move vulkan barrier conversions to own module
Joshua Simmons [Mon, 17 Jul 2023 16:03:45 +0000 (18:03 +0200)]
narcissus-gpu: Move vulkan barrier conversions to own module

23 months agonarcissus-gpu: Increase transient buffer size to 8MiB
Joshua Simmons [Mon, 17 Jul 2023 15:48:08 +0000 (17:48 +0200)]
narcissus-gpu: Increase transient buffer size to 8MiB

23 months agonarcissus-gpu: Add `_with_data` helper for transient buffers
Joshua Simmons [Mon, 17 Jul 2023 15:34:59 +0000 (17:34 +0200)]
narcissus-gpu: Add `_with_data` helper for transient buffers

23 months agonarcissus-gpu: Use TLSF to service large transient allocs
Joshua Simmons [Sat, 15 Jul 2023 20:19:22 +0000 (22:19 +0200)]
narcissus-gpu: Use TLSF to service large transient allocs

23 months agonarcissus-gpu: Expand transient buffer support
Joshua Simmons [Sat, 15 Jul 2023 19:35:26 +0000 (21:35 +0200)]
narcissus-gpu: Expand transient buffer support

Use transient buffers as staging area for uploads.
Allow passing transient buffers to more functions.

23 months agonarcissus-gpu: Use a single transient allocator type
Joshua Simmons [Sat, 15 Jul 2023 16:56:58 +0000 (18:56 +0200)]
narcissus-gpu: Use a single transient allocator type

Having a separate pool of buffers for different buffer usages is complex
and wasteful. Instead allocate transient buffers with all possible usage
flags in a single pool.

23 months agonarcissus-gpu: Simplify transfer usage for buffers and images
Joshua Simmons [Sat, 15 Jul 2023 15:56:39 +0000 (17:56 +0200)]
narcissus-gpu: Simplify transfer usage for buffers and images

23 months agonarcissus-gpu: Use arena to avoid heap allocation in begin_rendering
Joshua Simmons [Wed, 12 Jul 2023 22:31:02 +0000 (00:31 +0200)]
narcissus-gpu: Use arena to avoid heap allocation in begin_rendering

23 months agonarcissus: Avoid some useless allocations
Joshua Simmons [Wed, 12 Jul 2023 22:30:22 +0000 (00:30 +0200)]
narcissus: Avoid some useless allocations

23 months agonarcissus-gpu: Move all the magic constants into VULKAN_CONSTANTS
Joshua Simmons [Wed, 12 Jul 2023 21:52:49 +0000 (23:52 +0200)]
narcissus-gpu: Move all the magic constants into VULKAN_CONSTANTS

23 months agonarcissus-gpu: Move libc module into its own file
Joshua Simmons [Wed, 12 Jul 2023 21:52:12 +0000 (23:52 +0200)]
narcissus-gpu: Move libc module into its own file

23 months agonarcissus-gpu: Tidy up transient allocators
Joshua Simmons [Tue, 11 Jul 2023 20:27:23 +0000 (22:27 +0200)]
narcissus-gpu: Tidy up transient allocators

23 months agonarcissus-gpu: Cleanup suboptimal hash set on swapchain destruction
Joshua Simmons [Tue, 11 Jul 2023 19:15:06 +0000 (21:15 +0200)]
narcissus-gpu: Cleanup suboptimal hash set on swapchain destruction

23 months agonarcissus-gpu: Split WSI into its own module
Joshua Simmons [Tue, 11 Jul 2023 19:10:51 +0000 (21:10 +0200)]
narcissus-gpu: Split WSI into its own module

23 months agovulkan-sys: Add device extension enumeration
Joshua Simmons [Tue, 11 Jul 2023 07:25:44 +0000 (09:25 +0200)]
vulkan-sys: Add device extension enumeration

23 months agonarcissus-gpu: Reset transient uniform buffers
Joshua Simmons [Mon, 10 Jul 2023 17:53:14 +0000 (19:53 +0200)]
narcissus-gpu: Reset transient uniform buffers

23 months agonarcissus-gpu: Add transient buffer allocator
Joshua Simmons [Sun, 9 Jul 2023 22:07:48 +0000 (00:07 +0200)]
narcissus-gpu: Add transient buffer allocator

23 months agonarcissus-core: Elide lifetime in svg text fn
Joshua Simmons [Sun, 9 Jul 2023 21:22:03 +0000 (23:22 +0200)]
narcissus-core: Elide lifetime in svg text fn

23 months agonarcissus-core: Use explicit order of operations
Joshua Simmons [Sun, 9 Jul 2023 21:21:17 +0000 (23:21 +0200)]
narcissus-core: Use explicit order of operations

23 months agonarcissus-core: Fix potentially misaligned pointer
Joshua Simmons [Sun, 9 Jul 2023 17:53:59 +0000 (19:53 +0200)]
narcissus-core: Fix potentially misaligned pointer

If `new_page_size` was not aligned to the size of PageFooter, then we
could create misaligned references to the PageFooter.

23 months agonarcissus-core: Improve align_offset
Joshua Simmons [Sun, 9 Jul 2023 17:50:09 +0000 (19:50 +0200)]
narcissus-core: Improve align_offset

23 months agonarcissus-gpu: Use explict `vk::WHOLE_SIZE` const
Joshua Simmons [Tue, 13 Jun 2023 17:37:22 +0000 (19:37 +0200)]
narcissus-gpu: Use explict `vk::WHOLE_SIZE` const

23 months agonarcissus-gpu: Lock once when writing descriptors
Joshua Simmons [Sun, 11 Jun 2023 09:12:48 +0000 (11:12 +0200)]
narcissus-gpu: Lock once when writing descriptors

23 months agonarcissus-gpu: Improve TLSF alignment handling
Joshua Simmons [Sun, 11 Jun 2023 08:02:32 +0000 (10:02 +0200)]
narcissus-gpu: Improve TLSF alignment handling

Adjust bucket sizes to ensure all allocations are aligned on a 16b
boundary.

Simplify and derive some constants rather than using magical values.

Change signature of `search_non_empty_bin` since the starting bin isn't
required anywhere else.

23 months agonarcissus-core: Add extra svg helpers
Joshua Simmons [Sun, 11 Jun 2023 07:58:06 +0000 (09:58 +0200)]
narcissus-core: Add extra svg helpers

23 months agonarcissus-core: Add title to svg rect elements
Joshua Simmons [Wed, 7 Jun 2023 21:37:52 +0000 (23:37 +0200)]
narcissus-core: Add title to svg rect elements

23 months agonarcissus-core: Add `lower_bound` and `upper_bound`
Joshua Simmons [Wed, 7 Jun 2023 21:34:43 +0000 (23:34 +0200)]
narcissus-core: Add `lower_bound` and `upper_bound`

Calculates the range of values that will be attributed to a given
bin.

2 years agonarcissus-gpu: Fix slice size mismatch
Joshua Simmons [Sat, 1 Jul 2023 09:13:23 +0000 (11:13 +0200)]
narcissus-gpu: Fix slice size mismatch

It's possible that returned memory is larger than the requested size, so
we need to truncate the destination slice to match the input data.

2 years agostb_truetype: Fix clippy lints
Joshua Simmons [Sun, 4 Jun 2023 09:07:08 +0000 (11:07 +0200)]
stb_truetype: Fix clippy lints

2 years agonarcissus-core: Fix clippy lints
Joshua Simmons [Sun, 4 Jun 2023 09:06:47 +0000 (11:06 +0200)]
narcissus-core: Fix clippy lints

2 years agonarcissus: Fix clippy lints
Joshua Simmons [Sun, 4 Jun 2023 09:06:14 +0000 (11:06 +0200)]
narcissus: Fix clippy lints

2 years agonarcissus-math: Use tan_pi for projection matrix
Joshua Simmons [Sun, 4 Jun 2023 08:54:51 +0000 (10:54 +0200)]
narcissus-math: Use tan_pi for projection matrix

2 years agonarcissus-core: Add integer widening helper trait.
Joshua Simmons [Sun, 4 Jun 2023 08:24:21 +0000 (10:24 +0200)]
narcissus-core: Add integer widening helper trait.

2 years agonarcissus-gpu: Document block splitting behavior
Joshua Simmons [Mon, 29 May 2023 18:09:24 +0000 (20:09 +0200)]
narcissus-gpu: Document block splitting behavior

A relatively subtle part of the TLSF paper is the choice of size when
splitting blocks as part of an allocation. Add a short comment and test.

2 years agonarcissus-gpu: Add TLSF Allocator
Joshua Simmons [Mon, 29 May 2023 07:10:03 +0000 (09:10 +0200)]
narcissus-gpu: Add TLSF Allocator

2 years agocore: Add helper for linear-log binning
Joshua Simmons [Mon, 29 May 2023 07:05:36 +0000 (09:05 +0200)]
core: Add helper for linear-log binning

A method for sub-dividing a range into bins that is fast to compute and
minimizes fragmentation.

See Paul Khuong's [linear-log bucketing](https://pvk.ca/Blog/2015/06/27/linear-log-bucketing-fast-versatile-simple/)

2 years agocore: Fix wrapping assert when seeding Pcg64
Joshua Simmons [Mon, 29 May 2023 07:04:39 +0000 (09:04 +0200)]
core: Fix wrapping assert when seeding Pcg64

2 years agoRevert "build: Enable debug info compression"
Joshua Simmons [Sun, 23 Apr 2023 11:09:18 +0000 (13:09 +0200)]
Revert "build: Enable debug info compression"

This reverts commit e915e8e8494a6a8bfb11387259bc67b8dec5fb29.

2 years agocore: Add svg debug output helper
Joshua Simmons [Thu, 20 Apr 2023 20:28:24 +0000 (22:28 +0200)]
core: Add svg debug output helper

2 years agomisc: Improve cstr! macro implementation
Joshua Simmons [Thu, 20 Apr 2023 19:22:20 +0000 (21:22 +0200)]
misc: Improve cstr! macro implementation

2 years agobuild: Enable debug info compression
Joshua Simmons [Sat, 15 Apr 2023 10:29:46 +0000 (12:29 +0200)]
build: Enable debug info compression

This is not really useful since our binary is so small, and just makes
linking slower. But it seemed cool so I wanted to turn it on.

2 years agonarcissus-gpu: Add support for dedicated allocations
Joshua Simmons [Wed, 15 Mar 2023 22:58:28 +0000 (23:58 +0100)]
narcissus-gpu: Add support for dedicated allocations

2 years agovulkan-sys: Add dedicated allocation structs
Joshua Simmons [Wed, 15 Mar 2023 21:57:30 +0000 (22:57 +0100)]
vulkan-sys: Add dedicated allocation structs

2 years agoUse uniform std430 layout and row_major attribute
Joshua Simmons [Sun, 12 Mar 2023 11:35:49 +0000 (12:35 +0100)]
Use uniform std430 layout and row_major attribute

2 years agoTidy text shader
Joshua Simmons [Sat, 11 Mar 2023 08:55:36 +0000 (09:55 +0100)]
Tidy text shader

2 years agoImprove cos_pi polynomial
Joshua Simmons [Sat, 4 Mar 2023 14:28:34 +0000 (15:28 +0100)]
Improve cos_pi polynomial

Optimising for absolute error rather than relative error performs
slightly better for the cos_pi polynomial.

2 years agoFix doc comments
Joshua Simmons [Sat, 4 Mar 2023 13:11:49 +0000 (14:11 +0100)]
Fix doc comments

2 years agoComment tidying
Joshua Simmons [Sat, 4 Mar 2023 12:39:21 +0000 (13:39 +0100)]
Comment tidying

2 years agoImprove comment formatting
Joshua Simmons [Sat, 4 Mar 2023 09:51:59 +0000 (10:51 +0100)]
Improve comment formatting

2 years agoFix redundant lifetime annotation clippy lint
Joshua Simmons [Fri, 3 Mar 2023 22:30:50 +0000 (23:30 +0100)]
Fix redundant lifetime annotation clippy lint

2 years agoFix clippy lint
Joshua Simmons [Fri, 3 Mar 2023 22:30:11 +0000 (23:30 +0100)]
Fix clippy lint

It doesn't like it when you implement Ord and Eq without also
implementing PartialOrd and PartialEq manually.

2 years agoImprove font cache
Joshua Simmons [Fri, 3 Mar 2023 22:28:03 +0000 (23:28 +0100)]
Improve font cache

Don't do so much work on kerning.
Clean and simplify up cache API.
Improve comments a little.

2 years agoAdd `select` and `shuffle` functions to `Pcg64`
Joshua Simmons [Wed, 1 Mar 2023 19:25:09 +0000 (20:25 +0100)]
Add `select` and `shuffle` functions to `Pcg64`

2 years agoClean up main
Joshua Simmons [Tue, 28 Feb 2023 21:56:38 +0000 (22:56 +0100)]
Clean up main

2 years agoClean up font cache
Joshua Simmons [Tue, 28 Feb 2023 21:56:20 +0000 (22:56 +0100)]
Clean up font cache

2 years agoImprove font cache
Joshua Simmons [Tue, 28 Feb 2023 20:24:05 +0000 (21:24 +0100)]
Improve font cache

Always write the information for touched glyphs every frame, to try and
avoid accidently depending on those being stable across atlas updates.

When the font cache is out of space, perform an emergency repack,
recreating the atlas with only the glyphs touched in the current frame.

This should address both changing requirements on the font cache over
time from the application, as well as inefficient packing from
incrementally building the atlas.

2 years agoReformat imports
Joshua Simmons [Mon, 27 Feb 2023 20:19:15 +0000 (21:19 +0100)]
Reformat imports

2 years agoMove a bunch of helper code out of main.rs
Joshua Simmons [Mon, 27 Feb 2023 20:15:43 +0000 (21:15 +0100)]
Move a bunch of helper code out of main.rs

Re-organize the pipeline structures as well.