Threadwell

Recent Notes

  • JohannesVuorine

    Aug 26, 2026

    • archive
    • twitter
    • johannesvuorine
  • Threads

    Aug 26, 2026

    • archive
  • iquilezles

    Aug 26, 2026

    • archive
    • twitter
    • iquilezles
Home

❯

Archive

❯

Threads

❯

iquilezles

❯

Hey, don't "optimize" conditional moves with mix()+step().

❯

@iquilezles This greatly depends.

@iquilezles This greatly depends.

Properties5
typearchive
sourcetwitter
date2025-02-09
tagsarchive, twitter, iquilezles
description@iquilezles This greatly depends.

Feb 09, 20251 min read

  • archive
  • twitter
  • iquilezles

Source

  • URL: https://x.com/Tynach/status/1888663322171781564
  • Author: Tynach (@Tynach)
  • Posted: 2025-02-09 18:56:40

Branch

1/ @Tynach

@iquilezles

This greatly depends. Try doing this per-channel on a vec3 or vec4, and you’ll realize that the ‘mix()’ version creates a LOT less assembly code. I tested this with my GLSL code for converting to and from sRGB, using one of the online tools linked to in other responses.



Related

  • Spine: 2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step

Graph View

  • Source
  • Branch
  • Related

Backlinks

  • Hey, don't "optimize" conditional moves with mix()+step().

Created with Quartz v5.0.0 © 2026

  • GitHub