i hate metal

This commit is contained in:
Dynamitos
2025-03-05 09:41:34 +01:00
parent 5693802215
commit 4d7c5db2c3
15 changed files with 218 additions and 86 deletions
+22 -1
View File
@@ -6,6 +6,27 @@
using namespace Seele;
using namespace Seele::Metal;
DestructionManager::DestructionManager(PGraphics graphics) : graphics(graphics) {}
DestructionManager::~DestructionManager() {}
void DestructionManager::queueResourceForDestruction(OCommandBoundResource resource) {
if (resource == nullptr)
return;
if (resource->isCurrentlyBound()) {
resources.add(std::move(resource));
}
}
void DestructionManager::notifyCommandComplete() {
for (size_t i = 0; i < resources.size(); ++i) {
if (!resources[i]->isCurrentlyBound()) {
resources.removeAt(i, false);
i--;
}
}
}
Fence::Fence(PGraphics graphics) : handle(graphics->getDevice()->newFence()) {}
Fence::~Fence() { handle->release(); }
@@ -34,4 +55,4 @@ Sampler::Sampler(PGraphics graphics, const SamplerCreateInfo& createInfo) {
desc->release();
}
Sampler::~Sampler() { sampler->release(); }
Sampler::~Sampler() { sampler->release(); }