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). |
Claimed in #4683 (#4683 (comment)), new BUILD item.
What and why
make_game.pyalready turns on--f16-interp-fallbackand--pc-tail-ubowhere the runtime's GPU needs them.--bary-fallbackand--mesh-computestill had to be passed by hand. A build for a GPU withoutVK_KHR_fragment_shader_barycentricorVK_EXT_mesh_shader(RDNA1 on AMD's Windows driver and on RADV, NVIDIA Pascal) made without them can't draw those shaders. With the runtime halves (#4309 for the barycentric GS, #4408 for mesh as compute), these two flags are what such a GPU needs. @kapitche's sweep (#4628) shows the cost of leaving the flag off: 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: the feature bits, each only where the device also lists its 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, so it can't turn the fallbacks on by mistake (found by @shdann).per_vertex_inputsis unchanged.make_game.pyturns--bary-fallbackand--mesh-computeon where the runtime's GPU lacks the feature, from one probe, as it does for the other two flags.keep_recorded_fallback).--mesh-computeis decided beforewave64_settings, which depends on it, and before the push-constant check (152 bytes with it).--helpand the README say they turn on by themselves.Tests
tests/test_vk_subgroup_info.py(51 pass): the two fields with and without their extensions, including the RDNA1 case of a mesh bit withoutVK_EXT_mesh_shader, and a failed enumeration leaving both unknown. The fake Vulkan checks the extra struct in the features chain.tests/test_make_game_translator_flags.py(30 pass): each flag follows the device, explicit flags win,wave64_settingsgetsmesh_compute=True,--mesh-computeat 144 push-constant bytes also turns on--pc-tail-ubo, and a probe that can't tell keeps both flags of the last translation.tests/test_make_game*.py(360 pass, 1 skipped), the docs and text tests,compileallandmake_game.py --helppass.mesh_shader: true.I'll rebase around #4696 and #4715, which also touch
tools/vk_subgroup_info.py.No game files were used. AI-assisted (Claude Code).