shaderc: Fixed gl_FragColor patching for raw GLSL.

This commit is contained in:
Бранимир Караџић 2021-11-19 19:11:59 -08:00
parent 6224daf907
commit e6125ffa46

View File

@ -2491,6 +2491,17 @@ namespace bgfx
{
bx::stringPrintf(code, "#version %d\n", glsl_profile);
if (120 < glsl_profile)
{
if (!bx::findIdentifierMatch(input, "gl_FragColor").isEmpty() )
{
bx::stringPrintf(code
, "out vec4 bgfx_FragColor;\n"
"#define gl_FragColor bgfx_FragColor\n"
);
}
}
bx::stringPrintf(code
, "#define texture2DLod textureLod\n"
"#define texture2DGrad textureGrad\n"