Table of Contents

Class GraphicsResource

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

Represents an abstract resource that depends on a GraphicsDevice.

public abstract class GraphicsResource : GraphicsResourceBase, IDisposable, IComponent, IReferencable, ICollectorHolder
Inheritance
object
GraphicsResource
Implements
Derived
Inherited Members
Extension Methods

Constructors

GraphicsResource()

Initializes a new instance of the GraphicsResource class.

protected GraphicsResource()

GraphicsResource(GraphicsDevice)

Initializes a new instance of the GraphicsResource class attached to a graphics device.

protected GraphicsResource(GraphicsDevice device)

Parameters

device GraphicsDevice

The GraphicsDevice this resource belongs to.

GraphicsResource(GraphicsDevice, string?)

Initializes a new instance of the GraphicsResource class attached to a graphics device.

protected GraphicsResource(GraphicsDevice device, string? name)

Parameters

device GraphicsDevice

The GraphicsDevice this resource belongs to.

name string

A string to use as a name for identifying the resource. Useful when debugging. Specify null to use the type's name instead.

Properties

NativeShaderResourceView

Gets or sets the Silk.NET.Direct3D11.ID3D11ShaderResourceView attached to the Graphics Resource.

protected ComPtr<ID3D11ShaderResourceView> NativeShaderResourceView { get; set; }

Property Value

ComPtr<ID3D11ShaderResourceView>

The Shader Resource View associated with the Graphics Resource.

Remarks

Only Textures are using this Shader Resource View.

If the reference is going to be kept, use ComPtr<T>.AddRef() to increment the internal reference count, and Silk.NET.Core.Native.ComPtr<T>.Dispose() when no longer needed to release the object.

NativeUnorderedAccessView

Gets or sets the Silk.NET.Direct3D11.ID3D11UnorderedAccessView attached to the Graphics Resource.

protected ComPtr<ID3D11UnorderedAccessView> NativeUnorderedAccessView { get; set; }

Property Value

ComPtr<ID3D11UnorderedAccessView>

The Unordered Access View associated with the Graphics Resource.

Remarks

If the reference is going to be kept, use ComPtr<T>.AddRef() to increment the internal reference count, and Silk.NET.Core.Native.ComPtr<T>.Dispose() when no longer needed to release the object.

Methods

OnDestroyed(bool)

Called when the GraphicsDevice has been detected to be internally destroyed, or when the Destroy() methad has been called. Raises the Destroyed event.

protected override void OnDestroyed(bool immediately = false)

Parameters

immediately bool

A value indicating whether the resource should be destroyed immediately (true), or if it can be deferred until it's safe to do so (false).

Remarks

This method releases the underlying native resources (Silk.NET.Direct3D11.ID3D11Resource and Silk.NET.Direct3D11.ID3D11DeviceChild).

OnNameChanged()

Called when the Name property has changed.

protected override void OnNameChanged()