mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-26 03:13:15 -06:00
Merge pull request #8700 from liamwhite/xc3-vk-crash
vk_texture_cache: return VK_NULL_HANDLE for views of null images
This commit is contained in:
commit
0f2fc6335e
1 changed files with 12 additions and 0 deletions
|
@ -1618,6 +1618,9 @@ ImageView::ImageView(TextureCacheRuntime&, const VideoCommon::NullImageViewParam
|
||||||
ImageView::~ImageView() = default;
|
ImageView::~ImageView() = default;
|
||||||
|
|
||||||
VkImageView ImageView::DepthView() {
|
VkImageView ImageView::DepthView() {
|
||||||
|
if (!image_handle) {
|
||||||
|
return VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
if (depth_view) {
|
if (depth_view) {
|
||||||
return *depth_view;
|
return *depth_view;
|
||||||
}
|
}
|
||||||
|
@ -1627,6 +1630,9 @@ VkImageView ImageView::DepthView() {
|
||||||
}
|
}
|
||||||
|
|
||||||
VkImageView ImageView::StencilView() {
|
VkImageView ImageView::StencilView() {
|
||||||
|
if (!image_handle) {
|
||||||
|
return VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
if (stencil_view) {
|
if (stencil_view) {
|
||||||
return *stencil_view;
|
return *stencil_view;
|
||||||
}
|
}
|
||||||
|
@ -1636,6 +1642,9 @@ VkImageView ImageView::StencilView() {
|
||||||
}
|
}
|
||||||
|
|
||||||
VkImageView ImageView::ColorView() {
|
VkImageView ImageView::ColorView() {
|
||||||
|
if (!image_handle) {
|
||||||
|
return VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
if (color_view) {
|
if (color_view) {
|
||||||
return *color_view;
|
return *color_view;
|
||||||
}
|
}
|
||||||
|
@ -1645,6 +1654,9 @@ VkImageView ImageView::ColorView() {
|
||||||
|
|
||||||
VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||||
Shader::ImageFormat image_format) {
|
Shader::ImageFormat image_format) {
|
||||||
|
if (!image_handle) {
|
||||||
|
return VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
if (image_format == Shader::ImageFormat::Typeless) {
|
if (image_format == Shader::ImageFormat::Typeless) {
|
||||||
return Handle(texture_type);
|
return Handle(texture_type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue