you are viewing a single comment's thread
view the rest of the comments
[+] 4 points 2 years ago* (last edited 2 years ago) (2 children)
  • [–] 1 point 2 years ago (1 child)

    One way to get the data is to render to a (hidden) surface/canvas. It's just bytes to the computer, so just dump the result data in the display buffer. Then you take a "screenshot" and interpret the RGBA values as data.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 2 years ago

    Graphics Programmer here.

    More likely you would just write data to a buffer (basically an array of whatever element type you want) rather than a render target and then read it back to the cpu. Dx, vulkan, etc. all have APIs to upload / download to / from the GPU quite easily, and CUDA makes it even easier, so a simple compute shader or CUDA kernel that writes to a buffer would make the most sense for general purpose computation like an advent of code problem.

  • source
  • parent