diff options
| author | Petr Kraus <petr_kraus@email.cz> | 2017-05-14 23:43:38 +0200 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2017-05-17 09:30:13 -0600 |
| commit | 64510d8e9981171c115f810e55e4f55fa74ad6d4 (patch) | |
| tree | 34d599e8253a47aa10c06cc4fbd963a8aed644c0 /layers/descriptor_sets.cpp | |
| parent | ffaa557aabe1609713062efe79aea8c7aeb1bf76 (diff) | |
| download | usermoji-64510d8e9981171c115f810e55e4f55fa74ad6d4.tar.xz | |
layers: Transition all to HandleToUint64
Mostly automatic (i.e. probably missed some cases)
Diffstat (limited to 'layers/descriptor_sets.cpp')
| -rw-r--r-- | layers/descriptor_sets.cpp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 88d44e67..0627c67f 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -589,8 +589,7 @@ uint32_t cvdescriptorset::DescriptorSet::GetStorageUpdates(const std::map<uint32 } // 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 @@ void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node, // 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 @@ bool cvdescriptorset::ValidateUpdateDescriptorSets(const debug_report_data *repo 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 @@ bool cvdescriptorset::ValidateUpdateDescriptorSets(const debug_report_data *repo 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 @@ bool cvdescriptorset::ValidateAllocateDescriptorSets(const core_validation::laye 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 @@ bool cvdescriptorset::ValidateAllocateDescriptorSets(const core_validation::laye // 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]); } } |
