Violet: We can use a union to group the two available layers

This commit is contained in:
Gabriel Correia 2023-10-31 09:10:57 -03:00
parent 58919f1f59
commit b6ea4ff5a7
5 changed files with 9 additions and 6 deletions

View File

@ -9,7 +9,8 @@
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Headers" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp/Vulkan-Headers" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/fmt" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/perfetto" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/range-v3" vcs="Git" />

View File

@ -3,7 +3,7 @@
#include <jni.h>
#include <android/native_window_jni.h>
#include <gpu/violet/graphics_presenter.h>
#include <gpu/violet/layer.h>
namespace zenith::gpu {
class ExhibitionEngine {
public:

View File

@ -6,6 +6,6 @@
namespace zenith::gpu::violet {
class VioletPayload {
public:
std::function<void(jobject)> connectSurface;
std::function<void(jobject)> glvkSetSurface;
};
}

View File

@ -9,7 +9,9 @@ namespace zenith::gpu::violet {
public:
VioletLayer() = default;
VkRender vulkan{};
Gl3Render gl{};
union {
VkRender vulkan{};
Gl3Render gl;
};
};
}

View File

@ -5,7 +5,7 @@
namespace zenith::gpu::violet {
struct VkRender {
std::optional<vk::raii::SurfaceKHR> surface;
std::optional<vk::raii::SurfaceKHR> surface{};
};
}