2

When I'm reading the asm code ,I dont know how to get the instruction "round_" just below. Which function should I use in HLSL to get it? Or had it be replaced with the update of versions? The following is asm code:round_z r15.x

2 Answers2

1

There doesn't appear to be one, you can easily implement it though:

dst = sign(src) * floor(abs(src))
LJᛃ
  • 7,655
  • 2
  • 24
  • 35
0

The function you are looking for is modf. In the following snippet, i is the result of round_z:

float i;
modf(input, i);
Wouter
  • 538
  • 6
  • 15