소스 검색

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.
Alex Szpakowski 4 년 전
부모
커밋
b644d00bf7
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/modules/graphics/Shader.cpp

+ 3 - 0
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.");