Minor refactor of ShaderWriter flags. Extracted from the stereo PR

This commit is contained in:
Henrik Rydgård 2022-10-23 21:50:29 +02:00
parent a13ab3f76b
commit ecf2797173
7 changed files with 39 additions and 33 deletions

View file

@ -94,7 +94,7 @@ void GenerateStencilFs(char *buffer, const ShaderLanguageDesc &lang, const Draw:
writer.C("float roundAndScaleTo255f(in float x) { return floor(x * 255.99); }\n");
writer.BeginFSMain(uniforms, varyings, FSFLAG_NONE);
writer.BeginFSMain(uniforms, varyings);
writer.C(" vec4 index = ").SampleTexture2D("tex", "v_texcoord.xy").C(";\n");
writer.C(" vec4 outColor = index.aaaa;\n"); // Only care about a.
@ -106,7 +106,7 @@ void GenerateStencilFs(char *buffer, const ShaderLanguageDesc &lang, const Draw:
writer.C(" gl_FragDepth = gl_FragCoord.z;\n");
}
writer.EndFSMain("outColor", FSFLAG_NONE);
writer.EndFSMain("outColor");
}
// This can probably be shared with some other shaders, like reinterpret or the future depth upload.