From b644d00bf7d2734b0a7f02daa66be9410a4de85d Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 18 Jul 2021 13:18:43 -0300 Subject: [PATCH] Add a more specific error message when compute shaders aren't supported It already correctly errored, but the message was generic enough (GLSL 4 support) that it might be confusing. --- src/modules/graphics/Shader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/graphics/Shader.cpp b/src/modules/graphics/Shader.cpp index fdd68d67c..b71bf40ce 100644 --- a/src/modules/graphics/Shader.cpp +++ b/src/modules/graphics/Shader.cpp @@ -530,6 +530,9 @@ std::string Shader::createShaderStageCode(Graphics *gfx, ShaderStageType stage, const auto &features = gfx->getCapabilities().features; + if (stage == SHADERSTAGE_COMPUTE && !features[Graphics::FEATURE_GLSL4]) + throw love::Exception("Compute shaders require GLSL 4 which is not supported on this system."); + if (info.language == LANGUAGE_GLSL3 && !features[Graphics::FEATURE_GLSL3]) throw love::Exception("GLSL 3 shaders are not supported on this system.");