Repository navigation
vk_pipeline_check: support --pc-tail-ubo set-1 layouts and 128-byte push-constant devices - #2480
Conversation
…ush-constant devices vk_pipeline_check previously created one VkPipelineLayout with a hardcoded 144-byte push-constant range and set 0 only (without checking vkCreatePipelineLayout's result). On a 128-byte push-constant device (AMD Windows RDNA2 iGPUs, some Intel Arc drivers) that violates VUID-VkPushConstantRange-size-00298, and every --pc-tail-ubo shader declaring set 1 fails pipeline creation with VK_ERROR_UNKNOWN / VUID-VkComputePipelineCreateInfo-layout-07988. Parse push_constant_bytes and pc_tail.bytes from index.json (with strict from_chars validation, tested in check_vk_pipeline_cli.cmake), skip shaders whose required push-constant size exceeds props.limits.maxPushConstantsSize, add set 1 (UNIFORM_BUFFER_DYNAMIC at binding 0), and create one pipeline layout per distinct (push_bytes, has_pc_tail) needed by the selected shaders within the device limit. Claimed in ItsNotRexed#2300. Co-Authored-By: Gemini 4 Neon <noreply@google.com>
|
Independent Windows check of 3917298 with MSVC 19.44, SDK 10.0.26100.0, RTX 5070 driver 621.24, physical push-constant limit 256 bytes. The stock I ran the checker with three workers on a synthetic index with 128-byte tail and tail-less graphics entries, a 128-byte compute entry that inferred its width from
This checks driver pipeline creation. Synthetic inputs only. AI-assisted review. |
|
Independent AI-assisted review of Integration with #2366. Native AMD check of #2480. AMD Radeon iGPU, AMD proprietary driver
|
|
Tested
This checks the mixed-layout path on Blackwell. The device has a 256-byte limit, so this run does not exercise the 128-byte device skip. AI-assisted. |
|
Independent pipeline checker run on On The attached patch uses explicit empty |
|
Follow-up on the SwiftShader run above. With the empty-set patch applied, the translated On SwiftShader both modules now skip cleanly, with zero validation errors. The RX 6750 XT still compiles both modules with zero validation errors. I also reran the mixed, compute-only, and graphics-only SwiftShader cases, the three Radeon set-0 metadata cases, and the CLI CTest. All passed with the expected skips and zero Vulkan validation errors. AI-assisted testing on synthetic fixtures. |
|
Tested 3917298 (fast-forward onto
So the set-1 layout fixes the AI-assisted (Claude Code). Synthetic inputs only, no game files. Generated by Claude Code |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 3917298 on Windows 11 with an RX 9070 (AMD 26.11.1, Vulkan 1.4.359), built with VS 2022 Build Tools: pass Builds clean. AI-assisted |
Claimed in #2300: #2300 (comment).
Follow-up to #2046 (
--pc-tail-ubo; no merge dependency —vk_pipeline_checkworks onmainas-is and handlespc_tail/push_constant_bytesentries from #2046 once present).What and why
vk_pipeline_check(thepipelinesstage ofmake_game.py) previously created a singleVkPipelineLayoutwith a hardcoded 144-byte push-constant range and only set 0, without checkingvkCreatePipelineLayout's return value. On a 128-byte push-constant device (AMD Windows driver on RDNA2 iGPUs, some Intel Arc drivers) or on shaders translated with--pc-tail-ubo(#2046):VUID-VkPushConstantRange-size-00298whenmaxPushConstantsSize == 128.%pc_tail) fails pipeline creation withVUID-VkComputePipelineCreateInfo-layout-07988/VK_ERROR_UNKNOWN (-13)because set 1 is absent from the pipeline layout (reproduced on AMD Radeon Ryzen 5 7600 iGPU:PIPELINE FAIL cs_tail (cs w0, -13)).Changes (
runtime/test/vk_pipeline_check.cpp,runtime/test/check_vk_pipeline_cli.cmake):push_constant_bytesandpc_tail.bytesfromindex.jsonusing strictstd::from_charsunsigned 32-bit parsing (matchinglds_bytes, rejecting negative/float/overflow values; checked incheck_vk_pipeline_cli.cmake).required_push_bytes()(withstatic_assertchecks): usespush_constant_byteswhen recorded (128 with--pc-tail-ubo, 144 by default, 152 with--mesh-compute), or 128 whenpc_tailis present, else 144, rounded up to a 4-byte multiple without overflow.check_missing_feature()whoserequired_push_bytesexceedsprops.limits.maxPushConstantsSize(reporting e.g.needs 144 push-constant bytes, device has 128 (translate with --pc-tail-ubo)).VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMICat binding 0,VK_SHADER_STAGE_ALL) alongside set 0, and pre-create oneVkPipelineLayoutper distinct(push_bytes, has_pc_tail)needed by the selected shaders that fitsmaxPushConstantsSize(checkingvkCreatePipelineLayoutfor errors). Never creates a push-constant range abovemaxPushConstantsSize.cpi.layout) and graphics (gpci.layout) pipelines.Tested
AI-assisted (Gemini 4 Neon / Antigravity). Windows 11 (build 26200), MSVC 14.44, Windows SDK 10.0.26100, Vulkan SDK 1.4.363 (
VK_LAYER_KHRONOS_validation, SPIRV-Tools v2026.4), Python 3.14.4,llvm-mc21.1.8 (WSL). No game files.maxPushConstantsSize128,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation): failed withVUID-VkPushConstantRange-size-00298,VUID-VkComputePipelineCreateInfo-layout-07988, andPIPELINE FAIL cs_tail (cs w0, -13)(exit 1).ctest -R vk_pipeline_check_cli: 1/1 passed (including malformedpush_constant_bytesandpc_tail.bytescases).py -3.14 -I tests/test_shader_meta.py: 15/15 OK.pc_tailCS + 128-byte tail-less VS + 128-bytepc_tailPS, withVK_LAYER_KHRONOS_validation):cs_tail,vs_tail,ps_tail), 1/4 skipped (cs_full:needs 144 push-constant bytes, device has 128 (translate with --pc-tail-ubo)), 0 failed, 0 validation errors, exit 0.runtime/test/shaders/build.py+tools/spirv_stubs.py, withVK_LAYER_KHRONOS_validation):--pc-tail-ubobuild (from Translator: --pc-tail-ubo moves the push-constant tail to a uniform block (128-byte push-constant devices, 1/3) #2046/GPU tests: bind the --pc-tail-ubo block so 128-byte push-constant devices run the suite (2/3) #2048): 202/204 pipelines OK (93/93 CS, 93/95 PS with 2 skipped forno VK_KHR_maintenance8, 16/16 VS), 0 failed, 0 push-constant/layout validation errors, exit 0.needs 144 push-constant bytes, device has 128 (translate with --pc-tail-ubo)), 0 failed, 0 push-constant validation errors, exit 0.--pc-tail-ubobuild: 204/204 pipelines OK (93 CS, 95 PS, 16 VS), 0 failed, 0 skipped, 0 validation errors, exit 0.Checklist
docs/design.md, with how it was confirmed. (No translator change here.)🤖 Generated with Antigravity (Gemini 4 Neon)