Crafter.Graphics/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf e1b36b9257
fix(wayland): round a configured size's pixels half away from zero, and work both sizes out exactly from the scale's 120ths
A size the compositor configured became the buffers' size as
ceil(size * scale), in float. The protocol, as bundled in
lib/fractional-scale-v1.h, has the buffer's size as the surface's
times the scale, and says that "For toplevel surfaces, the size is
rounded halfway away from zero": wherever the product's fraction is
below a half, rounding up gave a pixel more than that. 89111e0 left
this as the rest of #201, and the comment on #165 asks for it. And the
sum was done in float, with the scale as a float, which a scale that
is no whole number of eighths is not exactly: a product that is a
whole number of pixels could come out just above it, and rounding up
then went a pixel past it, as 50 at 1.2 came to 61. The other way, the
surface's size for a window the application sized,
ceil(pixels / scale), had the same trouble: 171 pixels at 2.85 came to
61, where they are 60.

Window: ScaledPixels rounds half away from zero, and both it and
SurfaceLength work in 64-bit integers from the 120ths the compositor
sends: MatchSizesToScale from those of the scale the window draws at,
which a new member, drawnScale_, keeps beside scale, as they are not
preferredScale while a new scale waits, and the tests of whether a
scale gives the window new pixels from preferredScale. SurfaceLength
still rounds up, so that the surface of a window the application sized
is no smaller than its pixels at the scale. ScaledPixels never gives
less than one pixel: below a scale of a half a length of one rounds to
none, where rounding up gave one, and a swapchain cannot be made 0
wide or high. Nor more than the largest 32-bit value, which a
configured length can pass at a scale above 2 (2^30 at 4 comes to
2^32), where the cast to 32 bits would wrap it, to none in that case;
and SurfaceLength stops at the largest int32, which a length worked
out from 32-bit pixels can pass. The configure listener's test for a
configure at the size the window has uses the same sum, so a
configured size the window took is found to be the one it has, and so
do the tests, in TakeDeferredSize after a present and in
MatchSizesToScale, of whether a size or a scale comes to new pixels;
and the listener tells that no new scale waits from the 120ths,
preferredScale against drawnScale_, where 61f2698 compared the two
scales as floats.

So 392x796 at 2.85, the size in #201's phone trace, takes 1117x2269
pixels where it took 1118x2269. A window of 320x240 pixels at 1.75,
shown at 183x138, takes 320x242 for a configure of that size, where it
took 321x242.

Docs: the consumer notes say how a configured size's pixels are
rounded, and that the surface of a window the application sized is
rounded up; the guide's gotchas, that both are worked out in integers
from the 120ths; both, that the pixels are never fewer than one nor
more than the largest 32-bit value, and that the surface's length
never passes the largest int32. The gotcha and the interface's comment
on logicalWidth give, as a reason not to work the surface's size back
from the pixels, that a configured size worked back from them lands
above itself wherever its product with the scale is not whole. That
held while both roundings went up; now it lands above where that
product has a fraction of a half or more, short of the 32-bit limits
the two sums stop at, and both say so.

Tests: ConfigureResize takes the new numbers in its cases of #201's
trace and of the window at 1.75, and adds the protocol's own example
(100x50 at 1.5 is 150x75), halves that go up (853x101 at 1.5 is
1280x152), fractions below a half that go down (101x853 at 1.25 is
126x1066, which rounding up made 127x1067), and whole numbers the sum
in float came out above (50x25 at 1.2 is 60x30, which came to 61x31),
each acknowledged in the listener when it is configured again; a
configure of 1x300 at 0.4, whose width rounds to no pixel, taken as
1x120; a configure of 2^30x300 at 4, whose width is the largest 32-bit
value, and pixels of that value at a half, whose surface is the
largest int32 wide; and a window of 342x171 pixels at 2.85, whose
surface is 120x60, which came to 121x61. And it works configured sizes
into pixels and back with a window's own MatchSizesToScale: 853x101 at
1.5 comes back as 854x102, and 392x796 at 2.85 as 392x797.
ResizeViewport works the pixels and the surface's size out as the
window now does, and its comments say which way each is rounded.
2026-11-27 15:41:23 +01:00
..
BLASBuildOptions feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
ConfigureResize fix(wayland): round a configured size's pixels half away from zero, and work both sizes out exactly from the scale's 120ths 2026-11-27 15:41:23 +01:00
DebugMessengerSeverity feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
DeferredDeletion feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
DeletionQueueThreads feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
DescriptorHeapLayout fix(descriptor-heap): round the buffer region up, align the reserved range for buffers too, and never size a heap at zero 2026-10-31 16:06:44 +01:00
DeviceFeatures feat(device): applications ask for the device features their shaders use 2026-10-31 06:40:02 +01:00
DeviceSelection feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
ExampleShaders fix(rt): split Sponza's combined image sampler into a heap texture and sampler 2026-10-31 08:25:52 +01:00
FeatureRequests fix(device): stop requiring samplerAnisotropy, and remove SamplerVulkan, the class it was required for 2026-11-26 09:37:44 +01:00
FontAdvanceCache SPDX license update 2026-07-22 18:09:06 +02:00
FontAtlasDecode fix(ui): decode the font atlas's SDF in atlas pixels, so text edges ramp over one screen pixel 2026-10-31 20:23:40 +01:00
FontAtlasDirtyRect SPDX license update 2026-07-22 18:09:06 +02:00
FontAtlasEviction fix(font-atlas): give glyphs that find no room a cell when the next frame begins, evicting the least recently drawn 2026-10-31 19:43:58 +01:00
FontAtlasPacker fix(font-atlas): give glyphs that find no room a cell when the next frame begins, evicting the least recently drawn 2026-10-31 19:43:58 +01:00
FrameLoopSync fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
HeapASRead fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
HeapDynamicIndexHit fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
HeapSlotReuse feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
ImageStagingRelease feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
InputFieldCaretCache SPDX license update 2026-07-22 18:09:06 +02:00
InputFieldHitTest SPDX license update 2026-07-22 18:09:06 +02:00
InputTime feat(wayland): add Window::lastInputTime, the compositor's time of a pointer or touch event 2026-11-17 06:57:46 +01:00
KeyboardKeymap fix(wayland): keys come without text while no keymap has loaded, and a keymap that loads frees the one before 2026-11-26 10:55:26 +01:00
KeyRepeat fix(wayland): the first key repeat lands at the delay, not as a burst of the periods since the press 2026-11-01 00:53:56 +01:00
MemoryTypeFallback SPDX license update 2026-07-22 18:09:06 +02:00
MeshDecompressStagingRelease feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
MeshLifetime feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
MipChainBarrierBatch SPDX license update 2026-07-22 18:09:06 +02:00
MipChainNonSquare feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
MouseScroll SPDX license update 2026-07-22 18:09:06 +02:00
PipelineCacheValidation SPDX license update 2026-07-22 18:09:06 +02:00
PipelineLifetime feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
PointerEnterLeave fix(win32): restore mouse moves, add enter and leave, capture drags, and close and destroy windows cleanly 2026-10-31 03:29:50 +01:00
PointerWin32 fix(window): set the title on Win32 through a Unicode window class, and send only the view's bytes on Wayland 2026-10-31 18:28:16 +01:00
PushConstantRewrite feat(device): applications ask for the device features their shaders use 2026-10-31 06:40:02 +01:00
ResizeViewport fix(wayland): round a configured size's pixels half away from zero, and work both sizes out exactly from the scale's 120ths 2026-11-27 15:41:23 +01:00
RTPassPushData fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
SetupCmdBufferReuse fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
ShapeTextCache fix(font-atlas): give glyphs that find no room a cell when the next frame begins, evicting the least recently drawn 2026-10-31 19:43:58 +01:00
SwapchainBarrierScope feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
SwapchainImageCount fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
SwapchainTransferDst fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
TextAntialiasing fix(ui): decode the font atlas's SDF in atlas pixels, so text edges ramp over one screen pixel 2026-10-31 20:23:40 +01:00
TextInputContent feat(wayland): SetTextInput takes text-input-v3's purposes and its version 1 hints, and enables anew for a field of another kind 2026-11-20 10:08:36 +01:00
TextWin32 fix(window): set the title on Win32 through a Unicode window class, and send only the view's bytes on Wayland 2026-10-31 18:28:16 +01:00
TitleWayland fix(window): set the title on Win32 through a Unicode window class, and send only the view's bytes on Wayland 2026-10-31 18:28:16 +01:00
TLASBuildBarrier fix(rt): rebuild TLASes in place, after earlier traces, and queue their handles like a Mesh's 2026-10-31 02:32:48 +01:00
TLASEmptyBuild test(rt): an empty scene's TLAS builds, then grows and shrinks 2026-10-19 03:03:16 +02:00
TLASHighWaterMark fix(rt): rebuild TLASes in place, after earlier traces, and queue their handles like a Mesh's 2026-10-31 02:32:48 +01:00
TLASInstanceDirtyTracking fix(rt): never destroy the static TLASes 2026-10-19 03:03:16 +02:00
TLASLifetime fix(rt): rebuild TLASes in place, after earlier traces, and queue their handles like a Mesh's 2026-10-31 02:32:48 +01:00
ToplevelState feat(wayland): keep xdg_toplevel's activated and suspended states on the window 2026-11-17 06:57:46 +01:00
UIClipFlag SPDX license update 2026-07-22 18:09:06 +02:00
UIDispatchAtlasFlush fix(font-atlas): give glyphs that find no room a cell when the next frame begins, evicting the least recently drawn 2026-10-31 19:43:58 +01:00
UIFallbackParity fix(window): size the swapchain for its present mode, and key frames in flight by frame instead of image 2026-10-31 18:14:18 +01:00
UIFusedShader test(ui): the descriptor-set fallback draws the same frame as the heap 2026-10-06 17:28:46 +02:00
UploadInFlight feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
UploadStrategy SPDX license update 2026-07-22 18:09:06 +02:00
VulkanBufferAddress feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
VulkanBufferFlushGate SPDX license update 2026-07-22 18:09:06 +02:00
VulkanBufferRangedFlush SPDX license update 2026-07-22 18:09:06 +02:00
VulkanBufferResizeReuse SPDX license update 2026-07-22 18:09:06 +02:00
VulkanShaderLifetime feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00
Win32Link test(win32): drop the __libc_single_threaded stand-in, which crafter-build 5.0.0 made unneeded 2026-11-01 00:37:41 +01:00
WindowConstructorThrow fix(window): a Window constructor that throws leaves nothing of the window behind 2026-11-27 09:14:43 +01:00
WindowConstructorThrowWin32 fix(window): a Window constructor that throws leaves nothing of the window behind 2026-11-27 09:14:43 +01:00
WindowOptionalGlobals fix(wayland): the surface takes a new size with the first frame drawn at it, and a configure's rebuild waits for Render 2026-11-19 09:03:28 +01:00
WindowUpdateClock feat: windows on their own clock, deferred deletion for every handle owner, staged re-uploads, and RTPass push data 2026-10-20 20:20:29 +02:00