From e055b9a644c4ba7de6306404cb50a3c9fc5b889f Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 17 Feb 2026 10:29:28 +0800 Subject: [PATCH] [Fix] (MG_Backend/DirectVulkan): wrong early return --- .../Renderer/VertexInputStateFactory.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VertexInputStateFactory.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VertexInputStateFactory.cpp index 402cdf91..d3affbea 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VertexInputStateFactory.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VertexInputStateFactory.cpp @@ -7,6 +7,7 @@ // End of Source File Header #include "VertexInputStateFactory.h" +#include "MG_Util/Converters/MGToStr/DataTypeConverter.h" namespace MobileGL::MG_Backend::DirectVulkan { VertexInputStateFactory::HashType VertexInputStateFactory::ComputeHash( @@ -52,16 +53,16 @@ namespace MobileGL::MG_Backend::DirectVulkan { } const auto vkFormat = ToVkVertexFormat(attr.Type, attr.Size, attr.Normalized, attr.IsInteger); - if (vkFormat != VK_FORMAT_UNDEFINED) { - MGLOG_W("Skipping unsupported vertex attribute layout (location=%u, type=%d, size=%d)", - location, static_cast(attr.Type), attr.Size); + if (vkFormat == VK_FORMAT_UNDEFINED) { + MGLOG_W("Skipping unsupported vertex attribute layout (location=%u, type=%s, size=%d)", + location, MG_Util::ConvertDataTypeToString(attr.Type).c_str(), attr.Size); continue; } const SizeT componentSize = GetComponentSize(attr.Type); if (componentSize == 0) { - MGLOG_W("Skipping vertex attribute with unknown component size (location=%u, type=%d)", - location, static_cast(attr.Type)); + MGLOG_W("Skipping vertex attribute with unknown component size (location=%u, type=%s)", + location, MG_Util::ConvertDataTypeToString(attr.Type).c_str()); continue; } @@ -73,7 +74,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { builder .AddBinding(location, stride, inputRate) - .AddAttribute(location, location, vkFormat, 0); + .AddAttribute(location, location, vkFormat, static_cast(attr.Offset)); } const auto& state = builder.Build();