Class ShaderResourceViewProxy
- Namespace
- HelixToolkit.SharpDX.Utilities
- Assembly
- HelixToolkit.SharpDX.dll
A proxy container to handle view resources
public class ShaderResourceViewProxy : DisposeObject, IDisposable
- Inheritance
-
ShaderResourceViewProxy
- Implements
- Inherited Members
Constructors
ShaderResourceViewProxy(Device)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(Device device)
Parameters
deviceDeviceThe device.
ShaderResourceViewProxy(Device, Resource)
public ShaderResourceViewProxy(Device device, Resource resource)
Parameters
deviceDeviceresourceResource
ShaderResourceViewProxy(Device, Texture1DDescription)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(Device device, Texture1DDescription textureDesc)
Parameters
deviceDeviceThe device.
textureDescTexture1DDescriptionThe texture desc.
ShaderResourceViewProxy(Device, ref Texture1DDescription)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(Device device, ref Texture1DDescription textureDesc)
Parameters
deviceDeviceThe device.
textureDescTexture1DDescriptionThe texture desc.
ShaderResourceViewProxy(Device, Texture2DDescription)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(Device device, Texture2DDescription textureDesc)
Parameters
deviceDeviceThe device.
textureDescTexture2DDescriptionThe texture desc.
ShaderResourceViewProxy(Device, ref Texture2DDescription)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(Device device, ref Texture2DDescription textureDesc)
Parameters
deviceDeviceThe device.
textureDescTexture2DDescriptionThe texture desc.
ShaderResourceViewProxy(Device, Texture3DDescription)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(Device device, Texture3DDescription textureDesc)
Parameters
deviceDeviceThe device.
textureDescTexture3DDescriptionThe texture desc.
ShaderResourceViewProxy(Device, ref Texture3DDescription)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(Device device, ref Texture3DDescription textureDesc)
Parameters
deviceDeviceThe device.
textureDescTexture3DDescriptionThe texture desc.
ShaderResourceViewProxy(ShaderResourceView)
Initializes a new instance of the ShaderResourceViewProxy class.
public ShaderResourceViewProxy(ShaderResourceView view)
Parameters
viewShaderResourceViewThe view.
Properties
DepthStencilView
Gets the depth stencil view.
public DepthStencilView? DepthStencilView { get; }
Property Value
- DepthStencilView
The depth stencil view.
Empty
public static ShaderResourceViewProxy Empty { get; }
Property Value
Guid
public Guid Guid { get; set; }
Property Value
RenderTargetView
Gets the render target view.
public RenderTargetView? RenderTargetView { get; }
Property Value
- RenderTargetView
The render target view.
Resource
Gets the resource.
public Resource? Resource { get; }
Property Value
- Resource
The resource.
TextureFormat
public Format TextureFormat { get; }
Property Value
- Format
TextureView
Gets the texture view.
public ShaderResourceView? TextureView { get; }
Property Value
- ShaderResourceView
The texture view.
Methods
CreateDepthStencilView()
public void CreateDepthStencilView()
CreateDepthStencilView(DepthStencilViewDescription)
public void CreateDepthStencilView(DepthStencilViewDescription desc)
Parameters
descDepthStencilViewDescription
CreateDepthStencilView(ref DepthStencilViewDescription)
public void CreateDepthStencilView(ref DepthStencilViewDescription desc)
Parameters
descDepthStencilViewDescription
CreateRenderTargetView()
Creates the render target.
public void CreateRenderTargetView()
CreateTextureView()
Creates the view.
public void CreateTextureView()
CreateTextureView(ShaderResourceViewDescription)
Creates the view.
public void CreateTextureView(ShaderResourceViewDescription desc)
Parameters
descShaderResourceViewDescription
CreateTextureView(ref ShaderResourceViewDescription)
Creates the view.
public void CreateTextureView(ref ShaderResourceViewDescription desc)
Parameters
descShaderResourceViewDescription
CreateView(TextureModel?, bool, bool)
Creates the view from texture model.
public void CreateView(TextureModel? texture, bool createSRV = true, bool enableAutoGenMipMap = true)
Parameters
textureTextureModelThe stream.
createSRVboolCreate ShaderResourceView
enableAutoGenMipMapboolEnable auto mipmaps generation
Exceptions
CreateView(DepthStencilViewDescription)
Creates the view.
public void CreateView(DepthStencilViewDescription desc)
Parameters
descDepthStencilViewDescriptionThe desc.
CreateView(Device, Stream, bool, bool)
Creates ShaderResourceViewProxy from common file formats such as Jpg, Bmp, DDS, Png, etc
public static ShaderResourceViewProxy CreateView(Device device, Stream texture, bool createSRV = true, bool generateMipMaps = true)
Parameters
deviceDeviceThe device.
textureStreamThe texture.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Returns
CreateView(Device, nint, int, int, Format, bool, bool)
Creates the 2D texture view from raw pixel byte array
public static ShaderResourceViewProxy CreateView(Device device, nint dataPtr, int width, int height, Format format, bool createSRV = true, bool generateMipMaps = true)
Parameters
deviceDeviceThe device.
dataPtrnintThe data PTR.
widthintThe width.
heightintThe height.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Returns
CreateView(RenderTargetViewDescription)
Creates the view.
public void CreateView(RenderTargetViewDescription desc)
Parameters
descRenderTargetViewDescriptionThe desc.
CreateView(ShaderResourceViewDescription)
Creates the view.
public void CreateView(ShaderResourceViewDescription desc)
Parameters
descShaderResourceViewDescriptionThe desc.
CreateView(nint, int, Format, bool, bool)
Creates the shader resource view from data ptr.
public void CreateView(nint dataPtr, int width, Format format, bool createSRV = true, bool generateMipMaps = true)
Parameters
dataPtrnintThe data PTR.
widthintThe width.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
CreateView(nint, int, int, Format, bool, bool)
Creates the shader resource view from data ptr.
public void CreateView(nint dataPtr, int width, int height, Format format, bool createSRV = true, bool generateMipMaps = true)
Parameters
dataPtrnintThe data PTR.
widthintThe width.
heightintThe height.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
CreateView(nint, int, int, int, Format, bool, bool)
Creates the view.
public void CreateView(nint dataPtr, int width, int height, int depth, Format format, bool createSRV = true, bool generateMipMaps = true)
Parameters
dataPtrnintwidthintThe width.
heightintThe height.
depthintThe depth.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
CreateViewFromColorArray(Color4[])
Creates the 1D texture view from color array.
public void CreateViewFromColorArray(Color4[] array)
Parameters
arrayColor4[]The array.
CreateViewFromColorArray(Color4[], int, int, bool, bool)
Creates the 2D texture view from color array.
public void CreateViewFromColorArray(Color4[] array, int width, int height, bool createSRV = true, bool generateMipMaps = true)
Parameters
arrayColor4[]The array.
widthintThe width.
heightintThe height.
createSRVboolgenerateMipMapsbool
CreateViewFromColorArray(Device, Color4[])
Creates the 1D texture view from color array.
public static ShaderResourceViewProxy CreateViewFromColorArray(Device device, Color4[] array)
Parameters
deviceDevicearrayColor4[]The array.
Returns
CreateViewFromColorArray(Device, Color4[], int, int, bool, bool)
Creates the 2D texture view from color array.
public static ShaderResourceViewProxy CreateViewFromColorArray(Device device, Color4[] array, int width, int height, bool createSRV = true, bool generateMipMaps = true)
Parameters
deviceDevicearrayColor4[]The array.
widthintThe width.
heightintThe height.
createSRVboolgenerateMipMapsbool
Returns
CreateViewFromPixelData(Device, Half4[], int, int, int, Format, bool, bool)
Creates the view from pixel data.
public static ShaderResourceViewProxy CreateViewFromPixelData(Device device, Half4[] pixels, int width, int height, int depth, Format format, bool createSRV = true, bool generateMipMaps = true)
Parameters
deviceDeviceThe device.
pixelsHalf4[]The pixels.
widthintThe width.
heightintThe height.
depthintThe depth.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsboolif set to
true[generate mip maps].
Returns
CreateViewFromPixelData(Device, byte[], int, int, int, Format, bool, bool)
Creates the 3D texture view from raw pixel array
public static ShaderResourceViewProxy CreateViewFromPixelData(Device device, byte[] pixels, int width, int height, int depth, Format format, bool createSRV = true, bool generateMipMaps = true)
Parameters
deviceDeviceThe device.
pixelsbyte[]The pixels.
widthintThe width.
heightintThe height.
depthintThe depth.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Returns
CreateViewFromPixelData(Device, nint, int, int, int, Format, bool, bool)
Creates the view from pixel data.
public static ShaderResourceViewProxy CreateViewFromPixelData(Device device, nint pixels, int width, int height, int depth, Format format, bool createSRV = true, bool generateMipMaps = true)
Parameters
deviceDeviceThe device.
pixelsnintThe pixels.
widthintThe width.
heightintThe height.
depthintThe depth.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Returns
CreateView<T>(Device, T[], Format, bool, bool)
Creates ShaderResourceViewProxy from 2D texture array
public static ShaderResourceViewProxy CreateView<T>(Device device, T[] array, Format format, bool createSRV = true, bool generateMipMaps = true) where T : unmanaged
Parameters
deviceDeviceThe device.
arrayT[]The array.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Returns
Type Parameters
T
CreateView<T>(Device, T[], int, int, Format, bool, bool)
Creates the 2D texture view from data array
public static ShaderResourceViewProxy CreateView<T>(Device device, T[] array, int width, int height, Format format, bool createSRV = true, bool generateMipMaps = true) where T : unmanaged
Parameters
deviceDeviceThe device.
arrayT[]The array.
widthintThe width.
heightintThe height.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Returns
Type Parameters
T
CreateView<T>(T[], Format, bool, bool)
Creates the 1D texture view from data array.
public void CreateView<T>(T[] array, Format format, bool createSRV = true, bool generateMipMaps = true) where T : unmanaged
Parameters
arrayT[]The array.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsboolif set to
true[generate mip maps].
Type Parameters
T
CreateView<T>(T[], int, Format, bool, bool)
Creates the 1D texture view from data array.
public void CreateView<T>(T[] array, int length, Format format, bool createSRV = true, bool generateMipMaps = true) where T : unmanaged
Parameters
arrayT[]The array.
lengthintdata length
formatFormatThe pixel format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Type Parameters
T
CreateView<T>(T[], int, int, Format, bool, bool)
Creates the 2D texture view from data array.
public void CreateView<T>(T[] array, int width, int height, Format format, bool createSRV = true, bool generateMipMaps = true) where T : unmanaged
Parameters
arrayT[]The array.
widthintThe width.
heightintThe height.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Type Parameters
T
Exceptions
CreateView<T>(T[], int, int, int, Format, bool, bool)
Creates the view from 3D texture byte array.
public void CreateView<T>(T[] pixels, int width, int height, int depth, Format format, bool createSRV = true, bool generateMipMaps = true) where T : unmanaged
Parameters
pixelsT[]The pixels.
widthintThe width.
heightintThe height.
depthintThe depth.
formatFormatThe format.
createSRVboolif set to
true[create SRV].generateMipMapsbool
Type Parameters
T
Exceptions
OnDispose(bool)
Disposes of object resources.
protected override void OnDispose(bool disposeManagedResources)
Parameters
disposeManagedResourcesboolIf true, managed resources should be disposed of in addition to unmanaged resources.
Operators
implicit operator DepthStencilView?(ShaderResourceViewProxy?)
Performs an implicit conversion from ShaderResourceViewProxy to DepthStencilView.
public static implicit operator DepthStencilView?(ShaderResourceViewProxy? proxy)
Parameters
proxyShaderResourceViewProxyThe proxy.
Returns
- DepthStencilView
The result of the conversion.
implicit operator RenderTargetView?(ShaderResourceViewProxy?)
Performs an implicit conversion from ShaderResourceViewProxy to RenderTargetView.
public static implicit operator RenderTargetView?(ShaderResourceViewProxy? proxy)
Parameters
proxyShaderResourceViewProxyThe proxy.
Returns
- RenderTargetView
The result of the conversion.
implicit operator ShaderResourceView?(ShaderResourceViewProxy?)
Performs an implicit conversion from ShaderResourceViewProxy to SharpDX.Direct3D11.ShaderResourceView.
public static implicit operator ShaderResourceView?(ShaderResourceViewProxy? proxy)
Parameters
proxyShaderResourceViewProxyThe proxy.
Returns
- ShaderResourceView
The result of the conversion.