reckfellENGINE

RDTextureView

Format and channel selection for reading a GPU texture.

On this page
class RDTextureViewReckfellSharpInherits RefCounted

RDTextureView describes texture interpretation for TextureCreate or TextureCreateShared. It is not a UI Texture2D, a viewport or an image crop rectangle. By default FormatOverride=DataFormat.Max inherits the base format, while SwizzleR/G/B/A select their matching input channels.

Swizzle selects each output channel source: R/G/B/A or Zero/One. For example, SwizzleR=B and SwizzleB=R exchange red and blue selection when reading through the view. They neither rearrange storage bytes nor change UVs. TextureGetData returns storage data, not the image after shader sampling.

For another FormatOverride, prepare the base RDTextureFormat: if the shareable-format list is nonempty, it must include the base format and required override. Support depends on the device and format compatibility. R8G8B8A8Srgb specifies color interpretation, not arbitrary resizing or new-file encoding. The shared path can use a driver-dependent fallback, so it is not guaranteed to avoid copying at all times.

TextureCreateShared returns a separate RID dependent on the source texture. Keep the owner alive while using it. Free owned views through the same RenderingDevice.FreeRid; freeing the owner invalidates dependent views. A copied Rid.IsValid can still be true because it checks a nonzero identifier; query texture state with TextureIsValid on the correct device. Do not free a borrowed RID from another framebuffer.

You own a descriptor created with new RDTextureView and can Dispose it after creation. Later descriptor edits do not reconfigure an existing GPU view. The main RenderingDevice is borrowed; work in a render-thread callback and do not Dispose it.

The executed Windows/Vulkan Forward+ probe created distinct swizzled/sRGB views, read original storage bytes and checked invalidation when freeing the owner. It did not test shader-sampled swizzle output or sRGB conversion; the Vulkan loader warning remains. Texture creation example: RDTextureFormat.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

RDTextureViewConstructor
# RDTextureView
C#
public RDTextureView();

Creates a view descriptor: FormatOverride=DataFormat.Max and R→R, G→G, B→B, A→A channel mapping. Allocates no GPU view and owns no texture. Dispose your own descriptor after TextureCreate or TextureCreateShared.

Properties5

FormatOverrideProperty
# FormatOverride
C#
public RenderingDevice.DataFormat FormatOverride { get; set; }

View format, initially DataFormat.Max to inherit the texture format. Max is a sentinel here, not a valid RDTextureFormat storage format. Another format must be allowed with AddShareableFormat and supported by the device; this is not a general image converter.

SwizzleAProperty
# SwizzleA
C#
public RenderingDevice.TextureSwizzle SwizzleA { get; set; }

Source for output channel A when reading through the view, initially TextureSwizzle.A. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

SwizzleBProperty
# SwizzleB
C#
public RenderingDevice.TextureSwizzle SwizzleB { get; set; }

Source for output channel B when reading through the view, initially TextureSwizzle.B. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

SwizzleGProperty
# SwizzleG
C#
public RenderingDevice.TextureSwizzle SwizzleG { get; set; }

Source for output channel G when reading through the view, initially TextureSwizzle.G. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

SwizzleRProperty
# SwizzleR
C#
public RenderingDevice.TextureSwizzle SwizzleR { get; set; }

Source for output channel R when reading through the view, initially TextureSwizzle.R. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Methods10

GetFormatOverrideRenderingDevice.DataFormat
# GetFormatOverride
C#
public RenderingDevice.DataFormat GetFormatOverride();

Returns the stored descriptor value for FormatOverride. View format, initially DataFormat.Max to inherit the texture format. Max is a sentinel here, not a valid RDTextureFormat storage format. Another format must be allowed with AddShareableFormat and supported by the device; this is not a general image converter.

Returns RenderingDevice.DataFormat

Stored FormatOverride of this descriptor, not a query of a current GPU resource.

GetSwizzleARenderingDevice.TextureSwizzle
# GetSwizzleA
C#
public RenderingDevice.TextureSwizzle GetSwizzleA();

Returns the stored descriptor value for SwizzleA. Source for output channel A when reading through the view, initially TextureSwizzle.A. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Returns RenderingDevice.TextureSwizzle

Stored SwizzleA of this descriptor, not a query of a current GPU resource.

GetSwizzleBRenderingDevice.TextureSwizzle
# GetSwizzleB
C#
public RenderingDevice.TextureSwizzle GetSwizzleB();

Returns the stored descriptor value for SwizzleB. Source for output channel B when reading through the view, initially TextureSwizzle.B. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Returns RenderingDevice.TextureSwizzle

Stored SwizzleB of this descriptor, not a query of a current GPU resource.

GetSwizzleGRenderingDevice.TextureSwizzle
# GetSwizzleG
C#
public RenderingDevice.TextureSwizzle GetSwizzleG();

Returns the stored descriptor value for SwizzleG. Source for output channel G when reading through the view, initially TextureSwizzle.G. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Returns RenderingDevice.TextureSwizzle

Stored SwizzleG of this descriptor, not a query of a current GPU resource.

GetSwizzleRRenderingDevice.TextureSwizzle
# GetSwizzleR
C#
public RenderingDevice.TextureSwizzle GetSwizzleR();

Returns the stored descriptor value for SwizzleR. Source for output channel R when reading through the view, initially TextureSwizzle.R. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Returns RenderingDevice.TextureSwizzle

Stored SwizzleR of this descriptor, not a query of a current GPU resource.

SetFormatOverridevoid
# SetFormatOverride
C#
public void SetFormatOverride(RenderingDevice.DataFormat pMember);

Stores FormatOverride without GPU allocation or full-configuration validation. View format, initially DataFormat.Max to inherit the texture format. Max is a sentinel here, not a valid RDTextureFormat storage format. Another format must be allowed with AddShareableFormat and supported by the device; this is not a general image converter.

Parameters
NameTypeDefault
pMemberRenderingDevice.DataFormat—
pMember

View format, initially DataFormat.Max to inherit the texture format. Max is a sentinel here, not a valid RDTextureFormat storage format. Another format must be allowed with AddShareableFormat and supported by the device; this is not a general image converter.

SetSwizzleAvoid
# SetSwizzleA
C#
public void SetSwizzleA(RenderingDevice.TextureSwizzle pMember);

Stores SwizzleA without GPU allocation or full-configuration validation. Source for output channel A when reading through the view, initially TextureSwizzle.A. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Parameters
NameTypeDefault
pMemberRenderingDevice.TextureSwizzle—
pMember

Source for output channel A when reading through the view, initially TextureSwizzle.A. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

SetSwizzleBvoid
# SetSwizzleB
C#
public void SetSwizzleB(RenderingDevice.TextureSwizzle pMember);

Stores SwizzleB without GPU allocation or full-configuration validation. Source for output channel B when reading through the view, initially TextureSwizzle.B. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Parameters
NameTypeDefault
pMemberRenderingDevice.TextureSwizzle—
pMember

Source for output channel B when reading through the view, initially TextureSwizzle.B. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

SetSwizzleGvoid
# SetSwizzleG
C#
public void SetSwizzleG(RenderingDevice.TextureSwizzle pMember);

Stores SwizzleG without GPU allocation or full-configuration validation. Source for output channel G when reading through the view, initially TextureSwizzle.G. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Parameters
NameTypeDefault
pMemberRenderingDevice.TextureSwizzle—
pMember

Source for output channel G when reading through the view, initially TextureSwizzle.G. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

SetSwizzleRvoid
# SetSwizzleR
C#
public void SetSwizzleR(RenderingDevice.TextureSwizzle pMember);

Stores SwizzleR without GPU allocation or full-configuration validation. Source for output channel R when reading through the view, initially TextureSwizzle.R. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Parameters
NameTypeDefault
pMemberRenderingDevice.TextureSwizzle—
pMember

Source for output channel R when reading through the view, initially TextureSwizzle.R. Select an input R/G/B/A channel or the Zero/One constant. Swizzling does not rewrite storage bytes, change UVs or replace the format setting.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.