Skip to content

Commit

Permalink
Added state checks to TEXLDL opcode.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed May 8, 2008
1 parent 305a81d commit 170d971
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mojoshader.c
Expand Up @@ -4205,6 +4205,16 @@ static void state_TEXLD(Context *ctx)
// !!! FIXME: checks for ps_1_4 and ps_1_0 versions...
} // state_TEXLD

static void state_TEXLDL(Context *ctx)
{
if (!shader_version_atleast(ctx, 3, 0))
fail(ctx, "TEXLDL in version < Shader Model 3.0");
else if (ctx->source_args[0].regtype != REG_TYPE_TEXTURE)
fail(ctx, "TEXLDL src0 must be texture register");
else if (ctx->source_args[1].regtype != REG_TYPE_SAMPLER)
fail(ctx, "TEXLDL src1 must be sampler register");
} // state_TEXLDL

static void state_DP2ADD(Context *ctx)
{
if (!replicate_swizzle(ctx->source_args[2].swizzle))
Expand Down Expand Up @@ -4334,7 +4344,7 @@ static const Instruction instructions[] =
INSTRUCTION(DSY, DS, MOJOSHADER_TYPE_PIXEL),
INSTRUCTION(TEXLDD, DSSSS, MOJOSHADER_TYPE_PIXEL),
INSTRUCTION_STATE(SETP, DSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(TEXLDL, DSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION_STATE(TEXLDL, DSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION_STATE(BREAKP, S, MOJOSHADER_TYPE_ANY),

#undef INSTRUCTION
Expand Down

0 comments on commit 170d971

Please sign in to comment.