Skip to content

Commit

Permalink
synchronize bufferlike views and ptrs
Browse files Browse the repository at this point in the history
  • Loading branch information
martty committed Dec 30, 2024
1 parent 6b9cc90 commit 3f29bf9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/runtime/vk/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,11 +853,12 @@ namespace vuk {
return 0;
}
} else if (base_ty->kind == Type::POINTER_TY) {
return 0; // pointers cannot be synchronized
auto& v = *reinterpret_cast<ptr_base*>(value); // TODO: this should be with the implicit view and aliasing
key = v.device_address;
} else if (base_ty->is_bufferlike_view()) {
auto& v = *reinterpret_cast<view<BufferLike<void>>*>(value);
key = v.ptr.device_address;
hash_combine(key, v.sz_bytes); // TODO: aliasing
//hash_combine(key, v.sz_bytes); // TODO: aliasing
} else { // other types do not sync
return 0;
}
Expand Down Expand Up @@ -986,7 +987,7 @@ namespace vuk {
found->subrange.image.base_layer = isection.base_layer;
found->subrange.image.layer_count = isection.layer_count;
}
} else if (base_ty->hash_value == current_module->types.builtin_buffer) {
} else if (base_ty->kind == Type::POINTER_TY || base_ty->is_bufferlike_view()) {
auto& src_use = *head;
if (src_use.stream && dst_use.stream && (src_use.stream != dst_use.stream)) {
dst_use.stream->add_dependency(src_use.stream);
Expand Down

0 comments on commit 3f29bf9

Please sign in to comment.