diff --git a/archive/threads/AgileJebrim/2025-02-09-check-your-compiler/index.md b/archive/threads/AgileJebrim/2025-02-09-check-your-compiler/index.md index e9b6d19..bce5f2f 100644 --- a/archive/threads/AgileJebrim/2025-02-09-check-your-compiler/index.md +++ b/archive/threads/AgileJebrim/2025-02-09-check-your-compiler/index.md @@ -31,6 +31,9 @@ Check your compiler. Do not trust crap advice like this. Compilers do a piss poo step() isn’t necessary however. https://t.co/ianYUdKGcc +https://x.com/iquilezles/status/1888409333182218691 +[[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] + **2/** **@mcnabbd** ^1888418494666227843 **@AgileJebrim** diff --git a/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GamesMechanized-looks-soooo-good-for-mobile-great-work-hh-devs.md b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GamesMechanized-looks-soooo-good-for-mobile-great-work-hh-devs.md new file mode 100644 index 0000000..6d06024 --- /dev/null +++ b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GamesMechanized-looks-soooo-good-for-mobile-great-work-hh-devs.md @@ -0,0 +1,37 @@ +--- +title: "@JohannesVuorine Looks soooo good for mobile, great work HH devs!" +type: archive +source: twitter +source_url: "https://x.com/GamesMechanized/status/1903517066541383856" +author: "MechanizedGames" +handle: GamesMechanized +post_id: "1903517066541383856" +date: 2025-03-22 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - JohannesVuorine +description: "@JohannesVuorine Looks soooo good for mobile, great work HH devs!" +in_reply_to: "" +parent_post_id: "1903305450969526504" +--- + +## Source + +- URL: https://x.com/GamesMechanized/status/1903517066541383856 +- Author: MechanizedGames (@GamesMechanized) +- Posted: 2025-03-22 18:40:08 + +## Branch + +**1/** **@GamesMechanized** ^1903517066541383856 + +**@JohannesVuorine** + +Looks soooo good for mobile, great work HH devs! + +## Related + +- Spine: [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures]] diff --git a/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GioAbelix-this-is-so-cute.md b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GioAbelix-this-is-so-cute.md new file mode 100644 index 0000000..3e9b41a --- /dev/null +++ b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GioAbelix-this-is-so-cute.md @@ -0,0 +1,37 @@ +--- +title: "@JohannesVuorine This is so cute!" +type: archive +source: twitter +source_url: "https://x.com/GioAbelix/status/1903381068129993002" +author: "Giorgi Abelashvili" +handle: GioAbelix +post_id: "1903381068129993002" +date: 2025-03-22 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - JohannesVuorine +description: "@JohannesVuorine This is so cute!" +in_reply_to: "" +parent_post_id: "1903305450969526504" +--- + +## Source + +- URL: https://x.com/GioAbelix/status/1903381068129993002 +- Author: Giorgi Abelashvili (@GioAbelix) +- Posted: 2025-03-22 09:39:44 + +## Branch + +**1/** **@GioAbelix** ^1903381068129993002 + +**@JohannesVuorine** + +This is so cute! + +## Related + +- Spine: [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures]] diff --git a/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-i-love-creating-games-im-downloading-now-cant.md b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-i-love-creating-games-im-downloading-now-cant.md new file mode 100644 index 0000000..8d56482 --- /dev/null +++ b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-i-love-creating-games-im-downloading-now-cant.md @@ -0,0 +1,37 @@ +--- +title: "@JohannesVuorine I love creating games." +type: archive +source: twitter +source_url: "https://x.com/TryH4rd_Gaming/status/1903516100547023238" +author: "(GG's)TryH4rdGamingFN" +handle: TryH4rd_Gaming +post_id: "1903516100547023238" +date: 2025-03-22 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - JohannesVuorine +description: "@JohannesVuorine I love creating games." +in_reply_to: "" +parent_post_id: "1903305450969526504" +--- + +## Source + +- URL: https://x.com/TryH4rd_Gaming/status/1903516100547023238 +- Author: (GG's)TryH4rdGamingFN (@TryH4rd_Gaming) +- Posted: 2025-03-22 18:36:18 + +## Branch + +**1/** **@TryH4rd_Gaming** ^1903516100547023238 + +**@JohannesVuorine** + +I love creating games. Im downloading now. Cant wait to mess with it + +## Related + +- Spine: [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures]] diff --git a/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-maan-just-exploring-these-past-5-10-minutes-there.md b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-maan-just-exploring-these-past-5-10-minutes-there.md new file mode 100644 index 0000000..aae1244 --- /dev/null +++ b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-maan-just-exploring-these-past-5-10-minutes-there.md @@ -0,0 +1,58 @@ +--- +title: "MAAN." +type: archive +source: twitter +source_url: "https://x.com/TryH4rd_Gaming/status/1903521369330979233" +author: "(GG's)TryH4rdGamingFN" +handle: TryH4rd_Gaming +post_id: "1903521369330979233" +date: 2025-03-22 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - JohannesVuorine +description: "MAAN." +in_reply_to: "" +parent_post_id: "1903305450969526504" +--- + +## Source + +- URL: https://x.com/TryH4rd_Gaming/status/1903521369330979233 +- Author: (GG's)TryH4rdGamingFN (@TryH4rd_Gaming) +- Posted: 2025-03-22 18:57:14 + +## Branch + +**1/** **@TryH4rd_Gaming** ^1903521369330979233 + +MAAN. Just exploring these past 5-10 minutes. There is already so many options. This is so freaking cool. Im a beginner somewhat when it comes to Logic and more custom stuff, but it seems pretty easy to mess with, even for someone like me. + +And you can create and even IMPORT you're own assets. Thats INSANE. + +![](https://pbs.twimg.com/media/GmqqmCoXoAAABoS?format=jpg&name=orig) +![](https://pbs.twimg.com/media/GmqqmCoXkAAlveT?format=jpg&name=orig) + +**2/** **@JohannesVuorine** ^1903544791377564009 + +**@TryH4rd_Gaming** + +Glad to hear! We are building a fully featured custom game editor with instant publishing in your pocket (or web). + +**3/** **@TryH4rd_Gaming** ^1903571352260415860 + +**@JohannesVuorine** + +Where do i report bugs at ? + +**4/** **@JohannesVuorine** ^1903623742497886379 + +**@TryH4rd_Gaming** + +https://discord.gg/hypehype + +## Related + +- Spine: [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures]] diff --git a/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-charliejiangdev-i-like-the-art-style.md b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-charliejiangdev-i-like-the-art-style.md new file mode 100644 index 0000000..7fa936f --- /dev/null +++ b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-charliejiangdev-i-like-the-art-style.md @@ -0,0 +1,37 @@ +--- +title: "@JohannesVuorine I like the art style" +type: archive +source: twitter +source_url: "https://x.com/charliejiangdev/status/1903423991626551688" +author: "Charlie Jiang" +handle: charliejiangdev +post_id: "1903423991626551688" +date: 2025-03-22 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - JohannesVuorine +description: "@JohannesVuorine I like the art style" +in_reply_to: "" +parent_post_id: "1903305450969526504" +--- + +## Source + +- URL: https://x.com/charliejiangdev/status/1903423991626551688 +- Author: Charlie Jiang (@charliejiangdev) +- Posted: 2025-03-22 12:30:18 + +## Branch + +**1/** **@charliejiangdev** ^1903423991626551688 + +**@JohannesVuorine** + +I like the art style + +## Related + +- Spine: [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures]] diff --git a/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/index.md b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/index.md new file mode 100644 index 0000000..7f36b0a --- /dev/null +++ b/archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/index.md @@ -0,0 +1,38 @@ +--- +title: "you can now add textures" +type: archive +source: twitter +source_url: "https://x.com/JohannesVuorine/status/1903305450969526504" +author: "Johannes Vuorinen" +handle: JohannesVuorine +post_id: "1903305450969526504" +date: 2025-03-22 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - JohannesVuorine +description: "you can now add textures" +in_reply_to: "" +--- + +## Source + +- URL: https://x.com/JohannesVuorine/status/1903305450969526504 +- Author: Johannes Vuorinen (@JohannesVuorine) +- Posted: 2025-03-22 04:39:15 + +## Thread + +**1/** **@JohannesVuorine** ^1903305450969526504 + +you can now add textures + + + +Branches: [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GioAbelix-this-is-so-cute]], [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-charliejiangdev-i-like-the-art-style]], [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-i-love-creating-games-im-downloading-now-cant]], [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-GamesMechanized-looks-soooo-good-for-mobile-great-work-hh-devs]], [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures/2025-03-22-TryH4rd_Gaming-maan-just-exploring-these-past-5-10-minutes-there]] + +**2/** **@JohannesVuorine** ^1903763219438583903 + +https://hypehype.com/game/gdc-woolly-platformer-demo/r/uZAdwIZYalv8Nh diff --git a/archive/threads/JohannesVuorine/index.md b/archive/threads/JohannesVuorine/index.md new file mode 100644 index 0000000..2139420 --- /dev/null +++ b/archive/threads/JohannesVuorine/index.md @@ -0,0 +1,12 @@ +--- +title: JohannesVuorine +type: note +draft: false +description: Archived threads by JohannesVuorine. +tags: + - archive + - twitter + - JohannesVuorine +--- + +- [[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures]] diff --git a/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/2025-03-28-VoxelBoy-any-tips-or-existing-solutions-on-achieving.md b/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/2025-03-28-VoxelBoy-any-tips-or-existing-solutions-on-achieving.md index 361af28..c1e5534 100644 --- a/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/2025-03-28-VoxelBoy-any-tips-or-existing-solutions-on-achieving.md +++ b/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/2025-03-28-VoxelBoy-any-tips-or-existing-solutions-on-achieving.md @@ -7,7 +7,7 @@ author: "Yilmaz Kiymaz" handle: VoxelBoy post_id: "1905551799790006590" date: 2025-03-28 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive diff --git a/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/index.md b/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/index.md index dcabb76..b966b4c 100644 --- a/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/index.md +++ b/archive/threads/SebAaltonen/2025-03-28-indoor-scenes-in-hypehype-are-starting-to-look/index.md @@ -7,7 +7,7 @@ author: "Sebastian Aaltonen" handle: SebAaltonen post_id: "1905523331496828964" date: 2025-03-28 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive @@ -52,6 +52,9 @@ Both games are running smoothly on dirt cheap <$99 phones with all the tech runn Game by @DanielPalmiArt +https://x.com/JohannesVuorine/status/1903305450969526504 +[[archive/threads/JohannesVuorine/2025-03-22-you-can-now-add-textures]] + **5/** **@SebAaltonen** ^1905527913341972664 **@DanielPalmiArt** diff --git a/archive/threads/index.md b/archive/threads/index.md index af5f6c0..40b83c1 100644 --- a/archive/threads/index.md +++ b/archive/threads/index.md @@ -19,6 +19,7 @@ Example of the note shape (single spine, no branches): [[archive/threads/How to - [[archive/threads/ChipsandCheese9]] - [[archive/threads/Dispatch_Graph]] - [[archive/threads/FFmpeg]] +- [[archive/threads/JohannesVuorine]] - [[archive/threads/Jonathan_Blow]] - [[archive/threads/KostasAAA]] - [[archive/threads/MyNameIsMJP]] @@ -32,6 +33,7 @@ Example of the note shape (single spine, no branches): [[archive/threads/How to - [[archive/threads/bmcnett]] - [[archive/threads/cmuratori]] - [[archive/threads/hsn8086]] +- [[archive/threads/iquilezles]] - [[archive/threads/kechogarcia]] - [[archive/threads/kenpex]] - [[archive/threads/levelsio]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-conditional-moves-are-also-a-cpu-thing-and.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-conditional-moves-are-also-a-cpu-thing-and.md new file mode 100644 index 0000000..ebbc7a3 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-conditional-moves-are-also-a-cpu-thing-and.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Conditional moves are also a CPU thing, and compilers knows about them !" +type: archive +source: twitter +source_url: "https://x.com/AndroidBlogger/status/1888578441882034330" +author: "Manu_TechAndGames" +handle: AndroidBlogger +post_id: "1888578441882034330" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Conditional moves are also a CPU thing, and compilers knows about them !" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/AndroidBlogger/status/1888578441882034330 +- Author: Manu_TechAndGames (@AndroidBlogger) +- Posted: 2025-02-09 13:19:23 + +## Branch + +**1/** **@AndroidBlogger** ^1888578441882034330 + +**@iquilezles** + +Conditional moves are also a CPU thing, and compilers knows about them ! + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-do-you-know-if-there-is-any-online-shader.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-do-you-know-if-there-is-any-online-shader.md new file mode 100644 index 0000000..0e4858a --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-do-you-know-if-there-is-any-online-shader.md @@ -0,0 +1,40 @@ +--- +title: "@iquilezles @iquilezles :" +type: archive +source: twitter +source_url: "https://x.com/AndroidBlogger/status/1888579084411703305" +author: "Manu_TechAndGames" +handle: AndroidBlogger +post_id: "1888579084411703305" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles @iquilezles :" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/AndroidBlogger/status/1888579084411703305 +- Author: Manu_TechAndGames (@AndroidBlogger) +- Posted: 2025-02-09 13:21:56 + +## Branch + +**1/** **@AndroidBlogger** ^1888579084411703305 + +**@iquilezles** **@iquilezles** + +: +Do you know if there is any online shader compiler that let you see the ASM ? +I have a mental model of GPU as less complex things than CPU, but I never tried to watch the produced ASM... +( is it even called ASM ?? ) + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ENDESGA-i-feel-half-of-the-problem-is-that-people-dont.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ENDESGA-i-feel-half-of-the-problem-is-that-people-dont.md new file mode 100644 index 0000000..33c8cbc --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ENDESGA-i-feel-half-of-the-problem-is-that-people-dont.md @@ -0,0 +1,38 @@ +--- +title: "@iquilezles I feel half of the problem is that people don't quite understand when branching actually occurs, and then get convinced by the whole \"ternary/if-else is bad because branching\"." +type: archive +source: twitter +source_url: "https://x.com/ENDESGA/status/1888477617696981229" +author: "End" +handle: ENDESGA +post_id: "1888477617696981229" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles I feel half of the problem is that people don't quite understand when branching actually occurs, and then get convinced by the whole \"ternary/if-else is bad because branching\"." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/ENDESGA/status/1888477617696981229 +- Author: End (@ENDESGA) +- Posted: 2025-02-09 06:38:44 + +## Branch + +**1/** **@ENDESGA** ^1888477617696981229 + +**@iquilezles** + +I feel half of the problem is that people don't quite understand when branching actually occurs, and then get convinced by the whole "ternary/if-else is bad because branching". +This clarification helps, but I'm thinking more could be said about when complex branching does happen + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-GhostHandDev-tl-dr-compilers-will-generally-fix-this-kind-of.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-GhostHandDev-tl-dr-compilers-will-generally-fix-this-kind-of.md new file mode 100644 index 0000000..bb245ae --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-GhostHandDev-tl-dr-compilers-will-generally-fix-this-kind-of.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles tl dr, compilers will generally fix this kind of issue for you" +type: archive +source: twitter +source_url: "https://x.com/GhostHandDev/status/1888620838263439785" +author: "✨Ghost Hand - Follow us on Kickstarter!" +handle: GhostHandDev +post_id: "1888620838263439785" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles tl dr, compilers will generally fix this kind of issue for you" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/GhostHandDev/status/1888620838263439785 +- Author: ✨Ghost Hand - Follow us on Kickstarter! (@GhostHandDev) +- Posted: 2025-02-09 16:07:51 + +## Branch + +**1/** **@GhostHandDev** ^1888620838263439785 + +**@iquilezles** + +tl dr, compilers will generally fix this kind of issue for you + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Niels_Dewitte-i-think-we-need-deeper-write-ups-on-this-subject.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Niels_Dewitte-i-think-we-need-deeper-write-ups-on-this-subject.md new file mode 100644 index 0000000..b2dbec2 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Niels_Dewitte-i-think-we-need-deeper-write-ups-on-this-subject.md @@ -0,0 +1,38 @@ +--- +title: "@iquilezles I think we need deeper write-ups on this subject as well." +type: archive +source: twitter +source_url: "https://x.com/Niels_Dewitte/status/1888734935349080343" +author: "Niels Dewitte ニルス" +handle: Niels_Dewitte +post_id: "1888734935349080343" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles I think we need deeper write-ups on this subject as well." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/Niels_Dewitte/status/1888734935349080343 +- Author: Niels Dewitte ニルス (@Niels_Dewitte) +- Posted: 2025-02-09 23:41:14 + +## Branch + +**1/** **@Niels_Dewitte** ^1888734935349080343 + +**@iquilezles** + +I think we need deeper write-ups on this subject as well. +Like what about the case where the condition isn't constant? What if every fragment potentially has a completely different outcome. Are there any predictions we can make without just testing and profiling? + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-OtanoStudio-you-didnt-show-the-compiler-assembly-for-the-mix.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-OtanoStudio-you-didnt-show-the-compiler-assembly-for-the-mix.md new file mode 100644 index 0000000..154bc6a --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-OtanoStudio-you-didnt-show-the-compiler-assembly-for-the-mix.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles You didn’t show the compiler assembly for the mix alternative." +type: archive +source: twitter +source_url: "https://x.com/OtanoStudio/status/1888662052538925226" +author: "Otano Studio" +handle: OtanoStudio +post_id: "1888662052538925226" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles You didn’t show the compiler assembly for the mix alternative." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/OtanoStudio/status/1888662052538925226 +- Author: Otano Studio (@OtanoStudio) +- Posted: 2025-02-09 18:51:37 + +## Branch + +**1/** **@OtanoStudio** ^1888662052538925226 + +**@iquilezles** + +You didn’t show the compiler assembly for the mix alternative. I’m not saying you’re wrong but we can’t verify if only the desired conclusion is shown. I have also heard to never us if statements too and it’s be great to see the assembly to compare. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-TheWiseWolf_M-is-this-also-good-advice-when-programming-shaders.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-TheWiseWolf_M-is-this-also-good-advice-when-programming-shaders.md new file mode 100644 index 0000000..92c6ce9 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-TheWiseWolf_M-is-this-also-good-advice-when-programming-shaders.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Is this also good advice when programming shaders for mobile hardware?" +type: archive +source: twitter +source_url: "https://x.com/TheWiseWolf_M/status/1888523530200875141" +author: "The Wise Wolf" +handle: TheWiseWolf_M +post_id: "1888523530200875141" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Is this also good advice when programming shaders for mobile hardware?" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/TheWiseWolf_M/status/1888523530200875141 +- Author: The Wise Wolf (@TheWiseWolf_M) +- Posted: 2025-02-09 09:41:11 + +## Branch + +**1/** **@TheWiseWolf_M** ^1888523530200875141 + +**@iquilezles** + +Is this also good advice when programming shaders for mobile hardware? + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Tynach-this-greatly-depends-try-doing-this-per-channel.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Tynach-this-greatly-depends-try-doing-this-per-channel.md new file mode 100644 index 0000000..4843eb2 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Tynach-this-greatly-depends-try-doing-this-per-channel.md @@ -0,0 +1,41 @@ +--- +title: "@iquilezles This greatly depends." +type: archive +source: twitter +source_url: "https://x.com/Tynach/status/1888663322171781564" +author: "Tynach" +handle: Tynach +post_id: "1888663322171781564" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles This greatly depends." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/Tynach/status/1888663322171781564 +- Author: Tynach (@Tynach) +- Posted: 2025-02-09 18:56:40 + +## Branch + +**1/** **@Tynach** ^1888663322171781564 + +**@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. + +![](https://pbs.twimg.com/media/GjXeu13bQAATO5v?format=png&name=orig) +![](https://pbs.twimg.com/media/GjXfL0abYAAIoaJ?format=png&name=orig) +![](https://pbs.twimg.com/media/GjXfekua8AAW420?format=png&name=orig) + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-UnderwaterBepis-but-if-i-use-that-doesnt-that-result-in-a-time.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-UnderwaterBepis-but-if-i-use-that-doesnt-that-result-in-a-time.md new file mode 100644 index 0000000..8433eae --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-UnderwaterBepis-but-if-i-use-that-doesnt-that-result-in-a-time.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles But if I use that doesn’t that result in a time when the compiler uses a separate instance to do the effects that would have been done in a different way otherwise? Hypothetically, if you consider the end effects" +type: archive +source: twitter +source_url: "https://x.com/UnderwaterBepis/status/1888627023414759796" +author: "Bepis™ 🔀🫛" +handle: UnderwaterBepis +post_id: "1888627023414759796" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles But if I use that doesn’t that result in a time when the compiler uses a separate instance to do the effects that would have been done in a different way otherwise? Hypothetically, if you consider the end effects" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/UnderwaterBepis/status/1888627023414759796 +- Author: Bepis™ 🔀🫛 (@UnderwaterBepis) +- Posted: 2025-02-09 16:32:26 + +## Branch + +**1/** **@UnderwaterBepis** ^1888627023414759796 + +**@iquilezles** + +But if I use that doesn’t that result in a time when the compiler uses a separate instance to do the effects that would have been done in a different way otherwise? Hypothetically, if you consider the end effects + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-___nssy___-at-what-point-does-conditional-branching-occur.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-___nssy___-at-what-point-does-conditional-branching-occur.md new file mode 100644 index 0000000..39a6733 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-___nssy___-at-what-point-does-conditional-branching-occur.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles At what point does conditional branching occur though? Larger blocks of code?" +type: archive +source: twitter +source_url: "https://x.com/___nssy___/status/1888675757011906716" +author: "N Y 🇵🇸" +handle: ___nssy___ +post_id: "1888675757011906716" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles At what point does conditional branching occur though? Larger blocks of code?" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/___nssy___/status/1888675757011906716 +- Author: N Y 🇵🇸 (@___nssy___) +- Posted: 2025-02-09 19:46:05 + +## Branch + +**1/** **@___nssy___** ^1888675757011906716 + +**@iquilezles** + +At what point does conditional branching occur though? Larger blocks of code? + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-and_coder-id-say-always-look-at-the-generated-assembly-when.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-and_coder-id-say-always-look-at-the-generated-assembly-when.md new file mode 100644 index 0000000..e606ce8 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-and_coder-id-say-always-look-at-the-generated-assembly-when.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles I'd say ALWAYS look at the generated assembly when you care about optimizations." +type: archive +source: twitter +source_url: "https://x.com/and_coder/status/1888420888032559405" +author: "Dmitry Andreev" +handle: and_coder +post_id: "1888420888032559405" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles I'd say ALWAYS look at the generated assembly when you care about optimizations." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/and_coder/status/1888420888032559405 +- Author: Dmitry Andreev (@and_coder) +- Posted: 2025-02-09 02:53:19 + +## Branch + +**1/** **@and_coder** ^1888420888032559405 + +**@iquilezles** + +I'd say ALWAYS look at the generated assembly when you care about optimizations. I've seen NVidia compilers still generated branches even with the ternary operator if arguments are expressions. To be sure have float a = ..., float b = ..., and then float c = (x < 0.5) ? a : b; + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-apfiiez-thanks-but-if-i-understand-you-correctly-there.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-apfiiez-thanks-but-if-i-understand-you-correctly-there.md new file mode 100644 index 0000000..0188a26 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-apfiiez-thanks-but-if-i-understand-you-correctly-there.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles @SebAaltonen Thanks! But if I understand you correctly, there are other cases where if-statements should be avoided." +type: archive +source: twitter +source_url: "https://x.com/apfiiez/status/1888528814126313693" +author: "MarcusM" +handle: apfiiez +post_id: "1888528814126313693" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles @SebAaltonen Thanks! But if I understand you correctly, there are other cases where if-statements should be avoided." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/apfiiez/status/1888528814126313693 +- Author: MarcusM (@apfiiez) +- Posted: 2025-02-09 10:02:11 + +## Branch + +**1/** **@apfiiez** ^1888528814126313693 + +**@iquilezles** **@SebAaltonen** + +Thanks! But if I understand you correctly, there are other cases where if-statements should be avoided. Is there a simple way to explain when that is? + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-arafleaf-why-would-someone-do-the-bad-one.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-arafleaf-why-would-someone-do-the-bad-one.md new file mode 100644 index 0000000..da2791f --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-arafleaf-why-would-someone-do-the-bad-one.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Why would someone do the BAD one?" +type: archive +source: twitter +source_url: "https://x.com/arafleaf/status/1888522443771228399" +author: "Araf" +handle: arafleaf +post_id: "1888522443771228399" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Why would someone do the BAD one?" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/arafleaf/status/1888522443771228399 +- Author: Araf (@arafleaf) +- Posted: 2025-02-09 09:36:52 + +## Branch + +**1/** **@arafleaf** ^1888522443771228399 + +**@iquilezles** + +Why would someone do the BAD one? + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-charles_grassi-what-about-conditions-from-sampled-textures-if.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-charles_grassi-what-about-conditions-from-sampled-textures-if.md new file mode 100644 index 0000000..2d6215e --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-charles_grassi-what-about-conditions-from-sampled-textures-if.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles What about conditions from sampled textures? If every pixel in a warp takes a different branch, ?: causes extreme divergence." +type: archive +source: twitter +source_url: "https://x.com/charles_grassi/status/1888624348057006315" +author: "Charles Grassi" +handle: charles_grassi +post_id: "1888624348057006315" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles What about conditions from sampled textures? If every pixel in a warp takes a different branch, ?: causes extreme divergence." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/charles_grassi/status/1888624348057006315 +- Author: Charles Grassi (@charles_grassi) +- Posted: 2025-02-09 16:21:48 + +## Branch + +**1/** **@charles_grassi** ^1888624348057006315 + +**@iquilezles** + +What about conditions from sampled textures? If every pixel in a warp takes a different branch, ?: causes extreme divergence. Would mix() be better despite always computing both? + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-desugar_64-is-this-true-for-arm-gpus-as-well-i-dont-have-arm.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-desugar_64-is-this-true-for-arm-gpus-as-well-i-dont-have-arm.md new file mode 100644 index 0000000..81be876 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-desugar_64-is-this-true-for-arm-gpus-as-well-i-dont-have-arm.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Is this true for ARM GPUs as well? I don’t have arm shader disassembler on hand." +type: archive +source: twitter +source_url: "https://x.com/desugar_64/status/1888484297339752955" +author: "Serhii Y." +handle: desugar_64 +post_id: "1888484297339752955" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Is this true for ARM GPUs as well? I don’t have arm shader disassembler on hand." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/desugar_64/status/1888484297339752955 +- Author: Serhii Y. (@desugar_64) +- Posted: 2025-02-09 07:05:17 + +## Branch + +**1/** **@desugar_64** ^1888484297339752955 + +**@iquilezles** + +Is this true for ARM GPUs as well? I don’t have arm shader disassembler on hand. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-int_16h-the-fear-of-branching-is-still-so-strong-i-think.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-int_16h-the-fear-of-branching-is-still-so-strong-i-think.md new file mode 100644 index 0000000..ddab9a7 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-int_16h-the-fear-of-branching-is-still-so-strong-i-think.md @@ -0,0 +1,39 @@ +--- +title: "@iquilezles The fear of branching is still so strong." +type: archive +source: twitter +source_url: "https://x.com/int_16h/status/1888424191722229986" +author: "INT 16H" +handle: int_16h +post_id: "1888424191722229986" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles The fear of branching is still so strong." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/int_16h/status/1888424191722229986 +- Author: INT 16H (@int_16h) +- Posted: 2025-02-09 03:06:27 + +## Branch + +**1/** **@int_16h** ^1888424191722229986 + +**@iquilezles** + +The fear of branching is still so strong. + +I think people often see using ‘step’ or other tricks as guarantee that there will be no branching, while using ‘if’ means that we solely rely on compiler to do the right thing, while nothing is promised. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-jervineyard-what-about-the-classic-a-x-b-1-0-x-assuming-x-is.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-jervineyard-what-about-the-classic-a-x-b-1-0-x-assuming-x-is.md new file mode 100644 index 0000000..e16f8dc --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-jervineyard-what-about-the-classic-a-x-b-1-0-x-assuming-x-is.md @@ -0,0 +1,40 @@ +--- +title: "@iquilezles What about the classic:" +type: archive +source: twitter +source_url: "https://x.com/jervineyard/status/1888416642448916527" +author: "Jeremy Vineyard" +handle: jervineyard +post_id: "1888416642448916527" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles What about the classic:" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/jervineyard/status/1888416642448916527 +- Author: Jeremy Vineyard (@jervineyard) +- Posted: 2025-02-09 02:36:27 + +## Branch + +**1/** **@jervineyard** ^1888416642448916527 + +**@iquilezles** + +What about the classic: +a * x + b * (1.0 - x) + +Assuming x is 0 or 1?. And if you're using the full normalized number range (0-1), could you use round(x) first to use this? + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ko_yuki_lo-thanks-for-that-ive-been-told-that-the-if-node.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ko_yuki_lo-thanks-for-that-ive-been-told-that-the-if-node.md new file mode 100644 index 0000000..8daf834 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ko_yuki_lo-thanks-for-that-ive-been-told-that-the-if-node.md @@ -0,0 +1,43 @@ +--- +title: "@iquilezles Thanks for that." +type: archive +source: twitter +source_url: "https://x.com/ko_yuki_lo/status/1888414769205391405" +author: "YukiYa 🇨🇭→🇯🇵→🇨🇦" +handle: ko_yuki_lo +post_id: "1888414769205391405" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Thanks for that." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/ko_yuki_lo/status/1888414769205391405 +- Author: YukiYa 🇨🇭→🇯🇵→🇨🇦 (@ko_yuki_lo) +- Posted: 2025-02-09 02:29:00 + +## Branch + +**1/** **@ko_yuki_lo** ^1888414769205391405 + +**@iquilezles** + +Thanks for that. I've been told that the "if" node wad heavier a while ago. So i was using lerp in my shaders in unreal engine. Im not even putting the step because i ensure the value to be 0 or 1 into a parameter. Someone told me that actually "if" node is not that heavy + +**2/** **@iquilezles** ^1888417870041763913 + +**@ko_yuki_lo** + +Always measure (and/or check generated code) + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leonard_coder-also-valid-for-any-decent-modern-cpu-always.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leonard_coder-also-valid-for-any-decent-modern-cpu-always.md new file mode 100644 index 0000000..b31975c --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leonard_coder-also-valid-for-any-decent-modern-cpu-always.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles also valid for any decent modern CPU." +type: archive +source: twitter +source_url: "https://x.com/leonard_coder/status/1888630092550623666" +author: "Arnaud Carré" +handle: leonard_coder +post_id: "1888630092550623666" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles also valid for any decent modern CPU." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/leonard_coder/status/1888630092550623666 +- Author: Arnaud Carré (@leonard_coder) +- Posted: 2025-02-09 16:44:37 + +## Branch + +**1/** **@leonard_coder** ^1888630092550623666 + +**@iquilezles** + +also valid for any decent modern CPU. Always prefer ternary op if you can + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leowbattle-maybe-the-article-should-further-mention-that-the.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leowbattle-maybe-the-article-should-further-mention-that-the.md new file mode 100644 index 0000000..2050399 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leowbattle-maybe-the-article-should-further-mention-that-the.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Maybe the article should further mention that the true evil of if statements in shaders only comes when the neighbouring shader invocations take different paths, as both instances must execute both paths and then throw one away" +type: archive +source: twitter +source_url: "https://x.com/leowbattle/status/1888517439484240117" +author: "Leo Battle" +handle: leowbattle +post_id: "1888517439484240117" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Maybe the article should further mention that the true evil of if statements in shaders only comes when the neighbouring shader invocations take different paths, as both instances must execute both paths and then throw one away" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/leowbattle/status/1888517439484240117 +- Author: Leo Battle (@leowbattle) +- Posted: 2025-02-09 09:16:59 + +## Branch + +**1/** **@leowbattle** ^1888517439484240117 + +**@iquilezles** + +Maybe the article should further mention that the true evil of if statements in shaders only comes when the neighbouring shader invocations take different paths, as both instances must execute both paths and then throw one away + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-redorav-good-advice-in-hlsl-you-can-also-use-the-select.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-redorav-good-advice-in-hlsl-you-can-also-use-the-select.md new file mode 100644 index 0000000..75fae60 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-redorav-good-advice-in-hlsl-you-can-also-use-the-select.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Good advice! In HLSL you can also use the select() function to do the ternary which makes it explicit that you want a ternary, not sure if GLSL has a similar thing" +type: archive +source: twitter +source_url: "https://x.com/redorav/status/1888531027016261912" +author: "Emilio López" +handle: redorav +post_id: "1888531027016261912" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Good advice! In HLSL you can also use the select() function to do the ternary which makes it explicit that you want a ternary, not sure if GLSL has a similar thing" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/redorav/status/1888531027016261912 +- Author: Emilio López (@redorav) +- Posted: 2025-02-09 10:10:58 + +## Branch + +**1/** **@redorav** ^1888531027016261912 + +**@iquilezles** + +Good advice! In HLSL you can also use the select() function to do the ternary which makes it explicit that you want a ternary, not sure if GLSL has a similar thing + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-stormyy_ow-its-still-faster-even-if-the-condition-is-not.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-stormyy_ow-its-still-faster-even-if-the-condition-is-not.md new file mode 100644 index 0000000..a960e01 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-stormyy_ow-its-still-faster-even-if-the-condition-is-not.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles it’s still faster even if the condition is not true for all threads in a group? :o" +type: archive +source: twitter +source_url: "https://x.com/stormyy_ow/status/1888712750718767127" +author: "stormy" +handle: stormyy_ow +post_id: "1888712750718767127" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles it’s still faster even if the condition is not true for all threads in a group? :o" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/stormyy_ow/status/1888712750718767127 +- Author: stormy (@stormyy_ow) +- Posted: 2025-02-09 22:13:05 + +## Branch + +**1/** **@stormyy_ow** ^1888712750718767127 + +**@iquilezles** + +it’s still faster even if the condition is not true for all threads in a group? :o + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-tom_forsyth-this-is-so-infuriating-its-advice-that-is-20.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-tom_forsyth-this-is-so-infuriating-its-advice-that-is-20.md new file mode 100644 index 0000000..1893f72 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-tom_forsyth-this-is-so-infuriating-its-advice-that-is-20.md @@ -0,0 +1,61 @@ +--- +title: "@iquilezles This is so infuriating." +type: archive +source: twitter +source_url: "https://x.com/tom_forsyth/status/1888487365091733759" +author: "Tom Forsyth (TODO: fix my heart or die)" +handle: tom_forsyth +post_id: "1888487365091733759" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles This is so infuriating." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/tom_forsyth/status/1888487365091733759 +- Author: Tom Forsyth (TODO: fix my heart or die) (@tom_forsyth) +- Posted: 2025-02-09 07:17:28 + +## Branch + +**1/** **@tom_forsyth** ^1888487365091733759 + +**@iquilezles** + +This is so infuriating. It's advice that is 20 years out of date (maybe 15 if you're on mobile?) that was never that important to begin with, but has absolutely poisoned peoples' minds. + +**2/** **@iquilezles** ^1888538579502289296 + +**@tom_forsyth** + +I think one reason it's so sticky is that it has a bit of code obfuscation, some math, some hardware mythology... So you think you are obviously being very "smart" when you use it. + +**3/** **@MarkJGx** ^1888540762083848293 + +**@iquilezles** **@tom_forsyth** + +It’s super easy to get sucked into that kind of thinking because we all want to be clever. But sometimes the smartest move is the simplest one, just look at the disassembly. + +**4/** **@MarkJGx** ^1888541137302065649 + +**@iquilezles** **@tom_forsyth** + +Lower level optimization without even looking at the disassembly is the true cardinal sin. + +**5/** **@tom_forsyth** ^1888556506741870595 + +**@MarkJGx** **@iquilezles** + +Yeah, I'm totally fine with seeing some byzantine shader code along with a comment saying "sorry about the mess this is the only way I could get it to emit the right asm". We've all been there... :-) + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-valhahaha-thanks-for-this-i-learned-using-step-was-the.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-valhahaha-thanks-for-this-i-learned-using-step-was-the.md new file mode 100644 index 0000000..dca2de6 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-valhahaha-thanks-for-this-i-learned-using-step-was-the.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Thanks for this! I learned using step was the right way but it makes code ugly and harder to read." +type: archive +source: twitter +source_url: "https://x.com/valhahaha/status/1888584171322261622" +author: "Valerie GvM" +handle: valhahaha +post_id: "1888584171322261622" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Thanks for this! I learned using step was the right way but it makes code ugly and harder to read." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/valhahaha/status/1888584171322261622 +- Author: Valerie GvM (@valhahaha) +- Posted: 2025-02-09 13:42:09 + +## Branch + +**1/** **@valhahaha** ^1888584171322261622 + +**@iquilezles** + +Thanks for this! I learned using step was the right way but it makes code ugly and harder to read. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-BugoTheCat-i-dont-know-much-about-shader-optimization-but-i.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-BugoTheCat-i-dont-know-much-about-shader-optimization-but-i.md new file mode 100644 index 0000000..4605d16 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-BugoTheCat-i-dont-know-much-about-shader-optimization-but-i.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles I don't know much about shader optimization, but I do wonder how many more of these witty optimization gimmicks are just consumed like tricks of the trade, but nobody ever tests their assumptions, they just replicate as coding memes." +type: archive +source: twitter +source_url: "https://x.com/BugoTheCat/status/1888888524381802710" +author: "BugoTheCat" +handle: BugoTheCat +post_id: "1888888524381802710" +date: 2025-02-10 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles I don't know much about shader optimization, but I do wonder how many more of these witty optimization gimmicks are just consumed like tricks of the trade, but nobody ever tests their assumptions, they just replicate as coding memes." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/BugoTheCat/status/1888888524381802710 +- Author: BugoTheCat (@BugoTheCat) +- Posted: 2025-02-10 09:51:32 + +## Branch + +**1/** **@BugoTheCat** ^1888888524381802710 + +**@iquilezles** + +I don't know much about shader optimization, but I do wonder how many more of these witty optimization gimmicks are just consumed like tricks of the trade, but nobody ever tests their assumptions, they just replicate as coding memes. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-FabriceNEYRET-this-comes-from-common-misunderstanding-of.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-FabriceNEYRET-this-comes-from-common-misunderstanding-of.md new file mode 100644 index 0000000..6faebc2 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-FabriceNEYRET-this-comes-from-common-misunderstanding-of.md @@ -0,0 +1,40 @@ +--- +title: "@iquilezles This comes from common misunderstanding of divergence on GPU ( magic thinking of hiding all supposedly evil IF by something that may be costlier )" +type: archive +source: twitter +source_url: "https://x.com/FabriceNEYRET/status/1888964615742099529" +author: "Fabrice NEYRET - pro" +handle: FabriceNEYRET +post_id: "1888964615742099529" +date: 2025-02-10 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles This comes from common misunderstanding of divergence on GPU ( magic thinking of hiding all supposedly evil IF by something that may be costlier )" +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/FabriceNEYRET/status/1888964615742099529 +- Author: Fabrice NEYRET - pro (@FabriceNEYRET) +- Posted: 2025-02-10 14:53:54 + +## Branch + +**1/** **@FabriceNEYRET** ^1888964615742099529 + +**@iquilezles** + +This comes from common misunderstanding of divergence on GPU ( magic thinking of hiding all supposedly evil IF by something that may be costlier ) +https://shadertoyunofficial.wordpress.com/2023/11/26/performance-tricks/ +- only appropriate is when x is a vector +- ... or if it is a placeholder for a future smoothstep (for AA 😉 ) + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-djonesuk-x86-has-had-conditional-move-instructions-since.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-djonesuk-x86-has-had-conditional-move-instructions-since.md new file mode 100644 index 0000000..742c9b9 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-djonesuk-x86-has-had-conditional-move-instructions-since.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles x86 has had conditional move instructions since Pentium Pro (1995)." +type: archive +source: twitter +source_url: "https://x.com/djonesuk/status/1889058704701702210" +author: "David Jones" +handle: djonesuk +post_id: "1889058704701702210" +date: 2025-02-10 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles x86 has had conditional move instructions since Pentium Pro (1995)." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/djonesuk/status/1889058704701702210 +- Author: David Jones (@djonesuk) +- Posted: 2025-02-10 21:07:46 + +## Branch + +**1/** **@djonesuk** ^1889058704701702210 + +**@iquilezles** + +x86 has had conditional move instructions since Pentium Pro (1995). This was never good programming practice. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-ekakiya-in-addition-mix-can-cause-nan-because-gpu-can.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-ekakiya-in-addition-mix-can-cause-nan-because-gpu-can.md new file mode 100644 index 0000000..08a5d50 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-ekakiya-in-addition-mix-can-cause-nan-because-gpu-can.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles In addition, mix() can cause NaN because GPU can calculate 0*NaN=NaN." +type: archive +source: twitter +source_url: "https://x.com/ekakiya/status/1888852044645339609" +author: "Katsuhiko Omori" +handle: ekakiya +post_id: "1888852044645339609" +date: 2025-02-10 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles In addition, mix() can cause NaN because GPU can calculate 0*NaN=NaN." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/ekakiya/status/1888852044645339609 +- Author: Katsuhiko Omori (@ekakiya) +- Posted: 2025-02-10 07:26:35 + +## Branch + +**1/** **@ekakiya** ^1888852044645339609 + +**@iquilezles** + +In addition, mix() can cause NaN because GPU can calculate 0*NaN=NaN. It stops some optimizations that if() can get. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-evildisease-compilers-are-smart-enough-to-take-care-of.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-evildisease-compilers-are-smart-enough-to-take-care-of.md new file mode 100644 index 0000000..d068909 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-evildisease-compilers-are-smart-enough-to-take-care-of.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles compilers are smart enough to take care of conditional logic without branching(or conditional jump) in many cases, so don't pretend to be smart and just use if else." +type: archive +source: twitter +source_url: "https://x.com/evildisease/status/1889033552425333239" +author: "Street Mouse" +handle: evildisease +post_id: "1889033552425333239" +date: 2025-02-10 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles compilers are smart enough to take care of conditional logic without branching(or conditional jump) in many cases, so don't pretend to be smart and just use if else." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/evildisease/status/1889033552425333239 +- Author: Street Mouse (@evildisease) +- Posted: 2025-02-10 19:27:50 + +## Branch + +**1/** **@evildisease** ^1889033552425333239 + +**@iquilezles** + +compilers are smart enough to take care of conditional logic without branching(or conditional jump) in many cases, so don't pretend to be smart and just use if else. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-mlsprwr-okay-you-got-me-there-i-had-to-close-that.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-mlsprwr-okay-you-got-me-there-i-had-to-close-that.md new file mode 100644 index 0000000..43544b7 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-mlsprwr-okay-you-got-me-there-i-had-to-close-that.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles okay.." +type: archive +source: twitter +source_url: "https://x.com/mlsprwr/status/1888797119349415973" +author: "Tommy Dräger" +handle: mlsprwr +post_id: "1888797119349415973" +date: 2025-02-10 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles okay.." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/mlsprwr/status/1888797119349415973 +- Author: Tommy Dräger (@mlsprwr) +- Posted: 2025-02-10 03:48:20 + +## Branch + +**1/** **@mlsprwr** ^1888797119349415973 + +**@iquilezles** + +okay.. you got me there.. I had to close that knowledge gap.. thank you + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-12-luis_reyes_x-is-there-a-use-case-for-step-i-always-forget-if.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-12-luis_reyes_x-is-there-a-use-case-for-step-i-always-forget-if.md new file mode 100644 index 0000000..cf05d5e --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-12-luis_reyes_x-is-there-a-use-case-for-step-i-always-forget-if.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles Is there a use case for step()? I always forget if it's a < or > comparison." +type: archive +source: twitter +source_url: "https://x.com/luis_reyes_x/status/1889527342948643250" +author: "Luis Reyes" +handle: luis_reyes_x +post_id: "1889527342948643250" +date: 2025-02-12 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles Is there a use case for step()? I always forget if it's a < or > comparison." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/luis_reyes_x/status/1889527342948643250 +- Author: Luis Reyes (@luis_reyes_x) +- Posted: 2025-02-12 04:09:58 + +## Branch + +**1/** **@luis_reyes_x** ^1889527342948643250 + +**@iquilezles** + +Is there a use case for step()? I always forget if it's a < or > comparison. Ternary operator makes it very clear so I'm curious why it's a thing in the first place + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-05-08-meatloaf1024-as-a-shader-newb-this-is-helpful-i-was-definitely.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-05-08-meatloaf1024-as-a-shader-newb-this-is-helpful-i-was-definitely.md new file mode 100644 index 0000000..cd34852 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-05-08-meatloaf1024-as-a-shader-newb-this-is-helpful-i-was-definitely.md @@ -0,0 +1,37 @@ +--- +title: "@iquilezles As a shader newb, this is helpful." +type: archive +source: twitter +source_url: "https://x.com/meatloaf1024/status/1920584612205465742" +author: "Thomas Brown" +handle: meatloaf1024 +post_id: "1920584612205465742" +date: 2025-05-08 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles As a shader newb, this is helpful." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/meatloaf1024/status/1920584612205465742 +- Author: Thomas Brown (@meatloaf1024) +- Posted: 2025-05-08 21:00:28 + +## Branch + +**1/** **@meatloaf1024** ^1920584612205465742 + +**@iquilezles** + +As a shader newb, this is helpful. I was definitely under the impression that the latter was better. + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-06-01-codaaaaaaaaa-read-about-this-from-gpu-gems-2-chapter-34-gpu.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-06-01-codaaaaaaaaa-read-about-this-from-gpu-gems-2-chapter-34-gpu.md new file mode 100644 index 0000000..375c5e3 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-06-01-codaaaaaaaaa-read-about-this-from-gpu-gems-2-chapter-34-gpu.md @@ -0,0 +1,38 @@ +--- +title: "@iquilezles @james_ay_em_dee Read about this from ‘GPU Gems 2’, ‘Chapter 34." +type: archive +source: twitter +source_url: "https://x.com/codaaaaaaaaa/status/1929133683878907983" +author: "🌱" +handle: codaaaaaaaaa +post_id: "1929133683878907983" +date: 2025-06-01 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles @james_ay_em_dee Read about this from ‘GPU Gems 2’, ‘Chapter 34." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/codaaaaaaaaa/status/1929133683878907983 +- Author: 🌱 (@codaaaaaaaaa) +- Posted: 2025-06-01 11:11:26 + +## Branch + +**1/** **@codaaaaaaaaa** ^1929133683878907983 + +**@iquilezles** **@james_ay_em_dee** + +Read about this from ‘GPU Gems 2’, ‘Chapter 34. GPU Flow-Control Idioms’. +They say the GeForce 6 series from 21 years ago (!) supports branching instructions, and even older GPUs still support masked operations + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-07-30-SquaredApe-i-suspect-the-reason-for-the-poor-advice-stems.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-07-30-SquaredApe-i-suspect-the-reason-for-the-poor-advice-stems.md new file mode 100644 index 0000000..cdd0c91 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-07-30-SquaredApe-i-suspect-the-reason-for-the-poor-advice-stems.md @@ -0,0 +1,39 @@ +--- +title: "@iquilezles I suspect the reason for the poor advice stems from the beginning of programmable shaders on mobile." +type: archive +source: twitter +source_url: "https://x.com/SquaredApe/status/1950549491163246681" +author: "Robert William Cummings" +handle: SquaredApe +post_id: "1950549491163246681" +date: 2025-07-30 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "@iquilezles I suspect the reason for the poor advice stems from the beginning of programmable shaders on mobile." +in_reply_to: "" +parent_post_id: "1888409333182218691" +--- + +## Source + +- URL: https://x.com/SquaredApe/status/1950549491163246681 +- Author: Robert William Cummings (@SquaredApe) +- Posted: 2025-07-30 13:30:12 + +## Branch + +**1/** **@SquaredApe** ^1950549491163246681 + +**@iquilezles** + +I suspect the reason for the poor advice stems from the beginning of programmable shaders on mobile. Back then, branches were very expensive, a combination of early compilers and hardware. + +Much has changed in 20 years or more :) + +## Related + +- Spine: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/index.md b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/index.md new file mode 100644 index 0000000..c9fb8a5 --- /dev/null +++ b/archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/index.md @@ -0,0 +1,42 @@ +--- +title: "Hey, don't \"optimize\" conditional moves with mix()+step()." +type: archive +source: twitter +source_url: "https://x.com/iquilezles/status/1888409333182218691" +author: "inigo quilez" +handle: iquilezles +post_id: "1888409333182218691" +date: 2025-02-09 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - iquilezles +description: "Hey, don't \"optimize\" conditional moves with mix()+step()." +in_reply_to: "" +--- + +## Source + +- URL: https://x.com/iquilezles/status/1888409333182218691 +- Author: inigo quilez (@iquilezles) +- Posted: 2025-02-09 02:07:24 + +## Thread + +**1/** **@iquilezles** ^1888409333182218691 + +Hey, don't "optimize" conditional moves with mix()+step(). Please stop advising that. Why: https://iquilezles.org/articles/gpuconditionals/ + +![](https://pbs.twimg.com/media/GjT554daoAA0beA?format=png&name=orig) + +Branches: [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ko_yuki_lo-thanks-for-that-ive-been-told-that-the-if-node]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-jervineyard-what-about-the-classic-a-x-b-1-0-x-assuming-x-is]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-and_coder-id-say-always-look-at-the-generated-assembly-when]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-int_16h-the-fear-of-branching-is-still-so-strong-i-think]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-ENDESGA-i-feel-half-of-the-problem-is-that-people-dont]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-desugar_64-is-this-true-for-arm-gpus-as-well-i-dont-have-arm]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-tom_forsyth-this-is-so-infuriating-its-advice-that-is-20]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leowbattle-maybe-the-article-should-further-mention-that-the]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-arafleaf-why-would-someone-do-the-bad-one]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-TheWiseWolf_M-is-this-also-good-advice-when-programming-shaders]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-apfiiez-thanks-but-if-i-understand-you-correctly-there]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-redorav-good-advice-in-hlsl-you-can-also-use-the-select]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-conditional-moves-are-also-a-cpu-thing-and]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-AndroidBlogger-do-you-know-if-there-is-any-online-shader]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-valhahaha-thanks-for-this-i-learned-using-step-was-the]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-GhostHandDev-tl-dr-compilers-will-generally-fix-this-kind-of]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-charles_grassi-what-about-conditions-from-sampled-textures-if]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-UnderwaterBepis-but-if-i-use-that-doesnt-that-result-in-a-time]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-leonard_coder-also-valid-for-any-decent-modern-cpu-always]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-OtanoStudio-you-didnt-show-the-compiler-assembly-for-the-mix]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Tynach-this-greatly-depends-try-doing-this-per-channel]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-___nssy___-at-what-point-does-conditional-branching-occur]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-stormyy_ow-its-still-faster-even-if-the-condition-is-not]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-09-Niels_Dewitte-i-think-we-need-deeper-write-ups-on-this-subject]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-mlsprwr-okay-you-got-me-there-i-had-to-close-that]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-ekakiya-in-addition-mix-can-cause-nan-because-gpu-can]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-BugoTheCat-i-dont-know-much-about-shader-optimization-but-i]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-FabriceNEYRET-this-comes-from-common-misunderstanding-of]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-evildisease-compilers-are-smart-enough-to-take-care-of]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-10-djonesuk-x86-has-had-conditional-move-instructions-since]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-02-12-luis_reyes_x-is-there-a-use-case-for-step-i-always-forget-if]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-05-08-meatloaf1024-as-a-shader-newb-this-is-helpful-i-was-definitely]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-06-01-codaaaaaaaaa-read-about-this-from-gpu-gems-2-chapter-34-gpu]], [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step/2025-07-30-SquaredApe-i-suspect-the-reason-for-the-poor-advice-stems]] + +**2/** **@iquilezles** ^1888414119264739780 + +Also GOOD: + +float c; +if( x<0.5 ) c=a; +else c = b; diff --git a/archive/threads/iquilezles/index.md b/archive/threads/iquilezles/index.md new file mode 100644 index 0000000..3cbc976 --- /dev/null +++ b/archive/threads/iquilezles/index.md @@ -0,0 +1,12 @@ +--- +title: iquilezles +type: note +draft: false +description: Archived threads by iquilezles. +tags: + - archive + - twitter + - iquilezles +--- + +- [[archive/threads/iquilezles/2025-02-09-hey-dont-optimize-conditional-moves-with-mix-step]] diff --git a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-JBrooksBSI-more-speed-up-q-a-is-algorithm-on-hw-fastpath-asm.md b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-JBrooksBSI-more-speed-up-q-a-is-algorithm-on-hw-fastpath-asm.md index f55fc0d..aec7ec2 100644 --- a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-JBrooksBSI-more-speed-up-q-a-is-algorithm-on-hw-fastpath-asm.md +++ b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-JBrooksBSI-more-speed-up-q-a-is-algorithm-on-hw-fastpath-asm.md @@ -7,7 +7,7 @@ author: "John Brooks" handle: JBrooksBSI post_id: "989170547694059520" date: 2018-04-25 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive diff --git a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-Oberje-can-we-get-it-for-cheaper-as-addition-byproduct.md b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-Oberje-can-we-get-it-for-cheaper-as-addition-byproduct.md index 40b4759..e1e4b46 100644 --- a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-Oberje-can-we-get-it-for-cheaper-as-addition-byproduct.md +++ b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-Oberje-can-we-get-it-for-cheaper-as-addition-byproduct.md @@ -7,7 +7,7 @@ author: "Oberje" handle: Oberje post_id: "989116637939929088" date: 2018-04-25 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive diff --git a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-PaperBirdMaster-1-2-3-4-5-6-6-6-the-number-of-the-beast.md b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-PaperBirdMaster-1-2-3-4-5-6-6-6-the-number-of-the-beast.md index b844f39..3e3104f 100644 --- a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-PaperBirdMaster-1-2-3-4-5-6-6-6-the-number-of-the-beast.md +++ b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-PaperBirdMaster-1-2-3-4-5-6-6-6-the-number-of-the-beast.md @@ -7,7 +7,7 @@ author: "Pau Montequi" handle: PaperBirdMaster post_id: "989117219576610816" date: 2018-04-25 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive diff --git a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-aras_p-aras-approximator-can-we-delete-that-code-already.md b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-aras_p-aras-approximator-can-we-delete-that-code-already.md index ca4a5f2..d65bac9 100644 --- a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-aras_p-aras-approximator-can-we-delete-that-code-already.md +++ b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-aras_p-aras-approximator-can-we-delete-that-code-already.md @@ -3,11 +3,11 @@ title: "@mike_acton Aras approximator: can we delete that code already? :)" type: archive source: twitter source_url: "https://x.com/aras_p/status/989007374387204096" -author: "Aras Pranckevičius" +author: "Aras Pranckevičius 🇺🇦🇱🇹" handle: aras_p post_id: "989007374387204096" date: 2018-04-25 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive @@ -21,7 +21,7 @@ parent_post_id: "989001065893801984" ## Source - URL: https://x.com/aras_p/status/989007374387204096 -- Author: Aras Pranckevičius (@aras_p) +- Author: Aras Pranckevičius 🇺🇦🇱🇹 (@aras_p) - Posted: 2018-04-25 05:05:07 ## Branch diff --git a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-bonzajplc-i-like-the-aproximate-results-line.md b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-bonzajplc-i-like-the-aproximate-results-line.md index 0e1a393..50cd53c 100644 --- a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-bonzajplc-i-like-the-aproximate-results-line.md +++ b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-bonzajplc-i-like-the-aproximate-results-line.md @@ -7,7 +7,7 @@ author: "bonzaj/plastic" handle: bonzajplc post_id: "989031363369144320" date: 2018-04-25 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive diff --git a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-t_cheng_1-use-a-small-fifo-what-does-this-mean.md b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-t_cheng_1-use-a-small-fifo-what-does-this-mean.md index bff1e8a..baae006 100644 --- a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-t_cheng_1-use-a-small-fifo-what-does-this-mean.md +++ b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-t_cheng_1-use-a-small-fifo-what-does-this-mean.md @@ -7,7 +7,7 @@ author: "Tom Cheng" handle: t_cheng_1 post_id: "989156948070330374" date: 2018-04-25 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive diff --git a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/index.md b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/index.md index 6fdb827..5d32961 100644 --- a/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/index.md +++ b/archive/threads/mike_acton/2018-04-25-mike-acton-approximator/index.md @@ -7,7 +7,7 @@ author: "Mike Acton" handle: mike_acton post_id: "989001065893801984" date: 2018-04-25 -archived: 2026-08-25 +archived: 2026-08-26 draft: false tags: - archive @@ -37,4 +37,6 @@ Mike Acton approximator: 6. Can we constrain the problem further? RECURSE https://x.com/niinegames/status/988718667188854784 +https://x.com/i/status/988718667188854784 + Branches: [[archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-aras_p-aras-approximator-can-we-delete-that-code-already]], [[archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-bonzajplc-i-like-the-aproximate-results-line]], [[archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-Oberje-can-we-get-it-for-cheaper-as-addition-byproduct]], [[archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-PaperBirdMaster-1-2-3-4-5-6-6-6-the-number-of-the-beast]], [[archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-t_cheng_1-use-a-small-fifo-what-does-this-mean]], [[archive/threads/mike_acton/2018-04-25-mike-acton-approximator/2018-04-25-JBrooksBSI-more-speed-up-q-a-is-algorithm-on-hw-fastpath-asm]]