mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +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);
|
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
|
// force #version
|
||||||
ShaderProfile profile = ShaderProfile::Core;
|
ShaderProfile profile = ShaderProfile::Core;
|
||||||
SizeT versionPos = source.find("#version");
|
SizeT versionPos = source.find("#version");
|
||||||
|
|||||||
Reference in New Issue
Block a user