Add support for configurable subpixel precision Bug: b/141676114 Change-Id: I47e7d90e14b44533e64d352ecc6440495c0b7d3f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36597 Presubmit-Ready: Antonio Maiorano <amaiorano@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com> Tested-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Vulkan/VkConfig.h b/src/Vulkan/VkConfig.h index 905fcf2..3bc9819 100644 --- a/src/Vulkan/VkConfig.h +++ b/src/Vulkan/VkConfig.h
@@ -78,6 +78,10 @@ MAX_POINT_SIZE = 1, // Large points are not supported. If/when we turn this on, must be >= 64. }; +constexpr int SUBPIXEL_PRECISION_BITS = 4; +constexpr float SUBPIXEL_PRECISION_FACTOR = static_cast<float>(1 << SUBPIXEL_PRECISION_BITS); +constexpr int SUBPIXEL_PRECISION_MASK = 0xFFFFFFFF >> (32 - SUBPIXEL_PRECISION_BITS); + } #endif // VK_CONFIG_HPP_
diff --git a/src/Vulkan/VkPhysicalDevice.cpp b/src/Vulkan/VkPhysicalDevice.cpp index 2ad8cf8..44a2ba4 100644 --- a/src/Vulkan/VkPhysicalDevice.cpp +++ b/src/Vulkan/VkPhysicalDevice.cpp
@@ -200,7 +200,7 @@ { 65535, 65535, 65535 }, // maxComputeWorkGroupCount[3] 128, // maxComputeWorkGroupInvocations { 128, 128, 64, }, // maxComputeWorkGroupSize[3] - 4, // subPixelPrecisionBits + vk::SUBPIXEL_PRECISION_BITS, // subPixelPrecisionBits 4, // subTexelPrecisionBits 4, // mipmapPrecisionBits UINT32_MAX, // maxDrawIndexedIndexValue