I'm using cocos2d-x 3.17.2 and running my App on iPad mini 5th iOS 13.1.3.
When I call utils::captureScreen, it causes assertion failure.
_validateGetBytes:29: failed assertion `CPU access for textures with MTLResourceStorageModePrivate storage mode is disallowed.'
It seems like a MTLResourceStorageMode related problem.
But I can't find out how to fix this.
I run the same code on iOS 11.4.1 iPod touch 6th, and on iOS 12.4.3 iPad mini 2nd, but these 2 devices don't cause this problem, they run perfect.
Here is my code.
string path = FileUtils::getInstance()->getWritablePath().append("screenshot.jpg");
Label *path_lbl = Label::createWithSystemFont(path, "", 20.0);
const char* filename = path_lbl->getString().c_str();
utils::captureScreen([&](bool succeed,const std::string &fileName){}, filename);
and assertion failed on the line: ccUtils.cpp: Line 105
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer.get());
Does anyone know how to fix this problem?