andy-thomason / Vookoo

A set of utilities for taking the pain out of Vulkan in header only modern C++
MIT License
522 stars 52 forks source link

added new examples; threaded and flockaroo #42

Closed pocdn closed 3 years ago

pocdn commented 3 years ago

Please consider this pull request containing two new examples; threaded and flockaroo.

threaded example uses multiple threads to build secondary command buffers which are then used to draw.

flockaroo example is inspired by shadertoy https://www.shadertoy.com/view/MsGSRd which was created by florian berger (flockaroo) - 2016 License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. the flockaroo.cpp file is new and replaces webgl with vulkan/vookoo library.

Note, vkuframework.hpp needed to be modified with dynamicCommandBufferFences to syncronize threaded example.

vku.hpp's GenericImage::setLayout was giving many many vk validation errors relating to https://www.khronos.org/registry/vulkan/specs/1.2/html/chap7.html#synchronization-access-types-supported which were corrected by explicitly matching table's "Layout" and "*StageMask" columns -- not sure if all cases correctly fixed but all the ones seen with these examples were alleviated of validation errors related to this particular table.

lhog commented 3 years ago

Hi! Thanks for the PR. Are you planning any other changes?

pocdn commented 3 years ago

Hi, I caught one silly error in flockaroo.cpp and just corrected it. But for these two examples, I don't plan any new changes.

andy-thomason commented 3 years ago

Looks good. Advection-only CFD is simple and fun - no Navier-Stokes instability.

The threaded example is also useful. Recycling command buffers is a tricky business.