Home -> IStateContainer -> BindSampler

Description

The BindSampler method sets up a binding to an ITextureSampler object, for use with a separately bound ITextureBuffer.

ImportantImportant

In order to bind textures and samplers separately, the SeparateTextureSamplers feature must be supported on the IGraphicsDevice, and activated when the CreateRenderer method is called.

WarningWarning

Separate texture samplers are supported by all underlying rendering APIs other than OpenGL. If you care about OpenGL support, you must not use separate texture samplers. The BindTextureWithCombinedSampler method is portable across all renderers, and provides the same functionality as separate texture samplers, with the restriction that each separately bound texture requires the sampler to be bound with it. ITextureSampler objects can still be shared between textures even when they are bound separately, so unless you have a case where there is a significant advantage to separately binding samplers, it is recommended to use combined image samplers.

Usage

void BindSampler(SamplerId samplerId, ITextureSampler1D* sampler);
void BindSampler(SamplerId samplerId, ITextureSampler2D* sampler);
void BindSampler(SamplerId samplerId, ITextureSampler3D* sampler);
void BindSampler(SamplerId samplerId, ITextureSamplerCube* sampler);
void BindSampler(SamplerId samplerId, ITextureSampler1DArray* sampler);
void BindSampler(SamplerId samplerId, ITextureSampler2DArray* sampler);
void BindSampler(SamplerId samplerId, ITextureSamplerCubeArray* sampler);

Argument list

samplerId [SamplerId]
The SamplerId of the named sampler object to bind
sampler [ITextureSampler*]
The ITextureSampler to bind

See also