[Chore] (MG_Backend/DirectVulkan): exclude some validation logic from release build

This commit is contained in:
2026-05-09 13:45:19 +08:00
parent 9fbd83d602
commit c5bf0dc07d
4 changed files with 19 additions and 85 deletions
@@ -1549,7 +1549,9 @@ namespace MobileGL::MG_Backend::DirectVulkan {
auto& moduleSpv = moduleSpirvs[i];
if (moduleSpv.empty()) continue;
#if MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG
ValidateTransformedSpirv(moduleSpv, shaders[i]->GetShaderStage(), program.GetExternalIndex());
#endif
VkShaderModuleCreateInfo smci{VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO};
smci.codeSize = moduleSpv.size() * sizeof(Uint);
@@ -1569,7 +1571,9 @@ namespace MobileGL::MG_Backend::DirectVulkan {
}
// Reflect and create layout as part of the program object
#if MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG
ValidateRasterizationStageInterface(shaders, moduleSpirvs, entry, program.GetExternalIndex());
#endif
ReflectVertexInputs(shaders, moduleSpirvs, entry);
ReflectFragmentOutputs(shaders, moduleSpirvs, entry);
ReflectLayout(program, moduleSpirvs, entry);
@@ -1998,6 +1998,7 @@ void main() {
return VK_NULL_HANDLE;
}
#if MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG
const auto& limits = m_physicalDevice.properties.limits;
if (programObj.fragmentInputComponentCount != 0) {
MOBILEGL_ASSERT(
@@ -2033,6 +2034,7 @@ void main() {
static_cast<Int>(programObj.rasterizationProducerStage));
}
}
#endif
auto vertexInputHash = m_vertexInputStateFactory->ComputeHash(vao);
auto& vis = m_vertexInputStateFactory->GetOrCreateVertexInputState(vao);