mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-01 12:55:42 -04:00
GPU/D3D11: Fix crash/hang when toggling bilinear setting
This commit is contained in:
parent
d1ee6c0da7
commit
bb344a4e1e
@ -13,10 +13,12 @@ GPU_HW_D3D11::GPU_HW_D3D11() = default;
|
|||||||
GPU_HW_D3D11::~GPU_HW_D3D11()
|
GPU_HW_D3D11::~GPU_HW_D3D11()
|
||||||
{
|
{
|
||||||
if (m_host_display)
|
if (m_host_display)
|
||||||
{
|
|
||||||
m_host_display->ClearDisplayTexture();
|
m_host_display->ClearDisplayTexture();
|
||||||
ResetGraphicsAPIState();
|
|
||||||
}
|
m_context->ClearState();
|
||||||
|
|
||||||
|
DestroyShaders();
|
||||||
|
DestroyStateObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GPU_HW_D3D11::Initialize(HostDisplay* host_display)
|
bool GPU_HW_D3D11::Initialize(HostDisplay* host_display)
|
||||||
@ -121,8 +123,6 @@ void GPU_HW_D3D11::UpdateSettings()
|
|||||||
bool framebuffer_changed, shaders_changed;
|
bool framebuffer_changed, shaders_changed;
|
||||||
UpdateHWSettings(&framebuffer_changed, &shaders_changed);
|
UpdateHWSettings(&framebuffer_changed, &shaders_changed);
|
||||||
|
|
||||||
m_context->ClearState();
|
|
||||||
|
|
||||||
if (framebuffer_changed)
|
if (framebuffer_changed)
|
||||||
{
|
{
|
||||||
m_host_display->ClearDisplayTexture();
|
m_host_display->ClearDisplayTexture();
|
||||||
@ -132,6 +132,8 @@ void GPU_HW_D3D11::UpdateSettings()
|
|||||||
if (shaders_changed)
|
if (shaders_changed)
|
||||||
{
|
{
|
||||||
DestroyShaders();
|
DestroyShaders();
|
||||||
|
DestroyStateObjects();
|
||||||
|
CreateStateObjects();
|
||||||
CompileShaders();
|
CompileShaders();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,6 +354,19 @@ bool GPU_HW_D3D11::CreateStateObjects()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPU_HW_D3D11::DestroyStateObjects()
|
||||||
|
{
|
||||||
|
m_batch_blend_states = {};
|
||||||
|
m_linear_sampler_state.Reset();
|
||||||
|
m_point_sampler_state.Reset();
|
||||||
|
m_blend_no_color_writes_state.Reset();
|
||||||
|
m_blend_disabled_state.Reset();
|
||||||
|
m_depth_test_less_state.Reset();
|
||||||
|
m_depth_test_always_state.Reset();
|
||||||
|
m_depth_disabled_state.Reset();
|
||||||
|
m_cull_none_rasterizer_state.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
bool GPU_HW_D3D11::CompileShaders()
|
bool GPU_HW_D3D11::CompileShaders()
|
||||||
{
|
{
|
||||||
GPU_HW_ShaderGen shadergen(m_host_display->GetRenderAPI(), m_resolution_scale, m_true_color, m_scaled_dithering,
|
GPU_HW_ShaderGen shadergen(m_host_display->GetRenderAPI(), m_resolution_scale, m_true_color, m_scaled_dithering,
|
||||||
|
@ -57,6 +57,7 @@ private:
|
|||||||
bool CreateUniformBuffer();
|
bool CreateUniformBuffer();
|
||||||
bool CreateTextureBuffer();
|
bool CreateTextureBuffer();
|
||||||
bool CreateStateObjects();
|
bool CreateStateObjects();
|
||||||
|
void DestroyStateObjects();
|
||||||
|
|
||||||
bool CompileShaders();
|
bool CompileShaders();
|
||||||
void DestroyShaders();
|
void DestroyShaders();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user