Repository navigation
make_game, vk_subgroup_info: auto-enable --bary-fallback without VK_KHR_fragment_shader_barycentric - #2192
make_game, vk_subgroup_info: auto-enable --bary-fallback without VK_KHR_fragment_shader_barycentric#2192robot00f wants to merge 2 commits into
Conversation
745b4d3 to
f1b4616
Compare
|
Tested
So the PR changes nothing on MoltenVK and KosmicKrisp. It turns the fallback on for llvmpipe, which lacks
AI-assisted (Claude Code). No game data. |
3b9e130 to
0c0007a
Compare
…T_mesh_shader make_game.py previously turned on --mesh-compute automatically only on Intel's Windows Vulkan driver (BUILD-2202, runtime_gpu_mesh_draws_crash). On GPUs without VK_EXT_mesh_shader / meshShader (such as NVIDIA Pascal, AMD RDNA1/GCN, older Intel iGPUs, and MoltenVK), make_game.py left --mesh-compute off unless passed on the command line, translating native MeshEXT modules that the target GPU cannot create or execute. - Query VK_EXT_mesh_shader and VkPhysicalDeviceMeshShaderFeaturesEXT.meshShader (offset 20, after taskShader) in tools/vk_subgroup_info.py across both Vulkan 1.2 and Vulkan 1.3 devices (reusing the cached Vulkan 1.2 extension set and deferring Vulkan 1.3 extension enumeration to the winning device), exposing "mesh_shader" in the JSON output. - Add runtime_gpu_mesh_shader() in make_game.py and auto-enable --mesh-compute during the shaders stage when mesh_shader is False (unless --native-mesh is passed), preserving a recorded --mesh-compute setting via keep_recorded_fallback when the probe cannot answer. - Update CLI help, README.md, docs/design.md, and unit tests in tests/test_vk_subgroup_info.py and tests/test_make_game_translator_flags.py. Claim: ProjectLeonida#14 (comment) AI-assisted: yes (Antigravity, Gemini 4 Carbon)
…HR_fragment_shader_barycentric tools/vk_subgroup_info.py previously returned barycentric_fallback=true only for drivers that advertise native barycentrics with a known BaryCoordKHR bug (Mesa ANV and AMD Windows on gfx90c). On GPUs that lack VK_KHR_fragment_shader_barycentric altogether while supporting geometryShader (such as NVIDIA Pascal / GTX 1050 Ti, Intel Gen9.5, and older GCN), per_vertex_inputs=false turned on --f16-interp-fallback in make_game.py, while barycentric_fallback remained false and left raw BaryCoordKHR pixel shaders untranslated unless --bary-fallback or LEONIDA_BARY_FALLBACK=1 was passed manually. - Read VkPhysicalDeviceFeatures.geometryShader (offset 32 in VkPhysicalDeviceFeatures2) alongside VK_KHR_fragment_shader_barycentric in tools/vk_subgroup_info.py, exposing "fragment_shader_barycentric" and "geometry_shader" and setting "barycentric_fallback" to true when not fragment_shader_barycentric and geometry_shader (keeping MoltenVK false, as Metal has no geometryShader). - Distinguish missing VK_KHR_fragment_shader_barycentric from the Mesa ANV / AMD gfx90c driver-bug log message in make_game.py while keeping LEONIDA_BARY_FALLBACK=0/1 and --bary-fallback precedence unchanged across make_game.py and scripts/run_gpu_tests.py. - Update CLI help, README.md, docs/design.md, and unit tests in tests/test_vk_subgroup_info.py and tests/test_make_game_translator_flags.py. Depends on: ProjectLeonida#1885 Claim: ProjectLeonida#1608 (comment) AI-assisted: yes (Antigravity, Gemini 4 Carbon)
0c0007a to
d260b81
Compare
|
Tested on the GPU this PR names: GeForce GTX 1050 Ti 4 GB (Pascal), NVIDIA 582.66, Windows 10 19045 (profile S). Head MEASURED:
One small thing, READ IN CODE / MEASURED in the log: AI-assisted (Claude Code). |
|
Hi @robot00f, thanks for this pull request. It currently conflicts with AI-assisted (Claude Code, Claude Opus 5.5). |
|
Checked
AI-assisted (Claude Code). |
|
Independent check on Windows (not the author), at
Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10. AI-assisted: yes (opencode). |
aslan2142
left a comment
There was a problem hiding this comment.
This PR cannot merge in its current state:
- Stacked on unmerged base
#1885:#1885must land first, then this branch needs to be rebased ontomain. - Merge conflicts with
main(README.md,docs/design.md,make_game.py) and failing CI (windows,linux-gpu-tools,macos,macos-python,check).
Once #1885 lands, please rebase onto current main and obtain a green CI run.
(AI-assisted review.)
|
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime ( |
Summary
Auto-enable
--bary-fallbackinmake_game.py(andscripts/run_gpu_tests.py) whentools/vk_subgroup_info.pyselects a GPU withoutVK_KHR_fragment_shader_barycentric(fragmentShaderBarycentric) that supportsgeometryShader(such as NVIDIA Pascal / GTX 1050 Ti, Intel Gen9.5, and older GCN):vk_subgroup_info.pyreportedper_vertex_inputs: falseon Pascal (turning on--f16-interp-fallback), whilebarycentric_fallbackonly checked for driver bugs on devices that do advertiseVK_KHR_fragment_shader_barycentric(Mesa ANV and AMD Windows ongfx90c), returningfalseon Pascal and leaving rawBaryCoordKHRpixel shaders untranslated unless--bary-fallbackorLEONIDA_BARY_FALLBACK=1was passed manually.VkPhysicalDeviceFeatures.geometryShader(offset32in the existingVkPhysicalDeviceFeatures2query) alongsideVK_KHR_fragment_shader_barycentricintools/vk_subgroup_info.py, exposing"fragment_shader_barycentric"and"geometry_shader", and set"barycentric_fallback"totruewhennot fragment_shader_barycentric and geometry_shader(MoltenVK hasgeometry_shader == falseand staysfalse).VK_KHR_fragment_shader_barycentricreason distinctly from the Mesa ANV / AMDgfx90cdriver-bug message inmake_game.py, preservingLEONIDA_BARY_FALLBACK=0/1, explicit--bary-fallback, andkeep_recorded_fallbackon transient probe failures.README.md,docs/design.md, and unit tests intests/test_vk_subgroup_info.pyandtests/test_make_game_translator_flags.py.Validation
19045, driver582.28):python -I tools/vk_subgroup_info.pynow reports"fragment_shader_barycentric": false, "geometry_shader": true, "per_vertex_inputs": false, "barycentric_fallback": true, "mesh_shader": false.python -I tests/test_vk_subgroup_info.py,python -I tests/test_make_game_translator_flags.py,python -I tests/test_make_game_wave64.py,test_docs_*,test_text_write_line_endings.py(all OK).python -I scripts/check_no_game_data.py(clean).Depends on: #1885
Claim: #1608 (comment)
AI-assisted: yes (Antigravity, Gemini 4 Carbon)