Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implemented DSX and DSY in the GLSL profile.
I _think_ these are direct mappings to GLSL built-in functions, but I'm not
 sure here...msdn is really vague about exactly what equation should be used.

--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 6, 2008
1 parent f4fed45 commit 1b38ab5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mojoshader.c
Expand Up @@ -2635,12 +2635,16 @@ static void emit_GLSL_DP2ADD(Context *ctx)

static void emit_GLSL_DSX(Context *ctx)
{
fail(ctx, "unimplemented."); // !!! FIXME
const char *src0 = make_GLSL_sourcearg_string(ctx, 0);
const char *code = make_GLSL_destarg_assign(ctx, 0, "dFdx(%s)", src0);
output_line(ctx, "%s", code);
} // emit_GLSL_DSX

static void emit_GLSL_DSY(Context *ctx)
{
fail(ctx, "unimplemented."); // !!! FIXME
const char *src0 = make_GLSL_sourcearg_string(ctx, 0);
const char *code = make_GLSL_destarg_assign(ctx, 0, "dFdy(%s)", src0);
output_line(ctx, "%s", code);
} // emit_GLSL_DSY

static void emit_GLSL_TEXLDD(Context *ctx)
Expand Down Expand Up @@ -3497,8 +3501,8 @@ static const Instruction instructions[] =
INSTRUCTION(CMP, 4, DSSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(BEM, 3, DSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(DP2ADD, 4, DSSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(DSX, 2, DS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(DSY, 2, DS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(DSX, 2, DS, MOJOSHADER_TYPE_PIXEL),
INSTRUCTION(DSY, 2, DS, MOJOSHADER_TYPE_PIXEL),
INSTRUCTION(TEXLDD, 5, DSSSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION_STATE(SETP, 3, DSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(TEXLDL, 3, DSS, MOJOSHADER_TYPE_ANY),
Expand Down

0 comments on commit 1b38ab5

Please sign in to comment.