glsl: Fix support for PSIZE1 and up
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Thu, 31 Dec 2020 15:56:57 -0500
changeset 1319 cb1194078e48
parent 1318 ff4eb6d9c9c2
child 1320 f9036699b53a
glsl: Fix support for PSIZE1 and up
profiles/mojoshader_profile_glsl.c
--- a/profiles/mojoshader_profile_glsl.c	Wed Nov 11 15:09:32 2020 -0500
+++ b/profiles/mojoshader_profile_glsl.c	Thu Dec 31 15:56:57 2020 -0500
@@ -935,7 +935,23 @@
                     } // if
                     break;
                 case MOJOSHADER_USAGE_POINTSIZE:
-                    usage_str = "gl_PointSize";
+                    if (index == 0)
+                    {
+                        usage_str = "gl_PointSize";
+                    } // if
+                    else
+                    {
+                        push_output(ctx, &ctx->globals);
+#if SUPPORT_PROFILE_GLSLES
+                        if (support_glsles(ctx))
+                            output_line(ctx, "varying highp float io_%i_%i;", usage, index);
+                        else
+#endif
+                        output_line(ctx, "varying float io_%i_%i;", usage, index);
+                        output_line(ctx, "#define %s io_%i_%i", var, usage, index);
+                        pop_output(ctx);
+                        return;
+                    }
                     break;
                 case MOJOSHADER_USAGE_COLOR:
 #if SUPPORT_PROFILE_GLSLES