Implement EXT_shader_texture_lod
BUG=angle:551
Change-Id: I81d7574a15861f1b24ddf6147cf71adbf20e10f3
Reviewed-on: https://chromium-review.googlesource.com/194960
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/src/compiler/translator/OutputGLSL.cpp b/src/compiler/translator/OutputGLSL.cpp
index de1cd93..eb7cbb4 100644
--- a/src/compiler/translator/OutputGLSL.cpp
+++ b/src/compiler/translator/OutputGLSL.cpp
@@ -34,3 +34,24 @@
TOutputGLSLBase::visitSymbol(node);
}
}
+
+TString TOutputGLSL::translateTextureFunction(TString& name)
+{
+ static const char *simpleRename[] = {
+ "texture2DLodEXT", "texture2DLod",
+ "texture2DProjLodEXT", "texture2DProjLod",
+ "textureCubeLodEXT", "textureCubeLod",
+ "texture2DGradEXT", "texture2DGradARB",
+ "texture2DProjGradEXT", "texture2DProjGradARB",
+ "textureCubeGradEXT", "textureCubeGradARB",
+ NULL, NULL
+ };
+
+ for (int i = 0; simpleRename[i] != NULL; i += 2) {
+ if (name == simpleRename[i]) {
+ return simpleRename[i+1];
+ }
+ }
+
+ return name;
+}