mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 20:28:32 +09:00
[Feat] (MG_Util/ShaderTranspiler): remove noperspective in preprocessing
This commit is contained in:
@@ -22,6 +22,16 @@ namespace MobileGL {
|
||||
linedirPos = source.find("#line", linedirPos);
|
||||
}
|
||||
|
||||
// remove "noperspective"
|
||||
const char* str_np = "noperspective";
|
||||
const SizeT len_np = strlen(str_np);
|
||||
SizeT noperspectivePos = source.find(str_np);
|
||||
while (noperspectivePos != std::string::npos) {
|
||||
// + length of "\n"
|
||||
source = source.replace(noperspectivePos, len_np, "");
|
||||
noperspectivePos = source.find(str_np);
|
||||
}
|
||||
|
||||
// force #version
|
||||
ShaderProfile profile = ShaderProfile::Core;
|
||||
SizeT versionPos = source.find("#version");
|
||||
|
||||
Reference in New Issue
Block a user