From de12a1d637813b8472ef048ec30fb0c82da8e743 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 4 Jul 2024 12:12:51 +0200 Subject: [PATCH 01/30] Fix issue freeing node resources --- openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp index fdab92a..73028ba 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp @@ -19,6 +19,11 @@ namespace OpenVulkano::Vulkan Scene::Node* node = nullptr; UniformBuffer* buffer = nullptr; + ~VulkanNode() override + { + if (node) VulkanNode::Close(); + } + virtual void Init(Scene::Node* node, UniformBuffer* uniformBuffer) { this->node = node; @@ -30,7 +35,13 @@ namespace OpenVulkano::Vulkan buffer->Record(context); } - void Close() override {} + void Close() override + { + if (node) node->renderNode = nullptr; + delete buffer; + node = nullptr; + buffer = nullptr; + } }; struct VulkanNodeDynamic : VulkanNode @@ -52,7 +63,5 @@ namespace OpenVulkano::Vulkan } buffer->Record(context); } - - void Close() override{} }; } From f39a62813962d2a9402f1dd60ee7d566af8c9bb5 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 4 Jul 2024 12:13:31 +0200 Subject: [PATCH 02/30] Position camera initially outside of cubs area --- examples/ExampleApps/CubesExampleApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ExampleApps/CubesExampleApp.cpp b/examples/ExampleApps/CubesExampleApp.cpp index 0952192..8e24702 100644 --- a/examples/ExampleApps/CubesExampleApp.cpp +++ b/examples/ExampleApps/CubesExampleApp.cpp @@ -57,7 +57,6 @@ namespace OpenVulkano scene.Init(); cam.Init(70, 16, 9, 0.1f, 100); scene.SetCamera(&cam); - cam.SetMatrix(Math::Utils::translate(Matrix4f(1), Vector3f_SIMD(0, 0, -10))); shader.AddShaderProgram(OpenVulkano::ShaderProgramType::VERTEX, "Shader/basic"); shader.AddShaderProgram(OpenVulkano::ShaderProgramType::FRAGMENT, "Shader/basic"); shader.AddVertexInputDescription(OpenVulkano::Vertex::GetVertexInputDescription()); @@ -82,6 +81,7 @@ namespace OpenVulkano camController.Init(&cam); camController.SetDefaultKeybindings(); + camController.SetPosition({0, 0, 10}); std::shared_ptr m_perfInfo = std::make_shared(); m_ui.AddElement(m_perfInfo); From ebd1d85f398c2885cb19d9c82b9138c5a657cd84 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 4 Jul 2024 12:34:22 +0200 Subject: [PATCH 03/30] Add textured cube example app --- .../ExampleApps/TexturedCubeExampleApp.cpp | 98 +++++++++++++++++++ .../ExampleApps/TexturedCubeExampleApp.hpp | 27 +++++ examples/main.cpp | 3 + 3 files changed, 128 insertions(+) create mode 100644 examples/ExampleApps/TexturedCubeExampleApp.cpp create mode 100644 examples/ExampleApps/TexturedCubeExampleApp.hpp diff --git a/examples/ExampleApps/TexturedCubeExampleApp.cpp b/examples/ExampleApps/TexturedCubeExampleApp.cpp new file mode 100644 index 0000000..f63e958 --- /dev/null +++ b/examples/ExampleApps/TexturedCubeExampleApp.cpp @@ -0,0 +1,98 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "TexturedCubeExampleApp.hpp" +#include "Scene/Scene.hpp" +#include "Scene/Shader/Shader.hpp" +#include "Scene/Geometry.hpp" +#include "Scene/GeometryFactory.hpp" +#include "Scene/Material.hpp" +#include "Scene/Vertex.hpp" +#include "Scene/SimpleDrawable.hpp" +#include "Scene/UI/PerformanceInfo.hpp" +#include "Input/InputManager.hpp" +#include "Host/GraphicsAppManager.hpp" +#include "Math/Math.hpp" +#include "Base/EngineConfiguration.hpp" +#include "Controller/FreeCamCameraController.hpp" +#include "Base/FrameMetadata.hpp" + +namespace OpenVulkano +{ + using namespace Scene; + using namespace Input; + using namespace Math; + + class TexturedCubeExampleAppImpl final : public TexturedCubeExampleApp + { + OpenVulkano::Scene::Scene scene; + PerspectiveCamera cam; + OpenVulkano::FreeCamCameraController camController; + Material mat; + Shader shader; + SimpleDrawable drawable; + Node node; + Vector3f_SIMD position = {0, 0, -10}; + + OpenVulkano::Scene::UI::SimpleUi m_ui; + std::shared_ptr m_perfInfo; + + public: + void Init() override + { + std::srand(1); // Fix seed for random numbers + scene.Init(); + cam.Init(70, 16, 9, 0.1f, 100); + scene.SetCamera(&cam); + shader.AddShaderProgram(OpenVulkano::ShaderProgramType::VERTEX, "Shader/basic"); + shader.AddShaderProgram(OpenVulkano::ShaderProgramType::FRAGMENT, "Shader/basic"); + shader.AddVertexInputDescription(OpenVulkano::Vertex::GetVertexInputDescription()); + Geometry* geo = GeometryFactory::MakeCube(1, 1, 1, Vector4f((std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, 1)); + drawable.Init(&shader, geo, &mat); + node.Init(); + scene.GetRoot()->AddChild(&node); + node.SetUpdateFrequency(UpdateFrequency::Always); + node.AddDrawable(&drawable); + + GetGraphicsAppManager()->GetRenderer()->SetScene(&scene); + + camController.Init(&cam); + camController.SetDefaultKeybindings(); + camController.SetPosition({0, 0, 2}); + + std::shared_ptr m_perfInfo = std::make_shared(); + m_ui.AddElement(m_perfInfo); + GetGraphicsAppManager()->GetRenderer()->SetActiveUi(&m_ui); + } + + float t = 0; + void Tick() override + { + t += CURRENT_FRAME.frameTime * 0.25; + + Math::Matrix4f rotation = Math::Utils::rotate(t, Math::Vector3f_SIMD{1.0f, 0.0f, 0.0f}); + rotation *= Math::Utils::rotate(t, Math::Vector3f_SIMD{0.0f, 1.0f, 0.0f}); + rotation *= Math::Utils::rotate(t, Math::Vector3f_SIMD{0.0f, 0.0f, 1.0f}); + node.SetMatrix(rotation); + + camController.Tick(); + } + + void Close() override + {} + }; + + IGraphicsApp* TexturedCubeExampleApp::Create() + { + return new TexturedCubeExampleAppImpl(); + } + + std::unique_ptr TexturedCubeExampleApp::CreateUnique() + { + return std::make_unique(); + } + +} \ No newline at end of file diff --git a/examples/ExampleApps/TexturedCubeExampleApp.hpp b/examples/ExampleApps/TexturedCubeExampleApp.hpp new file mode 100644 index 0000000..3e7ad4d --- /dev/null +++ b/examples/ExampleApps/TexturedCubeExampleApp.hpp @@ -0,0 +1,27 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "Base/IGraphicsApp.hpp" +#include + +namespace OpenVulkano +{ + class TexturedCubeExampleApp : public IGraphicsApp + { + public: + static IGraphicsApp* Create(); + + static std::unique_ptr CreateUnique(); + + [[nodiscard]] std::string GetAppName() const final + { return "Textured Cube ExampleApp"; } + + [[nodiscard]] OpenVulkano::Version GetAppVersion() const final + { return {"v1.0"}; } + }; +} \ No newline at end of file diff --git a/examples/main.cpp b/examples/main.cpp index e81daae..18a8431 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -7,6 +7,7 @@ #include "Host/GraphicsAppManager.hpp" #include "ExampleApps/CubesExampleApp.hpp" #include "ExampleApps/MovingCubeApp.hpp" +#include "ExampleApps/TexturedCubeExampleApp.hpp" #include #include @@ -23,6 +24,7 @@ int main(int argc, char** argv) std::vector examples = { "Cubes Example App", "Moving Cube Example App", + "Textured Cube Example App", }; int selectedExample = 0; @@ -38,6 +40,7 @@ int main(int argc, char** argv) { case 0: app = CubesExampleApp::CreateUnique(); break; case 1: app = MovingCubeApp::CreateUnique(); break; + case 2: app = TexturedCubeExampleApp::CreateUnique(); break; default: throw std::runtime_error("Invalid menu selection!"); break; } From 471786d18e48f666542f45d287599ae08ed9f146 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 4 Jul 2024 15:12:06 +0200 Subject: [PATCH 04/30] Reduce log priority of some mouse related events --- openVulkanoCpp/Host/GLFW/WindowGLFW.cpp | 2 +- openVulkanoCpp/Input/InputDeviceMouse.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp b/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp index 5ed3a99..03f15e1 100644 --- a/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp +++ b/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp @@ -370,7 +370,7 @@ namespace OpenVulkano::GLFW { const auto windowInstance = GetWindow(window); windowInstance->inputProvider.MouseEnterExitWindow(windowInstance); - Logger::INPUT->info("Mouse enter/exit: {}", entered); + Logger::INPUT->trace("Mouse enter/exit: {}", entered); } void WindowGLFW::ResizeCallback(GLFWwindow* window, int width, int height) diff --git a/openVulkanoCpp/Input/InputDeviceMouse.cpp b/openVulkanoCpp/Input/InputDeviceMouse.cpp index 00e47fe..626e905 100644 --- a/openVulkanoCpp/Input/InputDeviceMouse.cpp +++ b/openVulkanoCpp/Input/InputDeviceMouse.cpp @@ -35,7 +35,7 @@ namespace OpenVulkano::Input axes[InputKey::Mouse::AXIS_Y] = static_cast(posY - mousePosY); mousePosX = posX; mousePosY = posY; - Logger::INPUT->debug("Mouse moved posX: {0} posY: {1}, relativeX: {2}, relativeY: {3}", posX, posY, axes[InputKey::Mouse::AXIS_X], axes[InputKey::Mouse::AXIS_Y]); + Logger::INPUT->trace("Mouse moved posX: {0} posY: {1}, relativeX: {2}, relativeY: {3}", posX, posY, axes[InputKey::Mouse::AXIS_X], axes[InputKey::Mouse::AXIS_Y]); } void InputDeviceMouse::UpdateWheel(float wheelX, float wheelY) From 6cb776587a31d1969a6e2d6edb574a767f67deac Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 4 Jul 2024 16:57:30 +0200 Subject: [PATCH 05/30] Add shader for texture handling --- openVulkanoCpp/Shader/Shaders.c | 414 ++++++++++++++---------- openVulkanoCpp/Shader/Shaders.h | 6 +- openVulkanoCpp/Shader/basic.vert | 8 +- openVulkanoCpp/Shader/basicTexture.frag | 11 + 4 files changed, 256 insertions(+), 183 deletions(-) create mode 100644 openVulkanoCpp/Shader/basicTexture.frag diff --git a/openVulkanoCpp/Shader/Shaders.c b/openVulkanoCpp/Shader/Shaders.c index bbe230c..10c4071 100644 --- a/openVulkanoCpp/Shader/Shaders.c +++ b/openVulkanoCpp/Shader/Shaders.c @@ -296,189 +296,244 @@ const unsigned char basic_frag_spv[376] = { 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; -/* Contents of file basic.vert.spv */ -const long int basic_vert_spv_size = 2840; -const unsigned char basic_vert_spv[2840] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x5E, 0x00, 0x00, 0x00, +/* Contents of file basicTexture.frag.spv */ +const long int basicTexture_frag_spv_size = 632; +const unsigned char basicTexture_frag_spv[632] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0F, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, - 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, - 0x3C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, - 0x5D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, - 0x04, 0x00, 0x09, 0x00, 0x47, 0x4C, 0x5F, 0x41, 0x52, 0x42, 0x5F, 0x73, 0x65, 0x70, 0x61, 0x72, - 0x61, 0x74, 0x65, 0x5F, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5F, 0x6F, 0x62, 0x6A, 0x65, 0x63, - 0x74, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x6C, 0x69, 0x67, 0x68, - 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x77, 0x6F, 0x72, 0x6C, - 0x64, 0x50, 0x6F, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x4E, 0x6F, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x6E, 0x6F, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x70, 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x77, 0x6F, 0x72, 0x6C, - 0x64, 0x4E, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x00, 0x05, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x6E, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x33, 0x00, 0x00, 0x00, - 0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x6E, 0x65, 0x73, 0x73, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x3A, 0x00, 0x00, 0x00, 0x6F, 0x75, 0x74, 0x43, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x06, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x65, 0x72, 0x56, 0x65, - 0x72, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x4F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, - 0x06, 0x00, 0x07, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, - 0x6F, 0x69, 0x6E, 0x74, 0x53, 0x69, 0x7A, 0x65, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, - 0x4F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x6C, 0x69, 0x70, 0x44, - 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x06, 0x00, 0x07, 0x00, 0x4F, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x75, 0x6C, 0x6C, 0x44, 0x69, 0x73, 0x74, 0x61, - 0x6E, 0x63, 0x65, 0x00, 0x05, 0x00, 0x03, 0x00, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x43, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x44, 0x61, - 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, - 0x05, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, 0x05, 0x00, 0x04, 0x00, - 0x5B, 0x00, 0x00, 0x00, 0x74, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x62, 0x69, 0x54, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x07, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, - 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, 0x65, 0x73, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4F, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x4F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x03, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x3A, 0xCD, 0x13, 0x3F, - 0x2C, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, - 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x3F, 0x18, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x40, 0x15, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x4D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x06, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x50, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x50, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x03, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, - 0x54, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, - 0x5B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, - 0x5D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, - 0x16, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, - 0x19, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, - 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x50, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00, - 0x0C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0x15, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, - 0x51, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, - 0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, - 0x23, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x28, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x29, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, - 0x24, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, - 0x2A, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x24, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x54, 0x00, 0x04, 0x00, - 0x24, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x45, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00, - 0x31, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, - 0x21, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x94, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, - 0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, - 0x37, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x33, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, - 0x4F, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, - 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x44, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, - 0x34, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, - 0x1B, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x08, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, - 0x44, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x4B, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, - 0x1B, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, - 0x55, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, - 0x0E, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, - 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x59, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, + 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x6F, 0x75, 0x74, 0x43, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x72, 0x00, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x43, 0x6F, 0x6F, 0x72, 0x64, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x63, 0x6F, 0x6C, 0x6F, + 0x72, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x0A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; +/* Contents of file basic.vert.spv */ +const long int basic_vert_spv_size = 2996; +const unsigned char basic_vert_spv[2996] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x63, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, + 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, + 0xC2, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, 0x47, 0x4C, 0x5F, 0x41, 0x52, 0x42, 0x5F, 0x73, + 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5F, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5F, 0x6F, + 0x62, 0x6A, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x6C, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x00, 0x00, + 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x50, 0x6F, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x4E, 0x6F, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x6F, 0x72, 0x6C, + 0x64, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x6E, 0x6F, 0x64, 0x65, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x70, 0x6F, 0x73, 0x69, + 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x4E, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x00, 0x05, 0x00, 0x04, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x6E, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x33, 0x00, 0x00, 0x00, 0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x6E, 0x65, 0x73, 0x73, 0x00, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x6F, 0x75, 0x74, 0x43, 0x6F, 0x6C, 0x6F, 0x72, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x63, 0x6F, 0x6C, 0x6F, + 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, + 0x65, 0x72, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, + 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x6F, 0x73, 0x69, 0x74, + 0x69, 0x6F, 0x6E, 0x00, 0x06, 0x00, 0x07, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x67, 0x6C, 0x5F, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x53, 0x69, 0x7A, 0x65, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x07, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, + 0x6C, 0x69, 0x70, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x06, 0x00, 0x07, 0x00, + 0x4F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x75, 0x6C, 0x6C, 0x44, + 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x05, 0x00, 0x03, 0x00, 0x51, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x43, 0x61, 0x6D, 0x65, + 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, + 0x6F, 0x6E, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, + 0x05, 0x00, 0x08, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67, 0x54, 0x65, 0x78, 0x74, + 0x75, 0x72, 0x65, 0x43, 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, 0x65, 0x73, 0x00, 0x00, + 0x05, 0x00, 0x07, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, + 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, 0x65, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x74, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x62, 0x00, 0x00, 0x00, 0x62, 0x69, 0x54, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4F, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x4F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x3A, 0xCD, 0x13, 0x3F, 0x2C, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x03, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x18, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, + 0x3A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x15, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x4D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x4E, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x06, 0x00, 0x4F, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x53, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x53, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, + 0x5B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x5C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x5C, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, + 0x33, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, + 0x91, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x26, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x27, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x4F, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, + 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x06, 0x00, 0x24, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x2C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, + 0x54, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x91, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, + 0x2F, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x21, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x35, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x36, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x94, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x37, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x07, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x33, 0x00, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x33, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x43, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x05, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x46, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x4A, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, + 0x4A, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x3A, 0x00, 0x00, 0x00, + 0x4B, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x54, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x57, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, + 0x58, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x5A, 0x00, 0x00, 0x00, + 0x59, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x5E, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x5F, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, + 0x38, 0x00, 0x01, 0x00 +}; + /* Contents of file grid.frag.spv */ const long int grid_frag_spv_size = 6472; const unsigned char grid_frag_spv[6472] = { @@ -1107,8 +1162,9 @@ const TFileTableEntry fileTable[] = { {"background.frag.spv", background_frag_spv, 1076}, {"background.vert.spv", background_vert_spv, 2980}, {"basic.frag.spv", basic_frag_spv, 376}, - {"basic.vert.spv", basic_vert_spv, 2840}, + {"basicTexture.frag.spv", basicTexture_frag_spv, 632}, + {"basic.vert.spv", basic_vert_spv, 2996}, {"grid.frag.spv", grid_frag_spv, 6472}, {"grid.vert.spv", grid_vert_spv, 3340} }; -const unsigned int fileTableSize = 6; +const unsigned int fileTableSize = 7; diff --git a/openVulkanoCpp/Shader/Shaders.h b/openVulkanoCpp/Shader/Shaders.h index 408fde3..39bca66 100644 --- a/openVulkanoCpp/Shader/Shaders.h +++ b/openVulkanoCpp/Shader/Shaders.h @@ -14,9 +14,13 @@ extern const unsigned char background_vert_spv[2980]; extern const long int basic_frag_spv_size; extern const unsigned char basic_frag_spv[376]; +/* Contents of file basicTexture.frag.spv */ +extern const long int basicTexture_frag_spv_size; +extern const unsigned char basicTexture_frag_spv[632]; + /* Contents of file basic.vert.spv */ extern const long int basic_vert_spv_size; -extern const unsigned char basic_vert_spv[2840]; +extern const unsigned char basic_vert_spv[2996]; /* Contents of file grid.frag.spv */ extern const long int grid_frag_spv_size; diff --git a/openVulkanoCpp/Shader/basic.vert b/openVulkanoCpp/Shader/basic.vert index 6a55b9f..239eaff 100644 --- a/openVulkanoCpp/Shader/basic.vert +++ b/openVulkanoCpp/Shader/basic.vert @@ -8,6 +8,7 @@ layout(location = 3) in vec3 biTangent; layout(location = 4) in vec3 textureCoordinates; layout(location = 5) in vec4 color; layout(location = 0) out vec4 outColor; +layout(location = 1) out vec2 fragTextureCoordinates; layout(set = 0, binding = 0) uniform NodeData { @@ -22,8 +23,9 @@ void main() { vec3 light = normalize(vec3(1)); vec4 worldPos = node.world * vec4(position, 1.0); - vec3 worldNormal = normalize(transpose(inverse(mat3(node.world))) * normal); - float brightness = max(0.0, dot(worldNormal, light)); - outColor = vec4(clamp(color.rgb * (0.5 + brightness / 2), 0, 1), 1); + vec3 worldNormal = normalize(transpose(inverse(mat3(node.world))) * normal); + float brightness = max(0.0, dot(worldNormal, light)); + outColor = vec4(clamp(color.rgb * (0.5 + brightness / 2), 0, 1), 1); gl_Position = normalize(cam.viewProjection * worldPos); + fragTextureCoordinates = textureCoordinates.xy; } \ No newline at end of file diff --git a/openVulkanoCpp/Shader/basicTexture.frag b/openVulkanoCpp/Shader/basicTexture.frag new file mode 100644 index 0000000..6c4aac1 --- /dev/null +++ b/openVulkanoCpp/Shader/basicTexture.frag @@ -0,0 +1,11 @@ +#version 450 + +layout(location = 0) in vec4 color; +layout(location = 1) in vec2 texCoord; +layout(location = 0) out vec4 outColor; +layout(set = 2, binding = 0) uniform sampler2D texSampler; + +void main() +{ + outColor = texture(texSampler, texCoord); +} \ No newline at end of file From d79f74c21d9948d9224ba4f65c06fd24b33873b5 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 4 Jul 2024 16:59:39 +0200 Subject: [PATCH 06/30] Remove unused variable --- examples/ExampleApps/MovingCubeApp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/ExampleApps/MovingCubeApp.cpp b/examples/ExampleApps/MovingCubeApp.cpp index 2d79ef2..5adcc8b 100644 --- a/examples/ExampleApps/MovingCubeApp.cpp +++ b/examples/ExampleApps/MovingCubeApp.cpp @@ -123,7 +123,6 @@ namespace OpenVulkano void Init() override { - auto engineConfig = EngineConfiguration::GetEngineConfiguration(); m_camera.Init(70, 16, 9, 0.1, 100); m_scene.Init(); From 3e736725382272f9001d98218255127a85179695 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 4 Jul 2024 17:00:46 +0200 Subject: [PATCH 07/30] Texture implementation basics --- .../ExampleApps/TexturedCubeExampleApp.cpp | 12 ++++---- openVulkanoCpp/Scene/Shader/Shader.hpp | 2 +- openVulkanoCpp/Scene/Textrue.cpp | 30 +++++++++++++++++++ openVulkanoCpp/Scene/Texture.hpp | 20 ++++++++++--- openVulkanoCpp/Scene/UpdateFrequency.hpp | 2 ++ openVulkanoCpp/Vulkan/Image.cpp | 25 ++++++---------- .../Vulkan/Resources/ResourceManager.cpp | 20 +++++++++++-- .../Vulkan/Resources/ResourceManager.hpp | 1 + openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp | 29 +++++++++++++----- 9 files changed, 104 insertions(+), 37 deletions(-) create mode 100644 openVulkanoCpp/Scene/Textrue.cpp diff --git a/examples/ExampleApps/TexturedCubeExampleApp.cpp b/examples/ExampleApps/TexturedCubeExampleApp.cpp index f63e958..39c6906 100644 --- a/examples/ExampleApps/TexturedCubeExampleApp.cpp +++ b/examples/ExampleApps/TexturedCubeExampleApp.cpp @@ -35,7 +35,6 @@ namespace OpenVulkano Shader shader; SimpleDrawable drawable; Node node; - Vector3f_SIMD position = {0, 0, -10}; OpenVulkano::Scene::UI::SimpleUi m_ui; std::shared_ptr m_perfInfo; @@ -43,14 +42,15 @@ namespace OpenVulkano public: void Init() override { - std::srand(1); // Fix seed for random numbers scene.Init(); cam.Init(70, 16, 9, 0.1f, 100); scene.SetCamera(&cam); shader.AddShaderProgram(OpenVulkano::ShaderProgramType::VERTEX, "Shader/basic"); - shader.AddShaderProgram(OpenVulkano::ShaderProgramType::FRAGMENT, "Shader/basic"); + shader.AddShaderProgram(OpenVulkano::ShaderProgramType::FRAGMENT, "Shader/basicTexture"); shader.AddVertexInputDescription(OpenVulkano::Vertex::GetVertexInputDescription()); - Geometry* geo = GeometryFactory::MakeCube(1, 1, 1, Vector4f((std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, 1)); + shader.AddDescriptorSetLayoutBinding(Texture::DESCRIPTOR_SET_LAYOUT_BINDING); + Geometry* geo = GeometryFactory::MakeCube(); + mat.texture = &Texture::PLACEHOLDER; drawable.Init(&shader, geo, &mat); node.Init(); scene.GetRoot()->AddChild(&node); @@ -60,10 +60,10 @@ namespace OpenVulkano GetGraphicsAppManager()->GetRenderer()->SetScene(&scene); camController.Init(&cam); - camController.SetDefaultKeybindings(); + //camController.SetDefaultKeybindings(); camController.SetPosition({0, 0, 2}); - std::shared_ptr m_perfInfo = std::make_shared(); + m_perfInfo = std::make_shared(); m_ui.AddElement(m_perfInfo); GetGraphicsAppManager()->GetRenderer()->SetActiveUi(&m_ui); } diff --git a/openVulkanoCpp/Scene/Shader/Shader.hpp b/openVulkanoCpp/Scene/Shader/Shader.hpp index 00f4d26..b7632c2 100644 --- a/openVulkanoCpp/Scene/Shader/Shader.hpp +++ b/openVulkanoCpp/Scene/Shader/Shader.hpp @@ -127,7 +127,7 @@ namespace OpenVulkano::Scene { CheckShaderInitState(); if (setId < 0) setId = static_cast(descriptorSets.size() + 2); - if (setId < 2) throw std::runtime_error("Cant bind set id 0 or 1!"); + if (setId < 2) throw std::runtime_error("Cant bind set id 0 or 1! They are used for node and camera!"); setId -= 2; while (setId >= static_cast(descriptorSets.size())) { diff --git a/openVulkanoCpp/Scene/Textrue.cpp b/openVulkanoCpp/Scene/Textrue.cpp new file mode 100644 index 0000000..afa5dcd --- /dev/null +++ b/openVulkanoCpp/Scene/Textrue.cpp @@ -0,0 +1,30 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "Texture.hpp" + +namespace OpenVulkano::Scene +{ + Texture Texture::PLACEHOLDER = Texture(true); + + void Texture::MakePlaceholder(uint32_t width, uint32_t height, Math::Vector4uc color1, Math::Vector4uc color2) + { + if (textureBuffer) throw std::runtime_error("Texture data already initialized"); + Math::Vector4uc* imageMemory = new Math::Vector4uc[width * height](); + for (uint32_t row = 0; row < height; row++) + { + for (uint32_t col = 0; col < width; col++) + { + imageMemory[row * width + col] = (((row & 0x10) == 0) ^ ((col & 0x10) == 0 )) ? color2 : color1; + } + } + textureBuffer = imageMemory; + resolution = {width, height, 1}; + size = sizeof(Math::Vector4uc) * width * height; + format = DataFormat::B8G8R8A8_UNORM; + + } +} \ No newline at end of file diff --git a/openVulkanoCpp/Scene/Texture.hpp b/openVulkanoCpp/Scene/Texture.hpp index 7833b33..205f26c 100644 --- a/openVulkanoCpp/Scene/Texture.hpp +++ b/openVulkanoCpp/Scene/Texture.hpp @@ -9,18 +9,30 @@ #include "UpdateFrequency.hpp" #include "Base/ICloseable.hpp" #include "Math/Math.hpp" +#include "DataFormat.hpp" +#include "Scene/Shader/DescriptorInputDescription.hpp" namespace OpenVulkano::Scene { class Texture { public: + static Texture PLACEHOLDER; + static constexpr inline DescriptorSetLayoutBinding DESCRIPTOR_SET_LAYOUT_BINDING = { 0, DescriptorSetLayoutBinding::Type::TYPE_COMBINED_IMAGE_SAMPLER, 1, ShaderProgramType::ALL_GRAPHICS }; + + Texture(bool placeholder = false) { if (placeholder) MakePlaceholder(); } + ICloseable* renderTexture = nullptr; - void* textureBuffer; - Math::Vector3ui resolution; - size_t size; + void* textureBuffer = nullptr; + Math::Vector3ui resolution = {0,0,0}; + size_t size = 0; + DataFormat format = DataFormat::B8G8R8A8_UNORM; bool updated = true; UpdateFrequency updateFrequency = UpdateFrequency::Never; - ICloseable* vulkanTexture = nullptr; + + + + void MakePlaceholder(uint32_t width = 128, uint32_t height = 128, + Math::Vector4uc color1 = {255, 135, 255, 255}, Math::Vector4uc color2 = {255, 225, 255, 255}); }; } \ No newline at end of file diff --git a/openVulkanoCpp/Scene/UpdateFrequency.hpp b/openVulkanoCpp/Scene/UpdateFrequency.hpp index 71a91ea..a7bfeda 100644 --- a/openVulkanoCpp/Scene/UpdateFrequency.hpp +++ b/openVulkanoCpp/Scene/UpdateFrequency.hpp @@ -6,6 +6,8 @@ #pragma once +#include + namespace OpenVulkano::Scene { enum class UpdateFrequency : uint8_t diff --git a/openVulkanoCpp/Vulkan/Image.cpp b/openVulkanoCpp/Vulkan/Image.cpp index 29ab8b9..e1616c2 100644 --- a/openVulkanoCpp/Vulkan/Image.cpp +++ b/openVulkanoCpp/Vulkan/Image.cpp @@ -16,6 +16,7 @@ namespace OpenVulkano::Vulkan format = imageCreateInfo.format; extent = imageCreateInfo.extent; + // TODO allocate from resource manager const vk::MemoryRequirements memRequirements = device->device.getImageMemoryRequirements(image); size = allocSize = memRequirements.size; const vk::MemoryAllocateInfo memAllocInfo = { allocSize, device->GetMemoryType(memRequirements.memoryTypeBits, memoryPropertyFlags) }; @@ -38,27 +39,19 @@ namespace OpenVulkano::Vulkan { this->device = device->device; - vk::ImageCreateInfo imgCreateInfo; - imgCreateInfo.imageType = vk::ImageType::e2D; - imgCreateInfo.extent = resolution; - imgCreateInfo.mipLevels = 1; - imgCreateInfo.arrayLayers = 1; - imgCreateInfo.format = vk::Format::eR8G8B8Srgb; - imgCreateInfo.tiling = vk::ImageTiling::eOptimal; - imgCreateInfo.initialLayout = vk::ImageLayout::eUndefined; - imgCreateInfo.usage = vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled; - imgCreateInfo.sharingMode = vk::SharingMode::eExclusive; - imgCreateInfo.samples = vk::SampleCountFlagBits::e1; + vk::ImageCreateInfo imgCreateInfo { {}, vk::ImageType::e2D, vk::Format::eB8G8R8A8Unorm, resolution, 1, 1 }; - vk::ImageViewCreateInfo imgViewCreateInfo; - imgViewCreateInfo.image = image; - imgViewCreateInfo.format = imgCreateInfo.format; - imgViewCreateInfo.viewType = vk::ImageViewType::e2D; + imgCreateInfo.usage = vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled; + imgCreateInfo.tiling = vk::ImageTiling::eOptimal; + imgCreateInfo.sharingMode = vk::SharingMode::eExclusive; + imgCreateInfo.initialLayout = vk::ImageLayout::eUndefined; + + vk::ImageViewCreateInfo imgViewCreateInfo { {}, image, vk::ImageViewType::e2D, imgCreateInfo.format }; imgViewCreateInfo.subresourceRange.aspectMask = vk::ImageAspectFlagBits::eColor; imgViewCreateInfo.subresourceRange.baseMipLevel = 0; imgViewCreateInfo.subresourceRange.levelCount = 1; imgViewCreateInfo.subresourceRange.baseArrayLayer = 0; - imgViewCreateInfo.subresourceRange.levelCount = 1; + imgViewCreateInfo.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; Init(device, imgCreateInfo, imgViewCreateInfo); CreateSampler(); diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp index 2e54ebc..9870af3 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp @@ -148,7 +148,7 @@ namespace OpenVulkano::Vulkan const std::unique_lock lock(mutex); if (material->texture && !material->texture->renderTexture) { - material->texture->renderTexture = PrepareTexture(material->texture); + PrepareTexture(material->texture); } } @@ -291,6 +291,21 @@ namespace OpenVulkano::Vulkan vk::BufferImageCopy region(0, 0, 0, { vk::ImageAspectFlagBits::eColor, 0, 0, 1 }, { 0, 0, 0 }, image->extent); cmdBuffers[currentBuffer].copyBufferToImage(uploadBuffer->buffer, image->image, vk::ImageLayout::eTransferDstOptimal, 1, ®ion); + vk::ImageMemoryBarrier barrier {}; + barrier.oldLayout = vk::ImageLayout::eUndefined; + barrier.newLayout = vk::ImageLayout::eShaderReadOnlyOptimal; + barrier.image = image->image; + barrier.subresourceRange.aspectMask = vk::ImageAspectFlagBits::eColor; + barrier.subresourceRange.baseMipLevel = 0; + barrier.subresourceRange.levelCount = 1; + barrier.subresourceRange.baseArrayLayer = 0; + barrier.subresourceRange.layerCount = 1; + barrier.setSrcAccessMask({}); + barrier.setDstAccessMask(vk::AccessFlagBits::eTransferWrite); + + // TODO set access masks for mip and array layers + cmdBuffers[currentBuffer].pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer, {}, 0, nullptr, 0, nullptr, 1, &barrier ); + FreeBuffer(uploadBuffer); } @@ -365,8 +380,7 @@ namespace OpenVulkano::Vulkan { VulkanTexture* vkTexture = new VulkanTexture(); - vkTexture->Init(this, texture); - //vkTexture-> + vkTexture->Init(this, texture, GetDescriptorLayoutSet(Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING), Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING, 2); return vkTexture; } diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp index 7c73dcf..1b7ce9d 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp @@ -40,6 +40,7 @@ namespace OpenVulkano class ResourceManager : public ICloseable, public IShaderOwner { friend UniformBuffer; + friend VulkanTexture; Context* context; vk::Device device = nullptr; diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp index ec39cce..52c7ff8 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp @@ -10,6 +10,7 @@ #include "Vulkan/Image.hpp" #include "Vulkan/Context.hpp" #include "Vulkan/Resources/ResourceManager.hpp" +#include "Vulkan/Scene/VulkanShader.hpp" #include "Scene/Texture.hpp" namespace OpenVulkano::Vulkan @@ -18,22 +19,36 @@ namespace OpenVulkano::Vulkan { public: Scene::Texture* m_texture = nullptr; + vk::DescriptorSet m_descriptorSet; + uint32_t m_setId; - virtual void Init(ResourceManager* resManager, Scene::Texture* texture) + virtual void Init(ResourceManager* resManager, Scene::Texture* texture, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding, uint32_t setId) { - this->m_texture = texture; + m_texture = texture; + m_setId = setId; Image::Init(resManager->GetContext()->device.get(), { texture->resolution.x, texture->resolution.y, texture->resolution.z }); resManager->CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); texture->updated = false; + + // Setup Descriptor set + const vk::DescriptorSetAllocateInfo descSetAllocInfo = { ResourceManager::INSTANCE->descriptorPool, 1, descriptorSetLayout }; + m_descriptorSet = resManager->GetContext()->device->device.allocateDescriptorSets(descSetAllocInfo)[0]; + vk::DescriptorImageInfo imageInfo = { sampler, view, vk::ImageLayout::eShaderReadOnlyOptimal }; + vk::WriteDescriptorSet writeDescriptorSet = { m_descriptorSet, binding.bindingId, 0, 1 }; + writeDescriptorSet.descriptorType = static_cast(binding.descriptorType); + writeDescriptorSet.pImageInfo = &imageInfo; + resManager->GetContext()->device->device.updateDescriptorSets(1, &writeDescriptorSet, 0, nullptr); + + texture->renderTexture = this; } void Record(VulkanDrawContext* context) override { - //cmdBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, ) + context->commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, context->GetShader()->pipelineLayout, m_setId, 1, &m_descriptorSet, 0, nullptr); } }; - class VulkanTextureDynamic : VulkanTexture + /*class VulkanTextureDynamic : VulkanTexture { public: uint32_t lastUpdate = -1; @@ -48,13 +63,13 @@ namespace OpenVulkano::Vulkan void Record(VulkanDrawContext* context) override { - /*if(bufferId != lastUpdate && m_texture->updated) + if(bufferId != lastUpdate && m_texture->updated) { lastUpdate = bufferId; resourceManager->CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); m_texture->updated = false; } - VulkanTexture::Record(cmdBuffer, bufferId);*/ + VulkanTexture::Record(cmdBuffer, bufferId); } - }; + };*/ } \ No newline at end of file From eb96d7d674e887b7f2e129f9ee5701ea9873d12d Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Fri, 5 Jul 2024 09:06:17 +0200 Subject: [PATCH 08/30] Fix perspective correction issue for uv coordinates --- openVulkanoCpp/Scene/Texture.hpp | 2 +- openVulkanoCpp/Shader/Shaders.c | 70 ++++++++++++------------- openVulkanoCpp/Shader/Shaders.h | 4 +- openVulkanoCpp/Shader/basic.vert | 4 +- openVulkanoCpp/Shader/basicTexture.frag | 2 +- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/openVulkanoCpp/Scene/Texture.hpp b/openVulkanoCpp/Scene/Texture.hpp index 205f26c..5e08449 100644 --- a/openVulkanoCpp/Scene/Texture.hpp +++ b/openVulkanoCpp/Scene/Texture.hpp @@ -32,7 +32,7 @@ namespace OpenVulkano::Scene - void MakePlaceholder(uint32_t width = 128, uint32_t height = 128, + void MakePlaceholder(uint32_t width = 32, uint32_t height = 32, Math::Vector4uc color1 = {255, 135, 255, 255}, Math::Vector4uc color2 = {255, 225, 255, 255}); }; } \ No newline at end of file diff --git a/openVulkanoCpp/Shader/Shaders.c b/openVulkanoCpp/Shader/Shaders.c index 10c4071..4795fcc 100644 --- a/openVulkanoCpp/Shader/Shaders.c +++ b/openVulkanoCpp/Shader/Shaders.c @@ -297,9 +297,9 @@ const unsigned char basic_frag_spv[376] = { }; /* Contents of file basicTexture.frag.spv */ -const long int basicTexture_frag_spv_size = 632; -const unsigned char basicTexture_frag_spv[632] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x16, 0x00, 0x00, 0x00, +const long int basicTexture_frag_spv_size = 668; +const unsigned char basicTexture_frag_spv[668] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, @@ -337,21 +337,23 @@ const unsigned char basicTexture_frag_spv[632] = { 0x3D, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, - 0x12, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, - 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 + 0x12, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; /* Contents of file basic.vert.spv */ -const long int basic_vert_spv_size = 2996; -const unsigned char basic_vert_spv[2996] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x63, 0x00, 0x00, 0x00, +const long int basic_vert_spv_size = 2972; +const unsigned char basic_vert_spv[2972] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, - 0x3C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, - 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, 0x47, 0x4C, 0x5F, 0x41, 0x52, 0x42, 0x5F, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5F, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5F, 0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, @@ -381,12 +383,12 @@ const unsigned char basic_vert_spv[2996] = { 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, - 0x05, 0x00, 0x08, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67, 0x54, 0x65, 0x78, 0x74, + 0x05, 0x00, 0x08, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, 0x65, 0x73, 0x00, 0x00, - 0x05, 0x00, 0x07, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, + 0x05, 0x00, 0x07, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, 0x65, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, - 0x61, 0x00, 0x00, 0x00, 0x74, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x62, 0x00, 0x00, 0x00, 0x62, 0x69, 0x54, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x74, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x62, 0x69, 0x54, 0x61, 0x6E, 0x67, 0x65, 0x6E, 0x74, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -409,10 +411,10 @@ const unsigned char basic_vert_spv[2996] = { 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, @@ -451,12 +453,12 @@ const unsigned char basic_vert_spv[2996] = { 0x1E, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, - 0x5B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x5C, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, + 0x5A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x5B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x5B, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, @@ -523,15 +525,13 @@ const unsigned char basic_vert_spv[2996] = { 0x54, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, - 0x0C, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, - 0x58, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, - 0x51, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x5A, 0x00, 0x00, 0x00, - 0x59, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, - 0x5E, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, - 0x5F, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, - 0x38, 0x00, 0x01, 0x00 + 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x39, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x59, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, + 0x5A, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x5C, 0x00, 0x00, 0x00, + 0x5F, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; /* Contents of file grid.frag.spv */ @@ -1162,8 +1162,8 @@ const TFileTableEntry fileTable[] = { {"background.frag.spv", background_frag_spv, 1076}, {"background.vert.spv", background_vert_spv, 2980}, {"basic.frag.spv", basic_frag_spv, 376}, - {"basicTexture.frag.spv", basicTexture_frag_spv, 632}, - {"basic.vert.spv", basic_vert_spv, 2996}, + {"basicTexture.frag.spv", basicTexture_frag_spv, 668}, + {"basic.vert.spv", basic_vert_spv, 2972}, {"grid.frag.spv", grid_frag_spv, 6472}, {"grid.vert.spv", grid_vert_spv, 3340} }; diff --git a/openVulkanoCpp/Shader/Shaders.h b/openVulkanoCpp/Shader/Shaders.h index 39bca66..ee1a6fa 100644 --- a/openVulkanoCpp/Shader/Shaders.h +++ b/openVulkanoCpp/Shader/Shaders.h @@ -16,11 +16,11 @@ extern const unsigned char basic_frag_spv[376]; /* Contents of file basicTexture.frag.spv */ extern const long int basicTexture_frag_spv_size; -extern const unsigned char basicTexture_frag_spv[632]; +extern const unsigned char basicTexture_frag_spv[668]; /* Contents of file basic.vert.spv */ extern const long int basic_vert_spv_size; -extern const unsigned char basic_vert_spv[2996]; +extern const unsigned char basic_vert_spv[2972]; /* Contents of file grid.frag.spv */ extern const long int grid_frag_spv_size; diff --git a/openVulkanoCpp/Shader/basic.vert b/openVulkanoCpp/Shader/basic.vert index 239eaff..1c952cb 100644 --- a/openVulkanoCpp/Shader/basic.vert +++ b/openVulkanoCpp/Shader/basic.vert @@ -21,11 +21,11 @@ layout(set = 1, binding = 0) uniform CameraData { void main() { - vec3 light = normalize(vec3(1)); + vec3 light = normalize(vec3(10)); vec4 worldPos = node.world * vec4(position, 1.0); vec3 worldNormal = normalize(transpose(inverse(mat3(node.world))) * normal); float brightness = max(0.0, dot(worldNormal, light)); outColor = vec4(clamp(color.rgb * (0.5 + brightness / 2), 0, 1), 1); - gl_Position = normalize(cam.viewProjection * worldPos); + gl_Position = cam.viewProjection * worldPos; fragTextureCoordinates = textureCoordinates.xy; } \ No newline at end of file diff --git a/openVulkanoCpp/Shader/basicTexture.frag b/openVulkanoCpp/Shader/basicTexture.frag index 6c4aac1..acf99a1 100644 --- a/openVulkanoCpp/Shader/basicTexture.frag +++ b/openVulkanoCpp/Shader/basicTexture.frag @@ -7,5 +7,5 @@ layout(set = 2, binding = 0) uniform sampler2D texSampler; void main() { - outColor = texture(texSampler, texCoord); + outColor = texture(texSampler, texCoord) * color; } \ No newline at end of file From 86e7681a8d45c0cee2a695c6e5ff8b06b3e5f34d Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Fri, 5 Jul 2024 09:50:19 +0200 Subject: [PATCH 09/30] Improve texture binding handling --- openVulkanoCpp/Scene/Shader/Shader.hpp | 4 +-- openVulkanoCpp/Scene/Texture.hpp | 12 +++++-- .../Vulkan/Resources/ResourceManager.cpp | 2 +- openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp | 36 ++++++++++++++++--- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/openVulkanoCpp/Scene/Shader/Shader.hpp b/openVulkanoCpp/Scene/Shader/Shader.hpp index b7632c2..c138a03 100644 --- a/openVulkanoCpp/Scene/Shader/Shader.hpp +++ b/openVulkanoCpp/Scene/Shader/Shader.hpp @@ -123,7 +123,7 @@ namespace OpenVulkano::Scene return *this; } - Shader& AddDescriptorSetLayoutBinding(const DescriptorSetLayoutBinding& binding, int setId = -1) + int AddDescriptorSetLayoutBinding(const DescriptorSetLayoutBinding& binding, int setId = -1) { CheckShaderInitState(); if (setId < 0) setId = static_cast(descriptorSets.size() + 2); @@ -134,7 +134,7 @@ namespace OpenVulkano::Scene descriptorSets.emplace_back(); } descriptorSets[setId].push_back(binding); - return *this; + return setId + 2; } #pragma clang diagnostic pop diff --git a/openVulkanoCpp/Scene/Texture.hpp b/openVulkanoCpp/Scene/Texture.hpp index 5e08449..f05dfef 100644 --- a/openVulkanoCpp/Scene/Texture.hpp +++ b/openVulkanoCpp/Scene/Texture.hpp @@ -31,8 +31,16 @@ namespace OpenVulkano::Scene UpdateFrequency updateFrequency = UpdateFrequency::Never; - void MakePlaceholder(uint32_t width = 32, uint32_t height = 32, - Math::Vector4uc color1 = {255, 135, 255, 255}, Math::Vector4uc color2 = {255, 225, 255, 255}); + Math::Vector4uc color1 = {248, 123, 255, 255}, Math::Vector4uc color2 = {250, 19, 255, 255}); + }; + + class TextureBinding + { + public: + Texture* texture; + int setId; + + operator bool() const { return setId >= 0 && texture; } }; } \ No newline at end of file diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp index 9870af3..92dd99f 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp @@ -380,7 +380,7 @@ namespace OpenVulkano::Vulkan { VulkanTexture* vkTexture = new VulkanTexture(); - vkTexture->Init(this, texture, GetDescriptorLayoutSet(Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING), Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING, 2); + vkTexture->Init(this, texture, GetDescriptorLayoutSet(Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING), Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING); return vkTexture; } diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp index 52c7ff8..f4be6f7 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp @@ -20,12 +20,10 @@ namespace OpenVulkano::Vulkan public: Scene::Texture* m_texture = nullptr; vk::DescriptorSet m_descriptorSet; - uint32_t m_setId; - virtual void Init(ResourceManager* resManager, Scene::Texture* texture, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding, uint32_t setId) + virtual void Init(ResourceManager* resManager, Scene::Texture* texture, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding) { m_texture = texture; - m_setId = setId; Image::Init(resManager->GetContext()->device.get(), { texture->resolution.x, texture->resolution.y, texture->resolution.z }); resManager->CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); texture->updated = false; @@ -44,7 +42,37 @@ namespace OpenVulkano::Vulkan void Record(VulkanDrawContext* context) override { - context->commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, context->GetShader()->pipelineLayout, m_setId, 1, &m_descriptorSet, 0, nullptr); + int setId = -1, i = 0; + for (const auto& descriptorSet : context->GetShader()->shader->descriptorSets) + { + for (const auto& descriptor : descriptorSet) + { + if (descriptor.descriptorType < 6) + { + if (setId != -1) [[unlikely]] + { + Logger::RENDER->error("Found multiple possible descriptor set for texture! Use 'Record(VulkanDrawContext* context, int setId)' explicitly when using multiple sets containing textures!"); + } + setId = i; + break; + } + } + i++; + } + if (setId == -1) [[unlikely]] + { + Logger::RENDER->error("Failed to discover setId for texture binding."); + return; + } + else [[likely]] + { + Record(context, setId + 2); // Set 0 and 1 are automatically bound special sets for the camera and the node + } + } + + void Record(VulkanDrawContext* context, int setId) + { + context->commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, context->GetShader()->pipelineLayout, setId, 1, &m_descriptorSet, 0, nullptr); } }; From 7e9c568779282123f878d2f73c720b15e1976a82 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Fri, 5 Jul 2024 14:08:04 +0200 Subject: [PATCH 10/30] Add interfaces for getting textures from ar frames --- openVulkanoCpp/AR/ArFrame.cpp | 16 ++++++++++++++++ openVulkanoCpp/AR/ArFrame.hpp | 15 +++++++++++++-- openVulkanoCpp/AR/ArSession.hpp | 11 +++++++++++ .../AR/Provider/ArKit/ArSessionArKitInternal.h | 5 +++++ .../AR/Provider/Network/ArSessionStream.h | 5 +++++ .../AR/Provider/Playback/ArSessionPlayback.cpp | 10 ++++++++++ .../AR/Provider/Playback/ArSessionPlayback.hpp | 5 +++++ 7 files changed, 65 insertions(+), 2 deletions(-) diff --git a/openVulkanoCpp/AR/ArFrame.cpp b/openVulkanoCpp/AR/ArFrame.cpp index 2f2aeb6..989b713 100644 --- a/openVulkanoCpp/AR/ArFrame.cpp +++ b/openVulkanoCpp/AR/ArFrame.cpp @@ -22,4 +22,20 @@ namespace OpenVulkano::AR else m_session->GetRecorder().Save(shared_from_this()); } + + void ArFrame::SaveToFile(const std::filesystem::path& path, bool downsample) + { + m_session->GetRecorder().SaveToFile(shared_from_this(), path, downsample); + } + + const Scene::Texture* ArFrame::GetImageTexture() + { + if (!m_texture) m_texture = m_session->MakeTexture(this); + return m_texture; + } + + ArFrame::~ArFrame() + { + if (m_texture) m_session->ReturnTexture(m_texture); + } } \ No newline at end of file diff --git a/openVulkanoCpp/AR/ArFrame.hpp b/openVulkanoCpp/AR/ArFrame.hpp index ef68870..ae769a3 100644 --- a/openVulkanoCpp/AR/ArFrame.hpp +++ b/openVulkanoCpp/AR/ArFrame.hpp @@ -13,8 +13,14 @@ #include "ArDepthFormat.hpp" #include "ArTrackingState.hpp" #include "ArFrameMetadata.hpp" -#include #include +#include +#include + +namespace OpenVulkano::Scene +{ + class Texture; +} namespace OpenVulkano::AR { @@ -89,6 +95,7 @@ namespace OpenVulkano::AR { std::shared_ptr m_session; size_t m_frameId; + Scene::Texture* m_texture = nullptr; bool m_saved = false; bool m_highRes = false; @@ -99,7 +106,7 @@ namespace OpenVulkano::AR {} public: - virtual ~ArFrame() = default; + virtual ~ArFrame(); [[nodiscard]] size_t GetFrameId() const { return m_frameId; } @@ -139,8 +146,12 @@ namespace OpenVulkano::AR [[nodiscard]] bool IsSaved() const { return m_saved; }; + [[nodiscard]] const Scene::Texture* GetImageTexture(); + void Save(); + void SaveToFile(const std::filesystem::path& path, bool downsample = false); + void SetSaved() { m_saved = true; } void MarkHighRes() { m_highRes = true; } diff --git a/openVulkanoCpp/AR/ArSession.hpp b/openVulkanoCpp/AR/ArSession.hpp index f493840..058853f 100644 --- a/openVulkanoCpp/AR/ArSession.hpp +++ b/openVulkanoCpp/AR/ArSession.hpp @@ -19,6 +19,11 @@ #include #include +namespace OpenVulkano::Scene +{ + class Texture; +} + namespace OpenVulkano::AR { class ArSession; @@ -75,9 +80,15 @@ namespace OpenVulkano::AR class ArSession { + friend ArFrame; + protected: ArSession(const ArSessionMetadata& metadata) : metadata(metadata), recorder(metadata.playback ? nullptr : this) {} + virtual Scene::Texture* MakeTexture(ArFrame* frame) = 0; + + virtual void ReturnTexture(Scene::Texture* texture) = 0; + public: /** * Creates a platform native AR session. nullptr if failed to create session. diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h index 5aeb960..bf60aaa 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h +++ b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h @@ -47,6 +47,11 @@ namespace OpenVulkano::AR::ArKit void OnArAnchorsUpdate(NSArray<__kindof ARAnchor*>* anchors); bool ArShouldAttemptRelocalization(); + protected: + Scene::Texture * MakeTexture(OpenVulkano::AR::ArFrame *frame) override; + + void ReturnTexture(Scene::Texture *texture) override; + private: ArKitDelegate* m_arKitDelegate; ARWorldTrackingConfiguration* m_arConfig; diff --git a/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h b/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h index 045374f..d75d19c 100644 --- a/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h +++ b/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h @@ -12,6 +12,11 @@ namespace OpenVulkano::AR::Network { class ArSessionStream final : public ArSession { + protected: + Scene::Texture * MakeTexture(OpenVulkano::AR::ArFrame *frame) override { return nullptr; } //TODO + + void ReturnTexture(Scene::Texture *texture) override {} // TODO + public: ArSessionStream(const std::string& serverAddress, std::optional requestConfig = std::nullopt); diff --git a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp index 2e11eb2..7ce3844 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp @@ -88,4 +88,14 @@ namespace OpenVulkano::AR::Playback Stop(); OnSessionInterruptionChange(true); } + + Scene::Texture* ArSessionPlayback::MakeTexture(OpenVulkano::AR::ArFrame* frame) + { + return nullptr; //TODO + } + + void ArSessionPlayback::ReturnTexture(Scene::Texture* texture) + { + //TODO + } } diff --git a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp index b506082..e3f77eb 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp @@ -31,6 +31,11 @@ class ArSessionPlayback final : public ArSession, public std::enable_shared_from [[nodiscard]] ArType GetArType() override; + protected: + Scene::Texture * MakeTexture(OpenVulkano::AR::ArFrame *frame) override; + + void ReturnTexture(Scene::Texture *texture) override; + private: void ReadWorker(); From c41b04db9be8880f812ad0c364c1b614662910e4 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 6 Jul 2024 14:08:20 +0200 Subject: [PATCH 11/30] Remove copy method from drawable --- openVulkanoCpp/Scene/Drawable.hpp | 2 -- openVulkanoCpp/Scene/Node.cpp | 5 ++--- openVulkanoCpp/Scene/Prefabs/GridDrawable.hpp | 2 -- openVulkanoCpp/Scene/SimpleDrawable.hpp | 2 -- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/openVulkanoCpp/Scene/Drawable.hpp b/openVulkanoCpp/Scene/Drawable.hpp index 5dced77..5f58614 100644 --- a/openVulkanoCpp/Scene/Drawable.hpp +++ b/openVulkanoCpp/Scene/Drawable.hpp @@ -45,8 +45,6 @@ namespace OpenVulkano::Scene void SetShader(Shader* shader) { m_shader = shader; } - [[nodiscard]] virtual Drawable* Copy() = 0; - [[nodiscard]] Scene* GetScene() const { return m_scene; } [[nodiscard]] const auto& GetNodes() const { return m_nodes; } diff --git a/openVulkanoCpp/Scene/Node.cpp b/openVulkanoCpp/Scene/Node.cpp index 60c71c0..78e43f6 100644 --- a/openVulkanoCpp/Scene/Node.cpp +++ b/openVulkanoCpp/Scene/Node.cpp @@ -125,10 +125,9 @@ namespace OpenVulkano::Scene for (auto& drawable : drawables) { Scene* drawableScene = drawable->GetScene(); - if(drawableScene && drawableScene != scene) + if(drawableScene && drawableScene != scene) [[unlikely]] { - Logger::SCENE->warn("Drawable is already associated with a scene! Creating copy."); - drawable = drawable->Copy(); + throw std::runtime_error("Drawable is already associated with a scene! Creating copy."); } drawable->SetScene(scene); } diff --git a/openVulkanoCpp/Scene/Prefabs/GridDrawable.hpp b/openVulkanoCpp/Scene/Prefabs/GridDrawable.hpp index a19b1c4..829fb40 100644 --- a/openVulkanoCpp/Scene/Prefabs/GridDrawable.hpp +++ b/openVulkanoCpp/Scene/Prefabs/GridDrawable.hpp @@ -19,7 +19,5 @@ namespace OpenVulkano::Scene GridDrawable(); [[nodiscard]] Shader& GetShader() { return m_shader; } - - [[nodiscard]] Drawable* Copy() override { return new GridDrawable(); } }; } \ No newline at end of file diff --git a/openVulkanoCpp/Scene/SimpleDrawable.hpp b/openVulkanoCpp/Scene/SimpleDrawable.hpp index 9babb32..49908d2 100644 --- a/openVulkanoCpp/Scene/SimpleDrawable.hpp +++ b/openVulkanoCpp/Scene/SimpleDrawable.hpp @@ -39,8 +39,6 @@ namespace OpenVulkano::Scene void Init(SimpleDrawable* drawable); - [[nodiscard]] Drawable* Copy() override { return new SimpleDrawable(this); } - [[nodiscard]] Geometry* GetMesh() const { return m_mesh; } [[nodiscard]] Material* GetMaterial() const { return m_material; } From d4c5e8700b5e5770283885179c3a47c7406ce5a2 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 6 Jul 2024 14:12:11 +0200 Subject: [PATCH 12/30] Allow exporting of metal device --- openVulkanoCpp/Vulkan/Context.cpp | 10 +++++++++- openVulkanoCpp/Vulkan/Renderer.hpp | 2 ++ openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/openVulkanoCpp/Vulkan/Context.cpp b/openVulkanoCpp/Vulkan/Context.cpp index 59706f5..b430379 100644 --- a/openVulkanoCpp/Vulkan/Context.cpp +++ b/openVulkanoCpp/Vulkan/Context.cpp @@ -12,6 +12,9 @@ #include "Base/EngineConstants.hpp" #include "Base/UI/IVulkanWindow.hpp" #include "Debuging/ValidationLayer.hpp" +#if __has_include("vulkan/vulkan_metal.h") +#include +#endif namespace OpenVulkano::Vulkan { @@ -62,9 +65,14 @@ namespace OpenVulkano::Vulkan vk::ApplicationInfo appInfo(graphicsAppManager->GetGraphicsApp()->GetAppName().c_str(), static_cast(graphicsAppManager->GetGraphicsApp()->GetAppVersion()), ENGINE_NAME, ENGINE_VERSION.intVersion, VK_MAKE_VERSION(1, 1, 0)); std::vector extensions = Utils::toCString(requiredExtensions), layers = Debug::GetValidationLayers(); - const vk::InstanceCreateInfo createInfo(vk::InstanceCreateFlags(), &appInfo, enableValidationLayer ? layers.size() : 0, + vk::InstanceCreateInfo createInfo(vk::InstanceCreateFlags(), &appInfo, enableValidationLayer ? layers.size() : 0, layers.data(), extensions.size(), extensions.data()); +#ifdef __APPLE__ + VkExportMetalObjectCreateInfoEXT metalExportInfo { VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT, nullptr, VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT }; + createInfo.pNext = &metalExportInfo; +#endif + instance = vk::createInstance(createInfo); if (enableValidationLayer) Debug::SetupValidationLayers(instance, vk::DebugReportFlagBitsEXT::eError | vk::DebugReportFlagBitsEXT::eWarning | vk::DebugReportFlagBitsEXT::ePerformanceWarning /*| vk::DebugReportFlagBitsEXT::eInformation | vk::DebugReportFlagBitsEXT::eDebug*/); diff --git a/openVulkanoCpp/Vulkan/Renderer.hpp b/openVulkanoCpp/Vulkan/Renderer.hpp index b56d686..f981bae 100644 --- a/openVulkanoCpp/Vulkan/Renderer.hpp +++ b/openVulkanoCpp/Vulkan/Renderer.hpp @@ -76,5 +76,7 @@ namespace OpenVulkano::Vulkan void RecordSecondaryBuffer(Data::ReadOnlyAtomicArrayQueue* jobQueue, uint32_t poolId); ResourceManager& GetResourceManager() { return resourceManager; } + + Context& GetContext() { return context; } }; } diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp index f4be6f7..7893a4c 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp @@ -12,6 +12,7 @@ #include "Vulkan/Resources/ResourceManager.hpp" #include "Vulkan/Scene/VulkanShader.hpp" #include "Scene/Texture.hpp" +#include "Scene/Shader/Shader.hpp" namespace OpenVulkano::Vulkan { From 2b32717c5bf2a079b5e6f5810de2c84c6a3819f9 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 6 Jul 2024 21:39:36 +0200 Subject: [PATCH 13/30] Update background shader --- openVulkanoCpp/Shader/Shaders.c | 365 ++++++++++++++------------ openVulkanoCpp/Shader/Shaders.h | 2 +- openVulkanoCpp/Shader/background.frag | 5 +- openVulkanoCpp/Shader/background.vert | 56 ++-- 4 files changed, 225 insertions(+), 203 deletions(-) diff --git a/openVulkanoCpp/Shader/Shaders.c b/openVulkanoCpp/Shader/Shaders.c index 4795fcc..ea40b77 100644 --- a/openVulkanoCpp/Shader/Shaders.c +++ b/openVulkanoCpp/Shader/Shaders.c @@ -28,7 +28,7 @@ const unsigned char background_frag_spv[1076] = { 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x66, 0x61, 0x72, 0x00, 0x05, 0x00, 0x03, 0x00, 0x17, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, @@ -76,194 +76,209 @@ const unsigned char background_frag_spv[1076] = { }; /* Contents of file background.vert.spv */ -const long int background_vert_spv_size = 2980; -const unsigned char background_vert_spv[2980] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x59, 0x00, 0x00, 0x00, +const long int background_vert_spv_size = 3220; +const unsigned char background_vert_spv[3220] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0F, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, - 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, - 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, 0x47, 0x4C, 0x5F, 0x41, - 0x52, 0x42, 0x5F, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5F, 0x73, 0x68, 0x61, 0x64, - 0x65, 0x72, 0x5F, 0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x0C, 0x00, 0x00, 0x00, 0x67, 0x72, 0x69, 0x64, 0x50, 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, 0x46, 0x6F, 0x76, 0x00, - 0x05, 0x00, 0x05, 0x00, 0x18, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, 0x41, 0x73, 0x70, 0x65, - 0x63, 0x74, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x76, 0x69, 0x72, 0x74, - 0x75, 0x61, 0x6C, 0x41, 0x73, 0x70, 0x65, 0x63, 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x43, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, - 0x06, 0x00, 0x07, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, - 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x70, 0x72, 0x6F, 0x6A, - 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x50, 0x6F, 0x73, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6E, 0x65, 0x61, 0x72, 0x50, 0x6C, 0x61, 0x6E, - 0x65, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x66, 0x61, 0x72, 0x50, 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x77, 0x69, 0x64, 0x74, 0x68, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x66, 0x6F, 0x76, 0x00, 0x06, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x61, 0x73, 0x70, 0x65, 0x63, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x1D, 0x00, 0x00, 0x00, - 0x0A, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x00, - 0x06, 0x00, 0x08, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x70, 0x69, 0x78, 0x65, - 0x6C, 0x53, 0x63, 0x61, 0x6C, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x03, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, 0x05, 0x00, 0x05, 0x00, - 0x2A, 0x00, 0x00, 0x00, 0x70, 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x06, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x56, 0x65, 0x72, 0x74, 0x65, - 0x78, 0x49, 0x6E, 0x64, 0x65, 0x78, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, - 0x73, 0x63, 0x61, 0x6C, 0x65, 0x58, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x3E, 0x00, 0x00, 0x00, - 0x73, 0x63, 0x61, 0x6C, 0x65, 0x59, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, + 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, + 0x47, 0x4C, 0x5F, 0x41, 0x52, 0x42, 0x5F, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5F, + 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5F, 0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, 0x46, 0x6F, 0x76, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, 0x53, 0x63, 0x61, 0x6C, + 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x12, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, + 0x41, 0x73, 0x70, 0x65, 0x63, 0x74, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x70, 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6E, 0x64, + 0x65, 0x78, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x27, 0x00, 0x00, 0x00, 0x69, 0x6E, 0x64, 0x65, + 0x78, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x2B, 0x00, 0x00, 0x00, + 0x73, 0x63, 0x61, 0x6C, 0x65, 0x58, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x43, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6F, 0x6A, + 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x70, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, + 0x6F, 0x6E, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x63, 0x61, 0x6D, 0x50, 0x6F, 0x73, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x6E, 0x65, 0x61, 0x72, 0x50, 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x06, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x66, 0x61, 0x72, 0x50, + 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x77, 0x69, 0x64, 0x74, 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, + 0x06, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x66, 0x6F, 0x76, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x61, 0x73, 0x70, 0x65, + 0x63, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x73, 0x63, 0x61, 0x6C, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x00, 0x06, 0x00, 0x08, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x70, 0x69, 0x78, 0x65, 0x6C, 0x53, 0x63, 0x61, + 0x6C, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, 0x05, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x73, 0x63, 0x61, 0x6C, 0x65, 0x59, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x65, 0x72, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, - 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x06, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x06, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, + 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x06, 0x00, 0x07, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x53, 0x69, 0x7A, 0x65, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x6C, 0x69, 0x70, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, - 0x06, 0x00, 0x07, 0x00, 0x52, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, + 0x06, 0x00, 0x07, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x75, 0x6C, 0x6C, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x05, 0x00, 0x03, 0x00, - 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, + 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x54, 0x00, 0x00, 0x00, + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, + 0x65, 0x73, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x69, 0x6E, 0x64, 0x65, + 0x78, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0xC0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x23, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0xC0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xD4, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0xDC, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x23, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0xDC, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x1D, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0xEC, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0xEC, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, + 0x4C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x03, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x54, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x0B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x0B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, - 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF, 0x2C, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, - 0x0D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, - 0x0D, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, - 0x2C, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, - 0x0A, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, - 0x16, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x42, 0x3B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x19, 0x00, 0x00, 0x00, 0xAB, 0xAA, 0xAA, 0x3F, 0x20, 0x00, 0x04, 0x00, 0x1A, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x1C, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x1D, 0x00, 0x00, 0x00, - 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x42, 0x3B, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3B, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xAB, 0xAA, 0xAA, 0x3F, 0x17, 0x00, 0x04, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, + 0x19, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF, 0x2B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x3F, 0x2C, 0x00, 0x07, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, + 0x2C, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, + 0x19, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2A, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x2D, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x2D, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x15, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, - 0x17, 0x00, 0x04, 0x00, 0x46, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x1C, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, - 0x1E, 0x00, 0x06, 0x00, 0x52, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x51, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, - 0x54, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, - 0x23, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0x22, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, - 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, - 0x27, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x2D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, - 0x2F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, - 0x32, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, - 0x33, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, - 0x34, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x37, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0F, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x39, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x3A, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x3A, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x31, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, - 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, - 0x42, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, - 0x50, 0x00, 0x05, 0x00, 0x46, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, - 0x45, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, - 0x2A, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x46, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x85, 0x00, 0x05, 0x00, 0x46, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, - 0x2A, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x4D, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, - 0x4C, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1A, 0x00, 0x00, 0x00, - 0x4F, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x04, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x06, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x4B, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4D, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x4D, 0x00, 0x00, 0x00, + 0x4E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, + 0x54, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x57, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, + 0x2C, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, + 0x56, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x5B, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, + 0x5A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, + 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x27, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x16, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x2C, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, + 0x33, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x32, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, + 0x3A, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, + 0x36, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x42, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x43, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, + 0x43, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x2A, 0x00, 0x00, 0x00, + 0x46, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x46, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x2A, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x49, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, + 0x4F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x5F, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; @@ -1160,7 +1175,7 @@ const unsigned char grid_vert_spv[3340] = { const TFileTableEntry fileTable[] = { {"background.frag.spv", background_frag_spv, 1076}, - {"background.vert.spv", background_vert_spv, 2980}, + {"background.vert.spv", background_vert_spv, 3220}, {"basic.frag.spv", basic_frag_spv, 376}, {"basicTexture.frag.spv", basicTexture_frag_spv, 668}, {"basic.vert.spv", basic_vert_spv, 2972}, diff --git a/openVulkanoCpp/Shader/Shaders.h b/openVulkanoCpp/Shader/Shaders.h index ee1a6fa..cf54487 100644 --- a/openVulkanoCpp/Shader/Shaders.h +++ b/openVulkanoCpp/Shader/Shaders.h @@ -8,7 +8,7 @@ extern const unsigned char background_frag_spv[1076]; /* Contents of file background.vert.spv */ extern const long int background_vert_spv_size; -extern const unsigned char background_vert_spv[2980]; +extern const unsigned char background_vert_spv[3220]; /* Contents of file basic.frag.spv */ extern const long int basic_frag_spv_size; diff --git a/openVulkanoCpp/Shader/background.frag b/openVulkanoCpp/Shader/background.frag index 897da81..bd67a6b 100644 --- a/openVulkanoCpp/Shader/background.frag +++ b/openVulkanoCpp/Shader/background.frag @@ -1,8 +1,9 @@ #version 450 -layout (binding = 0) uniform sampler2D camTexture; +layout (set = 2, binding = 0) uniform sampler2D camTexture; + #ifdef ENABLE_DEPTH_WRITE -layout (set = 1, binding = 0) uniform sampler2D depthMap; +layout (set = 2, binding = 1) uniform sampler2D depthMap; #endif layout (location = 0) in vec2 texCoords; diff --git a/openVulkanoCpp/Shader/background.vert b/openVulkanoCpp/Shader/background.vert index cf56d75..9381eb4 100644 --- a/openVulkanoCpp/Shader/background.vert +++ b/openVulkanoCpp/Shader/background.vert @@ -3,39 +3,45 @@ layout(set = 1, binding = 0) uniform CameraData { - mat4 viewProjection; - mat4 view; - mat4 projection; - vec4 camPos; - float nearPlane; - float farPlane; - float width; - float height; - float fov; - float aspect; - float scaleFactor; - float pixelScaleFactor; + mat4 viewProjection; + mat4 view; + mat4 projection; + vec4 camPos; + float nearPlane; + float farPlane; + float width; + float height; + float fov; + float aspect; + float scaleFactor; + float pixelScaleFactor; } cam; -// Grid position are in clipped space -vec4 gridPlane[4] = vec4[] ( - vec4(1, 1, 0, 1), vec4(-1, 1, 0, 1), vec4(1, -1, 0, 1), vec4(-1, -1, 0, 1) +layout(location = 0) out vec2 textureCoordinates; + +const float FLOAT_MAX_LESS_THAN_1 = 0.999999940395355224609; +// Background plane positions are in clipped space +const vec4 PLANE[4] = vec4[] ( + vec4(1, -1, FLOAT_MAX_LESS_THAN_1, 1), vec4(-1, -1, FLOAT_MAX_LESS_THAN_1, 1), vec4(1, 1, FLOAT_MAX_LESS_THAN_1, 1), vec4(-1, 1, FLOAT_MAX_LESS_THAN_1, 1) +); +const vec2 TEX_COORDS[4] = vec2[] ( + vec2(1, 0), vec2(0, 0), vec2(1, 1), vec2(0, 1) ); -float realFov = 53; +float realFov = 53; //TODO +float realScale = tan(radians(realFov * 0.5)) * 2; float realAspect = 1.33333333; void main() { - float virtualAspect = cam.width / cam.height; - vec4 position = gridPlane[gl_VertexIndex]; + vec4 position = PLANE[gl_VertexIndex]; - // Calculate the scaling factors for width and height - float scaleX = tan(radians(cam.fov * 0.5)) / tan(radians(realFov * 0.5)); - float scaleY = virtualAspect / realAspect * scaleX; + // Calculate the scaling factors for width and height + float scaleX = realScale / cam.scaleFactor; + float scaleY = cam.aspect / realAspect * scaleX; - // Scale the quad's position - position.xy *= vec2(scaleX, scaleY); + // Scale the quad's position + position.xy *= vec2(scaleX, scaleY); - // Pass the transformed position to the fragment shader - gl_Position = position; + gl_Position = position; + textureCoordinates = TEX_COORDS[gl_VertexIndex]; } From c6c67f2bff61e730dc673c9f5b51b1661a159179 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 6 Jul 2024 21:43:50 +0200 Subject: [PATCH 14/30] Add wrapper for smart pointers --- openVulkanoCpp/Base/Wrapper.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 openVulkanoCpp/Base/Wrapper.hpp diff --git a/openVulkanoCpp/Base/Wrapper.hpp b/openVulkanoCpp/Base/Wrapper.hpp new file mode 100644 index 0000000..b37939f --- /dev/null +++ b/openVulkanoCpp/Base/Wrapper.hpp @@ -0,0 +1,16 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +namespace OpenVulkano +{ + template using Ptr = std::shared_ptr; + template using Weak = std::weak_ptr; + template using Unique = std::unique_ptr; +} From d6850821d3adc25abb0a11848434dad677204ad3 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 00:21:28 +0200 Subject: [PATCH 15/30] Update aspect ratio --- openVulkanoCpp/Shader/Shaders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openVulkanoCpp/Shader/Shaders.c b/openVulkanoCpp/Shader/Shaders.c index ea40b77..6437ff2 100644 --- a/openVulkanoCpp/Shader/Shaders.c +++ b/openVulkanoCpp/Shader/Shaders.c @@ -165,7 +165,7 @@ const unsigned char background_vert_spv[3220] = { 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x42, 0x3B, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0xE1, 0x7A, 0x24, 0x42, 0x3B, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3B, 0x00, 0x04, 0x00, From fcecdd63a3f2b549f129aaabcf19e767728633a3 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 00:21:49 +0200 Subject: [PATCH 16/30] Fix GetFov methods --- openVulkanoCpp/Math/CameraIntrinsic.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openVulkanoCpp/Math/CameraIntrinsic.hpp b/openVulkanoCpp/Math/CameraIntrinsic.hpp index 1c64791..2661924 100644 --- a/openVulkanoCpp/Math/CameraIntrinsic.hpp +++ b/openVulkanoCpp/Math/CameraIntrinsic.hpp @@ -80,12 +80,12 @@ namespace OpenVulkano::Math [[nodiscard]] float GetFovX(float imageWidth) const { - return 2 * atanf(imageWidth * 0.5f / Fx()); + return 2 * atanf((Fx() / imageWidth) * 0.5f); } [[nodiscard]] float GetFovY(float imageHeight) const { - return 2 * atanf(imageHeight * 0.5f / Fy()); + return 2 * atanf((Fy() / imageHeight) * 0.5f); } [[nodiscard]] Math::Vector3f ProjectTo3D(Math::Vector2i pixelCoordinates, float depth) const From add09b59af99648bfdba0834330517e92e702edf Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 00:23:26 +0200 Subject: [PATCH 17/30] Handle texture data format --- openVulkanoCpp/Vulkan/Image.cpp | 4 ++-- openVulkanoCpp/Vulkan/Image.hpp | 3 ++- openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openVulkanoCpp/Vulkan/Image.cpp b/openVulkanoCpp/Vulkan/Image.cpp index e1616c2..b1f7172 100644 --- a/openVulkanoCpp/Vulkan/Image.cpp +++ b/openVulkanoCpp/Vulkan/Image.cpp @@ -35,11 +35,11 @@ namespace OpenVulkano::Vulkan {}, nullptr, nullptr, imgMemBarrier); } - void Image::Init(const Device* device, const vk::Extent3D& resolution) + void Image::Init(const Device* device, const DataFormat format, const vk::Extent3D& resolution) { this->device = device->device; - vk::ImageCreateInfo imgCreateInfo { {}, vk::ImageType::e2D, vk::Format::eB8G8R8A8Unorm, resolution, 1, 1 }; + vk::ImageCreateInfo imgCreateInfo { {}, vk::ImageType::e2D, reinterpret_cast(format), resolution, 1, 1 }; imgCreateInfo.usage = vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled; imgCreateInfo.tiling = vk::ImageTiling::eOptimal; diff --git a/openVulkanoCpp/Vulkan/Image.hpp b/openVulkanoCpp/Vulkan/Image.hpp index 9898675..e65fe1e 100644 --- a/openVulkanoCpp/Vulkan/Image.hpp +++ b/openVulkanoCpp/Vulkan/Image.hpp @@ -7,6 +7,7 @@ #pragma once #include "Buffer.hpp" +#include "Scene/DataFormat.hpp" #include "VulkanUtils.hpp" #include @@ -38,7 +39,7 @@ namespace OpenVulkano::Vulkan */ void Init(const Device* device, const vk::ImageCreateInfo& imageCreateInfo, vk::ImageViewCreateInfo imageViewCreateInfo, const vk::MemoryPropertyFlags& memoryPropertyFlags = vk::MemoryPropertyFlagBits::eDeviceLocal); - void Init(const Device* device, const vk::Extent3D& resolution); + void Init(const Device* device, const DataFormat format, const vk::Extent3D& resolution); void SetLayout(vk::CommandBuffer& cmdBuffer, vk::ImageSubresourceRange subResourceRange, vk::ImageLayout newLayout, vk::ImageLayout oldLayout = vk::ImageLayout::eUndefined) const; diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp index 7893a4c..1d31e6e 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp @@ -25,7 +25,7 @@ namespace OpenVulkano::Vulkan virtual void Init(ResourceManager* resManager, Scene::Texture* texture, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding) { m_texture = texture; - Image::Init(resManager->GetContext()->device.get(), { texture->resolution.x, texture->resolution.y, texture->resolution.z }); + Image::Init(resManager->GetContext()->device.get(), texture->format, { texture->resolution.x, texture->resolution.y, texture->resolution.z }); resManager->CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); texture->updated = false; From 2b05518c611bffcc1d1db10382294fa9b87cf8d7 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 00:24:51 +0200 Subject: [PATCH 18/30] Add VulkanTextureDynamic --- openVulkanoCpp/Scene/Textrue.cpp | 1 - .../Vulkan/Resources/ResourceManager.cpp | 9 ++++-- openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp | 32 +++++++++++-------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/openVulkanoCpp/Scene/Textrue.cpp b/openVulkanoCpp/Scene/Textrue.cpp index afa5dcd..4c1052c 100644 --- a/openVulkanoCpp/Scene/Textrue.cpp +++ b/openVulkanoCpp/Scene/Textrue.cpp @@ -25,6 +25,5 @@ namespace OpenVulkano::Scene resolution = {width, height, 1}; size = sizeof(Math::Vector4uc) * width * height; format = DataFormat::B8G8R8A8_UNORM; - } } \ No newline at end of file diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp index 92dd99f..95dfe80 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp @@ -145,7 +145,6 @@ namespace OpenVulkano::Vulkan void ResourceManager::PrepareMaterial(Scene::Material* material) { - const std::unique_lock lock(mutex); if (material->texture && !material->texture->renderTexture) { PrepareTexture(material->texture); @@ -378,7 +377,13 @@ namespace OpenVulkano::Vulkan VulkanTexture* ResourceManager::PrepareTexture(Scene::Texture* texture) { - VulkanTexture* vkTexture = new VulkanTexture(); + const std::unique_lock lock(mutex); + if (texture->renderTexture) return static_cast(texture->renderTexture); + VulkanTexture* vkTexture; + if (texture->updateFrequency == Scene::UpdateFrequency::Never) + vkTexture = new VulkanTexture(); + else + vkTexture = new VulkanTextureDynamic(); vkTexture->Init(this, texture, GetDescriptorLayoutSet(Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING), Scene::Texture::DESCRIPTOR_SET_LAYOUT_BINDING); diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp index 1d31e6e..48d4d93 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp @@ -71,34 +71,38 @@ namespace OpenVulkano::Vulkan } } - void Record(VulkanDrawContext* context, int setId) + virtual void Record(VulkanDrawContext* context, int setId) { context->commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, context->GetShader()->pipelineLayout, setId, 1, &m_descriptorSet, 0, nullptr); } }; - /*class VulkanTextureDynamic : VulkanTexture + class VulkanTextureDynamic : public VulkanTexture { public: - uint32_t lastUpdate = -1; - ResourceManager* resourceManager; - - void Init(ResourceManager* resManager, Scene::Texture* texture) override + void Init(ResourceManager* resManager, Scene::Texture* texture, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding) override { - resourceManager = resManager; - VulkanTexture::Init(resourceManager, texture); - lastUpdate = -1; + VulkanTexture::Init(resManager, texture, descriptorSetLayout, binding); } void Record(VulkanDrawContext* context) override { - if(bufferId != lastUpdate && m_texture->updated) + if(m_texture->updated) { - lastUpdate = bufferId; - resourceManager->CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); + context->renderer->GetResourceManager().CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); m_texture->updated = false; } - VulkanTexture::Record(cmdBuffer, bufferId); + VulkanTexture::Record(context); } - };*/ + + void Record(VulkanDrawContext* context, int setId) override + { + if(m_texture->updated) + { + context->renderer->GetResourceManager().CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); + m_texture->updated = false; + } + VulkanTexture::Record(context, setId); + } + }; } \ No newline at end of file From 52941b99cc250f87a2be67b324fe5d62a75e5a7b Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 00:25:37 +0200 Subject: [PATCH 19/30] Add frameid to context --- openVulkanoCpp/Vulkan/VulkanDrawContext.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openVulkanoCpp/Vulkan/VulkanDrawContext.hpp b/openVulkanoCpp/Vulkan/VulkanDrawContext.hpp index cd0ea87..87723d8 100644 --- a/openVulkanoCpp/Vulkan/VulkanDrawContext.hpp +++ b/openVulkanoCpp/Vulkan/VulkanDrawContext.hpp @@ -7,6 +7,7 @@ #pragma once #include "Renderer.hpp" +#include "Base/FrameMetadata.hpp" namespace OpenVulkano::Vulkan { @@ -18,6 +19,7 @@ namespace OpenVulkano::Vulkan public: const size_t encoderThreadId; const size_t currentImageId; + const size_t frameId = CURRENT_FRAME.frameId; vk::CommandBuffer& commandBuffer; Renderer* renderer; From 87ce56b8946bd4cb7ac63f94242a9fe93d835946 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 00:37:49 +0200 Subject: [PATCH 20/30] Add ArBackgroundDrawable --- openVulkanoCpp/AR/ArFrame.hpp | 5 +- openVulkanoCpp/AR/ArSession.hpp | 15 ++++- .../AR/Provider/Network/ArSessionStream.h | 2 + .../AR/Provider/Playback/ArFramePlayback.cpp | 1 + .../AR/Provider/Playback/ArPlaybackReader.cpp | 7 +- .../Provider/Playback/ArSessionPlayback.cpp | 25 +++++++- .../Provider/Playback/ArSessionPlayback.hpp | 4 ++ .../Scene/Prefabs/ArBackgroundDrawable.cpp | 64 +++++++++++++++++++ .../Scene/Prefabs/ArBackgroundDrawable.hpp | 49 ++++++++++++++ .../ArBackgroundDrawableVulkanEncoder.cpp | 34 ++++++++++ 10 files changed, 197 insertions(+), 9 deletions(-) create mode 100644 openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp create mode 100644 openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp create mode 100644 openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp diff --git a/openVulkanoCpp/AR/ArFrame.hpp b/openVulkanoCpp/AR/ArFrame.hpp index ae769a3..db0ce51 100644 --- a/openVulkanoCpp/AR/ArFrame.hpp +++ b/openVulkanoCpp/AR/ArFrame.hpp @@ -31,6 +31,7 @@ namespace OpenVulkano::AR public: void* data; Math::Vector2ui resolution; + uint32_t numChannels = 1; }; class ArImagePlanar @@ -49,12 +50,12 @@ namespace OpenVulkano::AR const uint8_t* lumColBuffer = static_cast(luminescenceOrColor.data); if (format == Format::BGR) { - size_t idx = (y * luminescenceOrColor.resolution.x + x) * 3; + size_t idx = (y * luminescenceOrColor.resolution.x + x) * luminescenceOrColor.numChannels; return { lumColBuffer[idx + 2], lumColBuffer[idx + 1], lumColBuffer[idx], 255 }; } else if (format == Format::RGB) { - size_t idx = (y * luminescenceOrColor.resolution.x + x) * 3; + size_t idx = (y * luminescenceOrColor.resolution.x + x) * luminescenceOrColor.numChannels; return { lumColBuffer[idx], lumColBuffer[idx + 1], lumColBuffer[idx + 2], 255 }; } diff --git a/openVulkanoCpp/AR/ArSession.hpp b/openVulkanoCpp/AR/ArSession.hpp index 058853f..5a47143 100644 --- a/openVulkanoCpp/AR/ArSession.hpp +++ b/openVulkanoCpp/AR/ArSession.hpp @@ -19,9 +19,14 @@ #include #include -namespace OpenVulkano::Scene +namespace OpenVulkano { - class Texture; + class IRenderer; + + namespace Scene + { + class Texture; + } } namespace OpenVulkano::AR @@ -203,6 +208,12 @@ namespace OpenVulkano::AR virtual void RequestHighResolutionFrame() {} + /** + * Sets the renderer that should be used for texture creation. + * @param renderer The renderer to be used to create textures. + */ + virtual void SetRenderer(IRenderer* renderer) = 0; + /** * Gets the capabilities for this ArSession. * @return The capabilities for the current AR session. diff --git a/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h b/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h index d75d19c..799943b 100644 --- a/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h +++ b/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h @@ -33,6 +33,8 @@ namespace OpenVulkano::AR::Network [[nodiscard]] ArSessionType GetSessionType() override { return ArSessionType::NETWORK_STREAM; } [[nodiscard]] ArType GetArType() override; + + void SetRenderer(IRenderer* renderer) {} // TODO }; } diff --git a/openVulkanoCpp/AR/Provider/Playback/ArFramePlayback.cpp b/openVulkanoCpp/AR/Provider/Playback/ArFramePlayback.cpp index ec77265..c7f4807 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArFramePlayback.cpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArFramePlayback.cpp @@ -30,6 +30,7 @@ namespace OpenVulkano::AR::Playback colorImage.intrinsic = frameMetadata.intrinsic.GetForResolution({ colorImgData.cols, colorImgData.rows }); colorImage.format = ArImagePlanar::Format::RGB; colorImage.luminescenceOrColor = { colorImgData.data, { colorImgData.cols, colorImgData.rows }}; + colorImage.luminescenceOrColor.numChannels = colorImgData.channels; SetSaved(); } diff --git a/openVulkanoCpp/AR/Provider/Playback/ArPlaybackReader.cpp b/openVulkanoCpp/AR/Provider/Playback/ArPlaybackReader.cpp index 94ffce3..1ae47bd 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArPlaybackReader.cpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArPlaybackReader.cpp @@ -23,13 +23,12 @@ namespace OpenVulkano::AR::Playback tjhandle jpegDecompressor = tjInitDecompress(); tjDecompressHeader2(jpegDecompressor, compressedImage, jpegSize, &img.cols, &img.rows, &jpegSubsamp); - img.channels = 3; - img.dataPtr = std::shared_ptr(new uint8_t[img.cols * img.rows * 3]); + img.channels = 4; + img.dataPtr = std::shared_ptr(new uint8_t[img.cols * img.rows * img.channels]); img.data = img.dataPtr.get(); //TODO is it better to not map to rgb? to keep the same pipeline as on device - tjDecompress2(jpegDecompressor, compressedImage, jpegSize, img.data, img.cols, 0/*pitch*/, img.rows, TJPF_RGB, TJFLAG_FASTDCT); - //tjDecompressToYUV2(jpegDecompressor, compressedImage, jpegSize, img.data, img.cols, img.rows, 1, TJFLAG_FASTDCT); + tjDecompress2(jpegDecompressor, compressedImage, jpegSize, img.data, img.cols, 0/*pitch*/, img.rows, TJPF_RGBA, TJFLAG_FASTDCT); tjDestroy(jpegDecompressor); //auto buff = new uint8_t[img.cols * img.rows * 3]; diff --git a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp index 7ce3844..5d1792b 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp @@ -7,6 +7,7 @@ #include "ArSessionPlayback.hpp" #include "ArFramePlayback.hpp" #include "Base/Logger.hpp" +#include "Scene/Texture.hpp" #include namespace OpenVulkano::AR::Playback @@ -91,10 +92,32 @@ namespace OpenVulkano::AR::Playback Scene::Texture* ArSessionPlayback::MakeTexture(OpenVulkano::AR::ArFrame* frame) { - return nullptr; //TODO + Scene::Texture* texture; + if (!m_textureCache.empty()) + { + texture = m_textureCache.back(); + m_textureCache.pop_back(); + } + else + { + texture = new Scene::Texture(); + texture->format = DataFormat::R8G8B8A8_UNORM; + texture->updateFrequency = Scene::UpdateFrequency::Always; + } + auto img = frame->GetCameraImage(); + texture->resolution = { img.luminescenceOrColor.resolution , 1 }; + texture->textureBuffer = img.luminescenceOrColor.data; + texture->size = img.luminescenceOrColor.resolution.x * img.luminescenceOrColor.resolution.y * img.luminescenceOrColor.numChannels; + texture->updated = true; + return texture; } void ArSessionPlayback::ReturnTexture(Scene::Texture* texture) + { + m_textureCache.push_back(texture); + } + + void ArSessionPlayback::SetRenderer(IRenderer* renderer) { //TODO } diff --git a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp index e3f77eb..fa481ee 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp @@ -31,6 +31,8 @@ class ArSessionPlayback final : public ArSession, public std::enable_shared_from [[nodiscard]] ArType GetArType() override; + void SetRenderer(IRenderer* renderer); + protected: Scene::Texture * MakeTexture(OpenVulkano::AR::ArFrame *frame) override; @@ -48,5 +50,7 @@ class ArSessionPlayback final : public ArSession, public std::enable_shared_from std::atomic_bool m_frameConsumed = true; std::shared_ptr m_nextFrame; std::thread m_playbackReaderThread; + + std::vector m_textureCache; }; } diff --git a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp new file mode 100644 index 0000000..d44e3f3 --- /dev/null +++ b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp @@ -0,0 +1,64 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "ArBackgroundDrawable.hpp" +#include "AR/ArSession.hpp" +#include "AR/ArFrame.hpp" +#include "Base/Logger.hpp" + +namespace OpenVulkano::Scene +{ + ArBackgroundDrawable::ArBackgroundDrawable(const Ptr& arSession) + : Drawable(DrawEncoder::GetDrawEncoder(), DrawPhase::BACKGROUND) + , m_arSession(arSession) + { + m_shader.topology = Topology::TRIANGLE_STRIP; + m_shader.AddShaderProgram(ShaderProgramType::VERTEX, "Shader/background"); + m_shader.AddShaderProgram(ShaderProgramType::FRAGMENT, "Shader/background"); + //m_shader.AddDescriptorSetLayoutBinding(DESCRIPTOR_SET_LAYOUT_BINDING); + m_shader.AddDescriptorSetLayoutBinding(Texture::DESCRIPTOR_SET_LAYOUT_BINDING); + SetShader(&m_shader); + if (m_arSession) + m_arSession->OnNewFrame += EventHandler(this, &ArBackgroundDrawable::OnNewArFrame); + } + + void ArBackgroundDrawable::Init(const Ptr& arSession) + { + if (m_arSession) + { + if (m_arSession == arSession) return; + Close(); + } + if (!arSession) return; + m_arSession = arSession; + m_arSession->OnNewFrame += EventHandler(this, &ArBackgroundDrawable::OnNewArFrame); + } + + void ArBackgroundDrawable::Close() + { + m_arSession->OnNewFrame -= EventHandler(this, &ArBackgroundDrawable::OnNewArFrame); + m_nextFrame = nullptr; + Drawable::Close(); + } + + void ArBackgroundDrawable::OnNewArFrame(const Ptr& frame) + { + m_nextFrame = frame; + } + + void ArBackgroundDrawable::Tick() + { + m_lastFrame = nullptr; + if (m_nextFrame) + { + m_lastFrame = std::move(m_currentFrame); + m_currentFrame = std::move(m_nextFrame); + m_nextFrame = nullptr; + } + if (m_currentFrame) m_texture = m_currentFrame->GetImageTexture(); + if (!m_texture) m_texture = &Texture::PLACEHOLDER; + } +} \ No newline at end of file diff --git a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp new file mode 100644 index 0000000..206600e --- /dev/null +++ b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp @@ -0,0 +1,49 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "Base/Wrapper.hpp" +#include "Scene/Drawable.hpp" +#include "Scene/Shader/Shader.hpp" +#include "Scene/Texture.hpp" + +namespace OpenVulkano +{ + namespace AR + { + class ArSession; + class ArFrame; + } + + namespace Scene + { + class ArBackgroundDrawable final : public Drawable + { + static constexpr inline DescriptorSetLayoutBinding DESCRIPTOR_SET_LAYOUT_BINDING = { 0, DescriptorSetLayoutBinding::Type::TYPE_UNIFORM_BUFFER, 1, ShaderProgramType::ALL_GRAPHICS }; + + Shader m_shader; + Ptr m_arSession; + Ptr m_nextFrame, m_currentFrame, m_lastFrame; + const Texture* m_texture; + + void OnNewArFrame(const Ptr& frame); + + public: + ArBackgroundDrawable(const Ptr& arSession = nullptr); + + ~ArBackgroundDrawable() override { if (m_arSession) ArBackgroundDrawable::Close(); } + + void Init(const Ptr& arSession); + + void Tick(); + + void Close() override; + + const Texture* GetTexture() const { return m_texture; } + }; + } +} \ No newline at end of file diff --git a/openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp b/openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp new file mode 100644 index 0000000..5566105 --- /dev/null +++ b/openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp @@ -0,0 +1,34 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "Scene/Prefabs/ArBackgroundDrawable.hpp" +#include "VulkanGeometry.hpp" +#include "Vulkan/VulkanDrawContext.hpp" +#include "Vulkan/Scene/VulkanTexture.hpp" + +using namespace OpenVulkano::Scene; + +namespace OpenVulkano::Vulkan +{ + void EncodeArBackgroundDrawable(Drawable* instance, Vulkan::VulkanDrawContext* drawContext) + { + ArBackgroundDrawable* bgDrawable = static_cast(instance); + bgDrawable->Tick(); + const Texture* texture = bgDrawable->GetTexture(); + VulkanTexture* vkTexture = static_cast(texture->renderTexture); + if (!vkTexture) + { + vkTexture = drawContext->renderer->GetResourceManager().PrepareTexture(const_cast(texture)); + } + vkTexture->Record(drawContext, 2); + drawContext->commandBuffer.draw(4, 1, 0, 0); + } +} + +namespace +{ + void* arBgDrawableVulkanEncoderReg = DrawEncoder::RegisterVulkanEncodeFunction(&OpenVulkano::Vulkan::EncodeArBackgroundDrawable); +} \ No newline at end of file From 5b2a2bbf726671d33211b38eb278faf9e657408d Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 11:58:52 +0200 Subject: [PATCH 21/30] Fix swap chain images being in wrong state (Fixes #23) --- openVulkanoCpp/Vulkan/SwapChain.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/openVulkanoCpp/Vulkan/SwapChain.cpp b/openVulkanoCpp/Vulkan/SwapChain.cpp index 6f8f565..a86ba33 100644 --- a/openVulkanoCpp/Vulkan/SwapChain.cpp +++ b/openVulkanoCpp/Vulkan/SwapChain.cpp @@ -116,13 +116,18 @@ namespace OpenVulkano::Vulkan auto swapChainImages = device->device.getSwapchainImagesKHR(swapChain); images.resize(swapChainImages.size()); - for (uint32_t i = 0; i < swapChainImages.size(); i++) - { - images[i].image = swapChainImages[i]; - imgViewCreateInfo.image = swapChainImages[i]; - images[i].view = device->device.createImageView(imgViewCreateInfo); - images[i].fence = device->device.createFence({ vk::FenceCreateFlags(vk::FenceCreateFlagBits::eSignaled)}); - } + device->ExecuteNow([&](auto cmdBuffer) { + for (uint32_t i = 0; i < swapChainImages.size(); i++) + { + images[i].image = swapChainImages[i]; + imgViewCreateInfo.image = swapChainImages[i]; + images[i].view = device->device.createImageView(imgViewCreateInfo); + images[i].fence = device->device.createFence({vk::FenceCreateFlags(vk::FenceCreateFlagBits::eSignaled)}); + + const vk::ImageMemoryBarrier imgMemBarrier({}, vk::AccessFlagBits::eTransferWrite, vk::ImageLayout::eUndefined, vk::ImageLayout::ePresentSrcKHR, 0, 0, images[i].image, vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); + cmdBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer, {}, nullptr, nullptr, imgMemBarrier); + } + }); } void SwapChain::DestroySwapChain() From aabc24616d15e96ed7a7f7890cdd5f3cd4a6a492 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 16:53:48 +0200 Subject: [PATCH 22/30] Add handling for camera intrinsics --- openVulkanoCpp/Math/CameraIntrinsic.hpp | 2 +- .../Scene/Prefabs/ArBackgroundDrawable.cpp | 13 +- .../Scene/Prefabs/ArBackgroundDrawable.hpp | 6 +- openVulkanoCpp/Scene/UniformBuffer.hpp | 35 ++ openVulkanoCpp/Shader/Shaders.c | 436 ++++++++++-------- openVulkanoCpp/Shader/Shaders.h | 2 +- openVulkanoCpp/Shader/background.frag | 2 +- openVulkanoCpp/Shader/background.vert | 19 +- openVulkanoCpp/Vulkan/Image.cpp | 2 +- openVulkanoCpp/Vulkan/Image.hpp | 2 +- .../Vulkan/Resources/ManagedResource.hpp | 2 +- .../Vulkan/Resources/ResourceManager.cpp | 48 +- .../Vulkan/Resources/ResourceManager.hpp | 6 +- .../Vulkan/Resources/UniformBuffer.cpp | 2 +- .../Vulkan/Resources/UniformBuffer.hpp | 2 +- .../ArBackgroundDrawableVulkanEncoder.cpp | 9 +- openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp | 4 +- .../Vulkan/Scene/VulkanUniformBuffer.hpp | 68 +++ 18 files changed, 447 insertions(+), 213 deletions(-) create mode 100644 openVulkanoCpp/Scene/UniformBuffer.hpp create mode 100644 openVulkanoCpp/Vulkan/Scene/VulkanUniformBuffer.hpp diff --git a/openVulkanoCpp/Math/CameraIntrinsic.hpp b/openVulkanoCpp/Math/CameraIntrinsic.hpp index 2661924..2d62c20 100644 --- a/openVulkanoCpp/Math/CameraIntrinsic.hpp +++ b/openVulkanoCpp/Math/CameraIntrinsic.hpp @@ -13,7 +13,7 @@ namespace OpenVulkano::Math class CameraIntrinsic { public: - Math::Matrix3f cameraMatrix; + Math::Matrix3f_SIMD cameraMatrix; CameraIntrinsic() : CameraIntrinsic(Math::Matrix3f(0)) {} diff --git a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp index d44e3f3..6268abc 100644 --- a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp +++ b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.cpp @@ -11,6 +11,11 @@ namespace OpenVulkano::Scene { + namespace + { + const Math::CameraIntrinsicWithResolution FALLBACK_INTRINSICS; + } + ArBackgroundDrawable::ArBackgroundDrawable(const Ptr& arSession) : Drawable(DrawEncoder::GetDrawEncoder(), DrawPhase::BACKGROUND) , m_arSession(arSession) @@ -18,9 +23,11 @@ namespace OpenVulkano::Scene m_shader.topology = Topology::TRIANGLE_STRIP; m_shader.AddShaderProgram(ShaderProgramType::VERTEX, "Shader/background"); m_shader.AddShaderProgram(ShaderProgramType::FRAGMENT, "Shader/background"); - //m_shader.AddDescriptorSetLayoutBinding(DESCRIPTOR_SET_LAYOUT_BINDING); + m_shader.AddDescriptorSetLayoutBinding(UniformBuffer::DESCRIPTOR_SET_LAYOUT_BINDING); m_shader.AddDescriptorSetLayoutBinding(Texture::DESCRIPTOR_SET_LAYOUT_BINDING); SetShader(&m_shader); + m_intrinsicsBuffer.Init(sizeof(Math::CameraIntrinsicWithResolution), &FALLBACK_INTRINSICS); + m_intrinsicsBuffer.updateFrequency = UpdateFrequency::Always; if (m_arSession) m_arSession->OnNewFrame += EventHandler(this, &ArBackgroundDrawable::OnNewArFrame); } @@ -57,8 +64,10 @@ namespace OpenVulkano::Scene m_lastFrame = std::move(m_currentFrame); m_currentFrame = std::move(m_nextFrame); m_nextFrame = nullptr; + m_texture = m_currentFrame->GetImageTexture(); + m_intrinsicsBuffer.data = &m_currentFrame->GetFrameMetadata().intrinsic; + m_intrinsicsBuffer.updated = true; } - if (m_currentFrame) m_texture = m_currentFrame->GetImageTexture(); if (!m_texture) m_texture = &Texture::PLACEHOLDER; } } \ No newline at end of file diff --git a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp index 206600e..6dda25b 100644 --- a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp +++ b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp @@ -10,6 +10,7 @@ #include "Scene/Drawable.hpp" #include "Scene/Shader/Shader.hpp" #include "Scene/Texture.hpp" +#include "Scene/UniformBuffer.hpp" namespace OpenVulkano { @@ -23,9 +24,8 @@ namespace OpenVulkano { class ArBackgroundDrawable final : public Drawable { - static constexpr inline DescriptorSetLayoutBinding DESCRIPTOR_SET_LAYOUT_BINDING = { 0, DescriptorSetLayoutBinding::Type::TYPE_UNIFORM_BUFFER, 1, ShaderProgramType::ALL_GRAPHICS }; - Shader m_shader; + UniformBuffer m_intrinsicsBuffer; Ptr m_arSession; Ptr m_nextFrame, m_currentFrame, m_lastFrame; const Texture* m_texture; @@ -44,6 +44,8 @@ namespace OpenVulkano void Close() override; const Texture* GetTexture() const { return m_texture; } + + UniformBuffer& GetBuffer() { return m_intrinsicsBuffer; } }; } } \ No newline at end of file diff --git a/openVulkanoCpp/Scene/UniformBuffer.hpp b/openVulkanoCpp/Scene/UniformBuffer.hpp new file mode 100644 index 0000000..06cf9ef --- /dev/null +++ b/openVulkanoCpp/Scene/UniformBuffer.hpp @@ -0,0 +1,35 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "Base/ICloseable.hpp" + +namespace OpenVulkano::Scene +{ + class UniformBuffer + { + public: + static constexpr inline DescriptorSetLayoutBinding DESCRIPTOR_SET_LAYOUT_BINDING = { 0, DescriptorSetLayoutBinding::Type::TYPE_UNIFORM_BUFFER, 1, ShaderProgramType::ALL_GRAPHICS }; + + DescriptorSetLayoutBinding binding; + uint32_t setId = 2; + ICloseable* renderBuffer = nullptr; + size_t size = 0; + const void* data = nullptr; + UpdateFrequency updateFrequency = UpdateFrequency::Never; + bool updated = true; + + void Init(size_t size, const void* data, const DescriptorSetLayoutBinding& binding = DESCRIPTOR_SET_LAYOUT_BINDING) + { + this->size = size; + this->data = data; + this->binding = binding; + } + + UpdateFrequency GetUpdateFrequency() const { return updateFrequency; } + }; +} \ No newline at end of file diff --git a/openVulkanoCpp/Shader/Shaders.c b/openVulkanoCpp/Shader/Shaders.c index 6437ff2..6bd1c66 100644 --- a/openVulkanoCpp/Shader/Shaders.c +++ b/openVulkanoCpp/Shader/Shaders.c @@ -28,7 +28,7 @@ const unsigned char background_frag_spv[1076] = { 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x66, 0x61, 0x72, 0x00, 0x05, 0x00, 0x03, 0x00, 0x17, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, @@ -76,209 +76,269 @@ const unsigned char background_frag_spv[1076] = { }; /* Contents of file background.vert.spv */ -const long int background_vert_spv_size = 3220; -const unsigned char background_vert_spv[3220] = { - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x62, 0x00, 0x00, 0x00, +const long int background_vert_spv_size = 4180; +const unsigned char background_vert_spv[4180] = { + 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0B, 0x00, 0x08, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, - 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00, 0x47, 0x4C, 0x5F, 0x41, 0x52, 0x42, 0x5F, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5F, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5F, 0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, 0x46, 0x6F, 0x76, 0x00, - 0x05, 0x00, 0x05, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, 0x53, 0x63, 0x61, 0x6C, - 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x12, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, - 0x41, 0x73, 0x70, 0x65, 0x63, 0x74, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x16, 0x00, 0x00, 0x00, - 0x70, 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, - 0x24, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6E, 0x64, - 0x65, 0x78, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x27, 0x00, 0x00, 0x00, 0x69, 0x6E, 0x64, 0x65, - 0x78, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x2B, 0x00, 0x00, 0x00, - 0x73, 0x63, 0x61, 0x6C, 0x65, 0x58, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x43, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6F, 0x6A, - 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x70, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, - 0x6F, 0x6E, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x63, 0x61, 0x6D, 0x50, 0x6F, 0x73, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x6E, 0x65, 0x61, 0x72, 0x50, 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x66, 0x61, 0x72, 0x50, - 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x77, 0x69, 0x64, 0x74, 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, - 0x06, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x66, 0x6F, 0x76, 0x00, - 0x06, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x61, 0x73, 0x70, 0x65, - 0x63, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, - 0x73, 0x63, 0x61, 0x6C, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x00, 0x06, 0x00, 0x08, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x70, 0x69, 0x78, 0x65, 0x6C, 0x53, 0x63, 0x61, - 0x6C, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, - 0x30, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, 0x05, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, - 0x73, 0x63, 0x61, 0x6C, 0x65, 0x59, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x70, 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x17, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x56, + 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6E, 0x64, 0x65, 0x78, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x1A, 0x00, 0x00, 0x00, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x77, 0x69, 0x64, 0x74, 0x68, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, 0x00, 0x52, 0x65, 0x61, 0x6C, 0x43, 0x61, 0x6D, 0x65, + 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x69, 0x6E, 0x74, 0x72, 0x69, 0x6E, 0x73, 0x69, 0x63, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x72, 0x65, 0x61, 0x6C, 0x43, 0x61, 0x6D, 0x00, 0x05, 0x00, 0x05, 0x00, 0x29, 0x00, 0x00, 0x00, + 0x72, 0x65, 0x61, 0x6C, 0x53, 0x63, 0x61, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, + 0x31, 0x00, 0x00, 0x00, 0x72, 0x65, 0x61, 0x6C, 0x41, 0x73, 0x70, 0x65, 0x63, 0x74, 0x00, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x58, 0x00, 0x00, + 0x05, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x43, 0x61, 0x6D, 0x65, 0x72, 0x61, 0x44, 0x61, + 0x74, 0x61, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x70, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x50, 0x6F, 0x73, 0x00, 0x00, + 0x06, 0x00, 0x06, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6E, 0x65, 0x61, 0x72, + 0x50, 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x66, 0x61, 0x72, 0x50, 0x6C, 0x61, 0x6E, 0x65, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x66, 0x6F, 0x76, 0x00, 0x06, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x09, 0x00, 0x00, 0x00, 0x61, 0x73, 0x70, 0x65, 0x63, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x46, 0x61, 0x63, + 0x74, 0x6F, 0x72, 0x00, 0x06, 0x00, 0x08, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x70, 0x69, 0x78, 0x65, 0x6C, 0x53, 0x63, 0x61, 0x6C, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x63, 0x61, 0x6D, 0x00, + 0x05, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65, 0x59, 0x00, 0x00, + 0x05, 0x00, 0x06, 0x00, 0x57, 0x00, 0x00, 0x00, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x4F, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x65, 0x72, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x06, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, - 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x06, 0x00, 0x07, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, + 0x6F, 0x73, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x06, 0x00, 0x07, 0x00, 0x71, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x50, 0x6F, 0x69, 0x6E, 0x74, 0x53, 0x69, 0x7A, 0x65, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x71, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x6C, 0x69, 0x70, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, - 0x06, 0x00, 0x07, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, + 0x06, 0x00, 0x07, 0x00, 0x71, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x43, 0x75, 0x6C, 0x6C, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x05, 0x00, 0x03, 0x00, - 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x54, 0x00, 0x00, 0x00, + 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x78, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6F, 0x6F, 0x72, 0x64, 0x69, 0x6E, 0x61, 0x74, - 0x65, 0x73, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x69, 0x6E, 0x64, 0x65, - 0x78, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, - 0x0B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, + 0x65, 0x73, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x82, 0x00, 0x00, 0x00, 0x69, 0x6E, 0x64, 0x65, + 0x78, 0x61, 0x62, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0xC0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x23, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xD4, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0xDC, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x23, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x2E, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, - 0xEC, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x04, 0x00, 0x30, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, - 0x4C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x47, 0x00, 0x03, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, - 0x54, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0xE1, 0x7A, 0x24, 0x42, 0x3B, 0x00, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3B, 0x00, 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xAB, 0xAA, 0xAA, 0x3F, 0x17, 0x00, 0x04, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, - 0x15, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, - 0x17, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, - 0x19, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF, 0x2B, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x3F, 0x2C, 0x00, 0x07, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, - 0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x1E, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, - 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, - 0x1A, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, - 0x2C, 0x00, 0x07, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, - 0x1A, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, - 0x19, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, - 0x1F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, - 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2A, 0x00, 0x00, 0x00, - 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x2D, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x2D, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0xD0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0xD4, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, + 0xE0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x0A, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x3B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xEC, 0x00, 0x00, 0x00, + 0x47, 0x00, 0x03, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x3D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, + 0x3D, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, + 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x05, 0x00, 0x71, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x71, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x71, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, + 0x71, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x78, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x0B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xBF, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x3F, 0x2C, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x2C, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2C, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x3A, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x3A, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x1C, 0x00, 0x04, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, - 0x1E, 0x00, 0x06, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x4B, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4D, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x4D, 0x00, 0x00, 0x00, - 0x4E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, - 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, - 0x54, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, - 0x2C, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, - 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, - 0x56, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x55, 0x00, 0x00, 0x00, - 0x5B, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, - 0x5A, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x55, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x04, 0x00, 0x58, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, + 0x1C, 0x00, 0x04, 0x00, 0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x06, 0x00, 0x71, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x72, 0x00, 0x00, 0x00, + 0x73, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x75, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, + 0x4C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x7A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x7B, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, + 0x4C, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, + 0x2C, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, + 0x7A, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x07, 0x00, 0x79, 0x00, 0x00, 0x00, + 0x7F, 0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00, + 0x7E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x79, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x04, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, - 0x0C, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x0B, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x0F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, - 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x22, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, - 0x27, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, - 0x28, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, - 0x16, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, - 0x2C, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x32, 0x00, 0x00, 0x00, - 0x33, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0x32, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, - 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, - 0x3A, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, - 0x3B, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x36, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, - 0x2B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x36, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x42, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x43, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, - 0x43, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x2A, 0x00, 0x00, 0x00, - 0x46, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x46, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0x2A, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, - 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x49, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, - 0x41, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, - 0x4F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x52, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, - 0x5F, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, - 0x3D, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, - 0x3E, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3B, 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, + 0x6F, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, + 0x2C, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, + 0x2A, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x2E, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x2F, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x29, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x32, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x34, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x31, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x2C, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, + 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x38, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, + 0x43, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, + 0x44, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, + 0x31, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x49, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x42, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x4A, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x4B, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x4D, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, + 0x4C, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x1D, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x53, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x54, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x58, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x1F, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, + 0x4C, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x25, 0x00, 0x00, 0x00, + 0x5C, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x25, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x6F, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, + 0x5B, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x57, 0x00, 0x00, 0x00, + 0x63, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, + 0x57, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x67, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, + 0x57, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x68, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x69, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00, 0x4C, 0x00, 0x00, 0x00, + 0x6A, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, + 0x6A, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1D, 0x00, 0x00, 0x00, + 0x6C, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x1D, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x05, 0x00, 0x75, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, + 0x2A, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x76, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x82, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, + 0x56, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x3D, 0x00, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, + 0x3E, 0x00, 0x03, 0x00, 0x78, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00 }; @@ -1175,7 +1235,7 @@ const unsigned char grid_vert_spv[3340] = { const TFileTableEntry fileTable[] = { {"background.frag.spv", background_frag_spv, 1076}, - {"background.vert.spv", background_vert_spv, 3220}, + {"background.vert.spv", background_vert_spv, 4180}, {"basic.frag.spv", basic_frag_spv, 376}, {"basicTexture.frag.spv", basicTexture_frag_spv, 668}, {"basic.vert.spv", basic_vert_spv, 2972}, diff --git a/openVulkanoCpp/Shader/Shaders.h b/openVulkanoCpp/Shader/Shaders.h index cf54487..a2e1722 100644 --- a/openVulkanoCpp/Shader/Shaders.h +++ b/openVulkanoCpp/Shader/Shaders.h @@ -8,7 +8,7 @@ extern const unsigned char background_frag_spv[1076]; /* Contents of file background.vert.spv */ extern const long int background_vert_spv_size; -extern const unsigned char background_vert_spv[3220]; +extern const unsigned char background_vert_spv[4180]; /* Contents of file basic.frag.spv */ extern const long int basic_frag_spv_size; diff --git a/openVulkanoCpp/Shader/background.frag b/openVulkanoCpp/Shader/background.frag index bd67a6b..a1025c7 100644 --- a/openVulkanoCpp/Shader/background.frag +++ b/openVulkanoCpp/Shader/background.frag @@ -1,6 +1,6 @@ #version 450 -layout (set = 2, binding = 0) uniform sampler2D camTexture; +layout (set = 3, binding = 0) uniform sampler2D camTexture; #ifdef ENABLE_DEPTH_WRITE layout (set = 2, binding = 1) uniform sampler2D depthMap; diff --git a/openVulkanoCpp/Shader/background.vert b/openVulkanoCpp/Shader/background.vert index 9381eb4..f0b9ff2 100644 --- a/openVulkanoCpp/Shader/background.vert +++ b/openVulkanoCpp/Shader/background.vert @@ -17,6 +17,13 @@ layout(set = 1, binding = 0) uniform CameraData float pixelScaleFactor; } cam; +layout(set = 2, binding = 0) uniform RealCameraData +{ + mat3 intrinsic; + int width; + int height; +} realCam; + layout(location = 0) out vec2 textureCoordinates; const float FLOAT_MAX_LESS_THAN_1 = 0.999999940395355224609; @@ -28,20 +35,24 @@ const vec2 TEX_COORDS[4] = vec2[] ( vec2(1, 0), vec2(0, 0), vec2(1, 1), vec2(0, 1) ); -float realFov = 53; //TODO -float realScale = tan(radians(realFov * 0.5)) * 2; -float realAspect = 1.33333333; - void main() { vec4 position = PLANE[gl_VertexIndex]; // Calculate the scaling factors for width and height + float width = realCam.width; + float realScale = realCam.intrinsic[0][0] / width; + float realAspect = width / realCam.height; float scaleX = realScale / cam.scaleFactor; float scaleY = cam.aspect / realAspect * scaleX; // Scale the quad's position position.xy *= vec2(scaleX, scaleY); + // Handle center + vec2 centerOffset = realCam.intrinsic[2].xy / vec2(realCam.width, realCam.height); + centerOffset -= 0.5; + position.xy += centerOffset; + gl_Position = position; textureCoordinates = TEX_COORDS[gl_VertexIndex]; } diff --git a/openVulkanoCpp/Vulkan/Image.cpp b/openVulkanoCpp/Vulkan/Image.cpp index b1f7172..c7b5985 100644 --- a/openVulkanoCpp/Vulkan/Image.cpp +++ b/openVulkanoCpp/Vulkan/Image.cpp @@ -27,7 +27,7 @@ namespace OpenVulkano::Vulkan view = device->device.createImageView(imageViewCreateInfo); } - void Image::SetLayout(vk::CommandBuffer& cmdBuffer, vk::ImageSubresourceRange subResourceRange, vk::ImageLayout newLayout, vk::ImageLayout oldLayout) const + void Image::SetLayout(vk::CommandBuffer& cmdBuffer, const vk::ImageSubresourceRange& subResourceRange, vk::ImageLayout newLayout, vk::ImageLayout oldLayout) const { const vk::ImageMemoryBarrier imgMemBarrier(VulkanUtils::GetAccessFlagsForLayout(oldLayout), VulkanUtils::GetAccessFlagsForLayout(newLayout), oldLayout, newLayout, 0, 0, image, subResourceRange); diff --git a/openVulkanoCpp/Vulkan/Image.hpp b/openVulkanoCpp/Vulkan/Image.hpp index e65fe1e..efc24e8 100644 --- a/openVulkanoCpp/Vulkan/Image.hpp +++ b/openVulkanoCpp/Vulkan/Image.hpp @@ -41,7 +41,7 @@ namespace OpenVulkano::Vulkan void Init(const Device* device, const DataFormat format, const vk::Extent3D& resolution); - void SetLayout(vk::CommandBuffer& cmdBuffer, vk::ImageSubresourceRange subResourceRange, vk::ImageLayout newLayout, vk::ImageLayout oldLayout = vk::ImageLayout::eUndefined) const; + void SetLayout(vk::CommandBuffer& cmdBuffer, const vk::ImageSubresourceRange& subResourceRange, vk::ImageLayout newLayout, vk::ImageLayout oldLayout = vk::ImageLayout::eUndefined) const; void SetLayout(vk::CommandBuffer& cmdBuffer, vk::ImageAspectFlags aspectMask, vk::ImageLayout newLayout, vk::ImageLayout oldLayout = vk::ImageLayout::eUndefined) const { diff --git a/openVulkanoCpp/Vulkan/Resources/ManagedResource.hpp b/openVulkanoCpp/Vulkan/Resources/ManagedResource.hpp index 3bb41d4..1142614 100644 --- a/openVulkanoCpp/Vulkan/Resources/ManagedResource.hpp +++ b/openVulkanoCpp/Vulkan/Resources/ManagedResource.hpp @@ -185,7 +185,7 @@ namespace OpenVulkano::Vulkan } } - void Copy(void* data, uint32_t size, uint32_t offset) + void Copy(const void* data, uint32_t size, uint32_t offset) { if(mapped) memcpy(static_cast(mapped) + offset, data, size); else diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp index 95dfe80..3e50a4b 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp @@ -8,14 +8,16 @@ #include "Scene/Vertex.hpp" #include "Scene/Geometry.hpp" #include "Scene/Material.hpp" +#include "Scene/UniformBuffer.hpp" #include "Math/ByteSize.hpp" #include "Vulkan/Context.hpp" +#include "Vulkan/Image.hpp" #include "Vulkan/Scene/VulkanShader.hpp" #include "Vulkan/Scene/VulkanGeometry.hpp" #include "Vulkan/Scene/VulkanNode.hpp" #include "Vulkan/Scene/VulkanTexture.hpp" -#include "Vulkan/Image.hpp" #include "Vulkan/Scene/VulkanCamera.hpp" +#include "Vulkan/Scene/VulkanUniformBuffer.hpp" namespace OpenVulkano::Vulkan { @@ -287,10 +289,12 @@ namespace OpenVulkano::Vulkan ManagedBuffer* uploadBuffer = CreateBuffer(size, vk::BufferUsageFlagBits::eTransferSrc, vk::MemoryPropertyFlagBits::eHostCoherent | vk::MemoryPropertyFlagBits::eHostVisible); uploadBuffer->Copy(data, size, 0); + image->SetLayout(cmdBuffers[currentBuffer], vk::ImageAspectFlagBits::eColor, vk::ImageLayout::eTransferDstOptimal); + vk::BufferImageCopy region(0, 0, 0, { vk::ImageAspectFlagBits::eColor, 0, 0, 1 }, { 0, 0, 0 }, image->extent); cmdBuffers[currentBuffer].copyBufferToImage(uploadBuffer->buffer, image->image, vk::ImageLayout::eTransferDstOptimal, 1, ®ion); - vk::ImageMemoryBarrier barrier {}; + /*vk::ImageMemoryBarrier barrier {}; barrier.oldLayout = vk::ImageLayout::eUndefined; barrier.newLayout = vk::ImageLayout::eShaderReadOnlyOptimal; barrier.image = image->image; @@ -300,15 +304,17 @@ namespace OpenVulkano::Vulkan barrier.subresourceRange.baseArrayLayer = 0; barrier.subresourceRange.layerCount = 1; barrier.setSrcAccessMask({}); - barrier.setDstAccessMask(vk::AccessFlagBits::eTransferWrite); + barrier.setDstAccessMask(vk::AccessFlagBits::eTransferWrite);*/ + + image->SetLayout(cmdBuffers[currentBuffer], vk::ImageAspectFlagBits::eColor, vk::ImageLayout::eShaderReadOnlyOptimal, vk::ImageLayout::eTransferDstOptimal); // TODO set access masks for mip and array layers - cmdBuffers[currentBuffer].pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer, {}, 0, nullptr, 0, nullptr, 1, &barrier ); + //cmdBuffers[currentBuffer].pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer, {}, 0, nullptr, 0, nullptr, 1, &barrier ); FreeBuffer(uploadBuffer); } - ManagedBuffer* ResourceManager::CreateDeviceOnlyBufferWithData(vk::DeviceSize size, vk::BufferUsageFlagBits usage, void* data) + ManagedBuffer* ResourceManager::CreateDeviceOnlyBufferWithData(vk::DeviceSize size, vk::BufferUsageFlagBits usage, const void* data) { ManagedBuffer* target = CreateBuffer(size, usage | vk::BufferUsageFlagBits::eTransferDst, vk::MemoryPropertyFlagBits::eDeviceLocal); ManagedBuffer* uploadBuffer = CreateBuffer(size, vk::BufferUsageFlagBits::eTransferSrc, vk::MemoryPropertyFlagBits::eHostCoherent | vk::MemoryPropertyFlagBits::eHostVisible); @@ -389,4 +395,36 @@ namespace OpenVulkano::Vulkan return vkTexture; } + + VulkanUniformBuffer* ResourceManager::PrepareUniformBuffer(Scene::UniformBuffer* buffer) + { + const std::unique_lock lock(mutex); + if (buffer->renderBuffer) return static_cast(buffer->renderBuffer); + + VulkanUniformBuffer* vkBuffer; + ManagedBuffer* mBuffer; + const vk::DeviceSize allocSize = Utils::Align(buffer->size, uniformBufferAlignment); + vk::DeviceSize frameSize = 0; + if (buffer->GetUpdateFrequency() != Scene::UpdateFrequency::Never) + { + frameSize = allocSize; + vkBuffer = new VulkanUniformBufferDynamic(); + const uint32_t imgs = context->swapChain.GetImageCount(); + mBuffer = CreateBuffer(imgs * allocSize, vk::BufferUsageFlagBits::eUniformBuffer, vk::MemoryPropertyFlagBits::eHostCoherent | vk::MemoryPropertyFlagBits::eHostVisible); + mBuffer->Map(); + } + else + { + vkBuffer = new VulkanUniformBuffer(); + mBuffer = CreateDeviceOnlyBufferWithData(Scene::Node::SIZE, vk::BufferUsageFlagBits::eUniformBuffer, buffer->data); + buffer->updated = false; + } + + + UniformBuffer* uBuffer = new UniformBuffer(); + uBuffer->Init(mBuffer, 0, mBuffer->size, GetDescriptorLayoutSet(buffer->binding), buffer->binding, buffer->setId); + + vkBuffer->Init(buffer, uBuffer); + return vkBuffer; + } } diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp index 1b7ce9d..8b2852f 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp @@ -26,6 +26,7 @@ namespace OpenVulkano class Material; class Texture; class Shader; + class UniformBuffer; } namespace Vulkan @@ -35,6 +36,7 @@ namespace OpenVulkano class VulkanTexture; class VulkanCamera; class VulkanNode; + class VulkanUniformBuffer; class UniformBuffer; class ResourceManager : public ICloseable, public IShaderOwner @@ -84,6 +86,8 @@ namespace OpenVulkano void PrepareMaterial(Scene::Material* material); + VulkanUniformBuffer* PrepareUniformBuffer(Scene::UniformBuffer* buffer); + VulkanNode* PrepareNode(Scene::Node* node); VulkanTexture* PrepareTexture(Scene::Texture* texture); @@ -109,7 +113,7 @@ namespace OpenVulkano void FreeBuffers(); - ManagedBuffer* CreateDeviceOnlyBufferWithData(vk::DeviceSize size, vk::BufferUsageFlagBits usage, void* data); + ManagedBuffer* CreateDeviceOnlyBufferWithData(vk::DeviceSize size, vk::BufferUsageFlagBits usage, const void* data); inline void RecordCopy(vk::Buffer src, vk::Buffer dest, vk::DeviceSize size) const { diff --git a/openVulkanoCpp/Vulkan/Resources/UniformBuffer.cpp b/openVulkanoCpp/Vulkan/Resources/UniformBuffer.cpp index 4246d55..4255f96 100644 --- a/openVulkanoCpp/Vulkan/Resources/UniformBuffer.cpp +++ b/openVulkanoCpp/Vulkan/Resources/UniformBuffer.cpp @@ -40,7 +40,7 @@ namespace OpenVulkano::Vulkan drawContext->commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, drawContext->GetShader()->pipelineLayout, m_setOffset, m_setCount, &m_descriptorSet, (m_dynamic) ? 1 : 0, &frameOffset); } - void UniformBuffer::Update(void* data, uint32_t size, uint32_t bufferId) const + void UniformBuffer::Update(const void* data, uint32_t size, uint32_t bufferId) const { m_buffer->Copy(data, size, m_frameOffset * bufferId); } diff --git a/openVulkanoCpp/Vulkan/Resources/UniformBuffer.hpp b/openVulkanoCpp/Vulkan/Resources/UniformBuffer.hpp index 1f8d8a2..37528c0 100644 --- a/openVulkanoCpp/Vulkan/Resources/UniformBuffer.hpp +++ b/openVulkanoCpp/Vulkan/Resources/UniformBuffer.hpp @@ -33,6 +33,6 @@ namespace OpenVulkano::Vulkan void Record(VulkanDrawContext* drawContext) override; - void Update(void* data, uint32_t size, uint32_t bufferId) const; + void Update(const void* data, uint32_t size, uint32_t bufferId) const; }; } diff --git a/openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp b/openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp index 5566105..eec522c 100644 --- a/openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp +++ b/openVulkanoCpp/Vulkan/Scene/ArBackgroundDrawableVulkanEncoder.cpp @@ -8,6 +8,7 @@ #include "VulkanGeometry.hpp" #include "Vulkan/VulkanDrawContext.hpp" #include "Vulkan/Scene/VulkanTexture.hpp" +#include "Vulkan/Scene/VulkanUniformBuffer.hpp" using namespace OpenVulkano::Scene; @@ -23,7 +24,13 @@ namespace OpenVulkano::Vulkan { vkTexture = drawContext->renderer->GetResourceManager().PrepareTexture(const_cast(texture)); } - vkTexture->Record(drawContext, 2); + VulkanUniformBuffer* vkBuffer = static_cast(bgDrawable->GetBuffer().renderBuffer); + if (!vkBuffer) + { + vkBuffer = drawContext->renderer->GetResourceManager().PrepareUniformBuffer(&bgDrawable->GetBuffer()); + } + vkBuffer->Record(drawContext); + vkTexture->Record(drawContext, 3); drawContext->commandBuffer.draw(4, 1, 0, 0); } } diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp index 73028ba..020c304 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanNode.hpp @@ -46,12 +46,12 @@ namespace OpenVulkano::Vulkan struct VulkanNodeDynamic : VulkanNode { - uint32_t lastUpdate = -1; + //uint32_t lastUpdate = -1; void Init(Scene::Node* node, UniformBuffer* uniformBuffer) override { VulkanNode::Init(node, uniformBuffer); - lastUpdate = -1; + //lastUpdate = -1; } void Record(VulkanDrawContext* context) override diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanUniformBuffer.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanUniformBuffer.hpp new file mode 100644 index 0000000..f7dd260 --- /dev/null +++ b/openVulkanoCpp/Vulkan/Scene/VulkanUniformBuffer.hpp @@ -0,0 +1,68 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "Base/ICloseable.hpp" +#include "IRecordable.hpp" +#include "Scene/UniformBuffer.hpp" +#include "Vulkan/Resources/UniformBuffer.hpp" + +namespace OpenVulkano::Vulkan +{ + class VulkanUniformBuffer : public IRecordable, public ICloseable + { + public: + Scene::UniformBuffer* uBuffer = nullptr; + UniformBuffer* buffer = nullptr; + + ~VulkanUniformBuffer() override + { + if (uBuffer) VulkanUniformBuffer::Close(); + } + + virtual void Init(Scene::UniformBuffer* uBuffer, UniformBuffer* uniformBuffer) + { + this->uBuffer = uBuffer; + this->buffer = uniformBuffer; + uBuffer->renderBuffer = this; + } + + void Record(VulkanDrawContext* context) override + { + buffer->Record(context); + } + + void Close() override + { + if (uBuffer) uBuffer->renderBuffer = nullptr; + delete buffer; + uBuffer = nullptr; + buffer = nullptr; + } + }; + + struct VulkanUniformBufferDynamic : VulkanUniformBuffer + { + uint32_t lastUpdate = 0; + + void Init(Scene::UniformBuffer* buffer, UniformBuffer* uniformBuffer) override + { + VulkanUniformBuffer::Init(buffer, uniformBuffer); + lastUpdate = -1; + } + + void Record(VulkanDrawContext* context) override + { + if(uBuffer->updated) //TODO fix + { + //uBuffer->updated = false; + buffer->Update(uBuffer->data, uBuffer->size, context->currentImageId); + } + buffer->Record(context); + } + }; +} From f947204ae283c7ccfd71abe2694de2007407f35a Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 23:50:33 +0200 Subject: [PATCH 23/30] Move DataFormat to vk Format conversion to cast operator --- openVulkanoCpp/Scene/DataFormat.hpp | 10 ++++++++++ openVulkanoCpp/Vulkan/Image.cpp | 6 ++---- openVulkanoCpp/Vulkan/Image.hpp | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openVulkanoCpp/Scene/DataFormat.hpp b/openVulkanoCpp/Scene/DataFormat.hpp index e33f466..2e3a4f1 100644 --- a/openVulkanoCpp/Scene/DataFormat.hpp +++ b/openVulkanoCpp/Scene/DataFormat.hpp @@ -9,6 +9,11 @@ #include #include +namespace vk +{ + enum class Format; +} + namespace OpenVulkano { class DataFormat @@ -361,6 +366,11 @@ namespace OpenVulkano return m_format; } + [[nodiscard]] operator const vk::Format&() const + { + return reinterpret_cast(m_format); + } + static DataFormat GetFromName(std::string_view name); private: Format m_format; diff --git a/openVulkanoCpp/Vulkan/Image.cpp b/openVulkanoCpp/Vulkan/Image.cpp index c7b5985..544af49 100644 --- a/openVulkanoCpp/Vulkan/Image.cpp +++ b/openVulkanoCpp/Vulkan/Image.cpp @@ -35,11 +35,9 @@ namespace OpenVulkano::Vulkan {}, nullptr, nullptr, imgMemBarrier); } - void Image::Init(const Device* device, const DataFormat format, const vk::Extent3D& resolution) + void Image::Init(const Device* device, const DataFormat& format, const vk::Extent3D& resolution) { - this->device = device->device; - - vk::ImageCreateInfo imgCreateInfo { {}, vk::ImageType::e2D, reinterpret_cast(format), resolution, 1, 1 }; + vk::ImageCreateInfo imgCreateInfo { {}, vk::ImageType::e2D, format, resolution, 1, 1 }; imgCreateInfo.usage = vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled; imgCreateInfo.tiling = vk::ImageTiling::eOptimal; diff --git a/openVulkanoCpp/Vulkan/Image.hpp b/openVulkanoCpp/Vulkan/Image.hpp index efc24e8..0b10a24 100644 --- a/openVulkanoCpp/Vulkan/Image.hpp +++ b/openVulkanoCpp/Vulkan/Image.hpp @@ -39,7 +39,7 @@ namespace OpenVulkano::Vulkan */ void Init(const Device* device, const vk::ImageCreateInfo& imageCreateInfo, vk::ImageViewCreateInfo imageViewCreateInfo, const vk::MemoryPropertyFlags& memoryPropertyFlags = vk::MemoryPropertyFlagBits::eDeviceLocal); - void Init(const Device* device, const DataFormat format, const vk::Extent3D& resolution); + void Init(const Device* device, const DataFormat& format, const vk::Extent3D& resolution); void SetLayout(vk::CommandBuffer& cmdBuffer, const vk::ImageSubresourceRange& subResourceRange, vk::ImageLayout newLayout, vk::ImageLayout oldLayout = vk::ImageLayout::eUndefined) const; From 92b77e46f57487ec07f5fbf1993bebf242a2c2a9 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sun, 7 Jul 2024 23:51:09 +0200 Subject: [PATCH 24/30] Fix set layout to be used from transfer queue --- openVulkanoCpp/Vulkan/Image.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openVulkanoCpp/Vulkan/Image.cpp b/openVulkanoCpp/Vulkan/Image.cpp index 544af49..22c024d 100644 --- a/openVulkanoCpp/Vulkan/Image.cpp +++ b/openVulkanoCpp/Vulkan/Image.cpp @@ -8,7 +8,6 @@ namespace OpenVulkano::Vulkan { - void Image::Init(const Device* device, const vk::ImageCreateInfo& imageCreateInfo, vk::ImageViewCreateInfo imageViewCreateInfo, const vk::MemoryPropertyFlags& memoryPropertyFlags) { this->device = device->device; @@ -29,10 +28,8 @@ namespace OpenVulkano::Vulkan void Image::SetLayout(vk::CommandBuffer& cmdBuffer, const vk::ImageSubresourceRange& subResourceRange, vk::ImageLayout newLayout, vk::ImageLayout oldLayout) const { - const vk::ImageMemoryBarrier imgMemBarrier(VulkanUtils::GetAccessFlagsForLayout(oldLayout), VulkanUtils::GetAccessFlagsForLayout(newLayout), oldLayout, - newLayout, 0, 0, image, subResourceRange); - cmdBuffer.pipelineBarrier(VulkanUtils::GetPipelineStageForLayout(oldLayout), VulkanUtils::GetPipelineStageForLayout(newLayout), - {}, nullptr, nullptr, imgMemBarrier); + const vk::ImageMemoryBarrier imgMemBarrier(/*VulkanUtils::GetAccessFlagsForLayout(oldLayout)*/{}, /*VulkanUtils::GetAccessFlagsForLayout(newLayout)*/vk::AccessFlagBits::eTransferWrite, oldLayout, newLayout, 0, 0, image, subResourceRange); + cmdBuffer.pipelineBarrier(/*VulkanUtils::GetPipelineStageForLayout(oldLayout)*/vk::PipelineStageFlagBits::eTopOfPipe, /*VulkanUtils::GetPipelineStageForLayout(newLayout)*/ vk::PipelineStageFlagBits::eTransfer, {}, nullptr, nullptr, imgMemBarrier); } void Image::Init(const Device* device, const DataFormat& format, const vk::Extent3D& resolution) From d48d60441a2fb09df931a2a8dbe60d690f83d2ad Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Tue, 9 Jul 2024 10:07:41 +0200 Subject: [PATCH 25/30] Add MTLPixelFormat to DataFormat mapping --- openVulkanoCpp/Scene/DataFormat.hpp | 4 +- openVulkanoCpp/Scene/DataFormat.mm | 282 ++++++++++++++++++++++++++++ 2 files changed, 285 insertions(+), 1 deletion(-) create mode 100644 openVulkanoCpp/Scene/DataFormat.mm diff --git a/openVulkanoCpp/Scene/DataFormat.hpp b/openVulkanoCpp/Scene/DataFormat.hpp index 2e3a4f1..67457a6 100644 --- a/openVulkanoCpp/Scene/DataFormat.hpp +++ b/openVulkanoCpp/Scene/DataFormat.hpp @@ -372,7 +372,9 @@ namespace OpenVulkano } static DataFormat GetFromName(std::string_view name); + + static DataFormat GetFromMetalPixelFormat(int formatId); private: Format m_format; }; -} \ No newline at end of file +} diff --git a/openVulkanoCpp/Scene/DataFormat.mm b/openVulkanoCpp/Scene/DataFormat.mm new file mode 100644 index 0000000..9aaee2f --- /dev/null +++ b/openVulkanoCpp/Scene/DataFormat.mm @@ -0,0 +1,282 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "DataFormat.hpp" + +#import + +namespace OpenVulkano +{ + DataFormat DataFormat::GetFromMetalPixelFormat(int formatId) + { + switch(formatId) + { + case MTLPixelFormatA8Unorm: // 1 + // Unavailable -> map to R8_UNORM + case MTLPixelFormatR8Unorm: // 10 + return DataFormat::R8_UNORM; + case MTLPixelFormatR8Unorm_sRGB: // 11 + return DataFormat::R8_SRGB; + case MTLPixelFormatR8Snorm: // 12 + return DataFormat::R8_SNORM; + case MTLPixelFormatR8Uint: // 13 + return DataFormat::R8_UINT; + case MTLPixelFormatR8Sint: // 14 + return DataFormat::R8_SINT; + + /* Normal 16 bit formats */ + case MTLPixelFormatR16Unorm: // 20 + return DataFormat::R16_UNORM; + case MTLPixelFormatR16Snorm: // 22 + return DataFormat::R16_SNORM; + case MTLPixelFormatR16Uint: // 23 + return DataFormat::R16_UINT; + case MTLPixelFormatR16Sint: // 24 + return DataFormat::R16_SINT; + case MTLPixelFormatR16Float: // 25 + return DataFormat::R16_SFLOAT; + + case MTLPixelFormatRG8Unorm: // 30 + return DataFormat::R8G8_UNORM; + case MTLPixelFormatRG8Unorm_sRGB: // 31 + return DataFormat::R8G8_SRGB; + case MTLPixelFormatRG8Snorm: // 32 + return DataFormat::R8G8_SNORM; + case MTLPixelFormatRG8Uint: // 33 + return DataFormat::R8G8_UINT; + case MTLPixelFormatRG8Sint: // 34 + return DataFormat::R8G8_SINT; + + /* Packed 16 bit formats */ + case MTLPixelFormatB5G6R5Unorm: // 40 + return DataFormat::B5G6R5_UNORM_PACK16; + case MTLPixelFormatA1BGR5Unorm: // 41 + throw std::runtime_error("No mapping form A1BGR5 to vk type"); + case MTLPixelFormatABGR4Unorm: // 42 + return DataFormat::A4B4G4R4_UNORM_PACK16; + case MTLPixelFormatBGR5A1Unorm: // 43 + return DataFormat::B5G5R5A1_UNORM_PACK16; + + /* Normal 32 bit formats */ + case MTLPixelFormatR32Uint: // 53 + return DataFormat::R32_UINT; + case MTLPixelFormatR32Sint: // 54 + return DataFormat::R32_SINT; + case MTLPixelFormatR32Float: // 55 + return DataFormat::R32_SFLOAT; + + case MTLPixelFormatRG16Unorm: // 60 + return DataFormat::R16G16_UNORM; + case MTLPixelFormatRG16Snorm: // 62 + return DataFormat::R16G16_SNORM; + case MTLPixelFormatRG16Uint: // 63 + return DataFormat::R16G16_UINT; + case MTLPixelFormatRG16Sint: // 64 + return DataFormat::R16G16_SINT; + case MTLPixelFormatRG16Float: // 65 + return DataFormat::R16G16_SFLOAT; + + case MTLPixelFormatRGBA8Unorm: // 70 + return DataFormat::R8G8B8A8_UNORM; + case MTLPixelFormatRGBA8Unorm_sRGB: // 71 + return DataFormat::R8G8B8A8_SRGB; + case MTLPixelFormatRGBA8Snorm: // 72 + return DataFormat::R8G8B8A8_SNORM; + case MTLPixelFormatRGBA8Uint: // 73 + return DataFormat::R8G8B8A8_UINT; + case MTLPixelFormatRGBA8Sint: // 74 + return DataFormat::R8G8B8A8_SINT; + + case MTLPixelFormatBGRA8Unorm: // 80 + return DataFormat::B8G8R8A8_UNORM; + case MTLPixelFormatBGRA8Unorm_sRGB: // 81 + return DataFormat::B8G8R8A8_SRGB; + + /* Packed 32 bit formats */ + + case MTLPixelFormatRGB10A2Unorm: // 90 + return DataFormat::A2B10G10R10_UNORM_PACK32; + case MTLPixelFormatRGB10A2Uint: // 91 + return DataFormat::A2B10G10R10_UINT_PACK32; + + case MTLPixelFormatRG11B10Float: // 92 + return DataFormat::B10G11R11_UFLOAT_PACK32; + case MTLPixelFormatRGB9E5Float: // 93 + return DataFormat::E5B9G9R9_UFLOAT_PACK32; + + case MTLPixelFormatBGR10A2Unorm: // 94 + return DataFormat::A2R10G10B10_UNORM_PACK32; + + case MTLPixelFormatBGR10_XR: // 554 + case MTLPixelFormatBGR10_XR_sRGB: // 555 + throw std::runtime_error("Unimplemented format"); + + /* Normal 64 bit formats */ + + case MTLPixelFormatRG32Uint: // 103 + return DataFormat::R32G32_UINT; + case MTLPixelFormatRG32Sint: // 104 + return DataFormat::R32G32_SINT; + case MTLPixelFormatRG32Float: // 105 + return DataFormat::R32G32_SFLOAT; + + case MTLPixelFormatRGBA16Unorm: // 110 + return DataFormat::R16G16B16A16_UNORM; + case MTLPixelFormatRGBA16Snorm: // 112 + return DataFormat::R16G16B16A16_SNORM; + case MTLPixelFormatRGBA16Uint: // 113 + return DataFormat::R16G16B16A16_UINT; + case MTLPixelFormatRGBA16Sint: // 114 + return DataFormat::R16G16B16A16_SINT; + case MTLPixelFormatRGBA16Float: // 115 + return DataFormat::R16G16B16A16_SFLOAT; + + case MTLPixelFormatBGRA10_XR: // 552 + case MTLPixelFormatBGRA10_XR_sRGB: // 553 + throw std::runtime_error("Unimplemented format"); + + /* Normal 128 bit formats */ + + case MTLPixelFormatRGBA32Uint: // 123 + return DataFormat::R32G32B32A32_UINT; + case MTLPixelFormatRGBA32Sint: // 124 + return DataFormat::R32G32B32A32_SINT; + case MTLPixelFormatRGBA32Float: // 125 + return DataFormat::R32G32B32A32_SFLOAT; + + /* Compressed formats. */ + /* S3TC/DXT */ + case MTLPixelFormatBC1_RGBA: // 130 + case MTLPixelFormatBC1_RGBA_sRGB: // 131 + case MTLPixelFormatBC2_RGBA: // 132 + case MTLPixelFormatBC2_RGBA_sRGB: // 133 + case MTLPixelFormatBC3_RGBA: // 134 + case MTLPixelFormatBC3_RGBA_sRGB: // 135 + + /* RGTC */ + case MTLPixelFormatBC4_RUnorm: // 140 + case MTLPixelFormatBC4_RSnorm: // 141 + case MTLPixelFormatBC5_RGUnorm: // 142 + case MTLPixelFormatBC5_RGSnorm: // 143 + + /* BPTC */ + case MTLPixelFormatBC6H_RGBFloat: // 150 + case MTLPixelFormatBC6H_RGBUfloat: // 151 + case MTLPixelFormatBC7_RGBAUnorm: // 152 + case MTLPixelFormatBC7_RGBAUnorm_sRGB: // 153 + + /* PVRTC */ + case MTLPixelFormatPVRTC_RGB_2BPP: // 160 + case MTLPixelFormatPVRTC_RGB_2BPP_sRGB: // 161 + case MTLPixelFormatPVRTC_RGB_4BPP: // 162 + case MTLPixelFormatPVRTC_RGB_4BPP_sRGB: // 163 + case MTLPixelFormatPVRTC_RGBA_2BPP: // 164 + case MTLPixelFormatPVRTC_RGBA_2BPP_sRGB: // 165 + case MTLPixelFormatPVRTC_RGBA_4BPP: // 166 + case MTLPixelFormatPVRTC_RGBA_4BPP_sRGB: // 167 + + /* ETC2 */ + case MTLPixelFormatEAC_R11Unorm: // 170 + case MTLPixelFormatEAC_R11Snorm: // 172 + case MTLPixelFormatEAC_RG11Unorm: // 174 + case MTLPixelFormatEAC_RG11Snorm: // 176 + case MTLPixelFormatEAC_RGBA8: // 178 + case MTLPixelFormatEAC_RGBA8_sRGB: // 179 + + case MTLPixelFormatETC2_RGB8: // 180 + case MTLPixelFormatETC2_RGB8_sRGB: // 181 + case MTLPixelFormatETC2_RGB8A1: // 182 + case MTLPixelFormatETC2_RGB8A1_sRGB: // 183 + + /* ASTC */ + case MTLPixelFormatASTC_4x4_sRGB: // 186 + case MTLPixelFormatASTC_5x4_sRGB: // 187 + case MTLPixelFormatASTC_5x5_sRGB: // 188 + case MTLPixelFormatASTC_6x5_sRGB: // 189 + case MTLPixelFormatASTC_6x6_sRGB: // 190 + case MTLPixelFormatASTC_8x5_sRGB: // 192 + case MTLPixelFormatASTC_8x6_sRGB: // 193 + case MTLPixelFormatASTC_8x8_sRGB: // 194 + case MTLPixelFormatASTC_10x5_sRGB: // 195 + case MTLPixelFormatASTC_10x6_sRGB: // 196 + case MTLPixelFormatASTC_10x8_sRGB: // 197 + case MTLPixelFormatASTC_10x10_sRGB: // 198 + case MTLPixelFormatASTC_12x10_sRGB: // 199 + case MTLPixelFormatASTC_12x12_sRGB: // 200 + + case MTLPixelFormatASTC_4x4_LDR: // 204 + case MTLPixelFormatASTC_5x4_LDR: // 205 + case MTLPixelFormatASTC_5x5_LDR: // 206 + case MTLPixelFormatASTC_6x5_LDR: // 207 + case MTLPixelFormatASTC_6x6_LDR: // 208 + case MTLPixelFormatASTC_8x5_LDR: // 210 + case MTLPixelFormatASTC_8x6_LDR: // 211 + case MTLPixelFormatASTC_8x8_LDR: // 212 + case MTLPixelFormatASTC_10x5_LDR: // 213 + case MTLPixelFormatASTC_10x6_LDR: // 214 + case MTLPixelFormatASTC_10x8_LDR: // 215 + case MTLPixelFormatASTC_10x10_LDR: // 216 + case MTLPixelFormatASTC_12x10_LDR: // 217 + case MTLPixelFormatASTC_12x12_LDR: // 218 + + + // ASTC HDR (High Dynamic Range) Formats + case MTLPixelFormatASTC_4x4_HDR: // 222 + case MTLPixelFormatASTC_5x4_HDR: // 223 + case MTLPixelFormatASTC_5x5_HDR: // 224 + case MTLPixelFormatASTC_6x5_HDR: // 225 + case MTLPixelFormatASTC_6x6_HDR: // 226 + case MTLPixelFormatASTC_8x5_HDR: // 228 + case MTLPixelFormatASTC_8x6_HDR: // 229 + case MTLPixelFormatASTC_8x8_HDR: // 230 + case MTLPixelFormatASTC_10x5_HDR: // 231 + case MTLPixelFormatASTC_10x6_HDR: // 232 + case MTLPixelFormatASTC_10x8_HDR: // 233 + case MTLPixelFormatASTC_10x10_HDR: // 234 + case MTLPixelFormatASTC_12x10_HDR: // 235 + case MTLPixelFormatASTC_12x12_HDR: // 236 + throw std::runtime_error("Conversion not yet implemented"); //TODO + + /*! + @constant case MTLPixelFormatGBGR422 + @abstract A pixel format where the red and green channels are subsampled horizontally. Two pixels are stored in 32 bits, with shared red and blue values, and unique green values. + @discussion This format is equivalent to YUY2, YUYV, yuvs, or GL_RGB_422_APPLE/GL_UNSIGNED_SHORT_8_8_REV_APPLE. The component order, from lowest addressed byte to highest, is Y0, Cb, Y1, Cr. There is no implicit colorspace conversion from YUV to RGB, the shader will receive (Cr, Y, Cb, 1). 422 textures must have a width that is a multiple of 2, and can only be used for 2D non-mipmap textures. When sampling, ClampToEdge is the only usable wrap mode. + */ + case MTLPixelFormatGBGR422: // 240 + return DataFormat::G8B8G8R8_422_UNORM; + + /*! + @constant case MTLPixelFormatBGRG422 + @abstract A pixel format where the red and green channels are subsampled horizontally. Two pixels are stored in 32 bits, with shared red and blue values, and unique green values. + @discussion This format is equivalent to UYVY, 2vuy, or GL_RGB_422_APPLE/GL_UNSIGNED_SHORT_8_8_APPLE. The component order, from lowest addressed byte to highest, is Cb, Y0, Cr, Y1. There is no implicit colorspace conversion from YUV to RGB, the shader will receive (Cr, Y, Cb, 1). 422 textures must have a width that is a multiple of 2, and can only be used for 2D non-mipmap textures. When sampling, ClampToEdge is the only usable wrap mode. + */ + case MTLPixelFormatBGRG422: // 241 + return DataFormat::B8G8R8G8_422_UNORM; + + /* Depth */ + case MTLPixelFormatDepth16Unorm: // 250 + return DataFormat::D16_UNORM; + case MTLPixelFormatDepth32Float: // 252 + return DataFormat::D32_SFLOAT; + + /* Stencil */ + case MTLPixelFormatStencil8: // 253 + return DataFormat::S8_UINT; + + /* Depth Stencil */ + //case MTLPixelFormatDepth24Unorm_Stencil8: // 255 + return DataFormat::D24_UNORM_S8_UINT; + case MTLPixelFormatDepth32Float_Stencil8: // 260 + return DataFormat::D32_SFLOAT_S8_UINT; + + case MTLPixelFormatX32_Stencil8: // 261 + //case MTLPixelFormatX24_Stencil8: // 262 + throw std::runtime_error("Conversion not yet implemented"); + } + + return UNDEFINED; + } +} From d9a22236b444a9e30867b299525cc8681abaa9d2 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Tue, 9 Jul 2024 12:31:52 +0200 Subject: [PATCH 26/30] Move sampler creation from image to resource manager and cache created samplers --- openVulkanoCpp/Vulkan/Image.cpp | 41 +++++-------------- openVulkanoCpp/Vulkan/Image.hpp | 5 +-- .../Vulkan/Resources/ResourceManager.cpp | 12 ++++++ .../Vulkan/Resources/ResourceManager.hpp | 8 +++- openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp | 21 ++++++++-- 5 files changed, 49 insertions(+), 38 deletions(-) diff --git a/openVulkanoCpp/Vulkan/Image.cpp b/openVulkanoCpp/Vulkan/Image.cpp index 22c024d..21e738f 100644 --- a/openVulkanoCpp/Vulkan/Image.cpp +++ b/openVulkanoCpp/Vulkan/Image.cpp @@ -8,19 +8,22 @@ namespace OpenVulkano::Vulkan { - void Image::Init(const Device* device, const vk::ImageCreateInfo& imageCreateInfo, vk::ImageViewCreateInfo imageViewCreateInfo, const vk::MemoryPropertyFlags& memoryPropertyFlags) + void Image::Init(const Device* device, const vk::ImageCreateInfo& imageCreateInfo, vk::ImageViewCreateInfo imageViewCreateInfo, bool allocateMem, const vk::MemoryPropertyFlags& memoryPropertyFlags) { this->device = device->device; image = device->device.createImage(imageCreateInfo); format = imageCreateInfo.format; extent = imageCreateInfo.extent; - // TODO allocate from resource manager - const vk::MemoryRequirements memRequirements = device->device.getImageMemoryRequirements(image); - size = allocSize = memRequirements.size; - const vk::MemoryAllocateInfo memAllocInfo = { allocSize, device->GetMemoryType(memRequirements.memoryTypeBits, memoryPropertyFlags) }; - memory = device->device.allocateMemory(memAllocInfo); - device->device.bindImageMemory(image, memory, 0); + if (allocateMem) + { + // TODO allocate from resource manager + const vk::MemoryRequirements memRequirements = device->device.getImageMemoryRequirements(image); + size = allocSize = memRequirements.size; + const vk::MemoryAllocateInfo memAllocInfo = { allocSize, device->GetMemoryType(memRequirements.memoryTypeBits, memoryPropertyFlags) }; + memory = device->device.allocateMemory(memAllocInfo); + device->device.bindImageMemory(image, memory, 0); + } imageViewCreateInfo.image = image; view = device->device.createImageView(imageViewCreateInfo); @@ -49,32 +52,10 @@ namespace OpenVulkano::Vulkan imgViewCreateInfo.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; Init(device, imgCreateInfo, imgViewCreateInfo); - CreateSampler(); - } - - void Image::CreateSampler() - { - vk::SamplerCreateInfo samplerCreateInfo; - samplerCreateInfo.magFilter = vk::Filter::eLinear; - samplerCreateInfo.minFilter = vk::Filter::eLinear; - samplerCreateInfo.mipmapMode = vk::SamplerMipmapMode::eLinear; - samplerCreateInfo.addressModeU = vk::SamplerAddressMode::eClampToEdge; - samplerCreateInfo.addressModeV = vk::SamplerAddressMode::eClampToEdge; - samplerCreateInfo.addressModeW = vk::SamplerAddressMode::eClampToEdge; - samplerCreateInfo.borderColor = vk::BorderColor::eFloatTransparentBlack; - samplerCreateInfo.unnormalizedCoordinates = false; - samplerCreateInfo.compareEnable = false; - - sampler = this->device.createSampler(samplerCreateInfo); } void Image::Close() { - if(sampler) - { - device.destroySampler(sampler); - sampler = vk::Sampler(); - } if(view) { device.destroyImageView(view); @@ -87,4 +68,4 @@ namespace OpenVulkano::Vulkan } Buffer::Close(); } -} \ No newline at end of file +} diff --git a/openVulkanoCpp/Vulkan/Image.hpp b/openVulkanoCpp/Vulkan/Image.hpp index 0b10a24..ee684bb 100644 --- a/openVulkanoCpp/Vulkan/Image.hpp +++ b/openVulkanoCpp/Vulkan/Image.hpp @@ -27,7 +27,6 @@ namespace OpenVulkano::Vulkan vk::Image image; vk::Extent3D extent; vk::ImageView view; - vk::Sampler sampler; vk::Format format = vk::Format::eUndefined; /** @@ -37,7 +36,7 @@ namespace OpenVulkano::Vulkan * \param imageViewCreateInfo The image will be set automatically after it's creation * \param memoryPropertyFlags */ - void Init(const Device* device, const vk::ImageCreateInfo& imageCreateInfo, vk::ImageViewCreateInfo imageViewCreateInfo, const vk::MemoryPropertyFlags& memoryPropertyFlags = vk::MemoryPropertyFlagBits::eDeviceLocal); + void Init(const Device* device, const vk::ImageCreateInfo& imageCreateInfo, vk::ImageViewCreateInfo imageViewCreateInfo, bool allocateMem = true, const vk::MemoryPropertyFlags& memoryPropertyFlags = vk::MemoryPropertyFlagBits::eDeviceLocal); void Init(const Device* device, const DataFormat& format, const vk::Extent3D& resolution); @@ -48,8 +47,6 @@ namespace OpenVulkano::Vulkan SetLayout(cmdBuffer, vk::ImageSubresourceRange(aspectMask, 0, 1, 0, 1), newLayout, oldLayout); } - void CreateSampler(); - void Close() override; operator bool() const { return image.operator bool(); } diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp index 3e50a4b..326d2aa 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.cpp @@ -95,6 +95,11 @@ namespace OpenVulkano::Vulkan toFree.clear(); recycleBuffers.clear(); descriptorSetLayoutCache.clear(); + for (auto& sampler : samplerCache) + { + device.destroy(sampler.second); + } + samplerCache.clear(); shaders.clear(); cmdBuffers = nullptr; cmdPools = nullptr; @@ -427,4 +432,11 @@ namespace OpenVulkano::Vulkan vkBuffer->Init(buffer, uBuffer); return vkBuffer; } + + vk::Sampler ResourceManager::CreateSampler(const vk::SamplerCreateInfo& samplerConfig) + { + auto& sampler = samplerCache[samplerConfig]; + if (!sampler) sampler = device.createSampler(samplerConfig); + return sampler; + } } diff --git a/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp b/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp index 8b2852f..0286d57 100644 --- a/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp +++ b/openVulkanoCpp/Vulkan/Resources/ResourceManager.hpp @@ -6,6 +6,9 @@ #pragma once +// Workaround for libc++ +#define __cpp_lib_three_way_comparison 201907 + #include "vulkan/vulkan.hpp" #include "Base/ICloseable.hpp" #include "IShaderOwner.hpp" @@ -62,6 +65,7 @@ namespace OpenVulkano std::function freeFunction; vk::DescriptorPool descriptorPool; std::map descriptorSetLayoutCache; + std::map samplerCache; int buffers = -1, currentBuffer = -1; @@ -108,6 +112,8 @@ namespace OpenVulkano UniformBuffer* CreateUniformBuffer(const DescriptorSetLayoutBinding& binding, size_t size, void* data, uint32_t setId = 2); + vk::Sampler CreateSampler(const vk::SamplerCreateInfo& samplerConfig); + protected: // Allocation management void DoFreeBuffer(ManagedBuffer* buffer); @@ -127,9 +133,9 @@ namespace OpenVulkano MemoryAllocation* GetFreeMemoryAllocation(size_t size, vk::DeviceSize alignment, uint32_t type, bool createIfAllFull = true); + public: vk::DescriptorSetLayout* GetDescriptorLayoutSet(const DescriptorSetLayoutBinding& descriptorSetLayoutBinding); - public: VulkanShader* CreateShader(Scene::Shader* shader); }; } diff --git a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp index 48d4d93..c41c2dc 100644 --- a/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp +++ b/openVulkanoCpp/Vulkan/Scene/VulkanTexture.hpp @@ -19,7 +19,9 @@ namespace OpenVulkano::Vulkan class VulkanTexture : public IRecordable, public Image { public: + static inline vk::SamplerCreateInfo DEFAULT_SAMPLER_CONFIG {}; Scene::Texture* m_texture = nullptr; + vk::Sampler m_sampler; vk::DescriptorSet m_descriptorSet; virtual void Init(ResourceManager* resManager, Scene::Texture* texture, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding) @@ -29,16 +31,29 @@ namespace OpenVulkano::Vulkan resManager->CopyDataToImage(m_texture->size, m_texture->textureBuffer, this); texture->updated = false; + m_sampler = resManager->CreateSampler(DEFAULT_SAMPLER_CONFIG); + SetDescriptorSet(resManager, descriptorSetLayout, binding); + + texture->renderTexture = this; + } + + void Close() override + { + Image::Close(); + if (m_texture) m_texture->renderTexture = nullptr; + m_texture = nullptr; + } + + void SetDescriptorSet(ResourceManager* resManager, vk::DescriptorSetLayout* descriptorSetLayout, const DescriptorSetLayoutBinding& binding) + { // Setup Descriptor set const vk::DescriptorSetAllocateInfo descSetAllocInfo = { ResourceManager::INSTANCE->descriptorPool, 1, descriptorSetLayout }; m_descriptorSet = resManager->GetContext()->device->device.allocateDescriptorSets(descSetAllocInfo)[0]; - vk::DescriptorImageInfo imageInfo = { sampler, view, vk::ImageLayout::eShaderReadOnlyOptimal }; + vk::DescriptorImageInfo imageInfo = { m_sampler, view, vk::ImageLayout::eShaderReadOnlyOptimal }; vk::WriteDescriptorSet writeDescriptorSet = { m_descriptorSet, binding.bindingId, 0, 1 }; writeDescriptorSet.descriptorType = static_cast(binding.descriptorType); writeDescriptorSet.pImageInfo = &imageInfo; resManager->GetContext()->device->device.updateDescriptorSets(1, &writeDescriptorSet, 0, nullptr); - - texture->renderTexture = this; } void Record(VulkanDrawContext* context) override From bb387489711da889aa448cd20423d4e21762c8d7 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Tue, 9 Jul 2024 12:37:02 +0200 Subject: [PATCH 27/30] Init texture to nullptr --- openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp index 6dda25b..960d256 100644 --- a/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp +++ b/openVulkanoCpp/Scene/Prefabs/ArBackgroundDrawable.hpp @@ -28,7 +28,7 @@ namespace OpenVulkano UniformBuffer m_intrinsicsBuffer; Ptr m_arSession; Ptr m_nextFrame, m_currentFrame, m_lastFrame; - const Texture* m_texture; + const Texture* m_texture = nullptr; void OnNewArFrame(const Ptr& frame); @@ -48,4 +48,4 @@ namespace OpenVulkano UniformBuffer& GetBuffer() { return m_intrinsicsBuffer; } }; } -} \ No newline at end of file +} From 88aa077dcb23dc9b01201d74e8a9a53adfbd4cc4 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Tue, 9 Jul 2024 13:26:54 +0200 Subject: [PATCH 28/30] Add missing override --- openVulkanoCpp/AR/Provider/Network/ArSessionStream.h | 2 +- openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h b/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h index 799943b..0c35453 100644 --- a/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h +++ b/openVulkanoCpp/AR/Provider/Network/ArSessionStream.h @@ -34,7 +34,7 @@ namespace OpenVulkano::AR::Network [[nodiscard]] ArType GetArType() override; - void SetRenderer(IRenderer* renderer) {} // TODO + void SetRenderer(IRenderer* renderer) override {} // TODO }; } diff --git a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp index fa481ee..85a6502 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.hpp @@ -31,7 +31,7 @@ class ArSessionPlayback final : public ArSession, public std::enable_shared_from [[nodiscard]] ArType GetArType() override; - void SetRenderer(IRenderer* renderer); + void SetRenderer(IRenderer* renderer) override; protected: Scene::Texture * MakeTexture(OpenVulkano::AR::ArFrame *frame) override; From bbaf8933ae9c1d4e79b62d7ac3dee8e1eba83738 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Tue, 9 Jul 2024 13:43:09 +0200 Subject: [PATCH 29/30] Add texture cache for ar frame textures --- .../Provider/ArKit/ArSessionArKitInternal.h | 7 ++- .../Provider/ArKit/ArSessionArKitInternal.mm | 25 ++++++++ .../Vulkan/Metal/MetalTextureCache.h | 35 +++++++++++ .../Vulkan/Metal/MetalTextureCache.mm | 63 +++++++++++++++++++ 4 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 openVulkanoCpp/Vulkan/Metal/MetalTextureCache.h create mode 100644 openVulkanoCpp/Vulkan/Metal/MetalTextureCache.mm diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h index bf60aaa..5fc8f8d 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h +++ b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.h @@ -8,6 +8,8 @@ #include "ArSessionArKit.h" #include "Data/Concurent/MutexProtectedObject.hpp" +#include "Scene/Texture.hpp" +#include "Vulkan/Metal/MetalTextureCache.h" #include #import @@ -46,9 +48,11 @@ namespace OpenVulkano::AR::ArKit void OnArCameraTrackingChange(ARSession* session, ARCamera* camera); void OnArAnchorsUpdate(NSArray<__kindof ARAnchor*>* anchors); bool ArShouldAttemptRelocalization(); + + void SetRenderer(IRenderer* renderer) override; protected: - Scene::Texture * MakeTexture(OpenVulkano::AR::ArFrame *frame) override; + Scene::Texture * MakeTexture(ArFrame *frame) override; void ReturnTexture(Scene::Texture *texture) override; @@ -56,6 +60,7 @@ namespace OpenVulkano::AR::ArKit ArKitDelegate* m_arKitDelegate; ARWorldTrackingConfiguration* m_arConfig; ARSession* m_arSession; + Vulkan::MetalTextureCache m_textureCache; /*#if (__cplusplus >= 202002L) std::atomic> m_frame; #else*/ diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm index 6874e6c..9ab0568 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm +++ b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm @@ -4,11 +4,17 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +// Makre usre the Molten include is first! +#include +#include + #include "ArSessionArKitInternal.h" #include "ArFrameArKit.h" #include "ArTrackingStateConverter.h" #include "Base/Logger.hpp" #include "IO/AppFolders.hpp" +#include "Vulkan/Renderer.hpp" +#include "Vulkan/Scene/VulkanTexture.hpp" #include #import @@ -102,6 +108,25 @@ namespace OpenVulkano::AR::ArKit [m_arKitDelegate release]; } + void ArSessionArKitInternal::SetRenderer(IRenderer* renderer) + { + m_textureCache.Init(renderer); + } + + Scene::Texture* ArSessionArKitInternal::MakeTexture(ArFrame* frame) + { + if (!m_textureCache) [[unlikely]] + throw std::runtime_error("No renderer set for which to produce textures"); + ArFrameArKit* arFrame = static_cast(frame); + ARFrame* arKitFrame = arFrame->GetArKitFrame(); + return m_textureCache.Get(arKitFrame.capturedImage, MTLPixelFormatR8Unorm); + } + + void ArSessionArKitInternal::ReturnTexture(Scene::Texture* texture) + { + m_textureCache.ReturnTexture(texture); + } + void ArSessionArKitInternal::Start() { [m_arSession runWithConfiguration:m_arConfig]; diff --git a/openVulkanoCpp/Vulkan/Metal/MetalTextureCache.h b/openVulkanoCpp/Vulkan/Metal/MetalTextureCache.h new file mode 100644 index 0000000..d6817c3 --- /dev/null +++ b/openVulkanoCpp/Vulkan/Metal/MetalTextureCache.h @@ -0,0 +1,35 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "MetalBackedTexture.h" + +#import +#import + +namespace OpenVulkano::Vulkan +{ + class MetalTextureCache + { + CVMetalTextureCacheRef m_textureCache = nullptr; + Vulkan::ResourceManager* m_resourceManager = nullptr; + std::map m_mtlToVkTextureMap; + + public: + ~MetalTextureCache() { if (m_resourceManager) Close(); } + + void Init(IRenderer* renderer); + + void Close(); + + Scene::Texture* Get(CVPixelBufferRef pixelBuffer, MTLPixelFormat pixelFormat); + + void ReturnTexture(Scene::Texture* texture); + + operator bool() const { return m_resourceManager; } + }; +} diff --git a/openVulkanoCpp/Vulkan/Metal/MetalTextureCache.mm b/openVulkanoCpp/Vulkan/Metal/MetalTextureCache.mm new file mode 100644 index 0000000..5b0e7aa --- /dev/null +++ b/openVulkanoCpp/Vulkan/Metal/MetalTextureCache.mm @@ -0,0 +1,63 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "MetalTextureCache.h" +#include "Vulkan/Renderer.hpp" + +namespace OpenVulkano::Vulkan +{ + void MetalTextureCache::Init(IRenderer* renderer) + { + if (m_resourceManager) Close(); + if (!renderer) return; + auto vkRenderer = dynamic_cast(renderer); + if (!vkRenderer) throw std::invalid_argument("The Metal Texture Cache only supports Vulkan renderer!"); + // Setup texture cache + VkExportMetalDeviceInfoEXT metalDeviceInfo {}; + metalDeviceInfo.sType = VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT; + metalDeviceInfo.pNext = nullptr; + VkExportMetalObjectsInfoEXT exportInfo { VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT, &metalDeviceInfo }; + VkDevice vkDevice = vkRenderer->GetContext().device->device; + vkExportMetalObjectsEXT(vkDevice, &exportInfo); + CVReturn result = CVMetalTextureCacheCreate(nil, nil, metalDeviceInfo.mtlDevice, nil, &m_textureCache); + if (result != kCVReturnSuccess) + { + Logger::AR->error("Failed to create metal texture cache! Status code: {}", result); + } + m_resourceManager = &vkRenderer->GetResourceManager(); + } + + Scene::Texture* MetalTextureCache::Get(CVPixelBufferRef pixelBuffer, MTLPixelFormat pixelFormat) + { + CVMetalTextureRef mtlTextureRef; + auto width = CVPixelBufferGetWidthOfPlane(pixelBuffer, 0); + auto height = CVPixelBufferGetHeightOfPlane(pixelBuffer, 0); + //TODO check pixel format from buffer? + CVMetalTextureCacheCreateTextureFromImage(nil, m_textureCache, pixelBuffer, nil, pixelFormat, width, height, 0, &mtlTextureRef); + id mtlTexture = CVMetalTextureGetTexture(mtlTextureRef); + CVBufferRelease(mtlTextureRef); + MetalBackedTexture& texture = m_mtlToVkTextureMap[static_cast(mtlTexture)]; + if (!texture) + { // Init texture + texture.Init(m_resourceManager, mtlTexture, false); + Logger::RENDER->info("Metal Texture Cache grew to: {}", m_mtlToVkTextureMap.size()); + } + return &texture; + } + + void MetalTextureCache::ReturnTexture(Scene::Texture* texture) + { + + } + + void MetalTextureCache::Close() + { + m_mtlToVkTextureMap.clear(); + m_resourceManager = nullptr; + //TODO delete the texture cache object? + m_textureCache = nullptr; + } +} From 5c4e9727223d85aeae56ec8376cb7f665bb491bc Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Wed, 10 Jul 2024 14:07:40 +0200 Subject: [PATCH 30/30] Add MetalBackedTexture --- .../Vulkan/Metal/MetalBackedTexture.h | 32 ++++++++ .../Vulkan/Metal/MetalBackedTexture.mm | 74 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.h create mode 100644 openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.mm diff --git a/openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.h b/openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.h new file mode 100644 index 0000000..8994f3c --- /dev/null +++ b/openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.h @@ -0,0 +1,32 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "Scene/Texture.hpp" +#include "Vulkan/Scene/VulkanTexture.hpp" +#include + + +namespace OpenVulkano::Vulkan +{ + class MetalBackedTexture : public Scene::Texture + { + VulkanTexture m_vulkanTexture; + MTLTexture_id m_metalTexture = nullptr; + + public: + MetalBackedTexture() = default; + + ~MetalBackedTexture() { if (m_vulkanTexture) Close(); } + + void Init(ResourceManager* resManager, MTLTexture_id mtlTexture, bool ownsTexture); + + void Close(); + + operator bool() const { return m_vulkanTexture; } + }; +} diff --git a/openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.mm b/openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.mm new file mode 100644 index 0000000..91be222 --- /dev/null +++ b/openVulkanoCpp/Vulkan/Metal/MetalBackedTexture.mm @@ -0,0 +1,74 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#include "MetalBackedTexture.h" +#include +#import + +namespace OpenVulkano::Vulkan +{ + void MetalBackedTexture::Init(ResourceManager* resManager, MTLTexture_id mtlTexture, bool ownsTexture) + { + auto binding = Texture::DESCRIPTOR_SET_LAYOUT_BINDING; + + m_metalTexture = mtlTexture; + + resolution = { static_cast(mtlTexture.width), static_cast(mtlTexture.height), static_cast(mtlTexture.depth) }; + format = DataFormat::GetFromMetalPixelFormat(static_cast(mtlTexture.pixelFormat)); + + m_vulkanTexture.m_texture = this; + m_vulkanTexture.device = resManager->GetDevice(); + m_vulkanTexture.format = format; + m_vulkanTexture.extent = reinterpret_cast(resolution); + + VkImportMetalTextureInfoEXT importInfo; + importInfo.sType = VK_STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT; + importInfo.pNext = nullptr; + importInfo.plane = VK_IMAGE_ASPECT_COLOR_BIT; + importInfo.mtlTexture = mtlTexture; + + vk::ImageCreateInfo imgCreateInfo { {}, vk::ImageType::e2D, m_vulkanTexture.format, m_vulkanTexture.extent, 1, 1 }; + + imgCreateInfo.sharingMode = vk::SharingMode::eExclusive; + imgCreateInfo.usage = vk::ImageUsageFlagBits::eSampled; + imgCreateInfo.tiling = vk::ImageTiling::eLinear; + imgCreateInfo.pNext = &importInfo; + + m_vulkanTexture.image = m_vulkanTexture.device.createImage(imgCreateInfo); + + vk::ImageViewCreateInfo imgViewCreateInfo { {}, m_vulkanTexture.image, vk::ImageViewType::e2D, imgCreateInfo.format }; + imgViewCreateInfo.subresourceRange.aspectMask = vk::ImageAspectFlagBits::eColor; + imgViewCreateInfo.subresourceRange.baseMipLevel = 0; + imgViewCreateInfo.subresourceRange.levelCount = 1; + imgViewCreateInfo.subresourceRange.baseArrayLayer = 0; + imgViewCreateInfo.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; + if (format == DataFormat::R8_UNORM) + { + imgViewCreateInfo.components.r = vk::ComponentSwizzle::eR; + imgViewCreateInfo.components.g = vk::ComponentSwizzle::eR; + imgViewCreateInfo.components.b = vk::ComponentSwizzle::eR; + imgViewCreateInfo.components.a = vk::ComponentSwizzle::eOne; + } + m_vulkanTexture.view = m_vulkanTexture.device.createImageView(imgViewCreateInfo); + + m_vulkanTexture.m_sampler = resManager->CreateSampler(VulkanTexture::DEFAULT_SAMPLER_CONFIG); + m_vulkanTexture.SetDescriptorSet(resManager, resManager->GetDescriptorLayoutSet(binding), binding); + + renderTexture = &m_vulkanTexture; + + if (!ownsTexture) m_metalTexture = nullptr; + } + + void MetalBackedTexture::Close() + { + m_vulkanTexture.Close(); + if (m_metalTexture) + { + [m_metalTexture release]; + m_metalTexture = nullptr; + } + } +}