From d7224e2b133006181a4be794fae8d54ba41c3866 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 25 May 2008 22:41:41 -0400 Subject: [PATCH] Fixed NRM in arb1 profile. Compliments of example code in GL_ARB_vertex_program spec, issue 67. --HG-- branch : trunk --- mojoshader.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index 857e4ca3..07de63c8 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -3741,12 +3741,10 @@ static void emit_ARB1_NRM(Context *ctx) { const char *dst0 = make_ARB1_destarg_string(ctx); const char *src0 = make_ARB1_srcarg_string(ctx, 0); - output_line(ctx, "MUL scratch, %s, %s", src0, src0); - output_line(ctx, "ADD scratch2.x, scratch.x, scratch.y"); - output_line(ctx, "ADD scratch2.x, scratch2.x, scratch.z"); - output_line(ctx, "RSQ%s, scratch2.x", dst0); + output_line(ctx, "DP3 scratch.w, %s, %s", src0, src0); + output_line(ctx, "RSQ scratch.w, scratch.w"); + output_line(ctx, "MUL%s, scratch.w, %s", dst0, src0); ctx->flags = (ContextFlags) (ctx->flags | CTX_FLAGS_ARB1_USES_SCRATCH1); - ctx->flags = (ContextFlags) (ctx->flags | CTX_FLAGS_ARB1_USES_SCRATCH2); } // emit_ARB1_NRM static void emit_ARB1_SINCOS(Context *ctx)