#
#asahi-gpu · 2022-10-02 16:57
karolherbstin the end what works decides what's the best thing, not some abstract reasoning
#asahi-gpu · 2022-10-02 16:56
karolherbstnot even wanting to say that it's a bad thing, because most of the time "technical points" are just mindsets/culture put into something abstract and ticked of with a "yep, that's how it must be"
#asahi-gpu · 2022-10-02 16:53
linaYup...
#asahi-gpu · 2022-10-02 16:53
karolherbstor well.. the more relevant reason why things turned out how they did
#asahi-gpu · 2022-10-02 16:52
karolherbstcoporate culture is more important than "technical reasoning" for most things
#asahi-gpu · 2022-10-02 16:52
linaalyssa: Yeah ^^
#asahi-gpu · 2022-10-02 16:52
karolherbstyeah...
#asahi-gpu · 2022-10-02 16:52
karolherbstand never will
#asahi-gpu · 2022-10-02 16:52
karolherbstif you can use avx/sse all the way, it can be super fast, but normal code doesn't give you that
#asahi-gpu · 2022-10-02 16:52
alyssalina: All of the "this GPU is scalar/vector" drama makes a lot more sense when you realize subgroup-style SIMD is equivalent to vec4 SIMD :)
#asahi-gpu · 2022-10-02 16:52
karolherbstthe main problem is, that for different problems you have to use different mindeset. Normal code written for C doesn't optimize well, and normal C devs never had to think much about data paralization and all of that
#asahi-gpu · 2022-10-02 16:52
linaThe stories of Intel internal coporate culture explain so much...
#asahi-gpu · 2022-10-02 16:51
linaI read until the leaving intel part
#asahi-gpu · 2022-10-02 16:51
karolherbstthough I am not sure myself if I read the full thing, might have stopped somewhere in the middle. The first part is in itself already a good story about intel here :D
#asahi-gpu · 2022-10-02 16:51
linaAlso it seems so obvious in retrospect, shaders for CPUs... why wasn't that a thing before?
#asahi-gpu · 2022-10-02 16:50
linaIt is!
#asahi-gpu · 2022-10-02 16:45
karolherbstit's fun, isn't it?
#asahi-gpu · 2022-10-02 16:45
linaI ended up reading the entire ispc saga...
#asahi-gpu · 2022-10-02 16:37
alyssasure
#asahi-gpu · 2022-10-02 15:51
karolherbstalyssa: sure.. but I could also imagine that nvidia or AMD are more aggressive about killing of stages, but maybe they are simply less concerned about space and keep their stuff. At least for nvidia I know that they already just use L1 or L2 cache for all those stage special memory things
#asahi-gpu · 2022-10-02 15:47
alyssakarolherbst: The conceptual block diagram is the same as Mali, the hardware is just a lot less opinionated.
#asahi-gpu · 2022-10-02 15:33
karolherbstI am actually wondering if we'll see more hardware like that even in the discrete space, where stages will be more like that
#asahi-gpu · 2022-10-02 15:26
alyssaI think it can be done... I don't think I want to be the one to do it ;)
#asahi-gpu · 2022-10-02 15:26
alyssaI don't think turnip can, because qualcomm isn't a traditional tiler.
#asahi-gpu · 2022-10-02 15:26
alyssaI don't know if v3dv could use.
#asahi-gpu · 2022-10-02 15:26
alyssaI assume PowerVR too given the heritage.
#asahi-gpu · 2022-10-02 15:25
alyssaBoth Mali and AGX want that common lowering
#asahi-gpu · 2022-10-02 15:25
alyssaMy motivated reasoning says that we could extend the render pass emulation in the Vulkan core to do that for tilers (implement with dynamic rendering + imageblocks)
#asahi-gpu · 2022-10-02 15:25
alyssa-----
#asahi-gpu · 2022-10-02 15:24
alyssa(EXT_pixel_local_storage is a GLES extension adding imageblocks.)
#asahi-gpu · 2022-10-02 15:23
alyssaSo to implement all this subpass gooiness, we'd want to be doing an internal dynamic rendering for the whole render pass, with some sort of internal VK_MESA_pixel_local_storage extension
#asahi-gpu · 2022-10-02 15:23
alyssavkEndRendering()
#asahi-gpu · 2022-10-02 15:23
alyssa(what Metal calls "imageblocks")
#asahi-gpu · 2022-10-02 15:23
alyssaDraws where input attachments are lowered to "tilebuffer load" and outputs are lowered to "tilebuffer store", keyed to the explicit tilebuffer layouts
#asahi-gpu · 2022-10-02 15:22
alyssavkBeginRendering(the layout at the END, that will actually be stored to memory)
#asahi-gpu · 2022-10-02 15:22
alyssaConceptually what we actually want is:
#asahi-gpu · 2022-10-02 15:22
alyssaThis can all be done with render passes, but it doesn't really map in a totally clean way.
#asahi-gpu · 2022-10-02 15:22
alyssa------------
#asahi-gpu · 2022-10-02 15:21
alyssaFinally, the end of tile program writes out only what's left at the end with STORE_OPs
#asahi-gpu · 2022-10-02 15:21
alyssaFragment shaders are keyed to the layout before and after, determining how input attachments are read and colour is written respectively.
#asahi-gpu · 2022-10-02 15:21
alyssaBefore and after each subpass, there is a fixed layout of the tilebuffer: mappings of colour attachments to offsets and tilebuffer formats.
#asahi-gpu · 2022-10-02 15:20
alyssaThe background program initializes the tilebuffer for the *first* subpass.
#asahi-gpu · 2022-10-02 15:20
alyssaIdeally, the "background -> draws -> end of tile" pipeline is a single *render pass*
#asahi-gpu · 2022-10-02 15:19
alyssaSo how does any of this map to subpasses?
#asahi-gpu · 2022-10-02 15:19
alyssa---------------
#asahi-gpu · 2022-10-02 15:19
alyssa(For loads, the driver will again bind N texture state registers with texture descriptors mapping the render target's existing contents)
#asahi-gpu · 2022-10-02 15:19
alyssaFor completeness, there's also a special "background" program that runs for every pixel before any other fragment shader. It should load or clear all render targets as necessary.
#asahi-gpu · 2022-10-02 15:18
alyssa(I expect those formats need not match exactly but they must be compatible for the results to make sense.)
#asahi-gpu · 2022-10-02 15:17
alyssawith a shader that contains N block copy instructions, each specifying the format and location of the render target in the tilebuffer
#asahi-gpu · 2022-10-02 15:16
alyssaFor example, to implement N render targets with different formats, the driver will bind N texture state registers with descriptors mapping each render target in memory with the format of the attachment in memory.

plus ›