Open 3D Engine Atom Gem API Reference  23.05.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::StreamingImageContext Class Reference

#include <StreamingImageContext.h>

Inherits intrusive_base, and intrusive_list_node< StreamingImageContext >.

Public Member Functions

 AZ_CLASS_ALLOCATOR (StreamingImageContext, AZ::ThreadPoolAllocator)
 
StreamingImageTryGetImage () const
 
uint16_t GetTargetMip () const
 Returns the target mip level requested for the image.
 
size_t GetLastAccessTimestamp () const
 Returns the timestamp of last access.
 

Friends

class StreamingImageController
 

Detailed Description

A context owned by a streaming controller which tracks a streaming image asset instance. The context has shared ownership between the streaming image and the streaming image controller. The controller is allowed to take a reference on the context, but not on the streaming image itself. As such, it's necessary to check that the image exists before using.

Member Function Documentation

StreamingImage* AZ::RPI::StreamingImageContext::TryGetImage ( ) const

Returns the parent image which owns this context. This may be null if the image was destroyed while the context is held in a work queue. You must test that the image is valid before using in your Update. The pointer is guaranteed valid for the duration of the StreamingImageController::UpdateInternal() call.

NOTE: Do NOT take a strong reference on this image. While doing so in the Update method is safe, allowing a reference to be held across Update ticks can result in a deadlock when the last reference on an image is released in a subsequent Update call (the deadlock will occur because the internal mutex on the controller is not recursive. This is by design). You are guaranteed that the streaming image reference is valid for the duration of the controller Update tick. So a strong reference is not required anyway.


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