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/OpenGL/compiler/OutputASM.cpp b/src/OpenGL/compiler/OutputASM.cpp
index fea45f9..b3385c2 100644
--- a/src/OpenGL/compiler/OutputASM.cpp
+++ b/src/OpenGL/compiler/OutputASM.cpp
@@ -421,11 +421,11 @@
{
TString name = TFunction::unmangleName(nodeName);
- if(name == "texture2D" || name == "textureCube" || name == "texture" || name == "texture3D")
+ if(name == "texture2D" || name == "textureCube" || name == "texture" || name == "texture3D" || name == "texture2DRect")
{
method = IMPLICIT;
}
- else if(name == "texture2DProj" || name == "textureProj")
+ else if(name == "texture2DProj" || name == "textureProj" || name == "texture2DRectProj")
{
method = IMPLICIT;
proj = true;
@@ -494,15 +494,6 @@
proj = true;
offset = true;
}
- else if(name == "texture2DRect")
- {
- method = RECT;
- }
- else if(name == "texture2DRectProj")
- {
- method = RECT;
- proj = true;
- }
else UNREACHABLE(0);
}
@@ -1470,9 +1461,6 @@
}
else UNREACHABLE(argumentCount);
break;
- case TextureFunction::RECT:
- emit(sw::Shader::OPCODE_TEXRECT, result, &coord, s);
- break;
case TextureFunction::SIZE:
emit(sw::Shader::OPCODE_TEXSIZE, result, arg[1], s);
break;