Use the correct default profile version for GLES shaders in glslang

* We need to pass 100 for GLES and 110 for desktop for proper default parsing
  without #version
This commit is contained in:
baldurk
2021-01-27 00:29:46 +00:00
parent 56c5c18aac
commit e270d76347
3 changed files with 4 additions and 1 deletions
@@ -274,6 +274,8 @@ void WrappedOpenGL::ShaderData::ProcessCompilation(WrappedOpenGL &drv, ResourceI
rdcspv::CompilationSettings settings(rdcspv::InputLanguage::OpenGLGLSL,
rdcspv::ShaderStage(ShaderIdx(type)));
settings.gles = IsGLES;
rdcstr s = rdcspv::Compile(settings, sources, spirvwords);
if(!spirvwords.empty())
spirv.Parse(spirvwords);
@@ -82,7 +82,7 @@ rdcstr rdcspv::Compile(const rdcspv::CompilationSettings &settings, const rdcarr
if(settings.debugInfo)
flags = EShMessages(flags | EShMsgDebugInfo);
bool success = shader->parse(GetDefaultResources(), 110, false, flags);
bool success = shader->parse(GetDefaultResources(), settings.gles ? 100 : 110, false, flags);
if(!success)
{
@@ -56,6 +56,7 @@ struct CompilationSettings
ShaderStage stage = ShaderStage::Invalid;
InputLanguage lang = InputLanguage::Unknown;
bool debugInfo = false;
bool gles = false;
rdcstr entryPoint;
};