+ if (sample_count >= 1) {
+ VkSampleCountFlagBits sample_mask = vk_sample_count_flags(sample_count);
+ const struct util_format_description *desc = util_format_description(format);
+ if (util_format_is_depth_or_stencil(format)) {
+ if (util_format_has_depth(desc)) {
+ if (bind & PIPE_BIND_DEPTH_STENCIL &&
+ (screen->props.limits.framebufferDepthSampleCounts & sample_mask) != sample_mask)
+ return FALSE;
+ if (bind & PIPE_BIND_SAMPLER_VIEW &&
+ (screen->props.limits.sampledImageDepthSampleCounts & sample_mask) != sample_mask)
+ return FALSE;
+ }
+ if (util_format_has_stencil(desc)) {
+ if (bind & PIPE_BIND_DEPTH_STENCIL &&
+ (screen->props.limits.framebufferStencilSampleCounts & sample_mask) != sample_mask)
+ return FALSE;
+ if (bind & PIPE_BIND_SAMPLER_VIEW &&
+ (screen->props.limits.sampledImageStencilSampleCounts & sample_mask) != sample_mask)
+ return FALSE;
+ }
+ } else if (util_format_is_pure_integer(format)) {
+ if (bind & PIPE_BIND_RENDER_TARGET &&
+ !(screen->props.limits.framebufferColorSampleCounts & sample_mask))
+ return FALSE;
+ if (bind & PIPE_BIND_SAMPLER_VIEW &&
+ !(screen->props.limits.sampledImageIntegerSampleCounts & sample_mask))
+ return FALSE;
+ } else {
+ if (bind & PIPE_BIND_RENDER_TARGET &&
+ !(screen->props.limits.framebufferColorSampleCounts & sample_mask))
+ return FALSE;
+ if (bind & PIPE_BIND_SAMPLER_VIEW &&
+ !(screen->props.limits.sampledImageColorSampleCounts & sample_mask))
+ return FALSE;
+ }
+ }
+