mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
#include "lsfg.hpp"
|
|
#include "vk/registry/shader_registry.hpp"
|
|
#include "vk/pool/shader_pool.hpp"
|
|
#include "vk/core/descriptorpool.hpp"
|
|
#include "vk/core/instance.hpp"
|
|
#include "vk/core/device.hpp"
|
|
#include "trans/rsrc.hpp"
|
|
|
|
#include <filesystem>
|
|
#include <utility>
|
|
#include <memory>
|
|
|
|
using namespace LSFG;
|
|
using namespace VK;
|
|
|
|
Instance::Instance(const std::filesystem::path& dll) {
|
|
VKD vkd{
|
|
.instance = Core::Instance(),
|
|
.device = Core::Device(vkd.instance, 0, false),
|
|
.dpool = Core::DescriptorPool(vkd.device),
|
|
.registry = Registry::ShaderRegistry(),
|
|
.spool = Pool::ShaderPool()
|
|
};
|
|
this->vkd = std::make_unique<VKD>(std::move(vkd));
|
|
|
|
// load shaders from dll file
|
|
const bool fp16 = this->vkd->device.supportsFP16();
|
|
Trans::RSRC::loadResources(dll, this->vkd->registry, fp16);
|
|
|
|
// ...
|
|
|
|
// const auto sampler1 =
|
|
// VK::Core::Sampler(vkd, VK_SAMPLER_ADDRESS_MODE_REPEAT, VK_COMPARE_OP_GREATER_OR_EQUAL, false);
|
|
// const auto sampler2 =
|
|
// VK::Core::Sampler(vkd, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, VK_COMPARE_OP_ALWAYS, true);
|
|
// const auto buffer0 =
|
|
// VK::Core::Buffer(vkd, 256, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT);
|
|
// const auto input0 =
|
|
// VK::Core::Image(vkd, { 1920, 1080 });
|
|
// const auto input1 =
|
|
// VK::Core::Image(vkd, { 1920, 1080 });
|
|
// const std::vector<VK::Core::Image> mipmaps{
|
|
// input0, input0
|
|
// };
|
|
|
|
// auto shader = VK::Types::ShaderBuilder(vkd, registry, this->shaders, "alpha[0]")
|
|
// .withSamplers(sampler1, sampler2)
|
|
// .withBuffer(buffer0)
|
|
// .addTemporalInput({ input0, input1 })
|
|
// .addOutputs(mipmaps)
|
|
// .build(vkd, this->pool);
|
|
}
|