UI layer change (#3201)

This commit is contained in:
ChiaNing
2021-01-11 14:02:04 +08:00
committed by GitHub
parent 8674eafd02
commit 2091df8754
@@ -39,20 +39,13 @@ void UIPhase::render(Camera *camera, gfx::RenderPass *renderPass){
auto cmdBuff = pipeline->getCommandBuffers()[0];
auto batches = camera->getScene()->getUIBatches();
const auto vis = camera->visibility & static_cast<uint>(LayerList::UI_2D);
const int batchCount = batches[0];
// Notice: The batches[0] is batchCount
for (int i = 1; i <= batchCount; ++i) {
const auto batch = GET_UI_BATCH(batches[i]);
bool visible = false;
if (vis) {
if (camera->visibility == batch->visFlags) {
visible = true;
}
} else {
if (camera->visibility & batch->visFlags) {
visible = true;
}
if (camera->visibility & batch->visFlags) {
visible = true;
}
if (!visible) continue;