Repository navigation
Conversation
Multi-window output, per output, in this order: - warp: corner pin, or a dense warp map (PFM), imported from MPCDI or Bourke files; bicubic sampling; mipmapped and anisotropic sampling of the canvas; - RGB alpha (blend) and beta (black level) maps, out = content * alpha + beta, in the space a per-output "Blend map space" gives: Auto applies float maps (PFM, EXR, Bourke intensities: what score writes, linear as Gfx/Calibration/Blending.hpp defines them) and an MPCDI alpha (which its gammaEmbedded linearises) in linear light, and 8 and 16-bit images in signal space, on the gamma-encoded values, as media servers such as WATCHOUT or Resolume blend their masks; Linear light and Signal force one space for every map. The edge ramps keep following the linear blend setting. The setting is saved in the output mapping (JSON only when not Auto), shown in the settings widget and exposed as /i/maps/blend_space; - radiometric compensation, P = M c + o with per-pixel M from comp*.pfm. Negative components are desaturated and an out-of-range colour is scaled down whole, keeping its hue; - the projector's own colour mixing, inverted through a 33^3 table packed in the response texture. A colour out of reach takes the closest reachable one, or is scaled towards black; - the measured per-channel response (name.response.json or a 1D .cube) in place of the 2.2 curve; gain, gamma, a 3D .cube LUT, HDR transfer functions, a 16-bit float canvas, and blue-noise dither (a baked 64x64 void-and-cluster table). What an output that only uses the earlier settings gets is unchanged: the edge ramps alone do not make the canvas 16-bit float nor turn Auto dither on (maps, LUTs, responses, compensation and the colour stage do), and Auto sampling stays linear under a corner warp; a warp map selects anisotropic sampling. The canvas format and mips are decided again once a window has a swap chain and when it is resized, and a rebuild can drop the mips. Calibration files: a calibration set (name.json + its .alpha/.beta/.cube/ .response/.comp files) assigned per output in the settings widget, through JSON and through /i/maps/* OSC parameters, and reloaded live when the files change (300 ms debounce). The settings store them as <PROJECT>: / <LIBRARY>: paths when they live under a root and list the files that cannot be found; the device resolves them against the project roots. setMaps() reads and checks the files on a worker thread and hands the result to the output on the GUI thread, a later request superseding an earlier one; only the texture upload stays on the render thread (the first load, in createOutput, before any frame, is synchronous). An MPCDI archive decodes only the region an output uses. A map whose size differs from its output's is reported once per load, and so is a compensation offset that does not match its rows. A compensation JSON saved under another name reads the file names it lists. The PFM, Bourke mesh, MPCDI, .cube and response.json readers bound every size read from the file, accept CRLF headers and refuse non-finite values; the 3D LUT and the 1D response share one .cube parser. OSC callbacks run on the GUI thread; the output mapping stream is delimited so a truncated project fails cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj
The device's Input width / height reached only the forced-offscreen path: the multi-window device was created without them, so its render state kept the 1280x720 that createRenderState was given, and every process feeding it rendered at that size whatever the canvas. Found on the CAVE with an 8192x4096 equirect canvas: a grid shader's parallels vanished on the projectors, sharp offscreen. The node now takes the canvas size at construction, and setRenderSize keeps the size it is given before the output exists instead of dropping it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj
Found profiling the CAVE: Score.benchmark() had no frame rate, and a multi-window device's own work (the warp, blend and colour pass into each window) was attributed nowhere, since each window is drawn in its own swap-chain frame after the render list's. - Frames carry the time they started; the profiler reports the frame rate of the fastest output over its last 64 frames (render.fps, and in the panel's summary). An output that has not rendered for a second no longer counts, and is forgotten when newer frames arrive, so a closed output or a rebuilt render list does not keep its last rate forever. - The multi-window node reports an "Output stage" entry: the CPU time of recording the windows' passes (not the waits in beginFrame / endFrame) and the sum of their command buffers' GPU time. It is kept apart from the frame totals, which it would otherwise count twice. - QRhiCommandBuffer::lastCompletedGpuTime() is in seconds: the render list's frame GPU timing recorded it as milliseconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj
The window pass reconstructed the warp with a 16-tap Catmull-Rom read of the RGBA32F warp map for every output pixel, every frame. On the CAVE (six 3840x2160 outputs, RTX A4000, Vulkan Sponza) that was about 1 ms of GPU per window: the six window passes cost 12.7-13.2 ms and the outputs ran at 43-44 fps. The interpolated lookup now goes into an RGBA32F texture at the window's pixel size, written by a small pass that runs only when the warp map, the bicubic/bilinear choice or the window size changes. The window pass reads it with a single texelFetch at gl_FragCoord. Both passes share the same sampleWarp() code, so the result is unchanged. Canvas sampling, blending, colour and the corner warp still run per frame. Measured on the CAVE, alternating baked and unbaked runs: window passes 6.4-7.1 ms instead of 12.7-13.2 ms, 54-59 fps instead of 43-44; 59.7 fps with linear canvas sampling. Camera grabs of baked and unbaked output differ no more than two baked grabs do. Costs one RGBA32F texture per window with a warp map (about 133 MB at 4K): the target, its render pass and its pipeline are made when a warp map is first drawn, and released, the texture back to 1x1, when the map is removed. RGBA32F because stock Qt has no RG32F render target. If it cannot be created the old path is used. SCORE_MW_NO_WARP_BAKE=1, read once, forces the old path for comparisons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj
QRhi Vulkan keeps two frames in flight shared by every swapchain and offscreen frame, and advances the slot after each of them. With the scene's offscreen frame followed by six window frames per tick, the second window's beginFrame waited for this tick's scene render to finish on the GPU, and each later window for the window two places before it: CPU and GPU never overlapped. On the CAVE the index-1 wait tracked the scene's GPU cost (1.5 ms at FACE=256, 9.1 at 1024, 23.9 at 2048). With a Qt that has the frame-slot group flags (QRHI_HAS_FRAME_SLOT_GROUPS, from the ossia SDK patch), the scene frame keeps its slot, the windows continue it, and the last live window advances it, so the only wait each tick is for the frame two ticks back. Measured on the CAVE: all window beginFrame calls drop to microseconds and the wait moves to beginOffscreenFrame, at the same total, because the pipeline is GPU-bound there; the change pays off once GPU time is below the frame period. Without those flags the code is compiled out. SCORE_MW_NO_SLOT_GROUP=1, read once, disables it at run time. A tick that keeps the slot open and then does not end it, because the render list has no output renderer or the last live window fails to begin its frame, closes it with an empty offscreen frame, so the next tick starts from a closed group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj
Auto picked anisotropic sampling, and so a mipmapped canvas regenerated every frame, for any output with a warp map. On the CAVE every output magnifies the canvas instead: about 0.3 canvas texels per output pixel (an 8192x4096 canvas, outputs covering 13-15 % of it in u on 3840 pixels). The mips and the anisotropic taps bought nothing there, and cost about 2.6 ms of GPU per frame on Vulkan and 50-55 ms on D3D12, whose generateMips on the RGBA16F 8192x4096 canvas blocks endOffscreenFrame (D3D12 Sponza 6 outputs: 16-18 fps default, 62 fps with Sampling=Linear). When a warp map loads, record the 99.5th percentile of the change in source u and v between neighbouring valid texels, per screen direction (sampled on at most 2^18 texels, so a large map costs little to load). The footprint is the longer of the row and column derivatives, as texture LOD selection takes it, each scaled by the source rectangle, the canvas size and the map-to-output ratio along its own axis; Auto chooses anisotropic only above 1.5 canvas texels per output pixel, and linear otherwise. Below that a bilinear tap already covers the footprint well enough that mipmapping changes nothing visible. Pairing the largest u change along a row with the largest v change along a column with hypot flagged the CAVE's left wall (1.19e-4 and 1.44e-4 per texel, 0.98 and 0.59 canvas texels, hypot 1.14) as minifying. The output size is the window's swap chain once it exists, the map's before; the canvas is decided again when the swap chain appears and on resize. A corner warp alone stays linear, and the explicit modes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj
The multi-window and capture tests compare readbacks against the window sizes they set, in pixels. On a desktop scaled by 2 (KWin at scale 2, under XWayland too), Qt made every output window twice that size and those tests failed for no fault of the code. The test fixture now turns Qt's high-DPI scaling off unless the environment chooses otherwise, as it already was under Xvfb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
depends on: #2415 to #2426, all the independent PRs of the series, because
split/chain-baseis master plus a merge of each of them. The code here uses #2420 and #2425. Through #2426 the base also carries the libossia gitlink of libossia#995.The first PR of the immersive chain. The multi-window output gets a full per-output calibration stage, so that score can drive a multi-projector installation (on the CAVE: six 3840x2160 projectors from one 8192x4096 equirect canvas) directly from the calibration files that the later PRs produce, without an external media server.
Per output, in this order:
Gfx/Calibration/Blending.hppdefines them) and an MPCDI alpha (linearised by itsgammaEmbedded) in linear light. It applies 8 and 16-bit images in signal space, on the gamma-encoded values, as WATCHOUT or Resolume blend their masks. Linear light and Signal force one space for every map. The edge ramps keep following the linear blend setting. The setting is saved in the output mapping (in JSON only when not Auto), shown in the settings widget, and exposed as/i/maps/blend_space.comp*.pfm. Negative components are desaturated, and an out-of-range colour is scaled down whole, keeping its hue.name.response.jsonor a 1D.cube) in place of the 2.2 curve; gain, gamma, a 3D.cubeLUT, HDR transfer functions, a 16-bit float canvas, and blue-noise dither (a baked 64x64 void-and-cluster table).Calibration sets (
name.jsonplus its.alpha/.beta/.cube/.response/.compfiles) are assigned per output in the settings widget, through JSON, and through/i/maps/*OSC parameters. They are reloaded live when the files change, with a 300 ms debounce. Paths are stored as<PROJECT>:/<LIBRARY>:when they live under a root, and missing files are listed.setMaps()reads and checks the files on a worker thread and hands the result to the output on the GUI thread; only the texture upload stays on the render thread.An output that only uses the settings that existed before is unchanged. Edge ramps alone neither make the canvas 16-bit float nor turn Auto dither on, and Auto sampling stays linear under a corner warp.
Commits
270b90377fgfx: multi-window output stage with per-output calibration. This is the bulk of the PR, described above. The first load, increateOutput, is synchronous, before any frame. An MPCDI archive decodes only the region an output uses. A map whose size differs from its output is reported once per load. The PFM, Bourke, MPCDI,.cubeandresponse.jsonreaders bound every size they read, accept CRLF headers and refuse non-finite values. The output mapping stream is delimited, so a truncated project fails cleanly.bd49445543gfx: a multi-window device renders its content at its input size. The device's Input width / height only reached the forced-offscreen path, so every process feeding the device rendered at 1280x720 whatever the canvas size.bdbf376952profiler: frame rate, and the multi-window output stage. The profiler reports the frame rate of the fastest output, and an "Output stage" entry for the windows' own passes, kept apart from frame totals. It also fixes a master bug:QRhiCommandBuffer::lastCompletedGpuTime()is in seconds, but was recorded as milliseconds.9126360463multi-window: bake the warp map lookup once per window. The 16-tap Catmull-Rom read is baked into an RGBA32F texture at the window's size, redone only when the map, the filter or the size changes. On the CAVE (RTX A4000, Vulkan): window passes take 6.4-7.1 ms instead of 12.7-13.2 ms, and 54-59 fps instead of 43-44. It costs about 133 MB per 4K window with a warp map.SCORE_MW_NO_WARP_BAKE=1forces the old path.a68cea3b63multi-window: one QRhi frame slot per tick when Qt supports it. See the notes.234e345f81multi-window: Auto sampling uses mips only where the warp minifies. The footprint is measured from the warp map when it loads (99.5th percentile, sampled on at most 2^18 texels). Auto picks anisotropic only above 1.5 canvas texels per output pixel. On the CAVE this avoids about 2.6 ms of GPU per frame on Vulkan and a blockinggenerateMipson D3D12 (16-18 fps before, 62 fps after).660c6e9859tests: device pixels on a HiDPI desktop. The test fixture turns Qt's high-DPI scaling off unless the environment chooses otherwise, so readback sizes match the window sizes on a scaled desktop.Tests
test_gfx_multi_window_calibration(warp, alpha / beta, colour, blending in linear light, live corner warp, blend map space, Auto sampling and mips, live map swaps and reloads),test_gfx_multi_window_photometric(RGB maps, measured response, compensation, colour mixing inverse),test_gfx_multi_window_quality(3D LUT, dither, Catmull-Rom warp, mip / anisotropic sampling),test_gfx_float_map_files(PFM layout, 16-bit images, Bourke meshes, MPCDI),test_gfx_calibration_file_hardening(crafted PFM, Bourke, MPCDI,.cubeandresponse.jsonfiles), andtest_gfx_profiler_gpu_time.test_gfx_multi_window(renders at the canvas size it is given),test_gfx_window_device_tree(warp, colour and map parameters, calibration file matching and watching),test_gfx_window_settings_ui(calibration maps and sets, relative paths, colour values), andtest_unit_profiler(frame rate, stale outputs, output stage report).test_gfx_shader_corpus_targets,test_gfx_window_layout,test_threedim_ply_fingerprint,test_unit_miniaudio_alsaand the few others master's run lists).Notes for review
a68cea3b63) compiles only against a patched Qt that definesQRHI_HAS_FRAME_SLOT_GROUPS(the ossia SDK patch). CI never builds it, and on stock Qt behaviour is unchanged. With the flags, the scene frame keeps its slot, the windows continue it, and the last live window advances it. A tick that opens the group and does not close it (no output renderer, or the last window failingbeginFrame) closes it with an empty offscreen frame.SCORE_MW_NO_SLOT_GROUP=1disables it at run time.MultiWindowNode.cppgrows by about 1600 lines. Most of it is the window pass and its resources.🤖 Generated with Claude Code
https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj