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_