]> git.nega.tv - josh/narcissus/log
josh/narcissus
14 months agonarcissus-maths: Small cleanup of perlin noise
Joshua Simmons [Fri, 3 May 2024 06:35:18 +0000 (08:35 +0200)]
narcissus-maths: Small cleanup of perlin noise

14 months agonarcissus-core: Fix out-of-bounds slice access
Joshua Simmons [Thu, 2 May 2024 20:58:22 +0000 (22:58 +0200)]
narcissus-core: Fix out-of-bounds slice access

14 months agoshark: Add basic camera shake
Joshua Simmons [Thu, 2 May 2024 20:33:57 +0000 (22:33 +0200)]
shark: Add basic camera shake

14 months agonarcissus-maths: Add perlin noise functions
Joshua Simmons [Thu, 2 May 2024 20:32:43 +0000 (22:32 +0200)]
narcissus-maths: Add perlin noise functions

Taken from `stb_perlin.h` by Sean Barrett et al

14 months agoshark: Only write two lines of text
Joshua Simmons [Wed, 1 May 2024 18:54:54 +0000 (20:54 +0200)]
shark: Only write two lines of text

14 months agonarcissus-gpu: Remove accidentally added sleep
Joshua Simmons [Wed, 1 May 2024 18:48:29 +0000 (20:48 +0200)]
narcissus-gpu: Remove accidentally added sleep

When debugging goes too far!

14 months agoshark: Dampen camera movement
Joshua Simmons [Wed, 1 May 2024 16:17:57 +0000 (18:17 +0200)]
shark: Dampen camera movement

14 months agoshark: Fix parameterization of top-down camera
Joshua Simmons [Wed, 1 May 2024 14:55:53 +0000 (16:55 +0200)]
shark: Fix parameterization of top-down camera

Using the camera height and camera angle to define a camera is
unfortunate as those to variables are tightly coupled; Adjusting the
camera height requires a camera angle adjustment to maintain the same
distance from the camera, and visa-versa.

Instead, calculate the height from the desired camera distance so these
variables can be changed independently.

14 months agonarcissus-maths: Add `lerp` for scalars and vectors
Joshua Simmons [Wed, 1 May 2024 14:55:10 +0000 (16:55 +0200)]
narcissus-maths: Add `lerp` for scalars and vectors

14 months agonarcissus-maths: Add `sin_pi_f32` and `cos_pi_f32`
Joshua Simmons [Wed, 1 May 2024 14:53:00 +0000 (16:53 +0200)]
narcissus-maths: Add `sin_pi_f32` and `cos_pi_f32`

Trivial implementation for now.

14 months agoshark: Add drivable shark
Joshua Simmons [Wed, 1 May 2024 08:26:59 +0000 (10:26 +0200)]
shark: Add drivable shark

14 months agosdl2-sys: Add repeat flag to key events
Joshua Simmons [Wed, 1 May 2024 07:29:44 +0000 (09:29 +0200)]
sdl2-sys: Add repeat flag to key events

14 months agoshark: Remove unused import
Joshua Simmons [Mon, 29 Apr 2024 18:13:29 +0000 (20:13 +0200)]
shark: Remove unused import

14 months agoshark-shaders: Remove unnecessary lifetime annotation
Joshua Simmons [Mon, 29 Apr 2024 18:12:52 +0000 (20:12 +0200)]
shark-shaders: Remove unnecessary lifetime annotation

14 months agoshark: Remove buffer test code
Joshua Simmons [Sun, 28 Apr 2024 16:30:41 +0000 (18:30 +0200)]
shark: Remove buffer test code

14 months agoshark-shaders: Use old name for glslang
Joshua Simmons [Sun, 28 Apr 2024 15:24:48 +0000 (17:24 +0200)]
shark-shaders: Use old name for glslang

Ubuntu image used by CI is old and doesn't have the command under the
new name. So just use `glslangValidator` instead.

14 months agogithub: Fix name for glslang package in ubuntu
Joshua Simmons [Sun, 28 Apr 2024 15:18:56 +0000 (17:18 +0200)]
github: Fix name for glslang package in ubuntu

14 months agogithub: Add glslang to github actions image
Joshua Simmons [Sun, 28 Apr 2024 15:16:07 +0000 (17:16 +0200)]
github: Add glslang to github actions image

14 months agoshark: Move shaders into their own crate
Joshua Simmons [Sun, 28 Apr 2024 15:08:27 +0000 (17:08 +0200)]
shark: Move shaders into their own crate

We can build them with cargo and a build script.

14 months agonarcissus: Remove cstr macro
Joshua Simmons [Sun, 28 Apr 2024 06:30:37 +0000 (08:30 +0200)]
narcissus: Remove cstr macro

We've got builtin functionality now!

14 months agonarcissus-gpu: Fix minor sync issues
Joshua Simmons [Sat, 27 Apr 2024 16:55:22 +0000 (18:55 +0200)]
narcissus-gpu: Fix minor sync issues

Resolve incorrect arguments to various presentation related barriers.

14 months agoshark: Remove duplicate image copy
Joshua Simmons [Sat, 27 Apr 2024 14:55:22 +0000 (16:55 +0200)]
shark: Remove duplicate image copy

14 months agonarcissus-gpu: Use VK_EXT_swapchain_maintenance1
Joshua Simmons [Sat, 6 Apr 2024 07:44:59 +0000 (09:44 +0200)]
narcissus-gpu: Use VK_EXT_swapchain_maintenance1

Fixes the broken way we were handling presentation semaphore recycling
as well as swapchain destruction. When VK_EXT_swapchain_maintenance1 is
unavailable, fallback to a fixed frame delay.

Remove the unused delay queue structure.

14 months agovulkan-sys: Add `VK_EXT_[swapchain,surface]_maintenance1`
Joshua Simmons [Fri, 5 Apr 2024 22:42:18 +0000 (00:42 +0200)]
vulkan-sys: Add `VK_EXT_[swapchain,surface]_maintenance1`

14 months agovulkan-sys: Add `VK_KHR_get_surface_capabilities2`
Joshua Simmons [Fri, 5 Apr 2024 22:40:21 +0000 (00:40 +0200)]
vulkan-sys: Add `VK_KHR_get_surface_capabilities2`

14 months agovulkan-sys: Add wrapper for `get_fence_status`
Joshua Simmons [Fri, 5 Apr 2024 22:21:41 +0000 (00:21 +0200)]
vulkan-sys: Add wrapper for `get_fence_status`

14 months agovulkan-sys: Use &CStr directly in wrapper function
Joshua Simmons [Fri, 5 Apr 2024 22:20:21 +0000 (00:20 +0200)]
vulkan-sys: Use &CStr directly in wrapper function

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