fix(agc): honor top bound for single-ended buffers

This commit is contained in:
nmzik
2026-08-30 23:39:18 +04:00
parent 9992ab18fc
commit 1469c53048
+3 -2
View File
@@ -257,11 +257,12 @@ struct CommandBuffer {
}
[[nodiscard]] KYTY_SYSV_ABI uint32_t GetAvailableSizeDW() const {
if (cursor_up == nullptr || cursor_down == nullptr || cursor_down <= cursor_up) {
auto* end = cursor_down != nullptr ? cursor_down : top;
if (cursor_up == nullptr || end == nullptr || end <= cursor_up) {
return 0;
}
auto available = static_cast<uint64_t>(cursor_down - cursor_up);
auto available = static_cast<uint64_t>(end - cursor_up);
if (available <= reserved_dw) {
return 0;
}