#
✕ nick:alyssa
#asahi-gpu · 2022-12-27 19:34
alyssaok. I guess this is ok.
#asahi-gpu · 2022-12-27 19:34
alyssadummy stencil if needed
#asahi-gpu · 2022-12-27 19:32
alyssaso we're allowed multiple zs_emit in a shader and they can terminate threads. maybe.
#asahi-gpu · 2022-12-27 19:32
alyssawait_pix 1; if (..) { zs_emit NaN }; store; zs emit; sigal_pix 1;
#asahi-gpu · 2022-12-27 19:32
alyssafor "if (..) { discard } write depth; side effect;" we get
#asahi-gpu · 2022-12-27 19:31
alyssado I really want to disassemble this in my head
#asahi-gpu · 2022-12-27 19:31
alyssawhat the heck
#asahi-gpu · 2022-12-27 19:31
alyssaokay let's see
#asahi-gpu · 2022-12-27 19:25
alyssasmells like a workaround
#asahi-gpu · 2022-12-27 19:24
alyssa(surely that last bit is a mistake?!)
#asahi-gpu · 2022-12-27 19:24
alyssadepth to any (!)
#asahi-gpu · 2022-12-27 19:24
alyssasets pass type to punch through
#asahi-gpu · 2022-12-27 19:24
alyssadisables triangle merging
#asahi-gpu · 2022-12-27 19:24
alyssaLooks like it inserts the equivalent of `gl_FragDepth = gl_FragCoord.z` for some reason
#asahi-gpu · 2022-12-27 19:23
alyssainserts a zs_emit instruction for some reason
#asahi-gpu · 2022-12-27 19:23
alyssadisables early-z
#asahi-gpu · 2022-12-27 19:23
alyssaunk 2 0 ->3
#asahi-gpu · 2022-12-27 19:23
alyssaadding a store into an FS sets "Set when frag shader spills: true" hm
#asahi-gpu · 2022-12-27 19:22
alyssastarting with a reference pipeline
#asahi-gpu · 2022-12-27 18:50
alyssaIt's not clear a priori how one would implement that on AGX given the zs_emit transform they do
#asahi-gpu · 2022-12-27 18:49
alyssabut if you actually terminate the thread when discarding -- or you discard a quad when all threads in it are demoted to helper threads -- then the shader will complete successfully
#asahi-gpu · 2022-12-27 18:49
alyssaIf you don't actually terminate the thread when discarding (merely demoting the thread to a helper invocation), the shader will hang the GPU
#asahi-gpu · 2022-12-27 18:48
alyssafor (;;) { if (condition that is eventually true) { discard } }
#asahi-gpu · 2022-12-27 18:48
alyssathere is an infamous fragment shader, I think it owes to GraphicsFuzz, that does something like:
#asahi-gpu · 2022-12-27 18:47
alyssabut it raises its own questions, like how to mask out stores from discarded threads, and how to terminate a quad after all threads in the quad are no longer needed for helper threads
#asahi-gpu · 2022-12-27 18:46
alyssaI did not realize that was necessary and not just an optimization
#asahi-gpu · 2022-12-27 18:46
alyssaApple's compiler lowers sample mask writes (including discard_fragment) to emitting a NaN depth, if zs_emit is used anywhere in the program
#asahi-gpu · 2022-12-27 18:46
alyssaso, I learned last night that sample_mask and zs_emit aren't allowed in the same program
#asahi-gpu · 2022-12-27 17:40
alyssathank you
#asahi-gpu · 2022-12-27 17:22
alyssa:p
#asahi-gpu · 2022-12-27 17:22
alyssathere will be no cursed USB spec references in my house
#asahi-gpu · 2022-12-27 17:21
alyssaor #asahi-dev maybe
#asahi-gpu · 2022-12-27 17:21
alyssa-> #asahi please
#asahi-gpu · 2022-12-27 16:56
alyssathe fallback would be generating little 1x1 vertex shaders to increase a counter each draw which is probably fine for a niche feature
#asahi-gpu · 2022-12-27 16:55
alyssaSome hw can plumb in a performance counter for this
#asahi-gpu · 2022-12-27 16:55
alyssalina: BTW, are you aware of any mechanism that Mesa could use to get the # of primitives generated?
#asahi-gpu · 2022-12-27 16:55
alyssalina: sounds nice :)
#asahi-gpu · 2022-12-27 16:05
alyssapower stats vs performance stats I suppose
#asahi-gpu · 2022-12-27 16:05
alyssaright, ok. that I would believe, yes
#asahi-gpu · 2022-12-27 15:56
alyssayeah that's definitely wrong
#asahi-gpu · 2022-12-27 15:42
alyssaand does not affect overhead on the CPU to actually submit work (right now the GPU is idle a ton of the time -- GPU speed ups are then subject to Amdahl's law)
#asahi-gpu · 2022-12-27 15:42
alyssabut does not affect the latency nor throughput of system memory (which we often stall on)
#asahi-gpu · 2022-12-27 15:41
alyssalina: I would not expect 78% faster for 720 -> 1287, because that's the clock only for actual GPU operation
#asahi-gpu · 2022-12-27 04:32
alyssatoday on broken nir_lower_blend: per-RT logic ops?
#asahi-gpu · 2022-12-27 03:00
alyssanot 5x faster but that's still substantial
#asahi-gpu · 2022-12-27 02:59
alyssat-rex is >15% faster
#asahi-gpu · 2022-12-27 02:59
alyssalina: took a cue from the "wtf pstates?" discussion and hacked my DTS to use 0x6 as the new base
#asahi-gpu · 2022-12-26 15:26
alyssabut it is entirely too boxing day for me to care to review more than I already have
#asahi-gpu · 2022-12-26 15:26
alyssathe diff isn't horrible since the indentation isn't changing (3 spaces before and after)
#asahi-gpu · 2022-12-26 15:26
alyssalina: !20434 waiting for review :D

plus ›