Follow texture2DLod/ARB_shader_texture_lod spec more aggressively
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Sun, 25 Aug 2019 13:00:18 -0400
changeset 1214 5887634ea695
parent 1213 dc86dc29d124
child 1215 8e9fb483f4d4
Follow texture2DLod/ARB_shader_texture_lod spec more aggressively
profiles/mojoshader_profile_glsl.c
--- a/profiles/mojoshader_profile_glsl.c	Wed Aug 21 10:14:07 2019 -0400
+++ b/profiles/mojoshader_profile_glsl.c	Sun Aug 25 13:00:18 2019 -0400
@@ -493,13 +493,13 @@
         output_line(ctx, "#extension GL_ARB_shader_texture_lod : enable");
         output_line(ctx, "#define texture2DGrad texture2DGradARB");
         output_line(ctx, "#define texture2DProjGrad texture2DProjARB");
-        output_line(ctx, "#define texture2DLod texture2DLodARB");
         output_line(ctx, "#elif GL_EXT_gpu_shader4");
         output_line(ctx, "#extension GL_EXT_gpu_shader4 : enable");
         output_line(ctx, "#else");
         output_line(ctx, "#define texture2DGrad(a,b,c,d) texture2D(a,b)");
         output_line(ctx, "#define texture2DProjGrad(a,b,c,d) texture2DProj(a,b)");
-        output_line(ctx, "#define texture2DLod(a,b,c) texture2D(a,b)");
+        if (shader_is_pixel(ctx))
+            output_line(ctx, "#define texture2DLod(a,b,c) texture2D(a,b)");
         output_line(ctx, "#endif");
         output_blank_line(ctx);
         pop_output(ctx);