diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/ProgramFactory.h b/MobileGL/MG_Backend/DirectVulkan/Renderer/ProgramFactory.h index b4ee96e3..aa138b09 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/ProgramFactory.h +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/ProgramFactory.h @@ -224,6 +224,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { fragmentInputComponentCount = other.fragmentInputComponentCount; fragmentReplacesDepth = other.fragmentReplacesDepth; readsBaseVertexBuiltin = other.readsBaseVertexBuiltin; + writesViewportIndexBuiltin = other.writesViewportIndexBuiltin; needsPassthroughTessControl = other.needsPassthroughTessControl; passthroughTessControlEmulatable = other.passthroughTessControlEmulatable; lastUsedFrame = other.lastUsedFrame; @@ -240,6 +241,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { other.fragmentInputComponentCount = 0; other.fragmentReplacesDepth = false; other.readsBaseVertexBuiltin = false; + other.writesViewportIndexBuiltin = false; other.needsPassthroughTessControl = false; other.passthroughTessControlEmulatable = false; other.lastUsedFrame = 0; @@ -282,6 +284,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { fragmentInputComponentCount = other.fragmentInputComponentCount; fragmentReplacesDepth = other.fragmentReplacesDepth; readsBaseVertexBuiltin = other.readsBaseVertexBuiltin; + writesViewportIndexBuiltin = other.writesViewportIndexBuiltin; needsPassthroughTessControl = other.needsPassthroughTessControl; passthroughTessControlEmulatable = other.passthroughTessControlEmulatable; lastUsedFrame = other.lastUsedFrame; @@ -298,6 +301,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { other.fragmentInputComponentCount = 0; other.fragmentReplacesDepth = false; other.readsBaseVertexBuiltin = false; + other.writesViewportIndexBuiltin = false; other.needsPassthroughTessControl = false; other.passthroughTessControlEmulatable = false; other.lastUsedFrame = 0; diff --git a/MobileGL/MG_Test/Backend/DirectVulkan/SanityTest.cpp b/MobileGL/MG_Test/Backend/DirectVulkan/SanityTest.cpp index 3ab900ca..f72655bc 100644 --- a/MobileGL/MG_Test/Backend/DirectVulkan/SanityTest.cpp +++ b/MobileGL/MG_Test/Backend/DirectVulkan/SanityTest.cpp @@ -8,9 +8,28 @@ #include #include +#include #include -#include +#include + +TEST(DirectVulkanSanity, ProgramMovePreservesViewportIndexUsage) { + using VkProgramObject = MobileGL::MG_Backend::DirectVulkan::ProgramFactory::VkProgramObject; + + VkProgramObject moveConstructedSource; + moveConstructedSource.writesViewportIndexBuiltin = true; + VkProgramObject moveConstructed(std::move(moveConstructedSource)); + EXPECT_TRUE(moveConstructed.writesViewportIndexBuiltin); + EXPECT_FALSE(moveConstructedSource.writesViewportIndexBuiltin); + + VkProgramObject moveAssignedSource; + moveAssignedSource.writesViewportIndexBuiltin = true; + VkProgramObject moveAssigned; + moveAssigned = std::move(moveAssignedSource); + EXPECT_TRUE(moveAssigned.writesViewportIndexBuiltin); + EXPECT_FALSE(moveAssignedSource.writesViewportIndexBuiltin); +} + TEST(DirectVulkanSanity, ExtensionEnumeration) { uint32_t extensionCount = 0; vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);