ezEngine  Milestone 9
ezRenderContext Class Reference


struct  Statistics

Public Member Functions

void SetGALContext (ezGALContext *pContext)
ezGALContextGetGALContext () const
Statistics GetAndResetStatistics ()
void SetShaderPermutationVariable (const char *szName, const ezTempHashedString &sValue)
void SetShaderPermutationVariable (const ezHashedString &sName, const ezHashedString &sValue)
void BindMaterial (const ezMaterialResourceHandle &hMaterial)
void BindTexture2D (const ezTempHashedString &sSlotName, const ezTexture2DResourceHandle &hTexture, ezResourceAcquireMode acquireMode=ezResourceAcquireMode::AllowFallback)
void BindTextureCube (const ezTempHashedString &sSlotName, const ezTextureCubeResourceHandle &hTexture, ezResourceAcquireMode acquireMode=ezResourceAcquireMode::AllowFallback)
void BindTexture2D (const ezTempHashedString &sSlotName, ezGALResourceViewHandle hResourceView)
void BindTextureCube (const ezTempHashedString &sSlotName, ezGALResourceViewHandle hResourceView)
void BindUAV (const ezTempHashedString &sSlotName, ezGALUnorderedAccessViewHandle hUnorderedAccessViewHandle)
 Binds a read+write texture or buffer.
void BindSamplerState (const ezTempHashedString &sSlotName, ezGALSamplerStateHandle hSamplerSate)
void BindBuffer (const ezTempHashedString &sSlotName, ezGALResourceViewHandle hResourceView)
void BindConstantBuffer (const ezTempHashedString &sSlotName, ezGALBufferHandle hConstantBuffer)
void BindConstantBuffer (const ezTempHashedString &sSlotName, ezConstantBufferStorageHandle hConstantBufferStorage)
void BindShader (const ezShaderResourceHandle &hShader, ezBitflags< ezShaderBindFlags > flags=ezShaderBindFlags::Default)
 Sets the currently active shader on the given render context. More...
void BindMeshBuffer (const ezMeshBufferResourceHandle &hMeshBuffer)
void BindMeshBuffer (ezGALBufferHandle hVertexBuffer, ezGALBufferHandle hIndexBuffer, const ezVertexDeclarationInfo *pVertexDeclarationInfo, ezGALPrimitiveTopology::Enum topology, ezUInt32 uiPrimitiveCount)
ezResult DrawMeshBuffer (ezUInt32 uiPrimitiveCount=0xFFFFFFFF, ezUInt32 uiFirstPrimitive=0, ezUInt32 uiInstanceCount=1)
ezResult Dispatch (ezUInt32 uiThreadGroupCountX, ezUInt32 uiThreadGroupCountY=1, ezUInt32 uiThreadGroupCountZ=1)
ezResult ApplyContextStates (bool bForce=false)
void ResetContextState ()
ezGlobalConstants & WriteGlobalConstants ()
const ezGlobalConstants & ReadGlobalConstants () const
void SetViewportAndRenderTargetSetup (const ezRectFloat &viewport, const ezGALRenderTagetSetup &renderTargetSetup)
void SetDefaultTextureFilter (ezTextureFilterSetting::Enum filter)
 Sets the texture filter mode that is used by default for texture resources. More...
ezTextureFilterSetting::Enum GetDefaultTextureFilter () const
 Returns the texture filter mode that is used by default for textures.
ezTextureFilterSetting::Enum GetSpecificTextureFilter (ezTextureFilterSetting::Enum configuration) const
 Returns the 'fixed' texture filter setting that the combination of default texture filter and given configuration defines. More...
void SetAllowAsyncShaderLoading (bool bAllow)
 Set async shader loading. During runtime all shaders should be preloaded so this is off by default.

Static Public Member Functions

static ezRenderContextGetDefaultInstance ()
static ezRenderContextCreateInstance ()
static void DestroyInstance (ezRenderContext *pRenderer)
template<typename T >
static EZ_ALWAYS_INLINE ezConstantBufferStorageHandle CreateConstantBufferStorage ()
template<typename T >
static EZ_FORCE_INLINE ezConstantBufferStorageHandle CreateConstantBufferStorage (ezConstantBufferStorage< T > *&out_pStorage)
static EZ_FORCE_INLINE ezConstantBufferStorageHandle CreateConstantBufferStorage (ezUInt32 uiSizeInBytes)
static ezConstantBufferStorageHandle CreateConstantBufferStorage (ezUInt32 uiSizeInBytes, ezConstantBufferStorageBase *&out_pStorage)
static void DeleteConstantBufferStorage (ezConstantBufferStorageHandle hStorage)
template<typename T >
static EZ_FORCE_INLINE bool TryGetConstantBufferStorage (ezConstantBufferStorageHandle hStorage, ezConstantBufferStorage< T > *&out_pStorage)
static bool TryGetConstantBufferStorage (ezConstantBufferStorageHandle hStorage, ezConstantBufferStorageBase *&out_pStorage)
template<typename T >
static EZ_FORCE_INLINE T * GetConstantBufferData (ezConstantBufferStorageHandle hStorage)
static ezGALSamplerStateHandle GetDefaultSamplerState (ezBitflags< ezDefaultSamplerFlags > flags)


class ezMemoryUtils

Member Function Documentation

◆ BindShader()

void ezRenderContext::BindShader ( const ezShaderResourceHandle hShader,
ezBitflags< ezShaderBindFlags flags = ezShaderBindFlags::Default 

Sets the currently active shader on the given render context.

This function has no effect until the next draw or dispatch call on the context.

◆ GetSpecificTextureFilter()

ezTextureFilterSetting::Enum ezRenderContext::GetSpecificTextureFilter ( ezTextureFilterSetting::Enum  configuration) const

Returns the 'fixed' texture filter setting that the combination of default texture filter and given configuration defines.

If configuration is set to a fixed filter, that setting is returned. If it is one of LowestQuality to HighestQuality, the adjusted default filter is returned. When the default filter is used (with adjustments), the allowed range is Bilinear to Aniso16x, the Nearest filter is never used.

◆ SetDefaultTextureFilter()

void ezRenderContext::SetDefaultTextureFilter ( ezTextureFilterSetting::Enum  filter)

Sets the texture filter mode that is used by default for texture resources.

The built in default is Anisotropic 4x. If the default setting is changed, already loaded textures might not adjust. Nearest filtering is not allowed as a default filter.

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