mirror of https://github.com/snes9xgit/snes9x.git
Add shaderchain support to win32.
This commit is contained in:
parent
44a2958c31
commit
89bbf08c74
|
@ -22,6 +22,16 @@ bool CVulkan::Initialize(HWND hWnd)
|
||||||
swapchain = context->swapchain.get();
|
swapchain = context->swapchain.get();
|
||||||
device = context->device;
|
device = context->device;
|
||||||
|
|
||||||
|
if (GUI.shaderEnabled && GUI.OGLshaderFileName)
|
||||||
|
{
|
||||||
|
shaderchain = std::make_unique<Vulkan::ShaderChain>(context.get());
|
||||||
|
if (!shaderchain->load_shader_preset(std::string(_tToChar(GUI.OGLshaderFileName))))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
create_pipeline();
|
create_pipeline();
|
||||||
|
|
||||||
descriptors.clear();
|
descriptors.clear();
|
||||||
|
@ -72,6 +82,7 @@ void CVulkan::DeInitialize()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
context->wait_idle();
|
context->wait_idle();
|
||||||
|
shaderchain.reset();
|
||||||
textures.clear();
|
textures.clear();
|
||||||
descriptors.clear();
|
descriptors.clear();
|
||||||
device.destroySampler(linear_sampler);
|
device.destroySampler(linear_sampler);
|
||||||
|
@ -117,6 +128,12 @@ void CVulkan::Render(SSurface Src)
|
||||||
//Get maximum rect respecting AR setting
|
//Get maximum rect respecting AR setting
|
||||||
displayRect = CalculateDisplayRect(Dst.Width, Dst.Height, windowSize.right, windowSize.bottom);
|
displayRect = CalculateDisplayRect(Dst.Width, Dst.Height, windowSize.right, windowSize.bottom);
|
||||||
|
|
||||||
|
if (shaderchain)
|
||||||
|
{
|
||||||
|
shaderchain->do_frame(Dst.Surface, Dst.Width, Dst.Height, Dst.Pitch, vk::Format::eR5G6B5UnormPack16, displayRect.left, displayRect.top, displayRect.right - displayRect.left, displayRect.bottom - displayRect.top);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!swapchain->begin_frame())
|
if (!swapchain->begin_frame())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "IS9xDisplayOutput.h"
|
#include "IS9xDisplayOutput.h"
|
||||||
#include "../vulkan/vulkan_context.hpp"
|
#include "../vulkan/vulkan_context.hpp"
|
||||||
#include "../vulkan/vulkan_texture.hpp"
|
#include "../vulkan/vulkan_texture.hpp"
|
||||||
|
#include "../vulkan/vulkan_shader_chain.hpp"
|
||||||
|
|
||||||
class CVulkan : public IS9xDisplayOutput
|
class CVulkan : public IS9xDisplayOutput
|
||||||
{
|
{
|
||||||
|
@ -21,6 +22,7 @@ class CVulkan : public IS9xDisplayOutput
|
||||||
std::vector<Vulkan::Texture> textures;
|
std::vector<Vulkan::Texture> textures;
|
||||||
std::vector<vk::UniqueDescriptorSet> descriptors;
|
std::vector<vk::UniqueDescriptorSet> descriptors;
|
||||||
std::vector<uint16_t> filtered_image;
|
std::vector<uint16_t> filtered_image;
|
||||||
|
std::unique_ptr<Vulkan::ShaderChain> shaderchain;
|
||||||
|
|
||||||
int current_width;
|
int current_width;
|
||||||
int current_height;
|
int current_height;
|
||||||
|
|
Loading…
Reference in New Issue