diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 65a194ec1..022e0ba91 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -45,6 +45,7 @@ Google Inc. Kai Ninomiya Victor Costan Shahbaz Youssefi + Eric Binet Adobe Systems Inc. Alexandru Chiculita diff --git a/src/gpu_info_util/SystemInfo.cpp b/src/gpu_info_util/SystemInfo.cpp index 975f6ea16..3e5549d55 100644 --- a/src/gpu_info_util/SystemInfo.cpp +++ b/src/gpu_info_util/SystemInfo.cpp @@ -320,4 +320,14 @@ void PrintSystemInfo(const SystemInfo &info) } std::cout << std::endl; } + +VersionInfo ParseNvidiaDriverVersion(uint32_t version) +{ + return { + version >> 22, // major + version >> 14 & 0xff, // minor + version >> 6 & 0xff, // subMinor + version & 0x3f // patch + }; +} } // namespace angle diff --git a/src/gpu_info_util/SystemInfo.h b/src/gpu_info_util/SystemInfo.h index fccd27784..bd8d5eafc 100644 --- a/src/gpu_info_util/SystemInfo.h +++ b/src/gpu_info_util/SystemInfo.h @@ -123,6 +123,8 @@ void GetDualGPUInfo(SystemInfo *info); // Dumps the system info to stdout. void PrintSystemInfo(const SystemInfo &info); + +VersionInfo ParseNvidiaDriverVersion(uint32_t version); } // namespace angle #endif // GPU_INFO_UTIL_SYSTEM_INFO_H_ diff --git a/src/libANGLE/renderer/vulkan/BUILD.gn b/src/libANGLE/renderer/vulkan/BUILD.gn index ed320f50b..b570bf978 100644 --- a/src/libANGLE/renderer/vulkan/BUILD.gn +++ b/src/libANGLE/renderer/vulkan/BUILD.gn @@ -195,6 +195,7 @@ angle_source_set("angle_vulkan_backend") { libs = [] deps = [ ":angle_vulkan_entry_points", + "$angle_root:angle_gpu_info_util", "$angle_root:angle_image_util", "$angle_root/third_party/vulkan-headers/src:vulkan_headers", "$angle_spirv_tools_dir:spvtools_val", diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp index e323d211d..d10e5a9f8 100644 --- a/src/libANGLE/renderer/vulkan/RendererVk.cpp +++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp @@ -17,6 +17,7 @@ #include "common/debug.h" #include "common/platform.h" #include "common/system_utils.h" +#include "gpu_info_util/SystemInfo.h" #include "libANGLE/Context.h" #include "libANGLE/Display.h" #include "libANGLE/renderer/driver_utils.h" @@ -1390,8 +1391,18 @@ void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames) ANGLE_FEATURE_CONDITION((&mFeatures), forceCPUPathForCubeMapCopy, IsWindows() && isIntel); // Work around incorrect NVIDIA point size range clamping. - // TODO(jmadill): Narrow driver range once fixed. http://anglebug.com/2970 - ANGLE_FEATURE_CONDITION((&mFeatures), clampPointSize, isNvidia); + // http://anglebug.com/2970#c10 + // Clamp if driver version is: + // < 430 on Windows + // < 421 otherwise + angle::VersionInfo nvidiaVersion; + if (isNvidia) + { + nvidiaVersion = + angle::ParseNvidiaDriverVersion(this->mPhysicalDeviceProperties.driverVersion); + } + ANGLE_FEATURE_CONDITION((&mFeatures), clampPointSize, + isNvidia && nvidiaVersion.major < uint32_t(IsWindows() ? 430 : 421)); // Work around ineffective compute-graphics barriers on Nexus 5X. // TODO(syoussefi): Figure out which other vendors and driver versions are affected.