mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
shaderc: Pass interpolator qualifiers into all stages.
This commit is contained in:
committed by
Branimir Karadžić
parent
772d6842d0
commit
39dc313347
@@ -367,6 +367,7 @@ namespace bgfx
|
|||||||
|
|
||||||
va_end(argList);
|
va_end(argList);
|
||||||
}
|
}
|
||||||
|
|
||||||
Options::Options()
|
Options::Options()
|
||||||
: shaderType(' ')
|
: shaderType(' ')
|
||||||
, disasm(false)
|
, disasm(false)
|
||||||
@@ -1220,6 +1221,7 @@ namespace bgfx
|
|||||||
else if (0 == bx::strCmpI(platform, "linux") )
|
else if (0 == bx::strCmpI(platform, "linux") )
|
||||||
{
|
{
|
||||||
preprocessor.setDefine("BX_PLATFORM_LINUX=1");
|
preprocessor.setDefine("BX_PLATFORM_LINUX=1");
|
||||||
|
|
||||||
if (profile->lang == ShadingLang::SpirV)
|
if (profile->lang == ShadingLang::SpirV)
|
||||||
{
|
{
|
||||||
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_SPIRV=1");
|
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_SPIRV=1");
|
||||||
@@ -1229,17 +1231,17 @@ namespace bgfx
|
|||||||
preprocessor.setDefine(glslDefine);
|
preprocessor.setDefine(glslDefine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (
|
else if (0 == bx::strCmpI(platform, "ios")
|
||||||
0 == bx::strCmpI(platform, "ios") ||
|
|| 0 == bx::strCmpI(platform, "osx")
|
||||||
0 == bx::strCmpI(platform, "osx") ||
|
|| 0 == bx::strCmpI(platform, "visionos")
|
||||||
0 == bx::strCmpI(platform, "visionos")
|
)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (0 == bx::strCmpI(platform, "osx"))
|
if (0 == bx::strCmpI(platform, "osx"))
|
||||||
{
|
{
|
||||||
preprocessor.setDefine("BX_PLATFORM_OSX=1");
|
preprocessor.setDefine("BX_PLATFORM_OSX=1");
|
||||||
}
|
}
|
||||||
else if (0 == bx::strCmpI(platform, "visionos")) {
|
else if (0 == bx::strCmpI(platform, "visionos"))
|
||||||
|
{
|
||||||
preprocessor.setDefine("BX_PLATFORM_VISIONOS=1");
|
preprocessor.setDefine("BX_PLATFORM_VISIONOS=1");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1257,7 +1259,7 @@ namespace bgfx
|
|||||||
, sizeof(temp)
|
, sizeof(temp)
|
||||||
, "BGFX_SHADER_LANGUAGE_METAL=%d"
|
, "BGFX_SHADER_LANGUAGE_METAL=%d"
|
||||||
, (profile->lang == ShadingLang::Metal) ? profile->id : 0
|
, (profile->lang == ShadingLang::Metal) ? profile->id : 0
|
||||||
);
|
);
|
||||||
preprocessor.setDefine(temp);
|
preprocessor.setDefine(temp);
|
||||||
}
|
}
|
||||||
else if (0 == bx::strCmpI(platform, "windows") )
|
else if (0 == bx::strCmpI(platform, "windows") )
|
||||||
@@ -1359,13 +1361,8 @@ namespace bgfx
|
|||||||
|| 0 == bx::strCmp(typen, "noperspective", 13)
|
|| 0 == bx::strCmp(typen, "noperspective", 13)
|
||||||
|| 0 == bx::strCmp(typen, "centroid", 8) )
|
|| 0 == bx::strCmp(typen, "centroid", 8) )
|
||||||
{
|
{
|
||||||
if ('f' == _options.shaderType
|
interpolation = typen;
|
||||||
|| profile->lang == ShadingLang::GLSL
|
usesInterpolationQualifiers = true;
|
||||||
|| profile->lang == ShadingLang::ESSL)
|
|
||||||
{
|
|
||||||
interpolation = typen;
|
|
||||||
usesInterpolationQualifiers = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
typen = nextWord(parse);
|
typen = nextWord(parse);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -603,8 +603,8 @@ namespace bgfx { namespace metal
|
|||||||
};
|
};
|
||||||
|
|
||||||
opt.SetMessageConsumer(print_msg_to_stderr);
|
opt.SetMessageConsumer(print_msg_to_stderr);
|
||||||
|
|
||||||
opt.RegisterLegalizationPasses();
|
opt.RegisterLegalizationPasses();
|
||||||
|
opt.RegisterPerformancePasses();
|
||||||
|
|
||||||
spvtools::ValidatorOptions validatorOptions;
|
spvtools::ValidatorOptions validatorOptions;
|
||||||
validatorOptions.SetBeforeHlslLegalization(true);
|
validatorOptions.SetBeforeHlslLegalization(true);
|
||||||
|
|||||||
@@ -732,8 +732,8 @@ namespace bgfx { namespace spirv
|
|||||||
};
|
};
|
||||||
|
|
||||||
opt.SetMessageConsumer(print_msg_to_stderr);
|
opt.SetMessageConsumer(print_msg_to_stderr);
|
||||||
|
|
||||||
opt.RegisterLegalizationPasses();
|
opt.RegisterLegalizationPasses();
|
||||||
|
opt.RegisterPerformancePasses();
|
||||||
|
|
||||||
spvtools::ValidatorOptions validatorOptions;
|
spvtools::ValidatorOptions validatorOptions;
|
||||||
validatorOptions.SetBeforeHlslLegalization(true);
|
validatorOptions.SetBeforeHlslLegalization(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user