Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::IO::IStreamerTypes::Recommendations Struct Reference

Provides configuration recommendations for using the file streaming system. More...

#include <IStreamerTypes.h>

Public Member Functions

AZ::u64 CalculateRecommendedMemorySize (u64 readSize, u64 readOffset=0)
 

Public Attributes

AZ::u64 m_memoryAlignment { AZCORE_GLOBAL_NEW_ALIGNMENT }
 
AZ::u64 m_sizeAlignment { 1 }
 
AZ::u64 m_granularity { 1_mib }
 
AZ::u16 m_maxConcurrentRequests { 1 }
 

Detailed Description

Provides configuration recommendations for using the file streaming system.

Member Function Documentation

◆ CalculateRecommendedMemorySize()

AZ::u64 AZ::IO::IStreamerTypes::Recommendations::CalculateRecommendedMemorySize ( u64  readSize,
u64  readOffset = 0 
)

Calculates the recommended size to allocate for the read buffer in order to avoid the need for temporary buffers. The returned size will always be at least as big as readSize, but can be bigger.

Parameters
readSizeThe intended amount of bytes to be read.
readOffsetThe number of bytes to offset into the file to start reading from.
Returns
The recommended amount of memory to reserve, taking size, offset and alignment into account.

Member Data Documentation

◆ m_granularity

AZ::u64 AZ::IO::IStreamerTypes::Recommendations::m_granularity { 1_mib }

The recommended size for partial reads. It's recommended to read entire files at once, but for streaming systems such as video and audio this is not always practical. The granularity will give the most optimal size for partial file reads. Note for partial reads it's also recommended to store the data uncompressed and to align the offset of the rest to the granularity.

◆ m_maxConcurrentRequests

AZ::u16 AZ::IO::IStreamerTypes::Recommendations::m_maxConcurrentRequests { 1 }

The number of requests that the scheduler will try to keep active in the stack. Additional requests are considered pending and are subject to scheduling. There are no restrictions on the number of requests that can be send and generally there is no need to throttle the number of requests. The exception is for streaming systems such as video and audio that could flood the scheduler with requests in a short amount of time if not capped. For those systems it's recommended that no more than the provided number of requests are issued.

◆ m_memoryAlignment

AZ::u64 AZ::IO::IStreamerTypes::Recommendations::m_memoryAlignment { AZCORE_GLOBAL_NEW_ALIGNMENT }

The minimal memory alignment that's required to avoid intermediate buffers. If the memory provided to the read request isn't aligned to this size it may require a temporary or cached buffer to first read to and copy the result from to the provided memory.

◆ m_sizeAlignment

AZ::u64 AZ::IO::IStreamerTypes::Recommendations::m_sizeAlignment { 1 }

The minimal size alignment that's required to avoid intermediate buffers. If the size and/or offset provided to the read request isn't aligned to this size it may require a temporary or cached buffer to first read to and copy the result from to the provided memory.


The documentation for this struct was generated from the following file: