class TGpuTextureMappedScope

template<bool IsRenderProxy>

RAII wrapper returned by Texture::Map operation.

Contains PixelData with mapped memory buffer. Automatically flushes on destruction for write operations. Move-only semantics. Templated to support both main thread and render thread variants.

Public

Constructors

TGpuTextureMappedScope<IsRenderProxy>

TGpuTextureMappedScope<IsRenderProxy>() = default

TGpuTextureMappedScope<IsRenderProxy>

TGpuTextureMappedScope<IsRenderProxy>(PixelData pixelData, SPtr<TextureType> texture, GpuTextureSubresource subresource, GpuMapOptions options)

TGpuTextureMappedScope<IsRenderProxy>

TGpuTextureMappedScope<IsRenderProxy>(TGpuTextureMappedScope<IsRenderProxy> &&other) noexcept

Methods

~TGpuTextureMappedScope<IsRenderProxy>

~TGpuTextureMappedScope<IsRenderProxy>()

Unmap

void Unmap()

Explicitly releases the mapping.

Safe to call multiple times. Flushes if write mapping.

GetPixelData

PixelData &GetPixelData()

Returns the PixelData containing the mapped memory buffer.

GetPixelData

const PixelData &GetPixelData() const

GetTexture

const SPtr<TextureType> &GetTexture() const

Returns the texture being mapped.

GetSubresource

const GpuTextureSubresource &GetSubresource() const

Returns the subresource being mapped.

IsValid

bool IsValid() const

Returns true if the mapping is valid.

Operators

operator=

TGpuTextureMappedScope<IsRenderProxy> &operator=(TGpuTextureMappedScope<IsRenderProxy> &&other) noexcept

operator bool

explicit operator bool() const

Private

Fields

mPixelData

PixelData mPixelData

mTexture

SPtr<TextureType> mTexture

mSubresource

mOptions

GpuMapOptions mOptions