Integrating github/staging through commit ab87ed9
This commit is contained in:
@@ -512,7 +512,8 @@ uint32 CAsyncIOFileRequest::ReadFile(CStreamingIOThread* pIOThread)
|
||||
}
|
||||
|
||||
CCryFile file;
|
||||
if ((nError = OpenFile(file)))
|
||||
nError = OpenFile(file);
|
||||
if (nError)
|
||||
{
|
||||
return nError;
|
||||
}
|
||||
@@ -555,12 +556,14 @@ uint32 CAsyncIOFileRequest::ReadFile(CStreamingIOThread* pIOThread)
|
||||
}
|
||||
|
||||
auto pZipEntry = ((AZ::IO::Archive*)(gEnv->pCryPak))->GetOpenedFileDataInZip(file.GetHandle());
|
||||
if ((nError = ConfigureRead(pZipEntry.get())))
|
||||
nError = ConfigureRead(pZipEntry.get());
|
||||
if (nError)
|
||||
{
|
||||
return nError;
|
||||
}
|
||||
|
||||
if ((nError = AllocateOutput(pZipEntry.get())))
|
||||
nError = AllocateOutput(pZipEntry.get());
|
||||
if (nError)
|
||||
{
|
||||
return nError;
|
||||
}
|
||||
@@ -578,14 +581,16 @@ uint32 CAsyncIOFileRequest::ReadFileResume(CStreamingIOThread* pIOThread)
|
||||
}
|
||||
|
||||
CCryFile file;
|
||||
if ((nError = OpenFile(file)))
|
||||
nError = OpenFile(file);
|
||||
if (nError)
|
||||
{
|
||||
return nError;
|
||||
}
|
||||
|
||||
auto pZipEntry = ((AZ::IO::Archive*)(gEnv->pCryPak))->GetOpenedFileDataInZip(file.GetHandle());
|
||||
|
||||
if ((nError = AllocateOutput(pZipEntry.get())))
|
||||
nError = AllocateOutput(pZipEntry.get());
|
||||
if (nError)
|
||||
{
|
||||
return nError;
|
||||
}
|
||||
@@ -653,7 +658,8 @@ uint32 CAsyncIOFileRequest::ReadFileInPages(CStreamingIOThread* pIOThread, CCryF
|
||||
}
|
||||
|
||||
//check if job needs to be pre-empted
|
||||
if ((nError = ReadFileCheckPreempt(pIOThread)))
|
||||
nError = ReadFileCheckPreempt(pIOThread);
|
||||
if (nError)
|
||||
{
|
||||
return nError;
|
||||
}
|
||||
|
||||
@@ -121,14 +121,14 @@ int SStreamJobQueue::Pop()
|
||||
|
||||
void CAsyncIOFileRequest::AddRef()
|
||||
{
|
||||
int nRef = CryInterlockedIncrement(&m_nRefCount);
|
||||
//int nRef =
|
||||
CryInterlockedIncrement(&m_nRefCount);
|
||||
STREAM_DECOMPRESS_TRACE("[StreamDecompress],AddRef,0x%x,%s,0x%p,%i\n", CryGetCurrentThreadId(), m_strFileName.c_str(), this, nRef);
|
||||
}
|
||||
|
||||
int CAsyncIOFileRequest::Release()
|
||||
{
|
||||
int nRef = CryInterlockedDecrement(&m_nRefCount);
|
||||
|
||||
STREAM_DECOMPRESS_TRACE("[StreamDecompress],Release,0x%x,%s,0x%p,%i\n", CryGetCurrentThreadId(), m_strFileName.c_str(), this, nRef);
|
||||
|
||||
#ifndef _RELEASE
|
||||
|
||||
@@ -251,7 +251,6 @@ size_t CStreamEngine::StartBatchRead(IReadStreamPtr* pStreamsOut, const StreamRe
|
||||
|
||||
if (numReqs > 0)
|
||||
{
|
||||
size_t nStreamsInBatch = 0;
|
||||
numReqs = AZStd::min(numReqs, aznumeric_cast<size_t>(MaxStreamsPerBatch));
|
||||
AZStd::vector<FileRequestPtr> batch;
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ void CStreamingIOThread::Run()
|
||||
if (pFileRequest->m_eMediaType != eStreamSourceTypeMemory)
|
||||
{
|
||||
pFileRequest->m_nReadHeadOffsetKB = (int32)(((int64)pFileRequest->m_nDiskOffset - m_nLastReadDiskOffset) >> 10); // in KB
|
||||
m_nLastReadDiskOffset = pFileRequest->m_nDiskOffset + pFileRequest->m_nSizeOnMedia;
|
||||
m_nLastReadDiskOffset = pFileRequest->m_nDiskOffset + nSizeOnMedia;
|
||||
|
||||
#ifdef STREAMENGINE_ENABLE_STATS
|
||||
m_NotInMemoryStats.m_nTempReadOffset += abs(pFileRequest->m_nReadHeadOffsetKB);
|
||||
@@ -288,7 +288,7 @@ void CStreamingIOThread::Run()
|
||||
m_NotInMemoryStats.m_nTempRequestCount++;
|
||||
|
||||
// Calc IO bandwidth only for non memory files.
|
||||
m_NotInMemoryStats.m_nTempBytesRead += pFileRequest->m_nSizeOnMedia;
|
||||
m_NotInMemoryStats.m_nTempBytesRead += nSizeOnMedia;
|
||||
m_NotInMemoryStats.m_TempReadTime += pFileRequest->m_readTime;
|
||||
#endif
|
||||
}
|
||||
@@ -298,7 +298,7 @@ void CStreamingIOThread::Run()
|
||||
m_InMemoryStats.m_nTempRequestCount++;
|
||||
|
||||
// Calc IO bandwidth only for in memory files.
|
||||
m_InMemoryStats.m_nTempBytesRead += pFileRequest->m_nSizeOnMedia;
|
||||
m_InMemoryStats.m_nTempBytesRead += nSizeOnMedia;
|
||||
m_InMemoryStats.m_TempReadTime += pFileRequest->m_readTime;
|
||||
#endif
|
||||
}
|
||||
@@ -753,9 +753,14 @@ void CStreamingWorkerThread::Run()
|
||||
{
|
||||
case eWorkerAsyncCallback:
|
||||
{
|
||||
#ifndef _RELEASE
|
||||
float fTime = gEnv->pTimer->GetAsyncCurTime();
|
||||
#endif
|
||||
|
||||
m_pStreamEngine->ReportAsyncFileRequestComplete(pFileRequest);
|
||||
#ifndef _RELEASE
|
||||
float fTime1 = gEnv->pTimer->GetAsyncCurTime();
|
||||
#endif
|
||||
|
||||
#ifdef STREAMENGINE_ENABLE_STATS
|
||||
CryInterlockedDecrement(&m_pStreamEngine->GetStreamingStatistics().nCurrentAsyncCount);
|
||||
|
||||
Reference in New Issue
Block a user