i hate metal
This commit is contained in:
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user