From 746ea7b0cd804afe9ade4516d0e3e2dd2921fe6e Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 7 Oct 2024 17:45:23 -0500 Subject: [PATCH] vulkan: Add a vk_fragment_shading_rate_is_disabled() helper Part-of: --- src/vulkan/runtime/vk_graphics_state.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vulkan/runtime/vk_graphics_state.h b/src/vulkan/runtime/vk_graphics_state.h index 3309cdfba02..16b1e8bd5de 100644 --- a/src/vulkan/runtime/vk_graphics_state.h +++ b/src/vulkan/runtime/vk_graphics_state.h @@ -427,6 +427,15 @@ struct vk_fragment_shading_rate_state { VkFragmentShadingRateCombinerOpKHR combiner_ops[2]; }; +static inline bool +vk_fragment_shading_rate_is_disabled(const struct vk_fragment_shading_rate_state *fsr) +{ + return fsr->fragment_size.width == 1 && + fsr->fragment_size.height == 1 && + fsr->combiner_ops[0] == VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR && + fsr->combiner_ops[1] == VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR; +} + /***/ struct vk_sample_locations_state { /** VkSampleLocationsInfoEXT::sampleLocationsPerPixel */