ADD: planet quadtree texture boilerplate

This commit is contained in:
2025-12-30 13:32:44 +09:00
parent 42645a31ea
commit 2bf97defcd
7 changed files with 440 additions and 13 deletions

View File

@@ -29,6 +29,13 @@ void SamplerManager::init(DeviceManager *deviceManager)
sampl.minFilter = VK_FILTER_LINEAR;
vkCreateSampler(_deviceManager->device(), &sampl, nullptr, &_defaultSamplerLinear);
// Linear clamp-to-edge (useful for tiled textures)
VkSamplerCreateInfo clampEdge = sampl;
clampEdge.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
clampEdge.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
clampEdge.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
vkCreateSampler(_deviceManager->device(), &clampEdge, nullptr, &_linearClampEdge);
// Shadow linear clamp sampler (border=white)
VkSamplerCreateInfo sh = sampl;
sh.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
@@ -60,4 +67,10 @@ void SamplerManager::cleanup()
vkDestroySampler(_deviceManager->device(), _shadowLinearClamp, nullptr);
_shadowLinearClamp = VK_NULL_HANDLE;
}
if (_linearClampEdge)
{
vkDestroySampler(_deviceManager->device(), _linearClampEdge, nullptr);
_linearClampEdge = VK_NULL_HANDLE;
}
}