diff --git a/src/gfx_device_vulkan.cpp b/src/gfx_device_vulkan.cpp index d558f28..8107cd8 100644 --- a/src/gfx_device_vulkan.cpp +++ b/src/gfx_device_vulkan.cpp @@ -344,8 +344,12 @@ struct GFXDevice::Impl { Swapchain swapchain{}; VkDescriptorPool descriptorPool; - std::array, FRAMES_IN_FLIGHT> - uniformBufferWriteQueues{}; + + struct WriteQueues { + std::unordered_set uniform_buffer_writes{}; + }; + + std::array write_queues{}; // For one-off transfer operations not bound to a specific frame-in-flight VkCommandPool transferCommandPool = VK_NULL_HANDLE; @@ -610,7 +614,7 @@ gfx::DrawBuffer* GFXDevice::BeginRender() { std::vector barriers{}; for (gfx::UniformBuffer* uniformBuffer : - pimpl->uniformBufferWriteQueues[currentFrameIndex]) { + pimpl->write_queues[currentFrameIndex].uniform_buffer_writes) { VkBufferCopy copyRegion{}; copyRegion.srcOffset = 0; copyRegion.dstOffset = 0; @@ -632,7 +636,7 @@ gfx::DrawBuffer* GFXDevice::BeginRender() { barrier.offset = 0; barrier.size = uniformBuffer->gpuBuffers[currentFrameIndex].size; } - pimpl->uniformBufferWriteQueues[currentFrameIndex].clear(); + pimpl->write_queues[currentFrameIndex].uniform_buffer_writes.clear(); VkDependencyInfo dependencyInfo{}; dependencyInfo.sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO; @@ -1291,7 +1295,7 @@ void GFXDevice::WriteUniformBuffer(gfx::UniformBuffer* buffer, uint64_t offset, /* queue the writes to each gpu buffer */ // This is required as buffers cannot be updated if they are currently in use for (uint32_t i = 0; i < FRAMES_IN_FLIGHT; i++) { - pimpl->uniformBufferWriteQueues[i].insert(buffer); + pimpl->write_queues[i].uniform_buffer_writes.insert(buffer); } } diff --git a/test/src/game.cpp b/test/src/game.cpp index 154d586..daea527 100644 --- a/test/src/game.cpp +++ b/test/src/game.cpp @@ -189,20 +189,19 @@ void PlayGame(GameSettings settings) { static float time_elapsed; time_elapsed += ts; if (time_elapsed >= 1.0f) { - time_elapsed = 0; + time_elapsed = 0.0f; - int fpsWidth, fpsHeight; - LOG_INFO("Creating new bitmap..."); - /*auto fpsBitmap = - app.GetResource("builtin.mono") - ->GetTextBitmap(std::to_string(ts), 768.0f, fpsWidth, - fpsHeight);*/ - LOG_INFO("Bitmap created! Loading into new texture..."); - /*textbox_renderable->material->texture_ = - std::make_unique( - &app.render_data_, fpsBitmap->data(), fpsWidth, fpsHeight, - engine::resources::Texture::Filtering::kBilinear);*/ - LOG_INFO("Texture created!"); + //LOG_INFO("Creating new bitmap..."); + //auto fpsBitmap = + // app.GetResource("builtin.mono") + // ->GetTextBitmap(std::to_string(ts), 768.0f, fpsWidth, + // fpsHeight); + //LOG_INFO("Bitmap created! Loading into new texture..."); + //textbox_renderable->material->texture_ = + // std::make_unique( + // &app.render_data_, fpsBitmap->data(), fpsWidth, fpsHeight, + // engine::resources::Texture::Filtering::kBilinear); + //LOG_INFO("Texture created!"); } }; }