Repository navigation
Conversation
Every Vulkan QRhi score creates imports the shared device built for video decode, and that device never enabled the fragment shading rate extension. QRhi reads its VRS caps from the physical device, so it still reported VariableRateShading as supported, but vkGetDeviceProcAddr returned null for vkCmdSetFragmentShadingRateKHR and setShadingRate silently did nothing. It looked NVIDIA-specific because on GPUs without a video decode queue score falls back to a QRhi-created device, which enables it. The extension is now in the curated list, and its feature struct is chained into the feature query so every supported mode is enabled. RTX 5090, sponza cube, face 1024, 2x2: GPU 2.68 -> 1.30 ms. Tested: on a GPU with the extension, vkCmdSetFragmentShadingRateKHR resolves on the device score creates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgufk1W2MBbpcjraruZq
QRhi assumes an imported device has it and resolves vkGetDeviceFaultInfoEXT to report the faulting address and vendor data on device loss; on the shared device that lookup returned null, so a device loss in score only ever said VK_ERROR_DEVICE_LOST. The extension is now requested with its feature struct, like the one QRhi creates. Tested: on a GPU with the extension, vkGetDeviceFaultInfoEXT resolves on the device score creates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgufk1W2MBbpcjraruZq
SHADING_RATE was parsed and merged but never reached the GPU: no pipeline got UsesShadingRate from it and nothing called setShadingRate. The pipeline now opts in when the state sets a rate and the backend supports VariableRateShading, and the raw raster records the rate before drawing. Intel ARL, sponza cube at 2x2: 41 -> 81 fps. Only raw rasters opt in (applyShadingRate): they are the nodes that record the rate before drawing, and a pipeline with the flag and no rate set is invalid use on Vulkan, so plain ISF passes keep ignoring SHADING_RATE. This needs VK_KHR_fragment_shading_rate on the shared device (the commit enabling it): QRhi reports VariableRateShading from the physical device either way, and without the extension the pipeline would use a dynamic state the device never enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgufk1W2MBbpcjraruZq
A geometry may carry an "indirect_draw_cmds_per_view" auxiliary: one copy of the indirect command list per view, view-major. When a raw raster runs PER_CUBE_FACE or PER_LAYER, each pass now draws from its own view's copy, so a compute filter that culls against each view's frustum (scene_cull_per_view.csf in score-csf-testers) leaves every cube face only the draws it can see. Without the auxiliary, or when it is too small for the pass's view, the shared list is used as before. Measured on scenes made of many separate objects: GPU time -13% on an RTX 5090, frame rate +10-21% on Intel ARL. Material-batched assets such as sponza (one draw per material spanning the whole scene) gain nothing. The copies are not compacted: a per-view cull zeroes the commands it drops, and the indirect count is not applied to them. A sub-mesh with an indirect buffer of its own keeps it. The auxiliary's size is clamped to its buffer (0 meaning the rest of it), and one too small for a pass's view warns once instead of silently drawing the shared list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgufk1W2MBbpcjraruZq
QRhi's OpenGL backend only reports MultiView when both GL_OVR_multiview and GL_OVR_multiview2 are present; Mesa's Intel driver has neither. The shader was still baked with gl_ViewIndex and a view count in that case, which the driver rejects, so MULTIVIEW shaders (prefilter_ggx, Camera Array) failed to build there. viewIndexNeedsPassIndexFallback now takes whether the renderer's QRhi supports MultiView, and ShaderCache keys its bakers on it, so the lowering to the per-pass VIEWINDEX uniform and the N-pass path are taken on any backend without multiview, not only D3D. SCORE_GFX_DISABLE_MULTIVIEW goes through the same input. Plain ISF passes have no N-pass loop: there, a MULTIVIEW shader on a backend without multiview renders view 0 only, which now warns once (raw rasters render every view in its own pass). A shader with a single view gets one baker whatever the renderer's multiview, instead of being compiled again for each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgufk1W2MBbpcjraruZq
EXECUTION_MODEL gains an optional "FACES" expression, evaluated every frame like MANUAL's COUNT: bit i set draws face i (+X -X +Y -Y +Z -Z). A face left out is cleared to transparent once and then skipped, so the cube stays complete and defined for whatever samples it (cube to equirect, mips) while no fragment work is spent on it. Bool inputs now bind in these expressions as 0/1, so a preset can expose one checkbox per face. Without FACES every face is drawn, as before. Rendering in the CAVE is bound by shaded pixels (one 1024x1024 face is about 1.2 ms of the ~8 ms Sponza cube), and no projector looks at +Y or behind, so dropping faces is the cheapest win. An integer FACES is taken as it is, without compiling an expression each frame; an expression's value is clamped to 0..63 rather than offset. A numeric FACES may be written as a double, and a FACES on a pass that does not run per face is ignored with a warning. Tested also with a mask that changes between frames: the faces it drops come back cleared, the ones it adds drawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdPgufk1W2MBbpcjraruZq
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.
Performance work on raw raster cube and per-layer rendering, found while rendering Sponza into a cube for the CAVE, plus two fixes on the shared Vulkan device that it needed.
VK_KHR_fragment_shading_rateorVK_EXT_device_fault. QRhi reads its VRS caps from the physical device, so it reported VariableRateShading as supported whilevkCmdSetFragmentShadingRateKHRresolved to null, andsetShadingRatesilently did nothing. Device loss only ever saidVK_ERROR_DEVICE_LOST. Both extensions are now requested with their feature structs.PIPELINE_STATE.SHADING_RATEwas parsed but never applied. Raw rasters now opt their pipeline in when the state sets a rate and the backend supports VRS, and they record the rate before drawing. Intel ARL, Sponza cube at 2x2: 41 -> 81 fps. RTX 5090, face 1024, 2x2: GPU 2.68 -> 1.30 ms.indirect_draw_cmds_per_viewauxiliary: one copy of the indirect command list per view, view-major. With it, each pass of a PER_CUBE_FACE or PER_LAYER raw raster draws from its own view's copy. A compute filter that culls against each view's frustum (scene_cull_per_view.csfin score-csf-testers) then leaves every face only the draws it can see. Scenes made of many objects: GPU time -13% on an RTX 5090, frame rate +10-21% on Intel ARL.FACESmask for PER_CUBE_FACE. An optional expression inEXECUTION_MODEL, evaluated every frame like MANUAL's COUNT: bit i set draws face i (+X -X +Y -Y +Z -Z). A face left out is cleared to transparent once and then skipped, so the cube stays defined for whatever samples it. On the CAVE no projector looks at +Y or behind, and one 1024² face is about 1.2 ms of an ~8 ms Sponza cube.GL_OVR_multiviewandGL_OVR_multiview2, and Mesa's Intel driver has neither. MULTIVIEW shaders were still baked withgl_ViewIndex, which failed to build (prefilter_ggx, Camera Array). The per-passVIEWINDEXlowering and the N-pass path are now taken on any backend without MultiView, not only D3D.Commits
fe8949fae0gfx: enable VK_KHR_fragment_shading_rate on the shared VkDevicec6b6d6b433gfx: enable VK_EXT_device_fault on the shared VkDevice417cb3caf3gfx: apply PIPELINE_STATE.SHADING_RATE in raw rasters. Only raw rasters opt in. A pipeline with the flag and no rate set is invalid use on Vulkan, so plain ISF passes keep ignoring SHADING_RATE. Needs the first commit.e3f5b879ddgfx: per-view indirect draw lists for per-face raster passes162fa1d3b1gfx: fall back to N passes for multiview when QRhi has no MultiView.viewIndexNeedsPassIndexFallbacktakes the renderer's MultiView support, andShaderCachekeys its bakers on it (a single-view shader gets one baker). Plain ISF passes have no N-pass loop, so a MULTIVIEW ISF shader on such a backend renders view 0 only and warns once.9d644ab613raw raster: PER_CUBE_FACE draws only the faces a FACES mask selects. Bool inputs now bind in these expressions as 0/1. An integer FACES is used directly, an expression is clamped to 0..63, and a FACES on a pass that is not per face is ignored with a warning.Tests
test_gfx_shared_device_extensions: the device score creates enables fragment shading rate and device fault where the GPU has them.test_gfx_shader_cache_multiview(no device): bakers keyed on MultiView only for multi-view shaders.test_gfx_cube_face_orientationgains two FACES mask cases (selected faces only, and a mask that changes between frames), with thecube-dir-ndc-perface-maskcorpus shader.test_gfx_camera_array_facesandtest_gfx_cubemap_six_facesfollow the newviewIndexNeedsPassIndexFallbacksignature.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
indirect_draw_cmds_per_view. Both were measured by hand on the GPUs above.🤖 Generated with Claude Code
https://claude.ai/code/session_01KdPgujQFUTMVZBdH6Hv7Vj