ezEngine  Milestone 7
ezShaderPermutationResource Class Reference
Inheritance diagram for ezShaderPermutationResource:

Public Member Functions

ezGALShaderHandle GetGALShader () const
 
const ezShaderStageBinaryGetShaderStageBinary (ezGALShaderStage::Enum stage) const
 
ezGALBlendStateHandle GetBlendState () const
 
ezGALDepthStencilStateHandle GetDepthStencilState () const
 
ezGALRasterizerStateHandle GetRasterizerState () const
 
bool IsShaderValid () const
 
- Public Member Functions inherited from ezResource< ezShaderPermutationResource, ezShaderPermutationResourceDescriptor >
void SetFallbackResource (const ezResourceHandle< ezShaderPermutationResource > &hResource)
 Sets the fallback resource that can be used while this resource is not yet loaded. More...
 
- Public Member Functions inherited from ezResourceBase
const ezStringGetResourceID () const
 Returns the unique ID that identifies this resource. On a file resource this might be a path. Can also be a GUID or any other scheme that uniquely identifies the resource.
 
void SetResourceDescription (const char *szDescription)
 The resource description allows to store an additional string that might be more descriptive during debugging, than the unique ID.
 
const ezStringGetResourceDescription () const
 The resource description allows to store an additional string that might be more descriptive during debugging, than the unique ID.
 
ezResourceState GetLoadingState () const
 Returns the current state in which this resource is in.
 
ezUInt8 GetNumQualityLevelsDiscardable () const
 Returns the current maximum quality level that the resource could have. More...
 
ezUInt8 GetNumQualityLevelsLoadable () const
 Returns how many quality levels the resource may additionally load.
 
void SetPriority (ezResourcePriority priority)
 Sets the current priority of this resource. More...
 
ezResourcePriority GetPriority () const
 Returns the currently user-specified priority of this resource. More...
 
void SetDueDate (ezTime date=ezTime::Seconds(60.0 *60.0 *24.0 *365.0 *1000.0))
 Specifies the time (usually in the future) at which this resource is needed and should be fully loaded. More...
 
virtual ezTime GetLoadingDeadline (ezTime tNow) const
 Returns the deadline (tNow + x) at which this resource is required to be loaded. More...
 
const ezBitflags
< ezResourceFlags > & 
GetBaseResourceFlags () const
 Returns the basic flags for the resource type. Mostly used the resource manager.
 
const MemoryUsageGetMemoryUsage () const
 Returns the information about the current memory usage of the resource.
 
ezTime GetLastAcquireTime () const
 Returns the time at which the resource was (tried to be) acquired last. If a resource is acquired using ezResourceAcquireMode::PointerOnly, this does not update the last acquired time, since the resource is not acquired for full use.
 
ezInt32 GetReferenceCount () const
 Returns the reference count of this resource.
 
const ezTimestampGetLoadedFileModificationTime () const
 Returns the modification date of the file from which this resource was loaded. More...
 
- Public Member Functions inherited from ezReflectedClass
EZ_FORCE_INLINE bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_FORCE_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 
virtual void Serialize (ezArchiveWriter &stream) const
 This function is called to serialize the instance. More...
 
virtual void Deserialize (ezArchiveReader &stream)
 This function is called to deserialize the instance. More...
 
virtual void OnDeserialized ()
 This function is called after all objects are deserialized and thus all references to other objects are valid. More...
 

Private Member Functions

 EZ_ADD_DYNAMIC_REFLECTION (ezShaderPermutationResource)
 
virtual ezResourceLoadDesc UnloadData (Unload WhatToUnload) override
 Requests the resource to unload another quality level. If bFullUnload is true, the resource should unload all data, because it is going to be deleted afterwards.
 
virtual ezResourceLoadDesc UpdateContent (ezStreamReaderBase *Stream) override
 Called whenever more data for the resource is available. The resource must read the stream to update it's data.
 
virtual void UpdateMemoryUsage (MemoryUsage &out_NewMemoryUsage) override
 This function must be overridden by all resource types. More...
 
virtual ezResourceTypeLoaderGetDefaultResourceTypeLoader () const override
 Returns the resource type loader that should be used for this type of resource, unless it has been overridden on the ezResourceManager. More...
 

Private Attributes

ezShaderStageBinarym_pShaderStageBinaries [ezGALShaderStage::ENUM_COUNT]
 
bool m_bShaderPermutationValid
 
ezGALShaderHandle m_hShader
 
ezGALBlendStateHandle m_hBlendState
 
ezGALDepthStencilStateHandle m_hDepthStencilState
 
ezGALRasterizerStateHandle m_hRasterizerState
 

Additional Inherited Members

- Public Types inherited from ezResource< ezShaderPermutationResource, ezShaderPermutationResourceDescriptor >
typedef
ezShaderPermutationResourceDescriptor 
DescriptorType
 
- Static Public Member Functions inherited from ezResource< ezShaderPermutationResource, ezShaderPermutationResourceDescriptor >
static void SetTypeFallbackResource (const ezResourceHandle< ezShaderPermutationResource > &hResource)
 
static void SetTypeMissingResource (const ezResourceHandle< ezShaderPermutationResource > &hResource)
 
static const ezResourceHandle
< ezShaderPermutationResource > & 
GetTypeFallbackResource ()
 
static const ezResourceHandle
< ezShaderPermutationResource > & 
GetTypeMissingResource ()
 
- Protected Types inherited from ezResourceBase
enum  DoUpdate { OnMainThread, OnAnyThread }
 
enum  Unload { AllQualityLevels, OneQualityLevel }
 
- Protected Member Functions inherited from ezResource< ezShaderPermutationResource, ezShaderPermutationResourceDescriptor >
 ezResource (DoUpdate ResourceUpdateThread, ezUInt8 uiQualityLevelsLoadable)
 

Member Function Documentation

ezResourceTypeLoader * ezShaderPermutationResource::GetDefaultResourceTypeLoader ( ) const
overrideprivatevirtual

Returns the resource type loader that should be used for this type of resource, unless it has been overridden on the ezResourceManager.

By default, this redirects to ezResourceManager::GetDefaultResourceLoader. So there is one global default loader, that can be set on the resource manager. Overriding this function will then allow to use a different resource loader on a specific type. Additionally, one can override the resource loader from the outside, by setting it via ezResourceManager::SetResourceTypeLoader. That last method always takes precedence and allows to modify the behavior without modifying the code for the resource. But in the default case, the resource defines which loader is used.

Reimplemented from ezResourceBase.

void ezShaderPermutationResource::UpdateMemoryUsage ( MemoryUsage out_NewMemoryUsage)
overrideprivatevirtual

This function must be overridden by all resource types.

It has to compute the memory used by this resource. It is called by the resource manager whenever the resource's data has been loaded or unloaded.

Implements ezResourceBase.


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