XLE  v0.02.0
Public Types | Public Member Functions | List of all members
SceneEngine::GestaltResource< Views > Class Template Reference

A GPU resources with one or more "views" More...

#include <GestaltResource.h>

Public Types

using ShaderResourceView = RenderCore::Metal::ShaderResourceView
 
using RenderTargetView = RenderCore::Metal::RenderTargetView
 
using DepthStencilView = RenderCore::Metal::DepthStencilView
 
using UnorderedAccessView = RenderCore::Metal::UnorderedAccessView
 

Public Member Functions

template<typename = std::enable_if<HasType<ShaderResourceView, std::tuple<Views...>>::value>>
const ShaderResourceView & SRV () const
 
template<typename = std::enable_if<HasType<RenderTargetView, std::tuple<Views...>>::value>>
const RenderTargetView & RTV () const
 
template<typename = std::enable_if<HasType<DepthStencilView, std::tuple<Views...>>::value>>
const DepthStencilView & DSV () const
 
template<typename = std::enable_if<HasType<UnorderedAccessView, std::tuple<Views...>>::value>>
const UnorderedAccessView & UAV () const
 
template<typename Type , typename = std::enable_if<HasType<Type, std::tuple<Views...>>::value>>
 operator const Type & () const
 
const bool IsGood () const
 
const BufferUploads::ResourceLocatorLocator () const
 
 GestaltResource (const BufferUploads::TextureDesc &desc, const char name[], BufferUploads::DataPacket *initialData=nullptr)
 
 GestaltResource (const BufferUploads::LinearBufferDesc &desc, const char name[], BufferUploads::DataPacket *initialData=nullptr, unsigned extraBindFlags=0u)
 
 GestaltResource (GestaltResource &&moveFrom) never_throws
 
GestaltResourceoperator= (GestaltResource &&moveFrom) never_throws
 
 GestaltResource (const GestaltResource &)=delete
 
GestaltResourceoperator= (const GestaltResource &)=delete
 

Detailed Description

template<typename... Views>
class SceneEngine::GestaltResource< Views >

A GPU resources with one or more "views"

Usually GPU resources are allocated by first reserving some memory, and then creating some view objects. The view objects determine how the memory will be used – as a render target, or a shader resource (etc).

This class is a utility to help automate the creation of the resource and views. It doesn't provide much more functionality; just enough for construction and some accessors.

See the GestaltTypes namespace for some renames for common types. For example, "RTVSRV" might be the most common type. This is a resource that can be used as a render target and as a texture.

See also
SceneEngine::GestaltTypes

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