]> git.nega.tv - josh/narcissus/log
josh/narcissus
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.

2 years agoCache glyphs instead of re-drawing
Joshua Simmons [Mon, 27 Feb 2023 19:18:48 +0000 (20:18 +0100)]
Cache glyphs instead of re-drawing

2 years agoSmall improvements for font handling
Joshua Simmons [Sun, 26 Feb 2023 22:43:00 +0000 (23:43 +0100)]
Small improvements for font handling

Automatically determine whether to use oversampling.
Expand glyph capacity slightly.
Draw a range of font sizes.

2 years agoRe-use glyph cache internal structures
Joshua Simmons [Sun, 26 Feb 2023 20:02:51 +0000 (21:02 +0100)]
Re-use glyph cache internal structures

2 years agoAdd support for basic text drawing
Joshua Simmons [Sun, 26 Feb 2023 18:23:07 +0000 (19:23 +0100)]
Add support for basic text drawing

Move pipelines out of main.rs and into their own module.
Add new text pipeline.
Add new text shader.
Update main.rs to draw nice text. :)

2 years agoFirst pass on narcissus-font library
Joshua Simmons [Sun, 26 Feb 2023 18:21:45 +0000 (19:21 +0100)]
First pass on narcissus-font library

2 years agoImprove and expand stb_truetype wrappers
Joshua Simmons [Sun, 26 Feb 2023 18:20:29 +0000 (19:20 +0100)]
Improve and expand stb_truetype wrappers

2 years agoAdd FiniteF32 and FiniteF64 wrappers
Joshua Simmons [Sun, 26 Feb 2023 18:17:50 +0000 (19:17 +0100)]
Add FiniteF32 and FiniteF64 wrappers

Ensures at creation time that the floating point values are neither NaN
nor infinities, so that we can implement `Hash`, `Eq` and `Ord` traits.

2 years agoImprove Box's MaybeUninit helpers
Joshua Simmons [Sun, 26 Feb 2023 18:16:59 +0000 (19:16 +0100)]
Improve Box's MaybeUninit helpers

2 years agoAdd support for `R8_UNORM` and `R8_SRGB` formats
Joshua Simmons [Sun, 26 Feb 2023 18:15:46 +0000 (19:15 +0100)]
Add support for `R8_UNORM` and `R8_SRGB` formats

2 years agoAdd Noto Sans Japanese font
Joshua Simmons [Sun, 26 Feb 2023 18:14:59 +0000 (19:14 +0100)]
Add Noto Sans Japanese font

2 years agoMake rect_height_compare a stable sort
Joshua Simmons [Sun, 26 Feb 2023 09:47:01 +0000 (10:47 +0100)]
Make rect_height_compare a stable sort

stb_rect_pack was producing different results on different platforms due to differing qsort implementations.

This change uses the existing was_packed field to make the sort stable.

2 years agoRemove integer log2 functions
Joshua Simmons [Sat, 25 Feb 2023 19:13:52 +0000 (20:13 +0100)]
Remove integer log2 functions

These have been stabilized as the ilog2 family in the standard library.

2 years agoAdd roboto font
Joshua Simmons [Sat, 25 Feb 2023 19:12:07 +0000 (20:12 +0100)]
Add roboto font

2 years agoAdd debug info generation to stb build scripts
Joshua Simmons [Sat, 25 Feb 2023 19:11:07 +0000 (20:11 +0100)]
Add debug info generation to stb build scripts

2 years agoRe-organize directory structure
Joshua Simmons [Thu, 23 Feb 2023 11:49:40 +0000 (12:49 +0100)]
Re-organize directory structure

2 years agoRemove blake3, F to pay respekts
Joshua Simmons [Sun, 19 Feb 2023 14:17:21 +0000 (15:17 +0100)]
Remove blake3, F to pay respekts

2 years agoFix doctests
Joshua Simmons [Sat, 18 Feb 2023 13:45:07 +0000 (14:45 +0100)]
Fix doctests

2 years agoFix clippy lint about struct name
Joshua Simmons [Sat, 18 Feb 2023 13:28:11 +0000 (14:28 +0100)]
Fix clippy lint about struct name

2 years agoAdd stripped down blake3 implementation
Joshua Simmons [Sat, 18 Feb 2023 13:26:57 +0000 (14:26 +0100)]
Add stripped down blake3 implementation

Upstream URL: https://github.com/BLAKE3-team/BLAKE3/

2 years agoCopy more unstable slice functions from std
Joshua Simmons [Sat, 18 Feb 2023 13:23:51 +0000 (14:23 +0100)]
Copy more unstable slice functions from std

Add `array_chunks` and `array_chunks_mut`.
Add `split_array_ref` and `split_array_mut`.
Add `rsplit_array_ref` and `rsplit_array_mut`.
Add `as_chunks` and `as_chunks_mut`.

2 years agoAdd Clone impl to FixedVec
Joshua Simmons [Sat, 18 Feb 2023 13:22:35 +0000 (14:22 +0100)]
Add Clone impl to FixedVec

2 years agoRe-arrange depth barrier
Joshua Simmons [Tue, 7 Feb 2023 22:12:53 +0000 (23:12 +0100)]
Re-arrange depth barrier

Avoid creating and submitting an extra command buffer when we don't
really need to.

2 years agoTransition depth attachment after creation
Joshua Simmons [Thu, 2 Feb 2023 09:34:23 +0000 (10:34 +0100)]
Transition depth attachment after creation

2 years agoFix new clippy lints
Joshua Simmons [Sat, 28 Jan 2023 10:01:31 +0000 (11:01 +0100)]
Fix new clippy lints

Mostly switching to inline formatting.

2 years agoSimplify cmd buffer API using interior mutability
Joshua Simmons [Sat, 28 Jan 2023 09:58:14 +0000 (10:58 +0100)]
Simplify cmd buffer API using interior mutability

This avoids requiring a mutable borrow on the thread token, which lets
us store that token inside the cmd buffer object without ergonomic
issues.

2 years agoHook up compute pipeline creation
Joshua Simmons [Sun, 4 Dec 2022 13:40:51 +0000 (14:40 +0100)]
Hook up compute pipeline creation

2 years agoTidy embedded spir-v
Joshua Simmons [Sat, 3 Dec 2022 20:17:03 +0000 (21:17 +0100)]
Tidy embedded spir-v

2 years agoAdd compute shader dispatch command
Joshua Simmons [Sat, 3 Dec 2022 20:05:58 +0000 (21:05 +0100)]
Add compute shader dispatch command

2 years agoAdd blending and blitting
Joshua Simmons [Fri, 2 Dec 2022 21:24:51 +0000 (22:24 +0100)]
Add blending and blitting

2 years agoAdd `create_buffer_with_data` helper
Joshua Simmons [Fri, 2 Dec 2022 21:24:27 +0000 (22:24 +0100)]
Add `create_buffer_with_data` helper

2 years agoAdd quantization helpers
Joshua Simmons [Fri, 2 Dec 2022 21:17:42 +0000 (22:17 +0100)]
Add quantization helpers

2 years agoAdd include_bytes variant with custom alignment
Joshua Simmons [Fri, 2 Dec 2022 21:16:28 +0000 (22:16 +0100)]
Add include_bytes variant with custom alignment

2 years agoRemove old stb_image dependency from core
Joshua Simmons [Fri, 2 Dec 2022 21:15:50 +0000 (22:15 +0100)]
Remove old stb_image dependency from core

2 years agoExpand stb_truetype wrapper
Joshua Simmons [Fri, 2 Dec 2022 21:13:34 +0000 (22:13 +0100)]
Expand stb_truetype wrapper

2 years agoAdd newlines to the end of C files
Joshua Simmons [Wed, 23 Nov 2022 21:51:51 +0000 (22:51 +0100)]
Add newlines to the end of C files

2 years agoAdd stb_truetype wrapper
Joshua Simmons [Wed, 23 Nov 2022 21:23:28 +0000 (22:23 +0100)]
Add stb_truetype wrapper

2 years agoRename MemoryLocation enum variants
Joshua Simmons [Sun, 20 Nov 2022 22:46:13 +0000 (23:46 +0100)]
Rename MemoryLocation enum variants

Try to be more explicit about what you're getting with each option.

2 years agoRemove empty test
Joshua Simmons [Sun, 20 Nov 2022 16:40:49 +0000 (17:40 +0100)]
Remove empty test

2 years agoMove image stuff into its own crate
Joshua Simmons [Sun, 20 Nov 2022 16:35:01 +0000 (17:35 +0100)]
Move image stuff into its own crate

2 years agoMove frame counter out of vulkan module
Joshua Simmons [Sat, 19 Nov 2022 23:32:55 +0000 (00:32 +0100)]
Move frame counter out of vulkan module