Visual Update for computeparticles

Instead of using a small amount of large textured particles, use a large
amount of small monochrome particles.
Which uses a new vulkanexamplebase functionality of creating and
updating a only device visible buffer via a temporary staging buffer.
This commit is contained in:
Voultapher 2016-04-21 11:21:48 +02:00
parent eb428db92d
commit 5d7014b221
9 changed files with 203 additions and 209 deletions

View file

@ -271,6 +271,20 @@ public:
// Load a SPIR-V shader
VkPipelineShaderStageCreateInfo loadShader(std::string fileName, VkShaderStageFlagBits stage);
// create device local buffer and use staging to access
VkBool32 createDeviceBuffer(
const VkBufferUsageFlags usage,
const VkDeviceSize size,
VkBuffer& buffer,
VkDeviceMemory& memory,
VkDescriptorBufferInfo& descriptor);
// update loacal buffer memory by creating a host visible staging buffer
VkBool32 updateDeviceBuffer(
const VkDeviceSize size,
VkBuffer& deviceBuffer,
void* data);
// Create a buffer, fill it with data (if != NULL) and bind buffer memory
VkBool32 createBuffer(
VkBufferUsageFlags usageFlags,