[Improvement] (MG_Backend/DirectVulkanTMP): Rename current DirectVulkan to DirectVulkanTMP.

This commit is contained in:
BZLZHH
2026-02-20 16:33:26 +08:00
parent 3fe0999550
commit d2485a3fbe
21 changed files with 90 additions and 90 deletions
+8 -8
View File
@@ -209,14 +209,14 @@ set(SOURCE_FILES
MobileGL/MG_Backend/DirectGLES/Utils.cpp MobileGL/MG_Backend/DirectGLES/Utils.cpp
MobileGL/MG_Backend/DirectGLES/Managers.cpp MobileGL/MG_Backend/DirectGLES/Managers.cpp
MobileGL/MG_Backend/DirectVulkan/DirectVulkan.cpp MobileGL/MG_Backend/DirectVulkanTMP/DirectVulkanTMP.cpp
MobileGL/MG_Backend/DirectVulkan/TmpImpl.cpp MobileGL/MG_Backend/DirectVulkanTMP/TmpImpl.cpp
MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp MobileGL/MG_Backend/DirectVulkanTMP/BackendObject_DirectVulkanTMP.cpp
MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanContext.cpp MobileGL/MG_Backend/DirectVulkanTMP/Renderer/VulkanContext.cpp
MobileGL/MG_Backend/DirectVulkan/Renderer/SwapchainManager.cpp MobileGL/MG_Backend/DirectVulkanTMP/Renderer/SwapchainManager.cpp
MobileGL/MG_Backend/DirectVulkan/Renderer/PipelineManager.cpp MobileGL/MG_Backend/DirectVulkanTMP/Renderer/PipelineManager.cpp
MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.cpp MobileGL/MG_Backend/DirectVulkanTMP/Renderer/FrameContext.cpp
MobileGL/MG_Backend/DirectVulkan/Managers/ProgramManager.cpp MobileGL/MG_Backend/DirectVulkanTMP/Managers/ProgramManager.cpp
MobileGL/MG_State/GLState/Core.cpp MobileGL/MG_State/GLState/Core.cpp
MobileGL/MG_State/GLState/ErrorState/Error.cpp MobileGL/MG_State/GLState/ErrorState/Error.cpp
+1 -1
View File
@@ -10,7 +10,7 @@
namespace MobileGL { namespace MobileGL {
namespace MG_Config { namespace MG_Config {
BackendType ActiveBackendType = BackendType::DirectVulkan; BackendType ActiveBackendType = BackendType::DirectVulkanTMP;
} // namespace MG_Config } // namespace MG_Config
namespace MG_Backend { namespace MG_Backend {
+1 -1
View File
@@ -12,7 +12,7 @@
namespace MobileGL { namespace MobileGL {
enum class BackendType { enum class BackendType {
DirectGLES, DirectGLES,
DirectVulkan, DirectVulkanTMP,
BackendTypeCount, BackendTypeCount,
Unknown = -1 Unknown = -1
}; };
+1 -1
View File
@@ -10,7 +10,7 @@
#include <Includes.h> #include <Includes.h>
#include "BackendObject.h" #include "BackendObject.h"
#include "DirectGLES/BackendObject_DirectGLES.h" #include "DirectGLES/BackendObject_DirectGLES.h"
#include "DirectVulkan/BackendObject_DirectVulkan.h" #include "DirectVulkanTMP/BackendObject_DirectVulkanTMP.h"
namespace MobileGL::MG_Backend { namespace MobileGL::MG_Backend {
extern UniquePtr<BackendObject> pActiveBackendObject; extern UniquePtr<BackendObject> pActiveBackendObject;
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/BackendObject_DirectVulkanTMP.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -6,42 +6,42 @@
// SPDX-License-Identifier: LGPL-3.0-only // SPDX-License-Identifier: LGPL-3.0-only
// End of Source File Header // End of Source File Header
#include "BackendObject_DirectVulkan.h" #include "BackendObject_DirectVulkanTMP.h"
#include "MG_Backend/BackendObject.h" #include "MG_Backend/BackendObject.h"
#include "DirectVulkan.h" #include "DirectVulkanTMP.h"
#include "TmpImpl.h" #include "TmpImpl.h"
#include <MG_Util/BackendLoaders/OpenGL/Loader.h> #include <MG_Util/BackendLoaders/OpenGL/Loader.h>
namespace MobileGL::MG_Backend::DirectVulkan { namespace MobileGL::MG_Backend::DirectVulkanTMP {
BackendObject_DirectVulkan::~BackendObject_DirectVulkan() = default; BackendObject_DirectVulkanTMP::~BackendObject_DirectVulkanTMP() = default;
void BackendObject_DirectVulkan::InitWindowSurface() { void BackendObject_DirectVulkanTMP::InitWindowSurface() {
auto nativeWindow = reinterpret_cast<NativeWindowType>(m_windowHandle.Handle); auto nativeWindow = reinterpret_cast<NativeWindowType>(m_windowHandle.Handle);
if (!DirectVulkan::InitWindowSurface(nativeWindow)) { if (!DirectVulkanTMP::InitWindowSurface(nativeWindow)) {
MGLOG_E("Failed to initialize window surface for DirectVulkan backend"); MGLOG_E("Failed to initialize window surface for DirectVulkanTMP backend");
} }
} }
void BackendObject_DirectVulkan::Initialize() { void BackendObject_DirectVulkanTMP::Initialize() {
m_initialized = true; m_initialized = true;
} }
void BackendObject_DirectVulkan::InitCapabilities() { void BackendObject_DirectVulkanTMP::InitCapabilities() {
if (!m_initialized) { if (!m_initialized) {
MGLOG_E("Cannot initialize capabilities before backend is initialized"); MGLOG_E("Cannot initialize capabilities before backend is initialized");
return; return;
} }
MG_Util::BackendLoader::QueryVulkanCapabilities(m_vulkanCaps, MG_Util::BackendLoader::QueryVulkanCapabilities(m_vulkanCaps,
DirectVulkan::GetVulkanState().ctx->GetPhysicalDevice()); DirectVulkanTMP::GetVulkanState().ctx->GetPhysicalDevice());
UpdateDynamicBackendParameters(); UpdateDynamicBackendParameters();
} }
const RendererInfo& BackendObject_DirectVulkan::GetRendererInfo() const { const RendererInfo& BackendObject_DirectVulkanTMP::GetRendererInfo() const {
static RendererInfo RendererInfo = { static RendererInfo RendererInfo = {
.RendererName = "Magma", // Renderer Name .RendererName = "Magma-TMP", // Renderer Name
.BackendName = "Direct (Vulkan)", // Backend Name .BackendName = "Direct (Vulkan) TMP", // Backend Name
.ExtraVendor = Nullopt, // Extra vendor .ExtraVendor = Nullopt, // Extra vendor
.RendererGLInfo = .RendererGLInfo =
{ {
.TargetGLVersion = {3, 3, 0}, // Target OpenGL Version .TargetGLVersion = {3, 3, 0}, // Target OpenGL Version
@@ -55,9 +55,9 @@ namespace MobileGL::MG_Backend::DirectVulkan {
return RendererInfo; return RendererInfo;
} }
String BackendObject_DirectVulkan::GetBackendAPIVersionString() const { String BackendObject_DirectVulkanTMP::GetBackendAPIVersionString() const {
if (!m_initialized) { if (!m_initialized) {
return "<uninitialized DirectVulkan backend>"; return "<uninitialized DirectVulkanTMP backend>";
} }
// Format: // Format:
// <GPU Name>, Vulkan <Vulkan Version>, Driver <Driver Version> // <GPU Name>, Vulkan <Vulkan Version>, Driver <Driver Version>
@@ -67,15 +67,15 @@ namespace MobileGL::MG_Backend::DirectVulkan {
return str; return str;
} }
BackendType BackendObject_DirectVulkan::GetBackendType() const { BackendType BackendObject_DirectVulkanTMP::GetBackendType() const {
return BackendType::DirectVulkan; return BackendType::DirectVulkanTMP;
} }
const GlobalBackendFunctionsTable& BackendObject_DirectVulkan::GetBackendFunctions() const { const GlobalBackendFunctionsTable& BackendObject_DirectVulkanTMP::GetBackendFunctions() const {
static GlobalBackendFunctionsTable funcsTable; static GlobalBackendFunctionsTable funcsTable;
static Bool funcsTableInitialized = false; static Bool funcsTableInitialized = false;
if (!funcsTableInitialized) { if (!funcsTableInitialized) {
funcsTable.Present = DirectVulkan::Present; funcsTable.Present = DirectVulkanTMP::Present;
funcsTable.GL.DrawArrays = DrawArrays; funcsTable.GL.DrawArrays = DrawArrays;
funcsTable.GL.DrawElements = DrawElements; funcsTable.GL.DrawElements = DrawElements;
funcsTable.GL.DrawElementsBaseVertex = DrawElementsBaseVertex; funcsTable.GL.DrawElementsBaseVertex = DrawElementsBaseVertex;
@@ -109,11 +109,11 @@ namespace MobileGL::MG_Backend::DirectVulkan {
return funcsTable; return funcsTable;
} }
const DynamicBackendParameters& BackendObject_DirectVulkan::GetDynamicParameters() const { const DynamicBackendParameters& BackendObject_DirectVulkanTMP::GetDynamicParameters() const {
return m_dynamicParameters; return m_dynamicParameters;
} }
void BackendObject_DirectVulkan::UpdateDynamicBackendParameters() { void BackendObject_DirectVulkanTMP::UpdateDynamicBackendParameters() {
m_dynamicParameters.UniformBufferOffsetAlignment = m_vulkanCaps.UniformBufferOffsetAlignment; m_dynamicParameters.UniformBufferOffsetAlignment = m_vulkanCaps.UniformBufferOffsetAlignment;
} }
} // namespace MobileGL::MG_Backend::DirectVulkan } // namespace MobileGL::MG_Backend::DirectVulkanTMP
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/BackendObject_DirectVulkanTMP.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -11,10 +11,10 @@
#include "../BackendObject.h" #include "../BackendObject.h"
#include <MG_Util/BackendLoaders/Vulkan/Loader.h> #include <MG_Util/BackendLoaders/Vulkan/Loader.h>
namespace MobileGL::MG_Backend::DirectVulkan { namespace MobileGL::MG_Backend::DirectVulkanTMP {
class BackendObject_DirectVulkan : public BackendObject { class BackendObject_DirectVulkanTMP : public BackendObject {
public: public:
~BackendObject_DirectVulkan() override; ~BackendObject_DirectVulkanTMP() override;
void Initialize() override; void Initialize() override;
void InitWindowSurface() override; void InitWindowSurface() override;
@@ -33,4 +33,4 @@ namespace MobileGL::MG_Backend::DirectVulkan {
DynamicBackendParameters m_dynamicParameters; DynamicBackendParameters m_dynamicParameters;
MG_External::VulkanCapabilities m_vulkanCaps; MG_External::VulkanCapabilities m_vulkanCaps;
}; };
} // namespace MobileGL::MG_Backend::DirectVulkan } // namespace MobileGL::MG_Backend::DirectVulkanTMP
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/DirectVulkan.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/DirectVulkanTMP.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -6,16 +6,16 @@
// SPDX-License-Identifier: LGPL-3.0-only // SPDX-License-Identifier: LGPL-3.0-only
// End of Source File Header // End of Source File Header
#include "DirectVulkan.h" #include "DirectVulkanTMP.h"
#include "TmpImpl.h" #include "TmpImpl.h"
namespace MobileGL::MG_Backend::DirectVulkan { namespace MobileGL::MG_Backend::DirectVulkanTMP {
void Clear(GLbitfield mask) { void Clear(GLbitfield mask) {
MobileGL::MG_Backend::DirectVulkan::TmpImpl::Clear(mask); MobileGL::MG_Backend::DirectVulkanTMP::TmpImpl::Clear(mask);
} }
void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices) { void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices) {
MobileGL::MG_Backend::DirectVulkan::TmpImpl::DrawElements(mode, count, type, indices); MobileGL::MG_Backend::DirectVulkanTMP::TmpImpl::DrawElements(mode, count, type, indices);
} }
void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {} void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {}
@@ -71,4 +71,4 @@ namespace MobileGL::MG_Backend::DirectVulkan {
const TmpImpl::VulkanState& GetVulkanState() { const TmpImpl::VulkanState& GetVulkanState() {
return TmpImpl::GetVulkanState(); return TmpImpl::GetVulkanState();
} }
} // namespace MobileGL::MG_Backend::DirectVulkan } // namespace MobileGL::MG_Backend::DirectVulkanTMP
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/DirectVulkan.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/DirectVulkanTMP.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -9,7 +9,7 @@
#pragma once #pragma once
#include <Includes.h> #include <Includes.h>
namespace MobileGL::MG_Backend::DirectVulkan { namespace MobileGL::MG_Backend::DirectVulkanTMP {
namespace TmpImpl { namespace TmpImpl {
class VulkanState; class VulkanState;
} // namespace TmpImpl } // namespace TmpImpl
@@ -55,4 +55,4 @@ namespace MobileGL::MG_Backend::DirectVulkan {
Bool InitWindowSurface(NativeWindowType window); Bool InitWindowSurface(NativeWindowType window);
void Present(); void Present();
const TmpImpl::VulkanState& GetVulkanState(); const TmpImpl::VulkanState& GetVulkanState();
} // namespace MobileGL::MG_Backend::DirectVulkan } // namespace MobileGL::MG_Backend::DirectVulkanTMP
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Managers/ProgramManager.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Managers/ProgramManager.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -21,7 +21,7 @@
#include <bit> #include <bit>
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
namespace { namespace {
using ProgramObject = MG_State::GLState::ProgramObject; using ProgramObject = MG_State::GLState::ProgramObject;
using ShaderObject = MG_State::GLState::ShaderObject; using ShaderObject = MG_State::GLState::ShaderObject;
@@ -444,4 +444,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::VkManager {
return entry.stages; return entry.stages;
} }
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Managers/ProgramManager.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Managers/ProgramManager.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -12,7 +12,7 @@
#include "../Renderer/VkCommon.h" #include "../Renderer/VkCommon.h"
#include "MG_State/GLState/ProgramState/ProgramObject.h" #include "MG_State/GLState/ProgramState/ProgramObject.h"
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
enum class ShaderTransformBit : Uint { enum class ShaderTransformBit : Uint {
None = 0, None = 0,
PositionYFlip = 1 << 0, PositionYFlip = 1 << 0,
@@ -55,4 +55,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::VkManager {
VulkanContext& m_ctx; VulkanContext& m_ctx;
UnorderedMap<const MG_State::GLState::ProgramObject*, ProgramStages> m_cache; UnorderedMap<const MG_State::GLState::ProgramObject*, ProgramStages> m_cache;
}; };
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/FrameContext.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -8,7 +8,7 @@
#include "FrameContext.h" #include "FrameContext.h"
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
void FrameContext::Initialize(VulkanContext& ctx, VkCommandPool pool) { void FrameContext::Initialize(VulkanContext& ctx, VkCommandPool pool) {
CommandPool = pool; CommandPool = pool;
VkCommandBufferAllocateInfo abci{VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO}; VkCommandBufferAllocateInfo abci{VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO};
@@ -46,4 +46,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::VkManager {
} }
CommandPool = VK_NULL_HANDLE; CommandPool = VK_NULL_HANDLE;
} }
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/FrameContext.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -11,7 +11,7 @@
#include "VulkanContext.h" #include "VulkanContext.h"
#include "VkCommon.h" #include "VkCommon.h"
namespace MobileGL::MG_Backend::DirectVulkan { namespace MobileGL::MG_Backend::DirectVulkanTMP {
struct TrashBuffer { struct TrashBuffer {
VkBuffer buffer = VK_NULL_HANDLE; VkBuffer buffer = VK_NULL_HANDLE;
VkDeviceMemory memory = VK_NULL_HANDLE; VkDeviceMemory memory = VK_NULL_HANDLE;
@@ -39,4 +39,4 @@ namespace MobileGL::MG_Backend::DirectVulkan {
void Cleanup(VulkanContext& ctx); void Cleanup(VulkanContext& ctx);
}; };
} // namespace VkManager } // namespace VkManager
} // namespace MobileGL::MG_Backend::DirectVulkan } // namespace MobileGL::MG_Backend::DirectVulkanTMP
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/PipelineManager.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/PipelineManager.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -8,4 +8,4 @@
#include <Includes.h> #include <Includes.h>
namespace MobileGL::MG_Backend::DirectVulkan::VkManager {} namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {}
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/SwapchainManager.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/SwapchainManager.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -8,7 +8,7 @@
#include "SwapchainManager.h" #include "SwapchainManager.h"
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
namespace { namespace {
VkSurfaceFormatKHR ChooseSurfaceFormat(const Vector<VkSurfaceFormatKHR>& formats) { VkSurfaceFormatKHR ChooseSurfaceFormat(const Vector<VkSurfaceFormatKHR>& formats) {
for (const auto& f : formats) { for (const auto& f : formats) {
@@ -163,4 +163,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::VkManager {
m_format = surfaceFormat.format; m_format = surfaceFormat.format;
m_extent = extent; m_extent = extent;
} }
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/SwapchainManager.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/SwapchainManager.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -12,7 +12,7 @@
#include "VulkanContext.h" #include "VulkanContext.h"
#include "VkCommon.h" #include "VkCommon.h"
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
class SwapchainManager { class SwapchainManager {
public: public:
explicit SwapchainManager(VulkanContext& ctx) : m_ctx(ctx) {} explicit SwapchainManager(VulkanContext& ctx) : m_ctx(ctx) {}
@@ -49,4 +49,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::VkManager {
Vector<VkFence> m_imagesInFlight; Vector<VkFence> m_imagesInFlight;
UintVec2 m_viewportSize{0, 0}; UintVec2 m_viewportSize{0, 0};
}; };
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/VkCommon.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/VkCommon.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -9,14 +9,14 @@
#pragma once #pragma once
#include <Includes.h> #include <Includes.h>
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
inline void VkCheck(VkResult result, const char* msg) { inline void VkCheck(VkResult result, const char* msg) {
if (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR) return; if (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR) return;
MGLOG_E("Vulkan error %d at %s", static_cast<Int>(result), msg ? msg : "(unknown)"); MGLOG_E("Vulkan error %d at %s", static_cast<Int>(result), msg ? msg : "(unknown)");
throw RuntimeError(msg ? msg : "Vulkan error"); throw RuntimeError(msg ? msg : "Vulkan error");
} }
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
#ifndef VK_VERIFY #ifndef VK_VERIFY
#define VK_VERIFY(res, msg) ::MobileGL::MG_Backend::DirectVulkan::VkManager::VkCheck((res), (msg)) #define VK_VERIFY(res, msg) ::MobileGL::MG_Backend::DirectVulkanTMP::VkManager::VkCheck((res), (msg))
#endif #endif
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanContext.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/VulkanContext.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -8,7 +8,7 @@
#include "VulkanContext.h" #include "VulkanContext.h"
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
namespace { namespace {
Bool CheckDeviceExtensionSupport(VkPhysicalDevice device, const Vector<const char*>& required) { Bool CheckDeviceExtensionSupport(VkPhysicalDevice device, const Vector<const char*>& required) {
Uint32 count = 0; Uint32 count = 0;
@@ -162,4 +162,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::VkManager {
VK_VERIFY(vkCreateDevice(m_physicalDevice, &dci, nullptr, &m_device), "vkCreateDevice"); VK_VERIFY(vkCreateDevice(m_physicalDevice, &dci, nullptr, &m_device), "vkCreateDevice");
vkGetDeviceQueue(m_device, m_graphicsQueueFamily, 0, &m_graphicsQueue); vkGetDeviceQueue(m_device, m_graphicsQueueFamily, 0, &m_graphicsQueue);
} }
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanContext.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/Renderer/VulkanContext.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -10,7 +10,7 @@
#include <Includes.h> #include <Includes.h>
#include "VkCommon.h" #include "VkCommon.h"
namespace MobileGL::MG_Backend::DirectVulkan::VkManager { namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager {
class VulkanContext { class VulkanContext {
public: public:
VulkanContext() = default; VulkanContext() = default;
@@ -44,4 +44,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::VkManager {
Uint32 m_graphicsQueueFamily = ~0u; Uint32 m_graphicsQueueFamily = ~0u;
ANativeWindow* m_window = nullptr; ANativeWindow* m_window = nullptr;
}; };
} // namespace MobileGL::MG_Backend::DirectVulkan::VkManager } // namespace MobileGL::MG_Backend::DirectVulkanTMP::VkManager
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/TmpImpl.cpp // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/TmpImpl.cpp
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -14,7 +14,7 @@
#include <xxhash.h> #include <xxhash.h>
#define DEBUG_TRACE_POINT() MGLOG_D("DV TmpImpl Trace: %s:%d", __func__, __LINE__) #define DEBUG_TRACE_POINT() MGLOG_D("DV TmpImpl Trace: %s:%d", __func__, __LINE__)
namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl { namespace MobileGL::MG_Backend::DirectVulkanTMP::TmpImpl {
class PendingClearInfo; class PendingClearInfo;
void BeginRenderPass(GLbitfield clearMask, const PendingClearInfo* clearInfo); void BeginRenderPass(GLbitfield clearMask, const PendingClearInfo* clearInfo);
@@ -2861,7 +2861,7 @@ namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl {
if (g.initialized) return; if (g.initialized) return;
g.ctx = MakeUnique<DV::VulkanContext>(); g.ctx = MakeUnique<DV::VulkanContext>();
g.ctx->Initialize(window, "MobileGL-DirectVulkan-Tmp"); g.ctx->Initialize(window, "MobileGL-DirectVulkanTMP-Tmp");
g.swapchain = MakeUnique<DV::SwapchainManager>(*g.ctx); g.swapchain = MakeUnique<DV::SwapchainManager>(*g.ctx);
g.swapchain->Initialize(); g.swapchain->Initialize();
@@ -3544,4 +3544,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl {
} }
clearInfo.mask |= validMask; clearInfo.mask |= validMask;
} }
} // namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl } // namespace MobileGL::MG_Backend::DirectVulkanTMP::TmpImpl
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Backend/DirectVulkan/TmpImpl.h // MobileGL - MobileGL/MG_Backend/DirectVulkanTMP/TmpImpl.h
// Copyright (c) 2025-2026 MobileGL-Dev // Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0: // Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt // https://www.gnu.org/licenses/gpl-3.0.txt
@@ -15,8 +15,8 @@
#include "Managers/ProgramManager.h" #include "Managers/ProgramManager.h"
#include <MG_State/GLState/Core.h> #include <MG_State/GLState/Core.h>
namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl { namespace MobileGL::MG_Backend::DirectVulkanTMP::TmpImpl {
namespace DV = MobileGL::MG_Backend::DirectVulkan::VkManager; namespace DV = MobileGL::MG_Backend::DirectVulkanTMP::VkManager;
using BufferObject = MobileGL::MG_State::GLState::BufferObject; using BufferObject = MobileGL::MG_State::GLState::BufferObject;
using ProgramObject = MobileGL::MG_State::GLState::ProgramObject; using ProgramObject = MobileGL::MG_State::GLState::ProgramObject;
using VertexArrayObject = MobileGL::MG_State::GLState::VertexArrayObject; using VertexArrayObject = MobileGL::MG_State::GLState::VertexArrayObject;
@@ -26,7 +26,7 @@ namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl {
using RenderbufferObject = MobileGL::MG_State::GLState::RenderbufferObject; using RenderbufferObject = MobileGL::MG_State::GLState::RenderbufferObject;
using SamplerObject = MobileGL::MG_State::GLState::SamplerObject; using SamplerObject = MobileGL::MG_State::GLState::SamplerObject;
using TextureObjectMipmap = MobileGL::MG_State::GLState::TextureObjectMipmap; using TextureObjectMipmap = MobileGL::MG_State::GLState::TextureObjectMipmap;
using TrashImage = MobileGL::MG_Backend::DirectVulkan::TrashImage; using TrashImage = MobileGL::MG_Backend::DirectVulkanTMP::TrashImage;
struct BufferResource { struct BufferResource {
VkBuffer buffer = VK_NULL_HANDLE; VkBuffer buffer = VK_NULL_HANDLE;
@@ -267,4 +267,4 @@ namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl {
void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width,
GLsizei height); GLsizei height);
void GenerateMipmap(GLenum target); void GenerateMipmap(GLenum target);
} // namespace MobileGL::MG_Backend::DirectVulkan::TmpImpl } // namespace MobileGL::MG_Backend::DirectVulkanTMP::TmpImpl
+2 -2
View File
@@ -52,8 +52,8 @@ namespace MobileGL::MG_Backend {
case BackendType::DirectGLES: case BackendType::DirectGLES:
pActiveBackendObject = MakeUnique<DirectGLES::BackendObject_DirectGLES>(); pActiveBackendObject = MakeUnique<DirectGLES::BackendObject_DirectGLES>();
break; break;
case BackendType::DirectVulkan: case BackendType::DirectVulkanTMP:
pActiveBackendObject = MakeUnique<DirectVulkan::BackendObject_DirectVulkan>(); pActiveBackendObject = MakeUnique<DirectVulkanTMP::BackendObject_DirectVulkanTMP>();
break; break;
case BackendType::Unknown: case BackendType::Unknown:
default: default: