Skip to content

Commit

Permalink
Vulkan backend cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuprynowicz committed Dec 15, 2024
1 parent e23623e commit 53ea3a5
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 1,519 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,6 @@ void VulkanDisplayPlugin::present(const std::shared_ptr<RefreshRateController>&
vkBackend->waitForGPU();
vkBackend->recycleFrame();

vkBackend->getContext().emptyDumpster(frameFence);
vkBackend->getContext().recycle();

gpu::Backend::freeGPUMemSize.set(gpu::gl::getFreeDedicatedMemory());
} else if (alwaysPresent()) {
refreshRateController->clockEndTime();
Expand Down
1 change: 0 additions & 1 deletion libraries/gpu-vk/src/gpu/vk/VKBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <vk/Config.h>
#include <vk/Context.h>
#include <vk/VulkanDebug.h>
#include <vk/VulkanTexture.h>
#include <vulkan/vulkan_core.h>

#include "VKForward.h"
Expand Down
19 changes: 0 additions & 19 deletions libraries/gpu-vk/src/gpu/vk/VKFramebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@

#include "VKShared.h"
#include "VKBackend.h"
#include <vk/VulkanFrameBuffer.hpp>

namespace gpu { namespace vk {

class VKFramebuffer : public vk::VKObject<Framebuffer> {
public:
//vks::Framebuffer vksFrameBuffer;
VkRenderPass vkRenderPass {VK_NULL_HANDLE};
VkFramebuffer vkFramebuffer {VK_NULL_HANDLE};

Expand Down Expand Up @@ -49,24 +47,8 @@ class VKFramebuffer : public vk::VKObject<Framebuffer> {
return object;
}

// VKTODO: what type should it return?
template <typename VKFramebufferType>
static uint32_t getId(vk::VKBackend& backend, const Framebuffer& framebuffer) {
VKFramebufferType* fbo = sync(backend, framebuffer);
if (fbo) {
return fbo->_id;
} else {
return 0;
}
}

// VKTODO: probably a Vulkan handle instead of this
//const VKuint& _fbo { _id };
//std::vector<VKenum> _colorBuffers;
Stamp _depthStamp { 0 };
std::vector<Stamp> _colorStamps;
// Contains attachment number?
//std::vector<uint32_t> _colorBuffers;

// From VKS
struct FramebufferAttachment
Expand Down Expand Up @@ -139,7 +121,6 @@ class VKFramebuffer : public vk::VKObject<Framebuffer> {

// VKTODO: We need a check on backend.lock(), or to pass backend reference instead
VKFramebuffer(const std::weak_ptr<vk::VKBackend>& backend, const Framebuffer& framebuffer) : VKObject(*backend.lock(), framebuffer) {}
//vksFrameBuffer(backend.lock()->getContext().device.get()){}
// VKTODO: Do we need virtual destructor here?
~VKFramebuffer();

Expand Down
5 changes: 3 additions & 2 deletions libraries/gpu-vk/src/gpu/vk/VKShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

namespace gpu { namespace vk {

class VKShader : public GPUObject {
// VKTODO:
/*class VKShader : public GPUObject {
public:
static VKShader* sync(VKBackend& backend, const Shader& shader);
static bool makeProgram(VKBackend& backend, Shader& shader, const Shader::BindingSet& slotBindings);
Expand Down Expand Up @@ -45,7 +46,7 @@ class VKShader : public GPUObject {
}
const std::weak_ptr<VKBackend> _backend;
};
};*/

} }

Expand Down
2 changes: 1 addition & 1 deletion libraries/vk/src/vk/Allocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace vks {
static VmaAllocator& getAllocator();

VmaAllocation allocation;
/** @brief Memory propertys flags to be filled by external source at buffer creation (to query at some later point) */
/** @brief Memory properties flags to be filled by external source at buffer creation (to query at some later point) */
VkMemoryPropertyFlags memoryPropertyFlags;
#else
VkDeviceMemory memory;
Expand Down
Loading

0 comments on commit 53ea3a5

Please sign in to comment.