From 1acc982b9d6f3077aceb1c05c54269deab42f604 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 13 Jun 2024 17:38:38 +0800 Subject: [PATCH] check TextureView and Texture format --- native/cocos/renderer/gfx-validator/TextureValidator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/native/cocos/renderer/gfx-validator/TextureValidator.cpp b/native/cocos/renderer/gfx-validator/TextureValidator.cpp index c0bc45a2393..8b9ec6cb662 100644 --- a/native/cocos/renderer/gfx-validator/TextureValidator.cpp +++ b/native/cocos/renderer/gfx-validator/TextureValidator.cpp @@ -120,6 +120,8 @@ void TextureValidator::doInit(const TextureViewInfo &info) { _inited = true; _isTextureView = true; CC_ASSERT(info.texture && static_cast(info.texture)->isInited()); + // TextureView format should equal to the corresponding Texture format. + CC_ASSERT(info.texture->getFormat() == info.format); /////////// execute ///////////