25 Mar 2024 |
ic.rbow | It is possible to keep contents from a previous frames, you just don't use clear/discard flags. | 08:27:43 |
ic.rbow | I think with every frame getting updated there should be two renderpasses called with attachments crossed to each other. | 08:28:54 |
tristanC | That looks great, thank you! | 11:20:31 |
26 Mar 2024 |
tristanC | Well, I don't get why dynamap is using Compose instead of the ForwardMsaa render pass. I tried duplicating my fullscreen pipeline but running it with the Offscreen pass results in the display getting stuck (with the following in dmesg: [drm] Resetting rcs0 for preemption time out, [drm] animation-fract[1537234 context reset due to GPU hang, [drm] GPU HANG: ecode 12:1:85dffffb, in animation-fract [1537234] ). | 01:13:01 |
tristanC | I must be doing something terribly wrong, and if I comment the following draw call, then the app runs fine (but the screen is dark): https://gitlab.com/TristanCacqueray/animation-fractal/-/blob/wip-postprocess/src/Stage/Fractal/Setup.hs?ref_type=heads#L470 | 01:13:50 |
tristanC | Looking at this example, it seems like a single Offscreen pass can hold multiple framebuffers, but I'm not sure how to map such code to keid: https://github.com/SaschaWillems/Vulkan/blob/master/examples/bloom/bloom.cpp#L325 | 02:50:49 |
ic.rbow | Indeed, a shader can write to multiple attachments. This would require a different renderpass to register all the buffers at right places. | 15:30:02 |
tristanC | I've reduced my bug to this simple commit that adds a dummy render pass, simply trying to re-render my offscreen texture to a new one. I was expecting this to work, but it get stuck with the same error I had earlier: https://gitlab.com/TristanCacqueray/animation-fractal/-/commit/fb8f6b0b9e705fa2a798327ccbc27f45b68ad1b4 | 17:19:54 |
ic.rbow | So, using ForwardMsaa, then Offscreen works, but injecting another Offscreen them locks up? | 19:42:28 |
tristanC | It seems like so, not sure what is locked because adding debug print around the new pass are only displayed after the process is unlocked. Though commenting the added triangle draw does fix the locks up. | 19:47:36 |
ic.rbow | Any hints from vulkan validators?.. | 19:49:36 |
ic.rbow | * So, using Offscreen, then ForwardMsaa works, but injecting another Offscreen them locks up? | 19:49:56 |
tristanC | I was looking for those, is there a flag/env I need to use to get them? | 19:50:05 |
ic.rbow | I launch vk-config and enable it there. | 19:50:34 |
ic.rbow | There is a way to do it with env vars, but I always forget the details. | 19:51:32 |
tristanC | There is! I got https://paste.debian.net/1312098/ | 19:58:24 |
tristanC | Alright, using sSamples = Vk.SAMPLE_COUNT_4_BIT for the offscreen settings fixed the issue! | 20:02:43 |
tristanC | These validation errors are so helpful, to get them without vk-config you just need to use: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation cabal ... | 20:04:08 |
tristanC | That's so cool, I can now tweak the fractal using an extra shader :) Now, onto using a copy of the last texture to smooth the diff... Thanks for the help ic.rbow ! | 20:17:30 |
28 Mar 2024 |
tristanC | ic.rbow: How are the postprocess constants updated in dynamap? Isn't it missing a call to Vk.cmdPushConstants ? | 01:26:10 |
tristanC | Oh well, I was able to add a slider to tweak my post process pipeline using a push constant with https://gitlab.com/TristanCacqueray/animation-fractal/-/commit/8c99919a203cc4991bd84b8932835f81a1d1c253 . I guess keid is missing a wrapper for that call. | 02:00:05 |
ic.rbow | In reply to @tristanc_:matrix.org ic.rbow: How are the postprocess constants updated in dynamap? Isn't it missing a call to Vk.cmdPushConstants ? Dynamap's postprocessing uses compile-time specialization. You pass a value when loading the shader and IR compiler strips all the conditionals, making the code branchless. | 08:49:35 |
ic.rbow | The PushConstants API is tricky. On a first look it is easy-peasy, write a value before draw call and done. However it very limited and breaks down in so many places. | 08:51:05 |
ic.rbow | Pipelines with different push constant layouts have incompatible bindings according to the validation layers, so you lose the ability to bind top-level sets once per render pass. | 08:53:44 |
ic.rbow | For shader globals you can have a piece of uniform buffer and for draws you'd better stick to instance buffers. Neither of those require writing data every frame. | 08:56:03 |
ic.rbow | * For shader globals you can have a piece of uniform buffer and for draws you'd better stick to instance buffers. Neither of those require writing same data every frame just to get it to work. | 08:56:21 |
ic.rbow | Push constants could've been useful with dynamic rendering, but its availability is not so great. | 08:57:21 |
ic.rbow | * Push constants could've been useful with renderpass-less dynamic rendering, but its availability is not so great. | 08:57:33 |
ic.rbow | In reply to @tristanc_:matrix.org ic.rbow: How are the postprocess constants updated in dynamap? Isn't it missing a call to Vk.cmdPushConstants ? * Dynamap's postprocessing uses compile-time specialization. You pass a value when loading the shader and IR compiler strips all the conditionals, making the code branchless. This way you can ship "ubershader" code without incurring its costs of runtime switching. | 08:58:35 |
tristanC | I see, thanks, I miss read constant_id as push_constant . I like them because they feels less magic, but you are right, I should be using an uniform buffer. | 12:46:21 |