diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-10-31 17:20:22 +1300 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-11-22 11:45:12 +1300 |
| commit | bd74767349a2b2ae84321c9ff2162906a2a1921b (patch) | |
| tree | b902e097b6e1581a398342b924e0fbdf96efc0af /layers/core_validation.cpp | |
| parent | 69b6cc08413c2e0cf2af00a16df9f486b58f3730 (diff) | |
| download | usermoji-bd74767349a2b2ae84321c9ff2162906a2a1921b.tar.xz | |
layers: Tweak comments for swapchain checks to be less brittle
Referring to specific lines within an expression breaks every time this
code changes.
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 93670f94..30c08312 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11643,9 +11643,8 @@ static bool PreCallValidateCreateSwapchainKHR(layer_data *dev_data, VkSwapchainC capabilities.currentExtent.height)) return true; } - // Validate pCreateInfo->preTransform has one bit set (1st two - // lines of if-statement), which bit is also set in - // VkSurfaceCapabilitiesKHR::supportedTransforms (3rd line of if-statement): + // pCreateInfo->preTransform should have exactly one bit set, and that + // bit must also be set in VkSurfaceCapabilitiesKHR::supportedTransforms. if (!pCreateInfo->preTransform || (pCreateInfo->preTransform & (pCreateInfo->preTransform - 1)) || !(pCreateInfo->preTransform & capabilities.supportedTransforms)) { // This is an error situation; one for which we'd like to give @@ -11673,9 +11672,9 @@ static bool PreCallValidateCreateSwapchainKHR(layer_data *dev_data, VkSwapchainC errorString.c_str())) return true; } - // Validate pCreateInfo->compositeAlpha has one bit set (1st two - // lines of if-statement), which bit is also set in - // VkSurfaceCapabilitiesKHR::supportedCompositeAlpha (3rd line of if-statement): + + // pCreateInfo->compositeAlpha should have exactly one bit set, and that + // bit must also be set in VkSurfaceCapabilitiesKHR::supportedCompositeAlpha if (!pCreateInfo->compositeAlpha || (pCreateInfo->compositeAlpha & (pCreateInfo->compositeAlpha - 1)) || !((pCreateInfo->compositeAlpha) & capabilities.supportedCompositeAlpha)) { // This is an error situation; one for which we'd like to give |
