Experimental shared memory texture handling
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user