diff options
Diffstat (limited to 'layers/vk_layer_utils.cpp')
| -rw-r--r-- | layers/vk_layer_utils.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layers/vk_layer_utils.cpp b/layers/vk_layer_utils.cpp index 4eb1e905..cfa2f9b7 100644 --- a/layers/vk_layer_utils.cpp +++ b/layers/vk_layer_utils.cpp @@ -584,3 +584,15 @@ unsigned int vk_format_get_channel_count(VkFormat format) { return vk_format_table[format].channel_count; } + +// Perform a zero-tolerant modulo operation +VkDeviceSize vk_safe_modulo(VkDeviceSize dividend, VkDeviceSize divisor) +{ + VkDeviceSize result = 0; + if (divisor != 0) { + result = dividend % divisor; + } + return result; +} + + |
