Fix shading rate image dimensions for resolutions that don't divide by shadingRateTexelSize
This commit is contained in:
parent
ccadcdd238
commit
3643d10cac
1 changed files with 4 additions and 1 deletions
|
|
@ -132,7 +132,10 @@ void VulkanExample::prepareShadingRateImage()
|
||||||
{
|
{
|
||||||
// Shading rate image size depends on shading rate texel size
|
// Shading rate image size depends on shading rate texel size
|
||||||
// For each texel in the target image, there is a corresponding shading texel size width x height block in the shading rate image
|
// For each texel in the target image, there is a corresponding shading texel size width x height block in the shading rate image
|
||||||
const VkExtent3D imageExtent = { width / physicalDeviceShadingRateImagePropertiesNV.shadingRateTexelSize.width, height / physicalDeviceShadingRateImagePropertiesNV.shadingRateTexelSize.height, 1 };
|
VkExtent3D imageExtent{};
|
||||||
|
imageExtent.width = static_cast<uint32_t>(ceil(width / (float)physicalDeviceShadingRateImagePropertiesNV.shadingRateTexelSize.width));
|
||||||
|
imageExtent.height = static_cast<uint32_t>(ceil(height / (float)physicalDeviceShadingRateImagePropertiesNV.shadingRateTexelSize.height));
|
||||||
|
imageExtent.depth = 1;
|
||||||
|
|
||||||
VkImageCreateInfo imageCI{};
|
VkImageCreateInfo imageCI{};
|
||||||
imageCI.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
imageCI.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue