replace assert with CC_ASSERT (#10913)

* replace assert with CC_ASSERT
This commit is contained in:
minggo
2022-04-29 10:18:41 +08:00
committed by GitHub
parent fa25709788
commit 8e7669bf92
65 changed files with 303 additions and 627 deletions
+5 -5
View File
@@ -554,7 +554,7 @@ IProgramInfo *ProgramLib::getTemplate(const ccstd::string &name) {
ITemplateInfo *ProgramLib::getTemplateInfo(const ccstd::string &name) {
auto it = _templates.find(name);
assert(it != _templates.end());
CC_ASSERT(it != _templates.end());
auto hash = it->second.hash;
auto itInfo = _templateInfos.find(hash);
return itInfo != _templateInfos.end() ? &itInfo->second : nullptr;
@@ -567,7 +567,7 @@ ITemplateInfo *ProgramLib::getTemplateInfo(const ccstd::string &name) {
*/
gfx::DescriptorSetLayout *ProgramLib::getDescriptorSetLayout(gfx::Device *device, const ccstd::string &name, bool isLocal) {
auto itTmpl = _templates.find(name);
assert(itTmpl != _templates.end());
CC_ASSERT(itTmpl != _templates.end());
const auto &tmpl = itTmpl->second;
auto itTplInfo = _templateInfos.find(tmpl.hash);
if (itTplInfo == _templateInfos.end()) {
@@ -588,7 +588,7 @@ gfx::DescriptorSetLayout *ProgramLib::getDescriptorSetLayout(gfx::Device *device
ccstd::string ProgramLib::getKey(const ccstd::string &name, const MacroRecord &defines) {
auto itTpl = _templates.find(name);
assert(itTpl != _templates.end());
CC_ASSERT(itTpl != _templates.end());
auto &tmpl = itTpl->second;
auto &tmplDefs = tmpl.defines;
if (tmpl.uber) {
@@ -668,11 +668,11 @@ gfx::Shader *ProgramLib::getGFXShader(gfx::Device *device, const ccstd::string &
}
auto itTpl = _templates.find(name);
assert(itTpl != _templates.end());
CC_ASSERT(itTpl != _templates.end());
const auto &tmpl = itTpl->second;
const auto itTplInfo = _templateInfos.find(tmpl.hash);
assert(itTplInfo != _templateInfos.end());
CC_ASSERT(itTplInfo != _templateInfos.end());
auto &tmplInfo = itTplInfo->second;
if (!tmplInfo.pipelineLayout) {