Skip to content
Permalink
Browse files
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 1b38ab51f2561f0c4a025531bb78808c2ff12fa8
Showing with 8 additions and 4 deletions.
  1. +8 −4 mojoshader.c
@@ -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)
@@ -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),

0 comments on commit 1b38ab5

Please sign in to comment.