I’m getting these warnings in the console window while running the Win32 build:
warning: vertex attribute 'a_texCoord' already set
warning: vertex attribute 'a_color' already set
warning: vertex attribute 'a_position' already set
warning: vertex attribute 'a_texCoord' already set
warning: vertex attribute 'a_color' already set
warning: vertex attribute 'a_position' already set
warning: vertex attribute 'a_texCoord' already set
warning: vertex attribute 'a_color' already set
warning: vertex attribute 'a_position' already set
... over and over again ...
From here:
void VertexLayout::setAtrribute(const std::string &name, unsigned int index, VertexFormat format, unsigned int offset, bool needToBeNormallized)
{
if (_attributes.find(name) != _attributes.end())
{
CCLOG("warning: vertex attribute '%s' already set", name.c_str());
}
_attributes[name] = { name, index, format, offset, needToBeNormallized };
}
Which called by this:
void Label::setVertexLayout(PipelineDescriptor& pipelineDescriptor)
{
auto& layout = pipelineDescriptor.vertexLayout;
const auto& attributeInfo = _programState->getProgram()->getActiveAttributes();
auto iter = attributeInfo.find("a_position");
if(iter != attributeInfo.end())
{
layout.setAtrribute("a_position", iter->second.location, backend::VertexFormat::FLOAT3, 0, false);
}
iter = attributeInfo.find("a_texCoord");
if(iter != attributeInfo.end())
{
layout.setAtrribute("a_texCoord", iter->second.location, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false);
}
iter = attributeInfo.find("a_color");
if(iter != attributeInfo.end())
{
layout.setAtrribute("a_color", iter->second.location, backend::VertexFormat::UBYTE4, offsetof(V3F_C4B_T2F, colors), true);
}
layout.setLayout(sizeof(V3F_C4B_T2F), backend::VertexStepMode::VERTEX);
}
Here is the callstack:
Slots2D.exe!cocos2d::backend::VertexLayout::setAtrribute(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name, unsigned int index, cocos2d::backend::VertexFormat format, unsigned int offset, bool needToBeNormallized) Line 11 C++
> Slots2D.exe!cocos2d::Label::setVertexLayout(cocos2d::PipelineDescriptor & pipelineDescriptor) Line 603 C++
Slots2D.exe!cocos2d::Label::updateShaderProgram() Line 717 C++
Slots2D.exe!cocos2d::Label::draw(cocos2d::Renderer * renderer, const cocos2d::Mat4 & transform, unsigned int flags) Line 1795 C++
Slots2D.exe!cocos2d::Label::drawSelf(bool visibleByCamera, cocos2d::Renderer * renderer, unsigned int flags) Line 1926 C++
Slots2D.exe!cocos2d::Label::visit(cocos2d::Renderer * renderer, const cocos2d::Mat4 & parentTransform, unsigned int parentFlags) Line 1911 C++
Slots2D.exe!cocos2d::ProtectedNode::visit(cocos2d::Renderer * renderer, const cocos2d::Mat4 & parentTransform, unsigned int parentFlags) Line 327 C++
Slots2D.exe!cocos2d::ui::Widget::visit(cocos2d::Renderer * renderer, const cocos2d::Mat4 & parentTransform, unsigned int parentFlags) Line 260 C++
Slots2D.exe!cocos2d::Node::visit(cocos2d::Renderer * renderer, const cocos2d::Mat4 & parentTransform, unsigned int parentFlags) Line 1248 C++
Slots2D.exe!cocos2d::Node::visit(cocos2d::Renderer * renderer, const cocos2d::Mat4 & parentTransform, unsigned int parentFlags) Line 1248 C++
Slots2D.exe!cocos2d::Scene::render(cocos2d::Renderer * renderer, const cocos2d::Mat4 & eyeTransform, const cocos2d::Mat4 * eyeProjection) Line 222 C++
Slots2D.exe!cocos2d::GLView::renderScene(cocos2d::Scene * scene, cocos2d::Renderer * renderer) Line 494 C++
Slots2D.exe!cocos2d::Director::drawScene() Line 293 C++
Aside from that, here is what I’ve noticed:
- Some scenes take longer to render in Alpha1, so I’m literally staring at a blank screen for almost 1 second before sprites appear (EDIT: Seems to be in scenes with Spine sprites)
- Alpha1 is using between 40-60% more memory for scenes with the exact same objects compared to 3.17.1, and I have absolutely no idea why [EDIT: It seems to have something to do with the new Spine runtime code that was modified to support this release of Cocos2d-x, where the Spine for Alpha1 is using 10x the memory for exactly the same Spine object]. The memory usage is visible in both Windows Task Manager and inside Visual Studio diagnostic tools. Is there something I should be aware of regarding memory usage?
EDIT: After running the Visual Studio performance profiler for memory analysis, these are the results:
V3.17.1:
Alpha1:
The excess memory usage seems to be coming from the modified Spine runtime, so perhaps there is a bug in the code added to support Cocos2d-x-metal. You can also see that the call count for the SkeletonTwoColorBatch::getInstance() is 44x more than the unmodified run-time in v3.17.1 (440,026 calls vs 10,066 calls).
Drilling down further into the SkeletonTwoColorBatch: