Repository navigation
Conversation
…the GPU lacks the feature tools/vk_subgroup_info.py reports fragment_shader_barycentric and mesh_shader: the feature bits, each only where the device also lists its extension, as the runtime checks. AMD's Windows driver (26.11.2) fills VkPhysicalDeviceMeshShaderFeaturesEXT with ones on an RX 5700 XT, which has no VK_EXT_mesh_shader. per_vertex_inputs is unchanged. make_game.py turns --bary-fallback and --mesh-compute on where the runtime's GPU lacks fragmentShaderBarycentric or meshShader, from one probe, as it does for --f16-interp-fallback and --pc-tail-ubo. A probe that can't tell keeps what the last translation used. --mesh-compute is decided before wave64_settings, which depends on it, and before the push-constant check (152 bytes with it). Tests: test_vk_subgroup_info.py (the two fields, extension gating, the RDNA1 case), test_make_game_translator_flags.py (each flag follows the device, explicit flags win, the order against wave64 and --pc-tail-ubo, a failed probe keeps both). On an RX 5700 XT (AMD 26.11.2, Windows 11) the probe reports neither feature, so both flags turn on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 17d40e2f3 on Windows 11: pytest tests/test_make_game_argparse.py tests/test_make_game_translator_flags.py tests/test_vk_subgroup_info.py -q -> 116 passed, 100 subtests passed; git diff --check clean.
vk_subgroup_info now reports the barycentric and mesh-shader feature support, and make_game enables --bary-fallback and --mesh-compute by themselves on a GPU that lacks the feature (an explicit choice still wins); the README and tests are updated.
Overlap: #4762 adds only the automatic --bary-fallback and conflicts with this branch in make_game.py (git merge-tree refs/remotes/pr/4772 refs/remotes/pr/4762 -> exit 1). This PR is the broader version (bary + mesh, with the probe fields); #4762 should probably close in its favor.
|
At I used the PR's fake Vulkan 1.3 device with both feature bits and both extension names. A successful query gives
Save this as import sys
from pathlib import Path
from unittest.mock import patch
sys.path.insert(0,str(Path("tests").resolve()))
import test_vk_subgroup_info as t, test_make_game_translator_flags as m
device=t.FakeDevice(mesh_shader=True,fragment_shader_barycentric=True,extension_names=(b"VK_EXT_mesh_shader",b"VK_KHR_fragment_shader_barycentric"))
def probe():
vk=t.FakeVulkan(devices=[device])
with patch.object(t.vk_info,"load_vulkan",return_value=vk):
r=t.vk_info.query()
case=m.MainWiringTest()
try: print(r["fragment_shader_barycentric"],r["mesh_shader"],case.run_main(features=r)[1])
finally: case.doCleanups()
probe()
with patch.object(t.FakeVulkan,"_enumerate_device_extension_properties",return_value=-1):
probe()All 116 focused tests pass on Windows 11. With successful live queries, the RTX 4090 reports both features. The AMD Radeon iGPU reports barycentric support only. AI-assisted. Fix verified at 8e2b1d7 on Windows 11. The same probe now returns None for both features when enumeration fails. The translation flag tuple stays empty. All 117 focused tests pass on CPython 3.14.7. The live query gives the same feature results on both adapters. |
…unknown device_extensions returned an empty set both for a device without extensions and for a failed vkEnumerateDeviceExtensionProperties, so a failed query read as "neither feature" and make_game turned both fallbacks on, translating the corpus again on a GPU that has both (found by shdann on ItsNotRexed#4772). query_device_extensions returns None on a failure; fragment_shader_barycentric and mesh_shader are then null, which make_game treats as unknown (it keeps the flags of the last translation). device_extensions is unchanged for the Vulkan 1.2 device check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
At head |
|
Thanks for the runs and the review.
Re-tested: AI-assisted (Claude Code). |
The runtime on main can't draw --mesh-compute output yet (its mesh PSO path without VK_EXT_mesh_shader is still pending), so a GPU without mesh shaders no longer turns the flag on: it stays manual until that lands. vk_subgroup_info.py still reports mesh_shader; adding the flag back is one FEATURE_FALLBACKS entry. Tests pin both halves: --bary-fallback follows the device, and a GPU without mesh shaders leaves --mesh-compute off unless asked for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @editrice, agreed. Merged alone, this would switch RDNA1/Pascal builds to shaders the runtime on
Re-tested: AI-assisted (Claude Code). |
|
Tested on Windows 11 / Python 3.12.10 at head
Code read: AI-assisted review (Gemini 4 Neon). |
|
Merge-order note: with |
|
Tested b46d24f merged with main 3faac55 on Linux (WSL2), Python 3.12.16: pass. |
toeeshchaudhary
left a comment
There was a problem hiding this comment.
Windows GTX 1060 6GB: the live probe reported fragment_shader_barycentric=false. With package checking and full-stage execution stubbed, the normal make_game selection passed --bary-fallback to the shader stage. Built synthetic vs_ids and ps_bary with the selected fallback flags and compared against explicit bary fallback. Both readbacks matched byte-for-byte, and all 4096 pixels matched the expected gradient at 1e-6. The three affected Python suites passed (117 tests).
|
Verified merged with current main: the FEATURE_FALLBACKS wiring mirrors the existing per-vertex probe (False turns the flag on, None keeps the recorded setting, True leaves it alone), and test_vk_subgroup_info, test_make_game_translator_flags and test_make_game_argparse pass with the new cases verifiably executed. The extension-listed feature check fixing the mesh-features-on-AMD-RDNA1 case is a nice catch. One doc gap: design.md's 16-bit-interpolation row still says Nothing picks --bary-fallback from the device — that sentence is now stale and should be amended in this PR. Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested b46d24f on Intel UHD 630 (Coffee Lake GT2), Mesa 25.2.8 ANV, Ubuntu 24.04: the device probe reports fragment_shader_barycentric false, and calling runtime_gpu_features() gives {'fragment_shader_barycentric': False}, so make_game.py:2083 turns bary_fallback on; with a nonexistent device name it returns None and keeps the recorded flags. test_vk_subgroup_info (51 tests), test_make_game_translator_flags (30) and test_make_game*.py (360, skipped=4; the PR body says 1 skipped, I did not inspect the skip reasons) pass. With LEONIDA_BARY_FALLBACK=1, ps_bary (4096/4096 pixels), ps_scc_mask32 and ps_uniform_branch pass on the GPU, and ps_bary with a nonexistent device name fails with "no Vulkan physical device matches". The end-to-end make_game shaders stage was not run. AI-assisted. |
|
Tested
|
Claimed in #4683 (#4683 (comment)), new BUILD item.
Depends on: #4309 (the runtime's pass-through geometry shader, which draws what
--bary-fallbacktranslates).What and why
make_game.pyalready turns on--f16-interp-fallbackand--pc-tail-ubowhere the runtime's GPU needs them.--bary-fallbackstill had to be passed by hand. A build for a GPU withoutVK_KHR_fragment_shader_barycentric(RDNA1 on AMD's Windows driver and on RADV, NVIDIA Pascal, Intel UHD) made without it can't draw those pixel shaders. @kapitche's sweep (#4628) shows the cost: 207 of the 480 sampled pixel shaders couldn't be created on an Intel UHD 770, because the corpus was translated withBaryCoordKHR.tools/vk_subgroup_info.pyreportsfragment_shader_barycentricandmesh_shader. Each is the feature bit, counted only where the device also lists the extension, as the runtime checks.VkPhysicalDeviceMeshShaderFeaturesEXTwith ones on an RX 5700 XT, which has noVK_EXT_mesh_shader. Read alone, the bit says the GPU has mesh shaders.null(unknown), not false (found by @shdann).per_vertex_inputsis unchanged.make_game.pyturns--bary-fallbackon where the runtime's GPU lacks the feature. It does this from one probe, as for the other two flags.keep_recorded_fallback).--mesh-computestays manual for now. The runtime onmaincan't draw its output withoutVK_EXT_mesh_shaderyet (Runtime: mesh PSOs and DispatchMesh without VK_EXT_mesh_shader, through --mesh-compute #4408, itself on Runtime: mesh-shader PSOs from pipeline state streams and DispatchMesh (D3D-29) #1712 and Runtime: ExecuteIndirect with DISPATCH_MESH signatures and the M5 mesh gate (translated mesh shader) #3777). The probe already reportsmesh_shader, so turning it on by itself later is one entry inFEATURE_FALLBACKS. I'll open that once Runtime: mesh PSOs and DispatchMesh without VK_EXT_mesh_shader, through --mesh-compute #4408 lands.--bary-fallbackhelp and the README say it turns on by itself.Tests
tests/test_vk_subgroup_info.py(51 pass) covers both fields with and without their extensions. That includes the RDNA1 case of a mesh bit withoutVK_EXT_mesh_shader, and a failed enumeration leaving both unknown.tests/test_make_game_translator_flags.py(30 pass):--bary-fallbackfollows the device, and an explicit flag wins.--mesh-computeoff unless it is asked for.--bary-fallback.tests/test_make_game*.py(360 pass, 1 skipped), the docs tests,compileallandmake_game.py --helppass.--bary-fallbackturns on and--mesh-computestays off.No game files were used. AI-assisted (Claude Code).