Experimental shared memory texture handling
This commit is contained in:
@@ -365,4 +365,19 @@ namespace OpenVulkano::Vulkan
|
||||
if (!sampler) sampler = device.createSampler(samplerConfig);
|
||||
return sampler;
|
||||
}
|
||||
|
||||
Unique<Scene::Texture> ResourceManager::CreateSharedMemoryTexture(const Math::Vector3ui& resolution, DataFormat format)
|
||||
{
|
||||
const std::unique_lock lock(mutex);
|
||||
Unique<Scene::Texture> texture = std::make_unique<Scene::Texture>();
|
||||
texture->resolution = resolution;
|
||||
texture->format = format;
|
||||
texture->size = resolution.x * resolution.y * resolution.z * format.GetBytesPerPixel();
|
||||
|
||||
VulkanTexture* vkTexture = new VulkanTexture();
|
||||
vkTexture->InitSharedMem(this, texture.get(), GetDescriptorLayoutSet(Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING), Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING);
|
||||
textures.emplace_back(vkTexture);
|
||||
|
||||
return texture;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user