raisin::TextureBindingCacheView
class · #include <rayrai/TextureBindingCache.hpp>
Internal: hot-loop handle to the calling thread's texture caches.
Captures references to the thread's binding state and texture-state cache once, so repeated binds avoid the thread-local lookups. Valid only on the constructing thread and while its GL context stays current.
Constructors & destructor
TextureBindingCacheView
TextureBindingCacheView()Public member functions
objectExists
bool objectExists(unsigned int textureId)Parameters
| Parameter | Description |
|---|---|
textureId | GL texture name; 0 returns false. |
Returns True if textureId names an existing texture (glIsTexture; positive results are cached).
samplerStatePrepared
bool samplerStatePrepared(
unsigned int textureId,
std::uint64_t samplerKey) constParameters
| Parameter | Description |
|---|---|
textureId | GL texture name. |
samplerKey | Caller-defined hash of the desired sampler state. |
Returns True if markSamplerStatePrepared() recorded samplerKey for textureId.
markSamplerStatePrepared
void markSamplerStatePrepared(
unsigned int textureId,
std::uint64_t samplerKey)Record that textureId's sampler state matches samplerKey (ignored for id 0).
Parameters
| Parameter | Description |
|---|---|
textureId | GL texture name. |
samplerKey | Caller-defined hash of the applied sampler state. |
bindTexture
void bindTexture(int unit, gl::GLenum target, unsigned int textureId)Bind textureId to target on unit unless the cache says it is already bound. Units outside [0, 64) are ignored. Leaves unit as the active texture unit.
Parameters
| Parameter | Description |
|---|---|
unit | Texture unit index. |
target | GL texture target. |
textureId | GL texture name (0 unbinds). |
bindTexture2D
void bindTexture2D(int unit, unsigned int textureId)bindTexture() with GL_TEXTURE_2D.
Parameters
| Parameter | Description |
|---|---|
unit | Texture unit index. |
textureId | GL texture name. |
bindTextureCube
void bindTextureCube(int unit, unsigned int textureId)bindTexture() with GL_TEXTURE_CUBE_MAP.
Parameters
| Parameter | Description |
|---|---|
unit | Texture unit index. |
textureId | GL texture name. |