From 9da55047110d20a93e2876af6be481a6d61f9588 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 12 May 2008 02:25:22 -0400 Subject: [PATCH] Fixed DCL'ing of vFace and vPos registers in D3D profile. --HG-- branch : trunk --- mojoshader.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index f86710a7..da99095e 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -1498,8 +1498,7 @@ static void emit_D3D_DCL(Context *ctx) if (arg->regtype == REG_TYPE_SAMPLER) { - const TextureType ttype = (const TextureType) ctx->dwords[0]; - switch (ttype) + switch ((const TextureType) ctx->dwords[0]) { case TEXTURE_TYPE_2D: usage_str = "_2d"; break; case TEXTURE_TYPE_CUBE: usage_str = "_cube"; break; @@ -1508,6 +1507,18 @@ static void emit_D3D_DCL(Context *ctx) } // switch } // if + else if (arg->regtype == REG_TYPE_MISCTYPE) + { + switch ((const MiscTypeType) arg->regnum) + { + case MISCTYPE_TYPE_POSITION: + case MISCTYPE_TYPE_FACE: + usage_str = ""; // just become "dcl vFace" or whatever. + break; + default: fail(ctx, "unknown misc register type"); return; + } // switch + } // else if + else { const uint32 usage = ctx->dwords[0];