summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/glslang/config.py4
-rw-r--r--modules/glslang/register_types.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/modules/glslang/config.py b/modules/glslang/config.py
index 1169776a73..a024dcf984 100644
--- a/modules/glslang/config.py
+++ b/modules/glslang/config.py
@@ -1,7 +1,7 @@
def can_build(env, platform):
- # glslang is only needed when Vulkan or Direct3D 12-based renderers are available,
+ # glslang is only needed when Vulkan, Direct3D 12 or Metal-based renderers are available,
# as OpenGL doesn't use glslang.
- return env["vulkan"] or env["d3d12"]
+ return env["vulkan"] or env["d3d12"] or env["metal"]
def configure(env):
diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp
index b5f70fb98b..81505f716a 100644
--- a/modules/glslang/register_types.cpp
+++ b/modules/glslang/register_types.cpp
@@ -73,6 +73,9 @@ static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage
// - SPIRV-Reflect won't be able to parse the compute workgroup size.
// - We want to play it safe with NIR-DXIL.
TargetVersion = glslang::EShTargetSpv_1_3;
+ } else if (capabilities.device_family == RDD::DEVICE_METAL) {
+ ClientVersion = glslang::EShTargetVulkan_1_1;
+ TargetVersion = glslang::EShTargetSpv_1_6;
} else {
// once we support other backends we'll need to do something here
if (r_error) {