/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #include "Scene/Prefabs/OriginIndicatorDrawable.hpp" #include "VulkanGeometry.hpp" #include "Vulkan/VulkanDrawContext.hpp" using namespace OpenVulkano::Scene; namespace OpenVulkano::Vulkan { void EncodeOriginIndicatorDrawable(Drawable* instance, Vulkan::VulkanDrawContext* drawContext) { for(Node* node : instance->GetNodes()) { if (!node->IsEnabled()) [[unlikely]] continue; drawContext->EncodeNode(node); drawContext->commandBuffer.draw(6, 1, 0, 0); } } } namespace { void* gridDrawableVulkanEncoderReg = DrawEncoder::RegisterVulkanEncodeFunction(&OpenVulkano::Vulkan::EncodeOriginIndicatorDrawable); }