mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Fix] (MG_Backend/DirectVulkan): wrong early return
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
// End of Source File Header
|
// End of Source File Header
|
||||||
|
|
||||||
#include "VertexInputStateFactory.h"
|
#include "VertexInputStateFactory.h"
|
||||||
|
#include "MG_Util/Converters/MGToStr/DataTypeConverter.h"
|
||||||
|
|
||||||
namespace MobileGL::MG_Backend::DirectVulkan {
|
namespace MobileGL::MG_Backend::DirectVulkan {
|
||||||
VertexInputStateFactory::HashType VertexInputStateFactory::ComputeHash(
|
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);
|
const auto vkFormat = ToVkVertexFormat(attr.Type, attr.Size, attr.Normalized, attr.IsInteger);
|
||||||
if (vkFormat != VK_FORMAT_UNDEFINED) {
|
if (vkFormat == VK_FORMAT_UNDEFINED) {
|
||||||
MGLOG_W("Skipping unsupported vertex attribute layout (location=%u, type=%d, size=%d)",
|
MGLOG_W("Skipping unsupported vertex attribute layout (location=%u, type=%s, size=%d)",
|
||||||
location, static_cast<Int>(attr.Type), attr.Size);
|
location, MG_Util::ConvertDataTypeToString(attr.Type).c_str(), attr.Size);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SizeT componentSize = GetComponentSize(attr.Type);
|
const SizeT componentSize = GetComponentSize(attr.Type);
|
||||||
if (componentSize == 0) {
|
if (componentSize == 0) {
|
||||||
MGLOG_W("Skipping vertex attribute with unknown component size (location=%u, type=%d)",
|
MGLOG_W("Skipping vertex attribute with unknown component size (location=%u, type=%s)",
|
||||||
location, static_cast<Int>(attr.Type));
|
location, MG_Util::ConvertDataTypeToString(attr.Type).c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
|
|
||||||
builder
|
builder
|
||||||
.AddBinding(location, stride, inputRate)
|
.AddBinding(location, stride, inputRate)
|
||||||
.AddAttribute(location, location, vkFormat, 0);
|
.AddAttribute(location, location, vkFormat, static_cast<Uint32>(attr.Offset));
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& state = builder.Build();
|
const auto& state = builder.Build();
|
||||||
|
|||||||
Reference in New Issue
Block a user