mirror of https://github.com/snes9xgit/snes9x.git
win32: Fix a couple of crashes.
This commit is contained in:
parent
c3366477a7
commit
93a242312f
|
@ -22,17 +22,19 @@ 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;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_shadername = shaderstring;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
create_pipeline();
|
create_pipeline();
|
||||||
|
@ -81,11 +83,10 @@ bool CVulkan::Initialize(HWND hWnd)
|
||||||
|
|
||||||
void CVulkan::DeInitialize()
|
void CVulkan::DeInitialize()
|
||||||
{
|
{
|
||||||
if (!context)
|
|
||||||
return;
|
|
||||||
|
|
||||||
current_shadername = "";
|
current_shadername = "";
|
||||||
context->wait_idle();
|
|
||||||
|
if (context)
|
||||||
|
context->wait_idle();
|
||||||
shaderchain.reset();
|
shaderchain.reset();
|
||||||
textures.clear();
|
textures.clear();
|
||||||
descriptors.clear();
|
descriptors.clear();
|
||||||
|
|
Loading…
Reference in New Issue