[+] AuIO::IOPipeRequest::bReadEntireAllocation

[*] Fix 24. Hello IO regression
This commit is contained in:
Reece Wilson 2024-09-17 18:23:49 +01:00
parent a4d2649dac
commit 436d50a01f
3 changed files with 20 additions and 6 deletions

View File

@ -52,6 +52,13 @@ namespace Aurora::IO
*/
AuUInt32 uMinBytesToRead {};
/**
* If true, no uPage-related retardation will be considered for per frame ingest.
* The entire internal allocation will be used to read/recv data, unless overwritten by SetNextFrameTargetLength.
* If false, uPageLengthOrZero as a constraint will be respected unless overwritten by SetNextFrameTargetLength.
*/
bool bReadEntireAllocation {};
/**
* @brief Used as the buffer size for streams of page length 0
*/

View File

@ -24,6 +24,7 @@ namespace Aurora::IO
this->uBufferSize_ = request.uBufferLengthOrZero ? request.uBufferLengthOrZero : request.kFallbackBufferSize;
this->uBytesWrittenLimit_ = request.uLengthOrZero;
this->uBytesWrittenTarget_ = request.uMinBytesToRead ? request.uMinBytesToRead : request.uLengthOrZero;
this->bReadEntireAllocation_ = request.bReadEntireAllocation;
this->pAsyncTransaction_ = request.pAsyncTransaction;
this->pAsyncAdapter_ = Adapters::NewAsyncStreamAdapter(request.pAsyncTransaction, request.bIsStream);
SysAssert(this->pAsyncAdapter_);
@ -41,6 +42,7 @@ namespace Aurora::IO
{
this->uBufferSize_ = request.uBufferLengthOrZero ? request.uBufferLengthOrZero : request.kFallbackBufferSize;
this->uFrameCap_ = request.uPageLengthOrZero ? request.uPageLengthOrZero : request.kFallbackPageSize;
this->bReadEntireAllocation_ = request.bReadEntireAllocation;
this->uBytesWrittenLimit_ = request.uLengthOrZero;
this->uBytesWrittenTarget_ = request.uMinBytesToRead ? request.uMinBytesToRead : request.uLengthOrZero;
}
@ -378,6 +380,10 @@ namespace Aurora::IO
}
else
{
if (!this->bReadEntireAllocation_)
{
uBytesMax = AuMin(this->uFrameCap_, uBytesMax);
}
return uBytesMax;
}
}

View File

@ -132,6 +132,7 @@ namespace Aurora::IO
AuUInt uBytesWrittenLimit_ {};
AuUInt uBytesWrittenTarget_ {};
AuUInt uBytesPerFrame_ {};
bool bReadEntireAllocation_ {};
AuByteBuffer buffer_;
Aurora::Utility::ThroughputCalculator throughput_;
AuUInt bytesProcessedInterframe_ {};