Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    Josh Barczak

    joshbarczak.com · Personal blog · on HN since 2014

    Graphics programmer Josh Barczak writes about GPU programming, OpenGL, SPMD models, and shader techniques.

    Visit blogHN submissions
    ProgrammingSystems & PerformanceGames
    What HN says

    HN links it for SPMD programming model posts and an explanation of why geometry shaders were hard to implement efficiently in hardware.

    Stats for nerds
    18HN people shared it
    14linked in comments
    988story points
    Aug 2025last shared
    2017people per year2025

    Top posts on HN

    1. 1
      OpenGL Is Broken
      1 person · 156 points · first shared 2014 · 124 comments on HN
    2. 2
      GPU Ray Tracing the Wrong Way
      1 person · 134 points · first shared 2016 · 11 comments on HN
    3. 3
      Stop Misquoting Donald Knuth
      1 person · 131 points · first shared 2015 · 54 comments on HN
    4. 4
      Considering performance in the small is not “premature optimization”
      3 people · 120 points · first shared 2015 · 68 comments on HN
    5. 5
      You Compiled This, Driver – Trust Me
      2 people · 108 points · first shared 2016 · 16 comments on HN
    6. 6
      Why Geometry Shaders Are Slow (Unless You’re Intel)
      5 people · 100 points · first shared 2015 · 8 comments on HN
    7. 7
      Fine, I’ll Go Build My Own Disassembler, with BlackJack
      1 person · 89 points · first shared 2015 · 4 comments on HN
    8. 8
      SPMD Is Not Intel’s Cup of Tea
      1 person · 89 points · first shared 2016 · 25 comments on HN
    9. 9
      Let’s Close the Buffer Zoo
      2 people · 35 points · first shared 2016 · 4 comments on HN
    10. 10
      A Quick Study on Tokenizing
      2 people · 24 points · first shared 2016 · 2 comments on HN

    What HN people wrote when they linked it

    • katasticOct 2017

      "'Premature optimization is the root of all evil' is the root of evil"

      https://medium.com/@okaleniuk/premature-optimization-is-the-root-of-all-evil-is-the-root-of-evil-a8ab8056c6b

      http://ubiquity.acm.org/article.cfm?id=1513451

      http://www.joshbarczak.com/blog/?p=580

      http://scottdorman.github.io/2009/08/28/premature-optimization-is-the-root-of-all-evil/

      It's basically an excuse to not think about the performance or implementation of your entire product until the end and then, when you use a profiler and chop away "10%" here and "20%" there, you still end up with a slow-as-piss program with every function taking less than 1% total time. Then what do you do?

      Oh yeah, what you should have done in the first place. _Think_ about how your program actually functions so you can remove all of the insane systemic, architecture decisions you made that all bleed a fixed amount of time every single function call. That's the difference between an engineer, and script kid. If you're not reasoning about _the entire platform_ (all the way down to the cache lines), you're not engineering. You can abstract all you want, but those abstractions don't magically prevent the underlying hardware and architectural decisions from affecting the product. Abstractions tools (read: approximations!) for high-level reasoning. They're not magic "you don't have to think [about low level implementation]" spells.

      Actual experts keep trying to warn you guys about abusing that quote, but nobody apparently…

    • quagAug 2025

      It sounds like you've got something specific in mind when you say, "modeling". The term modeling is used in a lot of different situations to mean different things. For example, it could mean to make a 3d model in Blender, it could mean to pose for someone to paint you or to take a photo, with databases it's used to mean modeling the data, with statistics it's used to mean finding a way to simply represent and reason about the data (create a model of it).

      The things you've listed out make me guess you want to write 2d or 3d image rendering software. Is that right?

      If that's the case, there's no substitute for trying to recreate certain algorithms or curves using a language or tool that you're comfortable with. It'll help you build an intuition about how the mathematical object behaves and what problems it solves (and doesn't). All of these approaches were created to solve problems, understanding the theory of it doesn't quite get you there. If you don't have a good place to try out functions, I recommend https://thebookofshaders.com/05/ , https://www.desmos.com/calculator , or https://www.geogebra.org/calculator .

      A good place to start is linear interpolation (lerp). It seems dead simple, but it's used extensively to blend two things together (say positions or colors) and the other things you listed are mostly fancier things built on top of linear interpolation.

      https://en.wikipedia.org/wiki/Linear_interpolation

      For bezier curves and surfaces here are some links I've…

    • Jasper_Jan 2019

      > We dispatch instanced draw calls where each instance corresponds to a segment’s quad. The vertex shader finds all of the information it needs from the primitive offset and segment id of the quad it is working on.

      Hm, any reason you're using instanced quads? From my understanding of how GPUs work, instancing only has big gains when you have a lot of vertex data in the draw call [0]. Instead of the instanced quads, have you considered making a vertex buffer containing two shapes: a + for the center/edges, and four quads for the corners. That way you could still do the whole thing in two draw calls, and you're not going through the slow instancing path. And if you have to blend the bg anyway (e.g. rgba background-color), you can just draw the whole vertex buffer in one go to skip the extra draw call.

      [0] http://www.joshbarczak.com/blog/?p=667

    • Const-meJun 2018

      Any shader.

      You can render a single quad and calculate UV in the pixel shader. Geometrically, this is the most accurate method.

      You can do without any shaders, write a CPU code that builds a reasonably dense (about 8x8 pixels/triangle) static geosphere mesh with position and texcoord channels.

      You can also build a reasonably dense grid mesh occupying just the screen with just the positions in clip space, and calculate UV channel in the VS based on the rotation.

      GS will work too but I’m not sure it makes sense performance-wise. People normally use GS-es to implement small dynamic objects. For static geometry I won’t be surprised an immutable buffer will be faster, just because that’s what hardware & drivers are optimized for. See e.g. this http://www.joshbarczak.com/blog/?p=667

    • jkoudysMay 2019

      I come across this one all the time, but it's usually in the form of "I know you're wrong, because person X made an argument that I don't understand, but this misunderstood summary of that argument says you're wrong".

      Happens all the time with the old Donald Knuth chestnut about "premature optimization". Half the time I hear it, it's from people who don't want to optimize at all. http://www.joshbarczak.com/blog/?p=580

    • raphlinusJan 2021

      Another interesting reference from a few years ago: http://www.joshbarczak.com/blog/?p=1028

      Also read the followups (1120 and 1197), as they go into considerably more detail about the SPMD programming model and some use cases.

      The author is now at Intel working on ray tracing.

    Related

    Fabian Giesenfgiesen.wordpress.com200 people

    Why do CPUs have multiple cache levels?

    Fabian Giesen
    Personal · last shared 2026
    Random ASCIIrandomascii.wordpress.com274 people

    There are only four billion floats, so test them all (2014)

    Random ASCII
    Personal · last shared 2026
    Adam Sawickiasawicki.info15 people

    Hello World Under the Microscope

    Adam Sawicki
    Personal · last shared 2026
    Bart Wronskibartwronski.com36 people

    Why are video games graphics challenging? Productionizing rendering algorithms

    Bart Wronski
    Personal · last shared 2025
    DirectX Developer Blogdevblogs.microsoft.com/directx86 people

    DirectX is coming to the Windows Subsystem for Linux

    DirectX Developer Blog
    Company · last shared 2026
    Nathan Reedreedbeta.com23 people

    A Programmer’s Introduction to Unicode

    Nathan Reed
    Personal · last shared 2026
    Dzmitry Malyshaukvark.github.io17 people

    NixOS on Framework Laptop

    Dzmitry Malyshau
    Personal · last shared 2026
    Alan Zucconialanzucconi.com53 people

    The challenging task of sorting colours

    Alan Zucconi
    Personal · last shared 2026