Skip to content

Commit 6db3104

Browse files
committed
hlsl: Add support for TEXLDP
1 parent 2e3e16f commit 6db3104

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

profiles/mojoshader_profile_hlsl.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,14 @@ void emit_HLSL_TEXLD(Context *ctx)
17031703
return;
17041704
} // if
17051705

1706+
const char *projsep = "";
1707+
char proj[64] = { '\0' };
1708+
if (ctx->instruction_controls == CONTROL_TEXLDP)
1709+
{
1710+
projsep = " / ";
1711+
make_HLSL_srcarg_string_w(ctx, 0, proj, sizeof (proj));
1712+
} // if
1713+
17061714
// !!! FIXME: does the d3d bias value map directly to HLSL?
17071715
const char *biassep = "";
17081716
char bias[64] = { '\0' };
@@ -1742,8 +1750,8 @@ void emit_HLSL_TEXLD(Context *ctx)
17421750

17431751
char code[128];
17441752
make_HLSL_destarg_assign(ctx, code, sizeof (code),
1745-
"%s_texture.%s(%s, %s%s%s)%s", src1, funcname,
1746-
src1, src0, biassep, bias, swiz_str);
1753+
"%s_texture.%s(%s, %s%s%s%s%s)%s", src1, funcname,
1754+
src1, src0, projsep, proj, biassep, bias, swiz_str);
17471755

17481756
output_line(ctx, "%s", code);
17491757
} // else

0 commit comments

Comments
 (0)