Skip to content

Instantly share code, notes, and snippets.

std::string PreprocessGLES3Shader (const std::string& source, bool autoNormalizeNormals, bool fullVertexShaderPreprocess)
{
std::string remainder1, remainder2;
std::string vertexShaderSource = ExtractDefineBlock (source, "VERTEX", &remainder1);
std::string fragmentShaderSource = ExtractDefineBlock (remainder1, "FRAGMENT", &remainder2);
if (fullVertexShaderPreprocess)
vertexShaderSource = PreprocessGLESVertexShader (vertexShaderSource, kShaderAPIGLES3, autoNormalizeNormals);
vertexShaderSource = PreprocessVertexShader(vertexShaderSource, autoNormalizeNormals);