[]
ID3D11Resource
[Guid("dc8e63f3-d12b-4952-b47b-5e45026a862d")]
public class Resource : DeviceChild, IDisposable, IUnknown
Initializes a new instance of the Resource class.
public Resource(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
Constant MaximumMipLevels.
public const int MaximumMipLevels = 15
Constant MaximumTexture1DArraySize.
public const int MaximumTexture1DArraySize = 2048
Constant MaximumTexture1DSize.
public const int MaximumTexture1DSize = 16384
Constant MaximumTexture2DArraySize.
public const int MaximumTexture2DArraySize = 2048
Constant MaximumTexture2DSize.
public const int MaximumTexture2DSize = 16384
Constant MaximumTexture3DSize.
public const int MaximumTexture3DSize = 2048
Constant MaximumTextureCubeSize.
public const int MaximumTextureCubeSize = 16384
Constant ResourceSizeInMegabytes.
public const int ResourceSizeInMegabytes = 128
Calculates the resulting size at a single level for an original size.
public static int CalculateMipSize(int mipLevel, int baseSize)
mipLevel
intThe mip level to get the size.
baseSize
intSize of the base.
Size of the mipLevel
Calculates the sub resource index for a particular mipSlice and arraySlice.
public virtual int CalculateSubResourceIndex(int mipSlice, int arraySlice, out int mipSize)
mipSlice
intThe mip slice.
arraySlice
intThe array slice.
mipSize
intThe size of slice. This values is resource dependent. Texture1D -> mipSize of the Width. Texture2D -> mipSize of the Height. Texture3D -> mipsize of the Depth
The resulting miplevel calulated for this instance with this mipSlice and arraySlice.
Gets a swap chain back buffer.
public static T FromSwapChain<T>(SwapChain swapChain, int index) where T : Resource
swapChain
SwapChainThe swap chain to get the buffer from.
index
intThe index of the desired buffer.
The buffer interface, or null
on failure.
T
The type of the buffer.
void ID3D11Resource::GetType([Out] D3D11_RESOURCE_DIMENSION* pResourceDimension)
public ResourceDimension GetDimension()
unsigned int ID3D11Resource::GetEvictionPriority()
public int GetEvictionPriority()
void ID3D11Resource::SetEvictionPriority([In] unsigned int EvictionPriority)
public void SetEvictionPriority(int evictionPriority)
evictionPriority
intCalculates the sub resource index from a miplevel.
public static int SubResourceIndexFromMipLevel(int mipSlice, int arraySlice, int mipLevel)
mipSlice
intA zero-based index for the mipmap level to address; 0 indicates the first, most detailed mipmap level.
arraySlice
intThe zero-based index for the array level to address; always use 0 for volume (3D) textures.
mipLevel
intNumber of mipmap levels in the resource.
The index which equals MipSlice + (ArraySlice * MipLevels).
Performs an explicit conversion from System.IntPtr to Resource.
public static explicit operator Resource(IntPtr nativePointer)
nativePointer
System.IntPtr