Add a new class to manage a set of default device resources. (#12936)

This commit is contained in:
Yiwen
2022-10-19 10:19:40 +08:00
committed by GitHub
parent 5e70d67b5f
commit f413ff7a9b
5 changed files with 195 additions and 2 deletions
@@ -74,6 +74,13 @@ void TextureValidator::doInit(const TextureInfo &info) {
}
break;
}
case TextureType::TEX1D_ARRAY: {
if (std::min(info.width, info.height) > 1 || std::max(info.width, info.height) > DeviceValidator::getInstance()->getCapabilities().maxTextureSize
|| info.layerCount > DeviceValidator::getInstance()->getCapabilities().maxArrayTextureLayers) {
CC_ASSERT(false);
}
break;
}
case TextureType::TEX2D_ARRAY: {
if (std::max(info.width, info.height) > DeviceValidator::getInstance()->getCapabilities().maxTextureSize
|| info.layerCount > DeviceValidator::getInstance()->getCapabilities().maxArrayTextureLayers) {