Skip to content

Commit c15bcb0

Browse files
add a missing fallthrough
1 parent 27da404 commit c15bcb0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

include/nbl/asset/IImageView.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,12 @@ class IImageView : public IDescriptor
8080
struct SCreationParams
8181
{
8282
E_CREATE_FLAGS flags = static_cast<E_CREATE_FLAGS>(0);
83-
#if 0
8483
// These are the set of usages for this ImageView, they must be a subset of the usages that `image` was created with.
8584
// If you leave it as the default NONE we'll inherit all usages from the `image`, setting it to anything else is
8685
// ONLY useful when creating multiple views of an image created with EXTENDED_USAGE to use different view formats.
8786
// Example: Create SRGB image with usage STORAGE, and two views with formats SRGB and R32_UINT. Then the SRGB view
8887
// CANNOT have STORAGE usage because the format doesn't support it, but the R32_UINT can.
8988
core::bitflag<IImage::E_USAGE_FLAGS> subUsages = EUF_NONE;
90-
#endif
9189
core::smart_refctd_ptr<ImageType> image;
9290
E_TYPE viewType;
9391
E_FORMAT format;
@@ -111,11 +109,11 @@ class IImageView : public IDescriptor
111109
if (imgParams.)
112110
return false;
113111
*/
114-
#if 0
112+
115113
// declared usages that are not a subset
116114
if (!imgParams.usage.hasFlags(_params.subUsages))
117115
return false;
118-
#endif
116+
119117
const bool mutableFormat = imgParams.flags.hasFlags(IImage::ECF_MUTABLE_FORMAT_BIT);
120118
const bool blockTexelViewCompatible = imgParams.flags.hasFlags(IImage::ECF_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT);
121119
const auto& subresourceRange = _params.subresourceRange;
@@ -235,7 +233,7 @@ class IImageView : public IDescriptor
235233
// https://registry.khronos.org/vulkan/specs/1.2/html/vkspec.html#VUID-VkImageViewCreateInfo-viewType-02962
236234
if (actualLayerCount!=6u)
237235
return false;
238-
break;
236+
[[fallthrough]];
239237
case ET_CUBE_MAP_ARRAY:
240238
// https://registry.khronos.org/vulkan/specs/1.2/html/vkspec.html#VUID-VkImageViewCreateInfo-viewType-02961
241239
// https://registry.khronos.org/vulkan/specs/1.2/html/vkspec.html#VUID-VkImageViewCreateInfo-viewType-02963

0 commit comments

Comments
 (0)