Unnormalized texture coordinates
Unnormalized texture coordinates are pretty much the same
as rectangle texture coordinates, with a few extra addressing
modes to support. ADDRESSING_CLAMP and ADDRESSING_BORDER
work properly. Other modes can't used with unnormalized
texture coordinates, according to the Vulkan spec:
"If unnormalizedCoordinates is VK_TRUE,
addressModeU and addressModeV must each be either
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER"
Bug b/129523279
Change-Id: I3e39c16172bc5825ec48c6395f52e9b177df1304
Tests: dEQP-VK.texture.filtering.unnormal.*
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31648
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Device/Sampler.hpp b/src/Device/Sampler.hpp
index d02c723..8768a19 100644
--- a/src/Device/Sampler.hpp
+++ b/src/Device/Sampler.hpp
@@ -68,7 +68,6 @@
TEXTURE_1D,
TEXTURE_2D,
TEXTURE_3D,
- TEXTURE_RECTANGLE, // TODO(b/129523279): Eliminate
TEXTURE_CUBE,
TEXTURE_1D_ARRAY, // Treated as 2D texture with second coordinate 0.
TEXTURE_2D_ARRAY,
@@ -154,6 +153,7 @@
bool compareEnable;
VkCompareOp compareOp;
VkBorderColor border;
+ bool unnormalizedCoordinates;
#if PERF_PROFILE
bool compressedFormat;