shaderc: Fixed metal interpolation qualifiers.
This commit is contained in:
parent
1cdc78b451
commit
9d1590670e
@ -61,6 +61,7 @@ initialize_mesa_context(struct gl_context *ctx, glslopt_target api)
|
||||
ctx->Extensions.EXT_shader_framebuffer_fetch = true;
|
||||
break;
|
||||
case kGlslTargetMetal:
|
||||
ctx->Const.GLSLVersion = 150;
|
||||
ctx->Extensions.ARB_ES3_compatibility = true;
|
||||
ctx->Extensions.EXT_shader_framebuffer_fetch = true;
|
||||
break;
|
||||
|
@ -1131,9 +1131,13 @@ namespace bgfx
|
||||
|| 0 == bx::strCmp(typen, "noperspective", 13)
|
||||
|| 0 == bx::strCmp(typen, "centroid", 8) )
|
||||
{
|
||||
interpolation = typen;
|
||||
if ('f' == _options.shaderType)
|
||||
{
|
||||
interpolation = typen;
|
||||
usesInterpolationQualifiers = true;
|
||||
}
|
||||
|
||||
typen = nextWord(parse);
|
||||
usesInterpolationQualifiers = true;
|
||||
}
|
||||
|
||||
bx::StringView name = nextWord(parse);
|
||||
@ -1956,15 +1960,15 @@ namespace bgfx
|
||||
|
||||
if (0 == essl)
|
||||
{
|
||||
const bool need130 = 120 == glsl && (false
|
||||
const bool need130 = 0 != metal || (120 == glsl && (false
|
||||
|| !bx::findIdentifierMatch(input, s_130).isEmpty()
|
||||
|| usesInterpolationQualifiers
|
||||
|| usesTexelFetch
|
||||
);
|
||||
) );
|
||||
|
||||
if (0 != metal)
|
||||
{
|
||||
bx::stringPrintf(code, "#version 120\n");
|
||||
bx::stringPrintf(code, "#version 130\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2081,7 +2085,7 @@ namespace bgfx
|
||||
{
|
||||
bx::stringPrintf(code
|
||||
, "#define bgfxShadow2D shadow2D\n"
|
||||
"#define bgfxShadow2DProj shadow2DProj\n"
|
||||
"#define bgfxShadow2DProj shadow2DProj\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user