Test DXIL preference when MSL is unavailable.

Locks the MSL > DXIL > SPIRV shader runtime order so Windows paths cannot silently fall through to Vulkan.
This commit is contained in:
2026-08-14 22:16:58 -07:00
parent 0d4cdbd8ca
commit deef204bd3
+9
View File
@@ -27,6 +27,15 @@ choose_shader_runtime_prefers_msl :: proc(t: ^testing.T) {
testing.expect_value(t, rt.format, sdl.GPUShaderFormat{.MSL}) testing.expect_value(t, rt.format, sdl.GPUShaderFormat{.MSL})
} }
@(test)
choose_shader_runtime_prefers_dxil_without_msl :: proc(t: ^testing.T) {
rt, ok := choose_shader_runtime_from_formats({.DXIL, .SPIRV})
testing.expect(t, ok, "should pick a runtime when DXIL is available")
testing.expect_value(t, rt.backend, Shader_Backend.DSD12_DXIL)
testing.expect_value(t, rt.shader_dir, "shaders/d3d12")
testing.expect_value(t, rt.format, sdl.GPUShaderFormat{.DXIL})
}
@(test) @(test)
choose_shader_runtime_spirv_only :: proc(t: ^testing.T) { choose_shader_runtime_spirv_only :: proc(t: ^testing.T) {
rt, ok := choose_shader_runtime_from_formats({.SPIRV}) rt, ok := choose_shader_runtime_from_formats({.SPIRV})