From b22ad4fb4d8148b67ab02d9168a45ff2fd0a6849 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 31 Dec 2020 15:56:57 -0500 Subject: [PATCH] glsl: Fix support for PSIZE1 and up --- profiles/mojoshader_profile_glsl.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/profiles/mojoshader_profile_glsl.c b/profiles/mojoshader_profile_glsl.c index daa7994..a02c9f8 100644 --- a/profiles/mojoshader_profile_glsl.c +++ b/profiles/mojoshader_profile_glsl.c @@ -935,7 +935,23 @@ void emit_GLSL_attribute(Context *ctx, RegisterType regtype, int regnum, } // 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