diff options
Diffstat (limited to 'video.cpp')
-rw-r--r-- | video.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -782,6 +782,7 @@ struct Vertex_Format_Vk { struct Sampler_Vk : public Late_Terminated { VkSampler sampler; + Sampler_Id id; void init(Device_Vk* dev, const Sampler_State& s); void destroy(Device_Vk* dev) override; @@ -2006,6 +2007,11 @@ void Device::destroy_texture(Texture_Id id) { dev->queue_destroy((Texture_Vk*)&dev->get_texture(id)); } +void Device::destroy_texturei(Texture_Id id) { + Device_Vk* dev = (Device_Vk*)this; + ((Texture_Vk*)&dev->get_texture(id))->destroy(dev); +} + void Context::wait() { Context_Vk* ctx = (Context_Vk*)this; Device_Vk* dev = ctx->dev; @@ -3169,6 +3175,12 @@ void Device::destroy_buffer(Buffer_Id id) { dev->queue_destroy(buf); } +void Device::destroy_bufferi(Buffer_Id id) { + Device_Vk* dev = (Device_Vk*)this; + Buffer_Vk* buf = (Buffer_Vk*)&get_buffer(id); + buf->destroy(dev); +} + void* Device::map_buffer( Buffer_Id id, size_t offset, @@ -3288,6 +3300,12 @@ void Device::destroy_sampler(Sampler_Id id) { dev->queue_destroy(&s); } +void Device::destroy_sampleri(Sampler_Id id) { + Device_Vk* dev = (Device_Vk*)this; + Sampler_Vk& s = dev->samplers[id]; + s.destroy(dev); +} + void Shader_Loader::init(Device_Vk* d) { dev = d; } @@ -3557,6 +3575,7 @@ void Sampler_Vk::init(Device_Vk* dev, const Sampler_State& s) { void Sampler_Vk::destroy(Device_Vk* dev) { vkDestroySampler(dev->dev, sampler, &dev->ac); + dev->samplers.remove(id); } void Vram_Allocator::Page::init( |