Based on feedback rename checkShaderStageForNVExtensions to checkExtensionStage

Also continue error checking post requireStage() check
This commit is contained in:
Sahil Parmar 2018-09-27 11:08:13 -07:00
parent 251344f692
commit 80b9872cb4
2 changed files with 6 additions and 18 deletions

View file

@ -742,10 +742,8 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
return;
}
#ifdef NV_EXTENSIONS
if (!checkShaderStageForNVExtensions(getCurrentLoc(), extension))
return;
#endif
// check if extension is used with correct shader stage
checkExtensionStage(getCurrentLoc(), extension);
// update the requested extension
updateExtensionBehavior(extension, behavior);
@ -839,24 +837,16 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe
}
}
#ifdef NV_EXTENSIONS
// Check if extension is used with correct shader stage.
bool TParseVersions::checkShaderStageForNVExtensions(const TSourceLoc& loc, const char * const extension)
void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * const extension)
{
int lNumErrors = getNumErrors();
#ifdef NV_EXTENSIONS
// GL_NV_mesh_shader extension is only allowed in task/mesh shaders
if (strcmp(extension, "GL_NV_mesh_shader") == 0)
requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask),
"#extension GL_NV_mesh_shader");
// TODO: need to add error checks for other nvidia turing extensions
if (getNumErrors() > lNumErrors)
return false;
return true;
}
#endif
}
// Call for any operation needing full GLSL integer data-type support.
void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op)