class render::RenderTexture

Inherits: RenderTarget

Render proxy variant of render texture.

Public

Constructors

RenderTexture

RenderTexture(const RenderTextureCreateInformation &createInformation)

Methods

~RenderTexture

virtual ~RenderTexture() noexcept = default

Initialize

void Initialize() override

Called on the render thread when the object is first created.

ReadAsync

TAsyncOp<SPtr<PixelData>> ReadAsync(GpuCommandBuffer &commandBuffer, u32 colorSurfaceIndex = 0, u32 mipLevel = 0, u32 arrayLayer = 0) override

Reads the contents of this render target.

Issues a copy command into the command buffer and returns an async operation that triggers when the data has been read.

commandBuffer
Command buffer to issue copy commands into.
colorSurfaceIndex
Which color surface to read (default 0).
mipLevel
Mip level to read (default 0).
arrayLayer
Array layer to read (default 0).

Returns: Async operation that triggers when the read operation is complete. May retun null PixelData if reading is not supported.

staticCreate

static SPtr<RenderTexture> Create(const RenderTextureCreateInformation &createInformation)

Creates a new RenderTexture and automatically generates a single color surface and (optionally) a depth/stencil surface.

colorDesc
Description of the color surface to create.
createDepth
Determines will a depth/stencil buffer of the same size as the color buffer be created for the render texture.
depthStencilFormat
Format of the depth/stencil buffer if enabled.

GetColorTexture

SPtr<Texture> GetColorTexture(u32 idx) const

Returns a color surface texture you may bind as an input to an GPU program.

GetDepthStencilTexture

SPtr<Texture> GetDepthStencilTexture() const

Returns a depth/stencil surface texture you may bind as an input to an GPU program.

Protected

Methods

SyncFromCoreObject

void SyncFromCoreObject(const CoreSyncData &data, FrameAllocator &allocator) override

Update internal data from provided memory buffer that was populated with data from the owning CoreObject.

Fields

mColorSurfaces

SPtr<TextureView>[8] mColorSurfaces

mDepthStencilSurface

SPtr<TextureView> mDepthStencilSurface

mInformation

Private

Methods

ReportIfBuffersDontMatch

void ReportIfBuffersDontMatch() const

Throws an exception of the color and depth/stencil buffers aren't compatible.