Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.65 KB

GraphicsResources.md

File metadata and controls

33 lines (18 loc) · 1.65 KB

Graphics IDs

ID is a trivial type which contains index in pool and generation counter.
Source code: HandleTmpl, Graphics IDs.

Supports strong and weak references:
BufferID - weak reference.
Strong<BufferID> - strong reference.
Conversion from strong ref to weak ref has zero cost.
Weak reference can be converted to the strong ref by using IResourceManager::AcquireResource().

IDs in command context

Inside command context resource internal data will be retrieved by ResourceManager::GetResourcesOrThrow() which throws exception if ID is not valid - resource is deleted.

IDs in ResourceManager

Exceptions are not used here. Error will be generated if ID is not valid and method will return false.

ResourceManager

Resource creation

Create*() methods doesn't check if resource description is supported by the GPU. Vulkan implementation may create resource even if it is not supported by the current GPU.

If the engine is compiled with AE_GRAPHICS_STRONG_VALIDATION=ON then Create*() methods will use the IsSupported() method to check whether the resource description is supported by the GPU. If the description is not supported, the resource will not be created and an error will be generated.

Resource description validation

Use IsSupported() method before creating new resource to check if the resource description is supported by the GPU.