V-EZ
V-EZ copied to clipboard
Divide by zero in compressed image subdata
There can be a divide by zero on this line when numBlocksX
is zero, which occurs for small / mip textures.
VkResult Device::CompressedImageSubData(Image* pImage, const VezImageSubDataInfo* pSubDataInfo, const void* pData)
auto maxTransferBlocksY = std::min(numBlocksY, static_cast<uint32_t>(pinnedMemoryBufferSize / (blockSize * numBlocksX)));
This can be trivially fixed by checking for zero before divide. The code otherwise appears correct as it rounds up zero block counts to one for those tiny sizes.
Hi, could you contribute to this repo? V-EZ github is unmaintained for now.
@manhnt9 Maybe. I'm just playing around with VEZ and reporting some issues I found here. I notice a few other forks of this repo have recent development and maintenance effort. I don't have a repo to share, just some code I'm playing with.