diff options
| -rwxr-xr-x | buildAndroid/android-generate.sh | 2 | ||||
| -rwxr-xr-x | layers/draw_state.h | 21 |
2 files changed, 9 insertions, 14 deletions
diff --git a/buildAndroid/android-generate.sh b/buildAndroid/android-generate.sh index 496e349f..5f980681 100755 --- a/buildAndroid/android-generate.sh +++ b/buildAndroid/android-generate.sh @@ -25,5 +25,5 @@ python ../vk_helper.py --gen_struct_wrappers ../include/vulkan/vulkan.h --abs_ou python ../vk-layer-generate.py object_tracker ../include/vulkan/vulkan.h > generated/object_tracker.cpp python ../vk-layer-generate.py unique_objects ../include/vulkan/vulkan.h > generated/unique_objects.cpp ( cd generated; python ../../genvk.py threading -registry ../../vk.xml thread_check.h ) -( cd generated; python ../../genvk.py ParamCheck -registry ../../vk.xml param_check.h ) +( cd generated; python ../../genvk.py paramchecker -registry ../../vk.xml param_check.h ) diff --git a/layers/draw_state.h b/layers/draw_state.h index 320668c7..c7435c4c 100755 --- a/layers/draw_state.h +++ b/layers/draw_state.h @@ -581,9 +581,8 @@ struct ImageSubresourcePair { }; bool operator==(const ImageSubresourcePair &img1, const ImageSubresourcePair &img2) { - return (img1.image == img2.image && - img1.hasSubresource == img2.hasSubresource && - img1.subresource.aspectMask == img2.subresource.aspectMask && + if (img1.image != img2.image || img1.hasSubresource != img2.hasSubresource) return false; + return !img1.hasSubresource || (img1.subresource.aspectMask == img2.subresource.aspectMask && img1.subresource.mipLevel == img2.subresource.mipLevel && img1.subresource.arrayLayer == img2.subresource.arrayLayer); } @@ -593,16 +592,12 @@ template <> struct hash<ImageSubresourcePair> { size_t operator()(ImageSubresourcePair img) const throw() { size_t hashVal = hash<uint64_t>()(reinterpret_cast<uint64_t &>(img.image)); - hashVal ^= - hash<uint32_t>()(reinterpret_cast<uint32_t &>(img.hasSubresource)) + - 0x9e3779b9 + (hashVal << 6) + (hashVal >> 2); - hashVal ^= hash<uint32_t>()(reinterpret_cast<uint32_t &>( - img.subresource.aspectMask)) + - 0x9e3779b9 + (hashVal << 6) + (hashVal >> 2); - hashVal ^= hash<uint32_t>()(img.subresource.mipLevel) + 0x9e3779b9 + - (hashVal << 6) + (hashVal >> 2); - hashVal ^= hash<uint32_t>()(img.subresource.arrayLayer) + 0x9e3779b9 + - (hashVal << 6) + (hashVal >> 2); + hashVal ^= hash<bool>()(img.hasSubresource); + if (img.hasSubresource) { + hashVal ^= hash<uint32_t>()(reinterpret_cast<uint32_t &>(img.subresource.aspectMask)); + hashVal ^= hash<uint32_t>()(img.subresource.mipLevel); + hashVal ^= hash<uint32_t>()(img.subresource.arrayLayer); + } return hashVal; } }; |
