Skip to content

Commit

Permalink
fix create_pipeline crash in vulkan-enabled layer without calling loa…
Browse files Browse the repository at this point in the history
…d_param/load_model first (#5410)
  • Loading branch information
nihui authored Apr 8, 2024
1 parent 3b048d1 commit 056509a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,16 @@ class Layer_final : public Layer
#if NCNN_VULKAN
if (layer_vulkan)
{
int ret = layer_vulkan->create_pipeline(opt);
get_layer_properties();
return ret;
if (vkdev)
{
int ret = layer_vulkan->create_pipeline(opt);
get_layer_properties();
return ret;
}

// fallback to cpu layer
delete layer_vulkan;
layer_vulkan = 0;
}
#endif // NCNN_VULKAN

Expand Down

0 comments on commit 056509a

Please sign in to comment.