Skip to content

Commit 55e4ba9

Browse files
layers: Better name for indeterminate_state
1 parent 185128d commit 55e4ba9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

layers/core_checks/cc_device_memory.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,15 @@ bool CoreChecks::ValidateSetMemBinding(const vvl::DeviceMemory &memory_state, co
307307
}
308308

309309
const auto *prev_binding = mem_binding.MemState();
310-
if (prev_binding || mem_binding.partial_bound) {
310+
if (prev_binding || mem_binding.indeterminate_state) {
311311
const char *vuid = kVUIDUndefined;
312312
if (is_buffer) {
313313
vuid = bind_2 ? "VUID-VkBindBufferMemoryInfo-buffer-07459" : "VUID-vkBindBufferMemory-buffer-07459";
314314
} else {
315315
vuid = bind_2 ? "VUID-VkBindImageMemoryInfo-image-07460" : "VUID-vkBindImageMemory-image-07460";
316316
}
317317

318-
if (mem_binding.partial_bound) {
318+
if (mem_binding.indeterminate_state) {
319319
Func bind_call = is_buffer ? Func::vkBindBufferMemory2 : Func::vkBindImageMemory2;
320320
const char *handle_type = is_buffer ? "buffer" : "image";
321321
const LogObjectList objlist(memory_state.Handle(), typed_handle);
@@ -2070,10 +2070,11 @@ bool CoreChecks::PreCallValidateBindImageMemory2(VkDevice device, uint32_t bindI
20702070
void CoreChecks::PostCallRecordBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo *pBindInfos,
20712071
const RecordObject &record_obj) {
20722072
if (VK_SUCCESS != record_obj.result) {
2073+
// if bindInfoCount is 1, we know for sure if that single image was bound or not
20732074
if (bindInfoCount > 1) {
20742075
for (uint32_t i = 0; i < bindInfoCount; i++) {
20752076
if (auto image_state = Get<vvl::Image>(pBindInfos[i].image)) {
2076-
image_state->partial_bound = true;
2077+
image_state->indeterminate_state = true;
20772078
}
20782079
}
20792080
}

layers/state_tracker/device_memory_state.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class Bindable : public StateObject {
316316
const bool unprotected; // can't be used for protected memory
317317

318318
// For when an array of binds don't succeed and the object is in an indeterminate state
319-
bool partial_bound = false;
319+
bool indeterminate_state = false;
320320

321321
private:
322322
mutable bool need_to_recache_invalid_memory_ = false;

layers/state_tracker/state_tracker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,10 +1615,11 @@ void ValidationStateTracker::PostCallRecordBindBufferMemory2(VkDevice device, ui
16151615
const VkBindBufferMemoryInfo *pBindInfos,
16161616
const RecordObject &record_obj) {
16171617
if (VK_SUCCESS != record_obj.result) {
1618+
// if bindInfoCount is 1, we know for sure if that single buffer was bound or not
16181619
if (bindInfoCount > 1) {
16191620
for (uint32_t i = 0; i < bindInfoCount; i++) {
16201621
if (auto buffer_state = Get<vvl::Buffer>(pBindInfos[i].buffer)) {
1621-
buffer_state->partial_bound = true;
1622+
buffer_state->indeterminate_state = true;
16221623
}
16231624
}
16241625
}

0 commit comments

Comments
 (0)