OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::TextureFlags Namespace Reference

Enumerations

enum  TextureFlags {
  NotTexture = 1u << 0u , RenderToTexture = 1u << 1u , Uav = 1u << 2u , AllowAutomipmaps = 1u << 3u ,
  AutomipmapsAuto = 1u << 4u , MsaaExplicitResolve = 1u << 5u , Reinterpretable = 1u << 6u , PrefersLoadingFromFileAsSRGB = 1u << 7u ,
  RenderWindowSpecific = 1u << 9u , RequiresTextureFlipping = 1u << 10u , ManualTexture = 1u << 11u , AutomaticBatching = 1u << 12u ,
  PoolOwner = 1u << 13u , DiscardableContent = 1u << 14u , TilerMemoryless = 1u << 15u
}
 

Enumeration Type Documentation

◆ TextureFlags

Enumerator
NotTexture 

Texture cannot be used as a regular texture (bound to SRV in D3D11 terms)

RenderToTexture 

Texture can be used as an RTT (FBO in GL terms)

Uav 

Texture can be used as an UAV.

AllowAutomipmaps 

Texture can use mipmap autogeneration.

This flag is NOT necessary for TextureFilter::TypeGenerateHwMipmaps, as this filter will create a temporary resource. AllowAutomipmaps is thought for RenderToTexture textures.

AutomipmapsAuto 

Texture will auto generate mipmaps every time it's dirty, automatically.

Requires AllowAutomipmaps.

MsaaExplicitResolve 

MSAA rendering is an antialiasing technique.

MSAA works by rendering to a special surface (an MSAA surface) and once we're done, "resolving" from MSAA surface into a regular texture for later sampling.

Without explicit resolves, Ogre will automatically resolve the MSAA surface into the texture whenever it detects you will be sampling from this texture.
However there are cases where you want to directly access the MSAA surface directly for advanced special effects (i.e. via Texture2DMS in HLSL). For cases like that, use MsaaExplicitResolve; which will let you to manually manage MSAA surfaces and when you want to resolve it.
Reinterpretable 

When present, you may be creating another TextureGpu that accesses the internal resources of this TextureGpu but with a different format (e.g.

useful for viewing a PFG_RGBA8_UNORM_SRGB as PFG_RGBA8_UNORM)

PrefersLoadingFromFileAsSRGB 

Prefer loading FROM FILES as sRGB when possible.

e.g. load PFG_RGBA8_UNORM as PFG_RGBA8_UNORM_SRGB This flag does not affect RenderTextures, UAVs, or manually created textures. If you're manually creating sRGB textures, set PFG_RGBA8_UNORM_SRGB directly

See TextureGpuManager::mIgnoreSRgbPreference

RenderWindowSpecific 

Indicates this texture contains a RenderWindow.

In several APIs render windows have particular limitations:

  • Cannot be sampled as textures (i.e. NotTexture will be set)
  • OpenGL cannot share the depth & stencil buffers with other textures.
  • Metal requires special maintenance.
  • etc.
RequiresTextureFlipping 
ManualTexture 

Indicates this texture will be filled by the user, and won't be loaded from file or a listener from within a worker thread.

This flag is implicit if NotTexture, RenderToTexture or Uav are set.

AutomaticBatching 

When not present: The Texture is exactly the type requested (e.g.

2D texture won't get a 2D array instead) While a texture is transitioning to Resident, no 64x64 is used, but the 4x4 dummy one will be used instead (blank texture).

When this bit is set: The Texture can be of a different type. Most normally we’ll treat 2D textures internally as a slice to a 2D array texture. Ogre will keep three API objects:

  1. A single 4x4 texture. Blank.
  2. An array of 2D textures of 64x64. One of its slices will contain the mips of the texture being loaded
  3. An array of 2D textures in which one of its slices the fully resident texture will live. Each time we change the internal API object, HlmsDatablocks need to be notified so it can pack the arrays, update the slices to the GPU, and compute the texture hashes. All of that (except updating slices to the GPU) can be done in a worker thread, then all the values swapped w/ the Datablock’s.
PoolOwner 

For internal use.

Indicates whether this texture is the owner of a TextureGpuManager::TexturePool, which are used to hold regular textures using AutomaticBatching

DiscardableContent 

When this flag is present, the contents of a RenderToTexture or Uav may not be preserved between frames.

Useful for RenderToTexture which are written or cleared first.

Must not be used on textures whose contents need to be preserved between frames (e.g. HDR luminance change over time)

If this flag is present, either RenderToTexture or Uav must be present

TilerMemoryless 

When this flag is present, we can save VRAM by using memoryless storage mode (Metal on iOS and Apple Silicon macOS) aka TRANSIENT memory (Vulkan).

With this flag set, the texture will not be backed by memory, it will only ever live in cache. Only TBDR GPUs support this. It will be ignored if unsupported.

Many operations are unsupported with TilerMemoryless textures (e.g. copy operations) because there is no memory behind them.

An example is a depth or stencil texture thatʼs used only within a render pass and isnʼt needed before or after GPU execution.

This flag requires RenderToTexture.