Added support for sampler2DRect in ESSL3
Being able to sample from sampler2DRect using the "texture" function is required for Chromium on Mac.
Change-Id: Iea8970aaec29734a251bcfc19a03223d0ebfbc7e
Reviewed-on: https://swiftshader-review.googlesource.com/17572
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Shader/SamplerCore.cpp b/src/Shader/SamplerCore.cpp
index 90aa984..8fa378f 100644
--- a/src/Shader/SamplerCore.cpp
+++ b/src/Shader/SamplerCore.cpp
@@ -299,7 +299,7 @@
// FIXME: YUV is not supported by the floating point path
bool forceFloatFiltering = state.highPrecisionFiltering && !hasYuvFormat() && (state.textureFilter != FILTER_POINT);
bool seamlessCube = (state.addressingModeU == ADDRESSING_SEAMLESS);
- bool rectangleTexture = (function == Rectangle);
+ bool rectangleTexture = (state.textureType == TEXTURE_RECTANGLE);
if(hasFloatTexture() || hasUnnormalizedIntegerTexture() || forceFloatFiltering || seamlessCube || rectangleTexture) // FIXME: Mostly identical to integer sampling
{
Float4 uuuu = u;
@@ -2368,7 +2368,7 @@
Float4 coord = uvw;
- if(function == Rectangle)
+ if(state.textureType == TEXTURE_RECTANGLE)
{
coord = Min(Max(coord, Float4(0.0f)), Float4(dim - Int4(1)));
}