From c7d609b062a41d5ecd655281c8c9ceea2524c59c Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 13 Jun 2024 18:31:43 +0800 Subject: [PATCH] check TextureView and Texture format (#17143) --- 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 ///////////