mirror of https://github.com/snes9xgit/snes9x.git
win32: Fix a couple of crashes.
This commit is contained in:
parent
c3366477a7
commit
93a242312f
|
@ -22,18 +22,20 @@ bool CVulkan::Initialize(HWND hWnd)
|
||||||
swapchain = context->swapchain.get();
|
swapchain = context->swapchain.get();
|
||||||
device = context->device;
|
device = context->device;
|
||||||
|
|
||||||
if (GUI.shaderEnabled && GUI.OGLshaderFileName)
|
if (GUI.shaderEnabled && GUI.OGLshaderFileName && GUI.OGLshaderFileName[0])
|
||||||
{
|
{
|
||||||
shaderchain = std::make_unique<Vulkan::ShaderChain>(context.get());
|
shaderchain = std::make_unique<Vulkan::ShaderChain>(context.get());
|
||||||
std::string shaderstring = _tToChar(GUI.OGLshaderFileName);
|
std::string shaderstring = _tToChar(GUI.OGLshaderFileName);
|
||||||
if (!shaderchain->load_shader_preset(shaderstring))
|
if (!shaderchain->load_shader_preset(shaderstring))
|
||||||
{
|
{
|
||||||
return false;
|
shaderchain.reset();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
current_shadername = shaderstring;
|
current_shadername = shaderstring;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
create_pipeline();
|
create_pipeline();
|
||||||
|
|
||||||
|
@ -81,10 +83,9 @@ bool CVulkan::Initialize(HWND hWnd)
|
||||||
|
|
||||||
void CVulkan::DeInitialize()
|
void CVulkan::DeInitialize()
|
||||||
{
|
{
|
||||||
if (!context)
|
|
||||||
return;
|
|
||||||
|
|
||||||
current_shadername = "";
|
current_shadername = "";
|
||||||
|
|
||||||
|
if (context)
|
||||||
context->wait_idle();
|
context->wait_idle();
|
||||||
shaderchain.reset();
|
shaderchain.reset();
|
||||||
textures.clear();
|
textures.clear();
|
||||||
|
|
Loading…
Reference in New Issue