Low-Level Thinking in High-Level Shading Languages | GDC 2013

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

ความคิดเห็น • 2

  • @xinyuezhu670
    @xinyuezhu670 ปีที่แล้ว

    why (x+1.0f)*0.5f has optimized way? I think (0.5*x + 0.5) and (x+1.0f)*0.5f both need ADD and MUL Command....

    • @perli216
      @perli216  ปีที่แล้ว

      What do you mean exactly? Writing it in the form of (0.5*x + 0.5) seems like it would map to a MAD instruction, while in the original form it doesn't. MAD does both Multiply and Add in a single instruction, but I the order of operation matters, so doing it in the order of Add then multiply (as in the original form) wouldn't work, at least not without breaking floating point rules.