Commit graph

58 commits

Author SHA1 Message Date
catbot
9ef554b97e perf(window): drop dead present-mode queries from swapchain recreate (#45)
CreateSwapchain unconditionally used VK_PRESENT_MODE_FIFO_KHR, but still
ran two vkGetPhysicalDeviceSurfacePresentModesKHR calls plus a heap-allocated
std::vector to enumerate present modes that were never consulted. Delete
them and assign the constant directly.

compositeAlpha is a surface property that does not change across swapchain
recreation, so select it once at construction instead of re-deriving it
(with another heap-allocated vector) on every resize configure. The
vkQueueWaitIdle before recreation is left intact as required.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 15:28:35 +00:00
catbot
41d99890c1 perf(window): ring buffer for CRAFTER_TIMING frame times (#44)
Replace the std::vector<nanoseconds> frameTimes plus
erase(begin()) with a fixed-size std::array ring buffer (head +
count). The previous code memmoved ~99 elements left every frame once
the window filled. LogTiming computes order-independent sum/avg/min/max,
so the ring's write order is irrelevant to the reported stats.

Behind CRAFTER_TIMING only; shipping builds are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 15:25:22 +00:00
catbot
419730f46b feat(input): wire native mouse-wheel scroll on Wayland + Win32, normalize all backends to ±1/detent (#32)
Window::onMouseScroll now fires on every backend and speaks one unit:
signed whole detents packed in the uint32 payload, +1 = wheel down
(DOM deltaY sign).

- Wayland: implement the previously-stubbed PointerListenerHandleAxis —
  vertical axis only, wl_fixed_to_double / 15 (libinput's units-per-
  detent), sub-detent remainder accumulated and reset on pointer leave.
- Win32: add the missing WM_MOUSEWHEEL case — -GET_WHEEL_DELTA_WPARAM /
  WHEEL_DELTA with a remainder accumulator for free-spinning wheels.
- DOM: dom-env.js normalizes WheelEvent.deltaY per deltaMode (100px /
  3 lines / 1 page per detent) with the same remainder scheme, so wasm
  delivers the identical unit instead of raw browser-specific deltas.
- Document the contract on Window::onMouseScroll.
- tests/MouseScroll: compositor-free regression test driving the
  Wayland axis handler directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 15:02:28 +00:00
catbot
cac433ee09 fix(vulkan): clear startup validation errors on native triangle
Two Vulkan validation errors fired on startup of every native (Vulkan)
example, reported in #5:

1. vkCreateDevice enabledLayerCount != 0. Device layers are deprecated
   and ignored since Vulkan 1.0; passing them is a spec violation
   (VUID-VkDeviceCreateInfo-enabledLayerCount-12384). The device-layer
   enumeration/match block in Device::Initialize is removed and
   enabledLayerCount is pinned to 0 — layers are enabled at the instance
   only.

2. vkQueueSubmit layout transition on a presentable image that "has not
   been acquired". StartInit() and RecreateSwapchainAndImages() eagerly
   transitioned every swapchain image UNDEFINED -> PRESENT_SRC_KHR before
   any vkAcquireNextImageKHR, which the spec forbids (a presentable image
   may only be touched after acquire). Those pre-transitions are removed.
   Each image's first layout transition now happens lazily in Render(),
   after acquire, from UNDEFINED; subsequent frames transition from
   PRESENT_SRC_KHR. A per-image `imageInitialised` flag (reset in
   CreateSwapchain) selects the correct oldLayout.

Verified under sway (headless, GPU renderer) + VK_LAYER_KHRONOS_validation:
the original code reproduces both errors on HelloUI; the fixed build emits
zero validation messages across initial render and swapchain recreation.

Resolves #5

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:59:10 +00:00
909a9b46d2 wasm fixes 2026-05-26 22:50:49 +02:00
dedf6b0467 webgpu support 2026-05-18 04:58:52 +02:00
5352ef69a2 browser DOM support 2026-05-18 02:07:48 +02:00
ac2eb7fb0a new input system 2026-05-12 00:24:48 +02:00
b3db40ebec update 2026-05-05 23:49:29 +02:00
1f5697326c UI rewrite 3rd attempt 2026-05-02 21:08:20 +02:00
c9fd1b1585 animated example 2026-05-02 00:03:24 +02:00
216972e73a new UI system 2026-05-01 23:35:37 +02:00
c9ebd448f9 update 2026-04-16 23:03:24 +02:00
3fcea6a3d7 writing ui descriptors 2026-04-10 22:26:15 +02:00
f8e142fb06 descriptor heap rewrite 2026-04-05 22:53:59 +02:00
22b8af7bfc update 2026-04-02 16:52:10 +02:00
477b7dd087 F16 rendering 2026-04-01 18:43:18 +02:00
bc97c13a0b rendertarget multi frame rewrite complete 2026-03-13 01:06:55 +01:00
2b22c16ce7 rendertarget multi frame rewrite 2026-03-12 21:13:53 +01:00
7f46ac13fa rendering improvements 2026-03-12 01:07:46 +01:00
LancenShield
38c8d57146 Added VK_CONTROL for same reason as VK_SHIFT. 2026-03-09 22:34:14 -05:00
103a35ee40 vk shift crash 2026-03-10 03:24:01 +01:00
123bb31f50 initalization 2026-03-10 03:05:10 +01:00
accc9ef8e7 typo 2026-03-10 02:47:28 +01:00
6effe88733 color format fix 2026-03-09 23:21:24 +01:00
cfebc896db color format fix 2026-03-09 23:21:10 +01:00
486775925b color format fix 2026-03-09 23:12:31 +01:00
1ff646ca01 color format fix 2026-03-09 23:05:32 +01:00
5fc7423387 time fix 2026-03-09 22:15:36 +01:00
3f18b3ae55 time fix 2026-03-09 22:12:40 +01:00
ef199b180e mouse fix 2026-03-09 21:50:24 +01:00
337cf1e43b wayland no refresh 2026-03-09 21:43:25 +01:00
6d031bacbe wayland no refresh 2026-03-09 21:32:16 +01:00
33312a5d01 crash fix 2026-03-09 21:16:14 +01:00
be9e3ceff2 crash fix 2026-03-09 21:15:15 +01:00
c26c7c2315 crash fix 2026-03-09 21:14:53 +01:00
91dbe7d8e9 crash fix 2026-03-09 21:14:10 +01:00
3400e56340 crash fix 2026-03-09 21:07:52 +01:00
faf94775df crash fix 2026-03-09 21:05:21 +01:00
c8ab2bf22e crash fix 2026-03-09 21:00:58 +01:00
fc8abaa38e crash fix 2026-03-09 20:59:24 +01:00
d661c88ee2 cleaned up renderer 2026-03-09 20:10:19 +01:00
d0cc3ad16a the great text and type rewrite 2025-12-30 23:28:38 +01:00
c84504331b scaling 2025-12-29 18:56:06 +01:00
3d40256bde rendering element rewrite 2025-12-28 00:05:03 +01:00
615d90c36f draw rect optimization 2025-11-26 23:36:08 +01:00
6df6355ba7 dirty rect 2025-11-26 20:41:54 +01:00
285e8c9182 optimization 2025-11-26 20:15:25 +01:00
9bb36c990d selective clearing 2025-11-26 18:48:58 +01:00
b41ec7960c timing 2025-11-25 23:36:43 +01:00