diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-01-08 05:16:37 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-01-08 05:16:37 +0000 |
| commit | ad4bded2ac01e1bdbf146403a85163d10bf16014 (patch) | |
| tree | 83249d0449b334999ac7ef6614a2aa3687876b39 /Graphics | |
| parent | Finished reworking device feature reporting; removed EngineVkCreateInfo::Devi... (diff) | |
| download | DiligentCore-ad4bded2ac01e1bdbf146403a85163d10bf16014.tar.gz DiligentCore-ad4bded2ac01e1bdbf146403a85163d10bf16014.zip | |
Fixed some clang warnings
Diffstat (limited to 'Graphics')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 13 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index ba65eb76..fc50c709 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -139,9 +139,10 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, if (m_DeviceCaps.DevType == DeviceType::OpenGL) { - const bool IsGL43OrAbove = MajorVersion >= 5 || MajorVersion == 4 && MinorVersion >= 3; - const bool IsGL42OrAbove = MajorVersion >= 5 || MajorVersion == 4 && MinorVersion >= 2; - const bool IsGL41OrAbove = MajorVersion >= 5 || MajorVersion == 4 && MinorVersion >= 1; + const bool IsGL46OrAbove = (MajorVersion >= 5) || (MajorVersion == 4 && MinorVersion >= 6); + const bool IsGL43OrAbove = (MajorVersion >= 5) || (MajorVersion == 4 && MinorVersion >= 3); + const bool IsGL42OrAbove = (MajorVersion >= 5) || (MajorVersion == 4 && MinorVersion >= 2); + const bool IsGL41OrAbove = (MajorVersion >= 5) || (MajorVersion == 4 && MinorVersion >= 1); Features.SeparablePrograms = True; Features.IndirectRendering = True; @@ -176,7 +177,7 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, TexCaps.CubemapArraysSupported = IsGL43OrAbove || CheckExtension("GL_ARB_texture_cube_map_array"); SamCaps.BorderSamplingModeSupported = True; - SamCaps.AnisotropicFilteringSupported = (MajorVersion >= 5 || MajorVersion == 4 && MinorVersion >= 6) || CheckExtension("GL_ARB_texture_filter_anisotropic"); + SamCaps.AnisotropicFilteringSupported = IsGL46OrAbove || CheckExtension("GL_ARB_texture_filter_anisotropic"); SamCaps.LODBiasSupported = True; } else @@ -186,8 +187,8 @@ RenderDeviceGLImpl::RenderDeviceGLImpl(IReferenceCounters* pRefCounters, VERIFY(m_DeviceCaps.DevType == DeviceType::OpenGLES, "Unexpected device type: OpenGLES expected"); - bool IsGLES31OrAbove = (MajorVersion >= 4 || (MajorVersion == 3 && MinorVersion >= 1)); - bool IsGLES32OrAbove = (MajorVersion >= 4 || (MajorVersion == 3 && MinorVersion >= 2)); + bool IsGLES31OrAbove = (MajorVersion >= 4) || (MajorVersion == 3 && MinorVersion >= 1); + bool IsGLES32OrAbove = (MajorVersion >= 4) || (MajorVersion == 3 && MinorVersion >= 2); Features.SeparablePrograms = IsGLES31OrAbove || strstr(Extensions, "separate_shader_objects"); Features.IndirectRendering = IsGLES31OrAbove || strstr(Extensions, "draw_indirect"); diff --git a/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp b/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp index 18db0546..44b84e78 100644 --- a/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/QueryManagerVk.cpp @@ -51,8 +51,8 @@ QueryManagerVk::QueryManagerVk(RenderDeviceVkImpl* pRenderDeviceVk, for (Uint32 QueryType = QUERY_TYPE_UNDEFINED + 1; QueryType < QUERY_TYPE_NUM_TYPES; ++QueryType) { - if (QueryType == QUERY_TYPE_OCCLUSION && !deviceFeatures.occlusionQueryPrecise || - QueryType == QUERY_TYPE_PIPELINE_STATISTICS && !deviceFeatures.pipelineStatisticsQuery) + if ((QueryType == QUERY_TYPE_OCCLUSION && !deviceFeatures.occlusionQueryPrecise) || + (QueryType == QUERY_TYPE_PIPELINE_STATISTICS && !deviceFeatures.pipelineStatisticsQuery)) continue; // clang-format off |
