From 1850dccb10db92e03c13bd793209f3ac9159f07f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 2 Jun 2008 16:47:27 -0400 Subject: [PATCH] Fix output register declaration in arb1 profile. --HG-- branch : trunk --- mojoshader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index 38cc78cc..c8ceca73 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -3963,13 +3963,20 @@ static void emit_ARB1_attribute(Context *ctx, RegisterType regtype, int regnum, else if (shader_is_pixel(ctx)) { + const char *paramtype_str = "ATTRIB"; // samplers DCLs get handled in emit_ARB1_sampler(). if (regtype == REG_TYPE_COLOROUT) + { + paramtype_str = "OUTPUT"; usage_str = "result.color"; + } // if else if (regtype == REG_TYPE_DEPTHOUT) + { + paramtype_str = "OUTPUT"; usage_str = "result.depth"; + } // else if // !!! FIXME: can you actualy have a texture register with COLOR usage? else if ((regtype == REG_TYPE_TEXTURE) || (regtype == REG_TYPE_INPUT)) @@ -4024,8 +4031,8 @@ static void emit_ARB1_attribute(Context *ctx, RegisterType regtype, int regnum, if (usage_str != NULL) { push_output(ctx, &ctx->globals); - output_line(ctx, "ATTRIB %s = %s%s%s%s;", varname, usage_str, - arrayleft, index_str, arrayright); + output_line(ctx, "%s %s = %s%s%s%s;", paramtype_str, varname, + usage_str, arrayleft, index_str, arrayright); pop_output(ctx); } // if } // else if