diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-06-21 16:41:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-21 17:00:56 +0300 |
commit | d2f47017b984a50c2bf9ff355fb1d01865663d39 (patch) | |
tree | c1454efc8d5de5bd85573a40e1e087e9b193611a /source/blender/gpu | |
parent | 9622dace3e23a8eddaa0c443030120072a4a6482 (diff) |
Fix crash editing anisotropic filter preference from background mode
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_context.cc | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.cc | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_context.cc b/source/blender/gpu/intern/gpu_context.cc index c6eaf7defdc..b7dad589395 100644 --- a/source/blender/gpu/intern/gpu_context.cc +++ b/source/blender/gpu/intern/gpu_context.cc @@ -177,7 +177,7 @@ void GPU_render_step() /** \name Backend selection * \{ */ -static GPUBackend *g_backend; +static GPUBackend *g_backend = nullptr; bool GPU_backend_supported(eGPUBackendType type) { diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc index d78dc845074..c300c0da3b2 100644 --- a/source/blender/gpu/intern/gpu_texture.cc +++ b/source/blender/gpu/intern/gpu_texture.cc @@ -702,7 +702,11 @@ void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *r_size) void GPU_samplers_update() { - GPUBackend::get()->samplers_update(); + /* Backend may not exist when we are updating preferences from background mode. */ + GPUBackend *backend = GPUBackend::get(); + if (backend) { + backend->samplers_update(); + } } /** \} */ |