From deef204bd3087ebb6464ad9faf02fd59d1344eb9 Mon Sep 17 00:00:00 2001 From: codegirl-007 Date: Fri, 14 Aug 2026 22:16:58 -0700 Subject: [PATCH] Test DXIL preference when MSL is unavailable. Locks the MSL > DXIL > SPIRV shader runtime order so Windows paths cannot silently fall through to Vulkan. --- engine/shader_backend_test.odin | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/shader_backend_test.odin b/engine/shader_backend_test.odin index 68ea4cf..5a9cd1d 100644 --- a/engine/shader_backend_test.odin +++ b/engine/shader_backend_test.odin @@ -27,6 +27,15 @@ choose_shader_runtime_prefers_msl :: proc(t: ^testing.T) { 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) choose_shader_runtime_spirv_only :: proc(t: ^testing.T) { rt, ok := choose_shader_runtime_from_formats({.SPIRV})