Narrow point size range clamping to affected versions

Bug: angleproject:2970
Change-Id: Ie14725b0cf30738d394320c24a72bc947135f5cf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1993204
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Eric Binet 2020-01-08 17:42:21 -05:00 коммит произвёл Commit Bot
Родитель 23b8857be5
Коммит 5aed7c74b7
5 изменённых файлов: 27 добавлений и 2 удалений

Просмотреть файл

@ -45,6 +45,7 @@ Google Inc.
Kai Ninomiya
Victor Costan
Shahbaz Youssefi
Eric Binet
Adobe Systems Inc.
Alexandru Chiculita

Просмотреть файл

@ -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

Просмотреть файл

@ -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_

Просмотреть файл

@ -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",

Просмотреть файл

@ -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.