Commit graph

47 commits

Author SHA1 Message Date
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
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
1f5697326c UI rewrite 3rd attempt 2026-05-02 21:08:20 +02:00
216972e73a new UI system 2026-05-01 23:35:37 +02:00
c9ebd448f9 update 2026-04-16 23:03:24 +02:00
f8e142fb06 descriptor heap rewrite 2026-04-05 22:53:59 +02:00
22b8af7bfc update 2026-04-02 16:52:10 +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
789bb307d5 render target improvements 2026-03-10 22:32:50 +01:00
d661c88ee2 cleaned up renderer 2026-03-09 20:10:19 +01:00
72bf6c83e1 windows build fix 2026-03-02 23:53:13 +01:00
732200a461 windows build fixes 2026-03-01 18:03:07 +01:00
b5e69c90fa Win32 vulkan window 2026-02-24 02:32:37 +01:00
415e523a45 runtime pipeline 2026-02-22 00:46:38 +01:00
d1b8e45fb6 new descriptor layout 2 2026-02-03 21:03:11 +01:00
74832c6824 templated pipeline 2026-01-31 21:08:42 +01:00
db1616ff0e vulkan animation 2026-01-30 00:09:37 +01:00
5e3a7738ed fixed descriptors 2026-01-29 23:31:56 +01:00
96b5d1a299 vulkan triangle 2026-01-29 19:18:47 +01:00
8b2fd773b1 working RT 2026-01-29 02:05:18 +01:00
e4e7c66808 RT descriptors 2026-01-29 01:31:17 +01:00
cfb43257a0 vulkan window 2026-01-27 22:34:24 +01:00
d0cc3ad16a the great text and type rewrite 2025-12-30 23:28:38 +01:00
d26d71ec91 fixes 2025-12-29 22:21:22 +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
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
4baeca1603 better timing 2025-11-25 23:29:48 +01:00
c3b8761102 actually sensible classes 2025-11-25 20:30:54 +01:00
1c4f476f18 oh yeah its rewrite time 2025-11-25 19:43:40 +01:00
02a6a64c56 merged uielement 2025-11-25 18:52:32 +01:00
3534f2e782 moved width height to window 2025-11-25 02:21:06 +01:00
e4dda0861c animations 2025-11-24 03:38:20 +01:00
721ff8f42f wayland rewrite complete 2025-11-24 01:47:49 +01:00
5ff43e240c integer math 2025-11-23 04:04:53 +01:00
4428cfe12c rewrite time 2025-11-22 20:58:42 +01:00
4bb7219ccf semi working wayland 2025-11-17 00:44:45 +01:00
1155e67d63 new structure 2025-11-16 15:32:11 +01:00
Renamed from src/module/Crafter.Graphics-Window.cppm (Browse further)