Experimental shared memory texture handling

This commit is contained in:
Georg Hagen
2024-07-23 01:21:27 +02:00
parent d64bb7a530
commit 75aa36c024
9 changed files with 76 additions and 7 deletions

View File

@@ -37,6 +37,19 @@ namespace OpenVulkano::Vulkan
texture->renderTexture = this;
}
void InitSharedMem(ResourceManager* resManager, Scene::Texture* texture, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding)
{
m_texture = texture;
Image::Init(resManager->GetContext()->device.get(), texture->format, { texture->resolution.x, texture->resolution.y, texture->resolution.z }, vk::MemoryPropertyFlagBits::eDeviceLocal | vk::MemoryPropertyFlagBits::eHostVisible);
texture->updated = false;
texture->textureBuffer = Map();
m_sampler = resManager->CreateSampler(DEFAULT_SAMPLER_CONFIG);
SetDescriptorSet(resManager, descriptorSetLayout, binding);
texture->renderTexture = this;
}
virtual ~VulkanTexture() override
{
if (m_texture) Close();