#
✕ nick:alyssa
#asahi-gpu · 2023-03-30 02:15
alyssayeah you need commit rights to add labels
#asahi-gpu · 2023-03-30 01:51
alyssaHm still faulting.
#asahi-gpu · 2023-03-30 01:47
alyssaOk. That's workable.
#asahi-gpu · 2023-03-30 01:47
alyssaoh. I bet the 0xff form isn't valid here. ok.
#asahi-gpu · 2023-03-30 01:46
alyssa(dEQP-GLES31.functional.fbo.no_attachments.multisample.samples4)
#asahi-gpu · 2023-03-30 01:46
alyssasome compiler bug
#asahi-gpu · 2023-03-30 01:46
alyssacurrently trying to figure out why my sample_mask is faulting
#asahi-gpu · 2023-03-30 01:46
alyssaSpeaking of.. ugh why is multisampling so tricky on this hw
#asahi-gpu · 2023-03-29 22:20
alyssaSo this isn't just AGX being quirky, it's AGX being awesome :^)
#asahi-gpu · 2023-03-29 22:20
alyssaand that doesn't require any special hardware, that happens automatically with standard compiler optimizations (either global code motion or loop unrolling with constant subexpression elimination)
#asahi-gpu · 2023-03-29 22:19
alyssaIf there are calculations that don't depend on the sample ID, only the pixel, then they can happen just once and get shared for all the samples
#asahi-gpu · 2023-03-29 22:19
alyssaThis lets us run shaders partially per sample and partially per pixel
#asahi-gpu · 2023-03-29 22:18
alyssaWhy would they possibly do this?
#asahi-gpu · 2023-03-29 22:18
alyssa}
#asahi-gpu · 2023-03-29 22:18
alyssa API_fragment_shader(sample_id);
#asahi-gpu · 2023-03-29 22:18
alyssafor (int sample_id = 0; sample_id < num_samples; ++sample_id) {
#asahi-gpu · 2023-03-29 22:18
alyssaSomething like:
#asahi-gpu · 2023-03-29 22:18
alyssaIf sample shading IS used, the compiler (or driver) has to build a pixel shader that loops over all the samples and executes the fragment shader once per sample
#asahi-gpu · 2023-03-29 22:17
alyssaIf sample shading is NOT used, this is easy -- just set all the masks to "all samples" and it'll work regardless of the sample count
#asahi-gpu · 2023-03-29 22:17
alyssaSo, an API level fragment shader needs to get transformed into a AGX pixel shader
#asahi-gpu · 2023-03-29 22:16
alyssa(the load colour, discard, emit depth/stencil instructions are similar)
#asahi-gpu · 2023-03-29 22:16
alyssabut if you pass just a single bit set, then it'll write out just that one sample
#asahi-gpu · 2023-03-29 22:16
alyssaIf you pass all-1's then it'll act like a pixel shader
#asahi-gpu · 2023-03-29 22:16
alyssaWell, the "store colour" instruction also takes a mask of samples that it should apply to
#asahi-gpu · 2023-03-29 22:15
alyssaHow can that possibly implement sample shading, you ask? (And Metal does support sample shading)
#asahi-gpu · 2023-03-29 22:15
alyssaInstead, it *always* runs a pixel shader!
#asahi-gpu · 2023-03-29 22:15
alyssaAGX does *not* work this way
#asahi-gpu · 2023-03-29 22:15
alyssaYou compile a fragment shader and then there's a bit in the command stream that controls whether the hw invokes it once per pixel or once per sample
#asahi-gpu · 2023-03-29 22:15
alyssaAnyway, all other GPUs that I know of implement this in hardware
#asahi-gpu · 2023-03-29 22:14
alyssa(What controls whether the fragment shader is invokved for every sample? Depends on the API, lots of different reasons it might happen. Kind of an ugly point in GL/Vulkan.)
#asahi-gpu · 2023-03-29 22:14
alyssathat is, the fragment is either a pixel or a sample depending on whether (per-)sample shading is used
#asahi-gpu · 2023-03-29 22:13
alyssaand then you can either evaluate the fragment shader once per pixel (outputting the same colour to all samples) or once per sample (different colours per sample)
#asahi-gpu · 2023-03-29 22:12
alyssain APIs, you can have multiple samples per pixel (multisampling)
#asahi-gpu · 2023-03-29 22:12
alyssaFor AGX, I'm using slightly different definitions
#asahi-gpu · 2023-03-29 22:11
alyssaIt's a pixel shader if you use Direct3D and a fragment shader if you don't ;-)
#asahi-gpu · 2023-03-29 22:11
alyssa 04:13 <i509vcb> What specifically makes a pixel shader a pixel shader? A lot of sources I found seem to conflate fragment and pixel shaders
#asahi-gpu · 2023-03-29 22:11
alyssapowervr term
#asahi-gpu · 2023-03-29 22:11
alyssawe assume
#asahi-gpu · 2023-03-29 22:11
alyssayes
#asahi-gpu · 2023-03-29 22:11
alyssa 03:42 <i509vcb> Pixel Data Master (PDM) is the hardware which dispatches fragment shaders? (I'd think fragment since that sounds most similar to pixel)
#asahi-gpu · 2023-03-29 22:09
alyssai509vcb: ok your questions
#asahi-gpu · 2023-03-29 21:27
alyssafor buffer map purposes we're a non-blitting driver
#asahi-gpu · 2023-03-29 21:24
alyssahttps://docs.mesa3d.org/gallium/buffermapping.html
#asahi-gpu · 2023-03-29 21:24
alyssaerr
#asahi-gpu · 2023-03-29 21:24
alyssalina: I forgot we had these docs, worth a read https://docs.mesa3d.org/gallium/buffermapping.html?highlight=buffer
#asahi-gpu · 2023-03-29 20:35
alyssabeen occupied
#asahi-gpu · 2023-03-29 20:35
alyssaactually not sorry i need to get out of my canadian habit of saying sorry when i'm not sorry
#asahi-gpu · 2023-03-29 20:35
alyssai509vcb: yeah, sorry
#asahi-gpu · 2023-03-28 19:25
alyssalol
#asahi-gpu · 2023-03-28 19:04
alyssaISP image synthesis processor

plus ›