mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-06-08 11:23:52 +00:00
shaderc: Fixed GLSL 140. (#3644)
This commit is contained in:
committed by
GitHub
parent
fd8d480b28
commit
f1ff08a799
@@ -2452,11 +2452,24 @@ namespace bgfx
|
||||
|
||||
bx::stringPrintf(code, "#version %d\n", need130 ? 130 : glsl_profile);
|
||||
|
||||
if (need130)
|
||||
if (need130
|
||||
|| glsl_profile >= 130)
|
||||
{
|
||||
bx::stringPrintf(code, "#define attribute in\n");
|
||||
bx::stringPrintf(code, "#define varying %s\n"
|
||||
, 'f' == _options.shaderType ? "in" : "out"
|
||||
);
|
||||
bx::stringPrintf(code
|
||||
, "#define bgfxShadow2D(_sampler, _coord) vec4_splat(texture(_sampler, _coord) )\n"
|
||||
"#define bgfxShadow2DProj(_sampler, _coord) vec4_splat(textureProj(_sampler, _coord) )\n"
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
bx::stringPrintf(code
|
||||
, "#define bgfxShadow2D shadow2D\n"
|
||||
"#define bgfxShadow2DProj shader2DProj\n"
|
||||
);
|
||||
}
|
||||
|
||||
if (usesInstanceID)
|
||||
@@ -2547,21 +2560,6 @@ namespace bgfx
|
||||
"#define textureCubeGrad textureCubeGradEXT\n"
|
||||
);
|
||||
}
|
||||
|
||||
if (need130 || (glsl_profile >= 130) )
|
||||
{
|
||||
bx::stringPrintf(code
|
||||
, "#define bgfxShadow2D(_sampler, _coord) vec4_splat(texture(_sampler, _coord) )\n"
|
||||
"#define bgfxShadow2DProj(_sampler, _coord) vec4_splat(textureProj(_sampler, _coord) )\n"
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
bx::stringPrintf(code
|
||||
, "#define bgfxShadow2D shadow2D\n"
|
||||
"#define bgfxShadow2DProj shader2DProj\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user