From 44c62c8a37164f1ec1ada7ef9a3392f64794cffc Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sat, 1 Jun 2019 13:31:56 -0700
Subject: [PATCH] Fix shaders init with glcore + kms.

See https://github.com/libretro/RetroArch/issues/8834
---
 gfx/drivers_context/drm_ctx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c
index 756b596524..8fa0b4239d 100644
--- a/gfx/drivers_context/drm_ctx.c
+++ b/gfx/drivers_context/drm_ctx.c
@@ -909,7 +909,12 @@ static uint32_t gfx_ctx_drm_get_flags(void *data)
    if (drm->core_hw_context_enable)
       BIT32_SET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
 
-   BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_GLSL);
+   if (string_is_equal(video_driver_get_ident(), "glcore"))
+#ifdef HAVE_SLANG
+      BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_SLANG);
+#endif
+   else
+      BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_GLSL);
 
    return flags;
 }