mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Fix, Test] (DirectVulkan): preserve viewport-index program metadata
This commit is contained in:
@@ -224,6 +224,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
fragmentInputComponentCount = other.fragmentInputComponentCount;
|
fragmentInputComponentCount = other.fragmentInputComponentCount;
|
||||||
fragmentReplacesDepth = other.fragmentReplacesDepth;
|
fragmentReplacesDepth = other.fragmentReplacesDepth;
|
||||||
readsBaseVertexBuiltin = other.readsBaseVertexBuiltin;
|
readsBaseVertexBuiltin = other.readsBaseVertexBuiltin;
|
||||||
|
writesViewportIndexBuiltin = other.writesViewportIndexBuiltin;
|
||||||
needsPassthroughTessControl = other.needsPassthroughTessControl;
|
needsPassthroughTessControl = other.needsPassthroughTessControl;
|
||||||
passthroughTessControlEmulatable = other.passthroughTessControlEmulatable;
|
passthroughTessControlEmulatable = other.passthroughTessControlEmulatable;
|
||||||
lastUsedFrame = other.lastUsedFrame;
|
lastUsedFrame = other.lastUsedFrame;
|
||||||
@@ -240,6 +241,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
other.fragmentInputComponentCount = 0;
|
other.fragmentInputComponentCount = 0;
|
||||||
other.fragmentReplacesDepth = false;
|
other.fragmentReplacesDepth = false;
|
||||||
other.readsBaseVertexBuiltin = false;
|
other.readsBaseVertexBuiltin = false;
|
||||||
|
other.writesViewportIndexBuiltin = false;
|
||||||
other.needsPassthroughTessControl = false;
|
other.needsPassthroughTessControl = false;
|
||||||
other.passthroughTessControlEmulatable = false;
|
other.passthroughTessControlEmulatable = false;
|
||||||
other.lastUsedFrame = 0;
|
other.lastUsedFrame = 0;
|
||||||
@@ -282,6 +284,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
fragmentInputComponentCount = other.fragmentInputComponentCount;
|
fragmentInputComponentCount = other.fragmentInputComponentCount;
|
||||||
fragmentReplacesDepth = other.fragmentReplacesDepth;
|
fragmentReplacesDepth = other.fragmentReplacesDepth;
|
||||||
readsBaseVertexBuiltin = other.readsBaseVertexBuiltin;
|
readsBaseVertexBuiltin = other.readsBaseVertexBuiltin;
|
||||||
|
writesViewportIndexBuiltin = other.writesViewportIndexBuiltin;
|
||||||
needsPassthroughTessControl = other.needsPassthroughTessControl;
|
needsPassthroughTessControl = other.needsPassthroughTessControl;
|
||||||
passthroughTessControlEmulatable = other.passthroughTessControlEmulatable;
|
passthroughTessControlEmulatable = other.passthroughTessControlEmulatable;
|
||||||
lastUsedFrame = other.lastUsedFrame;
|
lastUsedFrame = other.lastUsedFrame;
|
||||||
@@ -298,6 +301,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
other.fragmentInputComponentCount = 0;
|
other.fragmentInputComponentCount = 0;
|
||||||
other.fragmentReplacesDepth = false;
|
other.fragmentReplacesDepth = false;
|
||||||
other.readsBaseVertexBuiltin = false;
|
other.readsBaseVertexBuiltin = false;
|
||||||
|
other.writesViewportIndexBuiltin = false;
|
||||||
other.needsPassthroughTessControl = false;
|
other.needsPassthroughTessControl = false;
|
||||||
other.passthroughTessControlEmulatable = false;
|
other.passthroughTessControlEmulatable = false;
|
||||||
other.lastUsedFrame = 0;
|
other.lastUsedFrame = 0;
|
||||||
|
|||||||
@@ -8,9 +8,28 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <vulkan/vulkan.h>
|
#include <MG_Backend/DirectVulkan/Renderer/ProgramFactory.h>
|
||||||
|
|
||||||
|
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) {
|
TEST(DirectVulkanSanity, ExtensionEnumeration) {
|
||||||
uint32_t extensionCount = 0;
|
uint32_t extensionCount = 0;
|
||||||
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);
|
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user