Refactor enum flags with __underlying_type and new EnumHasAnyFlags/EnumHasAllFlags

Fixes #832
Closes #886
This commit is contained in:
Wojtek Figat
2023-01-15 12:44:39 +01:00
parent 810f7fb803
commit f127bbebe1
101 changed files with 424 additions and 414 deletions

View File

@@ -127,7 +127,7 @@ bool LightmapFeature::Bind(MaterialShader::BindParameters& params, Span<byte>& c
auto& drawCall = *params.FirstDrawCall;
ASSERT_LOW_LAYER(cb.Length() >= sizeof(Data));
const bool useLightmap = params.RenderContext.View.Flags & ViewFlags::GI
const bool useLightmap = EnumHasAnyFlags(params.RenderContext.View.Flags, ViewFlags::GI)
#if USE_EDITOR
&& EnableLightmapsUsage
#endif
@@ -157,7 +157,7 @@ bool GlobalIlluminationFeature::Bind(MaterialShader::BindParameters& params, Spa
ASSERT_LOW_LAYER(cb.Length() >= sizeof(Data));
bool useGI = false;
if (params.RenderContext.View.Flags & ViewFlags::GI)
if (EnumHasAnyFlags(params.RenderContext.View.Flags, ViewFlags::GI))
{
switch (params.RenderContext.List->Settings.GlobalIllumination.Mode)
{