2023-01-30 23:54:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "IS9xDisplayOutput.h"
|
2023-01-31 23:18:07 +00:00
|
|
|
#include "../vulkan/vulkan_context.hpp"
|
|
|
|
#include "../vulkan/vulkan_texture.hpp"
|
2023-01-31 23:38:02 +00:00
|
|
|
#include "../vulkan/vulkan_shader_chain.hpp"
|
2023-02-01 20:47:42 +00:00
|
|
|
#include <functional>
|
2023-01-30 23:54:23 +00:00
|
|
|
|
|
|
|
class CVulkan : public IS9xDisplayOutput
|
|
|
|
{
|
|
|
|
private:
|
2023-01-31 23:18:07 +00:00
|
|
|
void create_pipeline();
|
|
|
|
|
2023-01-30 23:54:23 +00:00
|
|
|
HWND hWnd;
|
|
|
|
std::unique_ptr<Vulkan::Context> context;
|
|
|
|
Vulkan::Swapchain* swapchain;
|
|
|
|
vk::Device device;
|
2023-01-31 23:18:07 +00:00
|
|
|
vk::UniqueDescriptorSetLayout descriptor_set_layout;
|
|
|
|
vk::UniquePipelineLayout pipeline_layout;
|
|
|
|
vk::UniquePipeline pipeline;
|
|
|
|
vk::Sampler linear_sampler;
|
|
|
|
vk::Sampler nearest_sampler;
|
|
|
|
std::vector<Vulkan::Texture> textures;
|
|
|
|
std::vector<vk::UniqueDescriptorSet> descriptors;
|
|
|
|
std::vector<uint16_t> filtered_image;
|
2023-01-31 23:38:02 +00:00
|
|
|
std::unique_ptr<Vulkan::ShaderChain> shaderchain;
|
2023-02-01 20:47:42 +00:00
|
|
|
std::string current_shadername;
|
2023-01-30 23:54:23 +00:00
|
|
|
|
|
|
|
int current_width;
|
|
|
|
int current_height;
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool Initialize(HWND hWnd);
|
|
|
|
void DeInitialize();
|
|
|
|
void Render(SSurface Src);
|
|
|
|
bool ChangeRenderSize(unsigned int newWidth, unsigned int newHeight);
|
|
|
|
bool ApplyDisplayChanges(void);
|
|
|
|
bool SetFullscreen(bool fullscreen);
|
|
|
|
void SetSnes9xColorFormat();
|
|
|
|
void EnumModes(std::vector<dMode>* modeVector);
|
2023-02-01 20:47:42 +00:00
|
|
|
std::vector<SlangShader::Parameter> *GetShaderParameters(void);
|
|
|
|
std::function<void(const char *)> GetShaderParametersSaveFunction();
|
2023-01-30 23:54:23 +00:00
|
|
|
};
|
|
|
|
|