layers: Transition all to HandleToUint64
Mostly automatic (i.e. probably missed some cases)
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 88d44e6..0627c67 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -589,8 +589,7 @@
}
// Set is being deleted or updates so invalidate all bound cmd buffers
void cvdescriptorset::DescriptorSet::InvalidateBoundCmdBuffers() {
- core_validation::invalidateCommandBuffers(device_data_, cb_bindings,
- {reinterpret_cast<uint64_t &>(set_), kVulkanObjectTypeDescriptorSet });
+ core_validation::invalidateCommandBuffers(device_data_, cb_bindings, {HandleToUint64(set_), kVulkanObjectTypeDescriptorSet});
}
// Perform write update in given update struct
void cvdescriptorset::DescriptorSet::PerformWriteUpdate(const VkWriteDescriptorSet *update) {
@@ -726,10 +725,9 @@
// bind cb to this descriptor set
cb_bindings.insert(cb_node);
// Add bindings for descriptor set, the set's pool, and individual objects in the set
- cb_node->object_bindings.insert({reinterpret_cast<uint64_t &>(set_), kVulkanObjectTypeDescriptorSet });
+ cb_node->object_bindings.insert({HandleToUint64(set_), kVulkanObjectTypeDescriptorSet});
pool_state_->cb_bindings.insert(cb_node);
- cb_node->object_bindings.insert(
- {reinterpret_cast<uint64_t &>(pool_state_->pool), kVulkanObjectTypeDescriptorPool });
+ cb_node->object_bindings.insert({HandleToUint64(pool_state_->pool), kVulkanObjectTypeDescriptorPool});
// For the active slots, use set# to look up descriptorSet from boundDescriptorSets, and bind all of that descriptor set's
// resources
for (auto binding_req_pair : binding_req_map) {
@@ -1098,18 +1096,18 @@
if (!set_node) {
skip |=
log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- reinterpret_cast<uint64_t &>(dest_set), __LINE__, DRAWSTATE_INVALID_DESCRIPTOR_SET, "DS",
+ HandleToUint64(dest_set), __LINE__, DRAWSTATE_INVALID_DESCRIPTOR_SET, "DS",
"Cannot call vkUpdateDescriptorSets() on descriptor set 0x%" PRIxLEAST64 " that has not been allocated.",
- reinterpret_cast<uint64_t &>(dest_set));
+ HandleToUint64(dest_set));
} else {
UNIQUE_VALIDATION_ERROR_CODE error_code;
std::string error_str;
if (!set_node->ValidateWriteUpdate(report_data, &p_wds[i], &error_code, &error_str)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- reinterpret_cast<uint64_t &>(dest_set), __LINE__, error_code, "DS",
+ HandleToUint64(dest_set), __LINE__, error_code, "DS",
"vkUpdateDescriptorsSets() failed write update validation for Descriptor Set 0x%" PRIx64
" with error: %s. %s",
- reinterpret_cast<uint64_t &>(dest_set), error_str.c_str(), validation_error_map[error_code]);
+ HandleToUint64(dest_set), error_str.c_str(), validation_error_map[error_code]);
}
}
}
@@ -1126,11 +1124,10 @@
std::string error_str;
if (!dst_node->ValidateCopyUpdate(report_data, &p_cds[i], src_node, &error_code, &error_str)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- reinterpret_cast<uint64_t &>(dst_set), __LINE__, error_code, "DS",
+ HandleToUint64(dst_set), __LINE__, error_code, "DS",
"vkUpdateDescriptorsSets() failed copy update from Descriptor Set 0x%" PRIx64
" to Descriptor Set 0x%" PRIx64 " with error: %s. %s",
- reinterpret_cast<uint64_t &>(src_set), reinterpret_cast<uint64_t &>(dst_set), error_str.c_str(),
- validation_error_map[error_code]);
+ HandleToUint64(src_set), HandleToUint64(dst_set), error_str.c_str(), validation_error_map[error_code]);
}
}
return skip;
@@ -1657,9 +1654,9 @@
if (!layout) {
skip |=
log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT,
- reinterpret_cast<const uint64_t &>(p_alloc_info->pSetLayouts[i]), __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS",
+ HandleToUint64(p_alloc_info->pSetLayouts[i]), __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS",
"Unable to find set layout node for layout 0x%" PRIxLEAST64 " specified in vkAllocateDescriptorSets() call",
- reinterpret_cast<const uint64_t &>(p_alloc_info->pSetLayouts[i]));
+ HandleToUint64(p_alloc_info->pSetLayouts[i]));
}
}
if (!GetDeviceExtensions(dev_data)->khr_maintenance1) {
@@ -1667,21 +1664,21 @@
// Track number of descriptorSets allowable in this pool
if (pool_state->availableSets < p_alloc_info->descriptorSetCount) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT,
- reinterpret_cast<uint64_t &>(pool_state->pool), __LINE__, VALIDATION_ERROR_00911, "DS",
+ HandleToUint64(pool_state->pool), __LINE__, VALIDATION_ERROR_00911, "DS",
"Unable to allocate %u descriptorSets from pool 0x%" PRIxLEAST64
". This pool only has %d descriptorSets remaining. %s",
- p_alloc_info->descriptorSetCount, reinterpret_cast<uint64_t &>(pool_state->pool),
- pool_state->availableSets, validation_error_map[VALIDATION_ERROR_00911]);
+ p_alloc_info->descriptorSetCount, HandleToUint64(pool_state->pool), pool_state->availableSets,
+ validation_error_map[VALIDATION_ERROR_00911]);
}
// Determine whether descriptor counts are satisfiable
for (uint32_t i = 0; i < VK_DESCRIPTOR_TYPE_RANGE_SIZE; i++) {
if (ds_data->required_descriptors_by_type[i] > pool_state->availableDescriptorTypeCount[i]) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT,
- reinterpret_cast<const uint64_t &>(pool_state->pool), __LINE__, VALIDATION_ERROR_00912, "DS",
+ HandleToUint64(pool_state->pool), __LINE__, VALIDATION_ERROR_00912, "DS",
"Unable to allocate %u descriptors of type %s from pool 0x%" PRIxLEAST64
". This pool only has %d descriptors of this type remaining. %s",
ds_data->required_descriptors_by_type[i], string_VkDescriptorType(VkDescriptorType(i)),
- reinterpret_cast<uint64_t &>(pool_state->pool), pool_state->availableDescriptorTypeCount[i],
+ HandleToUint64(pool_state->pool), pool_state->availableDescriptorTypeCount[i],
validation_error_map[VALIDATION_ERROR_00912]);
}
}