[]
ID3D11DeviceContext
[Guid("c0bfa96c-e089-44fb-8eaf-26f8796190da")]
public class DeviceContext : DeviceChild, IDisposable, IUnknown
Initializes a new instance of the DeviceContext class.
public DeviceContext(IntPtr nativePtr)
nativePtr System.IntPtrThe native pointer.
Inner interface giving access to ComputeShaderStage methods.
public ComputeShaderStage ComputeShader { get; }
Inner interface giving access to DomainShaderStage methods.
public DomainShaderStage DomainShader { get; }
Inner interface giving access to GeometryShaderStage methods.
public GeometryShaderStage GeometryShader { get; }
Inner interface giving access to HullShaderStage methods.
public HullShaderStage HullShader { get; }
Inner interface giving access to InputAssemblerStage methods.
public InputAssemblerStage InputAssembler { get; }
Inner interface giving access to OutputMergerStage methods.
public OutputMergerStage OutputMerger { get; }
Inner interface giving access to PixelShaderStage methods.
public PixelShaderStage PixelShader { get; }
Inner interface giving access to RasterizerStage methods.
public RasterizerStage Rasterizer { get; }
Inner interface giving access to StreamOutputStage methods.
public StreamOutputStage StreamOutput { get; }
Inner interface giving access to VertexShaderStage methods.
public VertexShaderStage VertexShader { get; }
void ID3D11DeviceContext::Begin([In] ID3D11Asynchronous* pAsync)
public void Begin(Asynchronous asyncRef)
asyncRef Asynchronousvoid ID3D11DeviceContext::ClearDepthStencilView([In] ID3D11DepthStencilView* pDepthStencilView,[In] D3D11_CLEAR_FLAG ClearFlags,[In] float Depth,[In] unsigned char Stencil)
public void ClearDepthStencilView(DepthStencilView depthStencilViewRef, DepthStencilClearFlags clearFlags, float depth, byte stencil)
depthStencilViewRef DepthStencilViewclearFlags DepthStencilClearFlagsdepth floatstencil bytevoid ID3D11DeviceContext::ClearRenderTargetView([In] ID3D11RenderTargetView* pRenderTargetView,[In] const SHARPDX_COLOR4* ColorRGBA)
public void ClearRenderTargetView(RenderTargetView renderTargetViewRef, ColorF colorRGBA)
renderTargetViewRef RenderTargetViewcolorRGBA ColorFvoid ID3D11DeviceContext::ClearState()
public void ClearState()
void ID3D11DeviceContext::ClearUnorderedAccessViewFloat([In] ID3D11UnorderedAccessView* pUnorderedAccessView,[In] const SHARPDX_VECTOR4* Values)
public void ClearUnorderedAccessView(UnorderedAccessView unorderedAccessViewRef, Vector4 values)
unorderedAccessViewRef UnorderedAccessViewvalues Vector4void ID3D11DeviceContext::ClearUnorderedAccessViewUint([In] ID3D11UnorderedAccessView* pUnorderedAccessView,[In] const SHARPDX_INT4* Values)
public void ClearUnorderedAccessView(UnorderedAccessView unorderedAccessViewRef, int[] values)
unorderedAccessViewRef UnorderedAccessViewvalues int[]void ID3D11DeviceContext::CopyResource([In] ID3D11Resource* pDstResource,[In] ID3D11Resource* pSrcResource)
public void CopyResource_(Resource dstResourceRef, Resource srcResourceRef)
Copy the entire contents of the source resource to the destination resource using the GPU.
public void CopyResource(Resource source, Resource destination)
source ResourceA reference to the source resource (see Resource).
destination ResourceA reference to the destination resource (see Resource).
void ID3D11DeviceContext::CopyStructureCount([In] ID3D11Buffer* pDstBuffer,[In] unsigned int DstAlignedByteOffset,[In] ID3D11UnorderedAccessView* pSrcView)
public void CopyStructureCount(Buffer dstBufferRef, int dstAlignedByteOffset, UnorderedAccessView srcViewRef)
dstBufferRef BufferdstAlignedByteOffset intsrcViewRef UnorderedAccessViewvoid ID3D11DeviceContext::CopySubresourceRegion([In] ID3D11Resource* pDstResource,[In] unsigned int DstSubresource,[In] unsigned int DstX,[In] unsigned int DstY,[In] unsigned int DstZ,[In] ID3D11Resource* pSrcResource,[In] unsigned int SrcSubresource,[In, Optional] const D3D11_BOX* pSrcBox)
public void CopySubresourceRegion_(Resource dstResourceRef, int dstSubresource, int dstX, int dstY, int dstZ, Resource srcResourceRef, int srcSubresource, ResourceRegion? srcBoxRef)
dstResourceRef ResourcedstSubresource intdstX intdstY intdstZ intsrcResourceRef ResourcesrcSubresource intsrcBoxRef ResourceRegion?Copy a region from a source resource to a destination resource.
public void CopySubresourceRegion(Resource source, int sourceSubresource, ResourceRegion? sourceRegion, Resource destination, int destinationSubResource, int dstX = 0, int dstY = 0, int dstZ = 0)
source ResourceA reference to the source resource (see Resource).
sourceSubresource intSource subresource index.
sourceRegion ResourceRegion?A reference to a 3D box (see ResourceRegion) that defines the source subresources that can be copied. If NULL, the entire source subresource is copied. The box must fit within the source resource.
destination ResourceA reference to the destination resource (see Resource).
destinationSubResource intDestination subresource index.
dstX intThe x-coordinate of the upper left corner of the destination region.
dstY intThe y-coordinate of the upper left corner of the destination region. For a 1D subresource, this must be zero.
dstZ intThe z-coordinate of the upper left corner of the destination region. For a 1D or 2D subresource, this must be zero.
Constructs a new deferred context DeviceContext.
public static DeviceContext Create(Device device)
device DeviceThe device with which to associate the state object.
void ID3D11DeviceContext::Dispatch([In] unsigned int ThreadGroupCountX,[In] unsigned int ThreadGroupCountY,[In] unsigned int ThreadGroupCountZ)
public void Dispatch(int threadGroupCountX, int threadGroupCountY, int threadGroupCountZ)
threadGroupCountX intthreadGroupCountY intthreadGroupCountZ intvoid ID3D11DeviceContext::DispatchIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs)
public void DispatchIndirect(Buffer bufferForArgsRef, int alignedByteOffsetForArgs)
bufferForArgsRef BufferalignedByteOffsetForArgs intClean up any resources being used.
protected override void Dispose(bool disposing)
disposing boolvoid ID3D11DeviceContext::Draw([In] unsigned int VertexCount,[In] unsigned int StartVertexLocation)
public void Draw(int vertexCount, int startVertexLocation)
vertexCount intstartVertexLocation intvoid ID3D11DeviceContext::DrawAuto()
public void DrawAuto()
void ID3D11DeviceContext::DrawIndexed([In] unsigned int IndexCount,[In] unsigned int StartIndexLocation,[In] int BaseVertexLocation)
public void DrawIndexed(int indexCount, int startIndexLocation, int baseVertexLocation)
indexCount intstartIndexLocation intbaseVertexLocation intvoid ID3D11DeviceContext::DrawIndexedInstanced([In] unsigned int IndexCountPerInstance,[In] unsigned int InstanceCount,[In] unsigned int StartIndexLocation,[In] int BaseVertexLocation,[In] unsigned int StartInstanceLocation)
public void DrawIndexedInstanced(int indexCountPerInstance, int instanceCount, int startIndexLocation, int baseVertexLocation, int startInstanceLocation)
indexCountPerInstance intinstanceCount intstartIndexLocation intbaseVertexLocation intstartInstanceLocation intvoid ID3D11DeviceContext::DrawIndexedInstancedIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs)
public void DrawIndexedInstancedIndirect(Buffer bufferForArgsRef, int alignedByteOffsetForArgs)
bufferForArgsRef BufferalignedByteOffsetForArgs intvoid ID3D11DeviceContext::DrawInstanced([In] unsigned int VertexCountPerInstance,[In] unsigned int InstanceCount,[In] unsigned int StartVertexLocation,[In] unsigned int StartInstanceLocation)
public void DrawInstanced(int vertexCountPerInstance, int instanceCount, int startVertexLocation, int startInstanceLocation)
vertexCountPerInstance intinstanceCount intstartVertexLocation intstartInstanceLocation intvoid ID3D11DeviceContext::DrawInstancedIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs)
public void DrawInstancedIndirect(Buffer bufferForArgsRef, int alignedByteOffsetForArgs)
bufferForArgsRef BufferalignedByteOffsetForArgs intvoid ID3D11DeviceContext::End([In] ID3D11Asynchronous* pAsync)
public void End(Asynchronous asyncRef)
asyncRef Asynchronousvoid ID3D11DeviceContext::ExecuteCommandList([In] ID3D11CommandList* pCommandList,[In] BOOL RestoreContextState)
public void ExecuteCommandList(CommandList commandListRef, Bool restoreContextState)
commandListRef CommandListrestoreContextState BoolHRESULT ID3D11DeviceContext::FinishCommandList([In] BOOL RestoreDeferredContextState,[Out, Optional] ID3D11CommandList** ppCommandList)
public CommandList FinishCommandList(Bool restoreDeferredContextState)
restoreDeferredContextState Boolvoid ID3D11DeviceContext::Flush()
public void Flush()
void ID3D11DeviceContext::GenerateMips([In] ID3D11ShaderResourceView* pShaderResourceView)
public void GenerateMips(ShaderResourceView shaderResourceViewRef)
shaderResourceViewRef ShaderResourceViewunsigned int ID3D11DeviceContext::GetContextFlags()
public int GetContextFlags()
Gets data from the GPU asynchronously.
public DataStream GetData(Asynchronous data, AsynchronousFlags flags)
data AsynchronousThe asynchronous data provider.
flags AsynchronousFlagsFlags specifying how the command should operate.
The data retrieved from the GPU.
Gets data from the GPU asynchronously.
public DataStream GetData(Asynchronous data)
data AsynchronousThe asynchronous data provider.
The data retrieved from the GPU.
Gets data from the GPU asynchronously.
public bool GetData<T>(Asynchronous data, out T result) where T : struct
data AsynchronousThe asynchronous data provider.
result TThe data retrieved from the GPU.
True if result contains valid data, false otherwise.
TGets data from the GPU asynchronously.
public bool GetData<T>(Asynchronous data, AsynchronousFlags flags, out T result) where T : struct
data AsynchronousThe asynchronous data provider.
flags AsynchronousFlagsFlags specifying how the command should operate.
result TThe data retrieved from the GPU.
True if result contains valid data, false otherwise.
TGets data from the GPU asynchronously.
public T GetData<T>(Asynchronous data, AsynchronousFlags flags) where T : struct
data AsynchronousThe asynchronous data provider.
flags AsynchronousFlagsFlags specifying how the command should operate.
The data retrieved from the GPU.
TGets data from the GPU asynchronously.
public T GetData<T>(Asynchronous data) where T : struct
data AsynchronousThe asynchronous data provider.
The data retrieved from the GPU.
THRESULT ID3D11DeviceContext::GetData([In] ID3D11Asynchronous* pAsync,[Out, Buffer, Optional] void* pData,[In] unsigned int DataSize,[In] D3D11_ASYNC_GETDATA_FLAG GetDataFlags)
public HResult GetDataInternal(Asynchronous asyncRef, IntPtr dataRef, int dataSize, AsynchronousFlags getDataFlags)
asyncRef AsynchronousdataRef System.IntPtrdataSize intgetDataFlags AsynchronousFlagsfloat ID3D11DeviceContext::GetResourceMinLOD([In] ID3D11Resource* pResource)
public float GetMinimumLod(Resource resourceRef)
resourceRef Resourcevoid ID3D11DeviceContext::GetPredication([Out, Optional] ID3D11Predicate** ppPredicate,[Out, Optional] BOOL* pPredicateValue)
public Predicate GetPredication(out Bool predicateValueRef)
predicateValueRef BoolD3D11_DEVICE_CONTEXT_TYPE ID3D11DeviceContext::GetType()
public DeviceContextType GetTypeInfo()
Determines whether asynchronous query data is available.
public bool IsDataAvailable(Asynchronous data, AsynchronousFlags flags)
data AsynchronousThe data.
flags AsynchronousFlagsOptional flags
true if asynchronous query data is available; otherwise, false.
Determines whether asynchronous query data is available.
public bool IsDataAvailable(Asynchronous data)
data AsynchronousThe data.
true if asynchronous query data is available; otherwise, false.
Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.
public DataBox MapSubresource(Buffer resource, MapMode mode, MapFlags flags, out DataStream stream)
resource BufferThe resource.
mode MapModeThe mode.
flags MapFlagsThe flags.
stream DataStreamThe output stream containing the pointer.
HRESULT ID3D11DeviceContext::Map([In] ID3D11Resource* pResource,[In] unsigned int Subresource,[In] D3D11_MAP MapType,[In] D3D11_MAP_FLAG MapFlags,[Out] D3D11_MAPPED_SUBRESOURCE* pMappedResource)
public HResult MapSubresource(Resource resourceRef, int subresource, MapMode mapType, MapFlags mapFlags, out DataBox mappedResourceRef)
Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.
public DataBox MapSubresource(Resource resource, int subresource, MapMode mode, MapFlags flags, out DataStream stream)
resource ResourceThe resource.
subresource intThe subresource.
mode MapModeThe mode.
flags MapFlagsThe flags.
stream DataStreamThe output stream containing the pointer.
Gets a reference to the data contained in a subresource, and denies the GPU access to that subresource.
public DataBox MapSubresource(Resource resourceRef, int subresource, MapMode mapType, MapFlags mapFlags)
resourceRef ResourceA reference to a Resource interface.
subresource intIndex number of the subresource.
mapType MapModeSpecifies the CPU's read and write permissions for a resource. For possible values, see MapMode.
mapFlags MapFlagsFlag that specifies what the CPU should do when the GPU is busy. This flag is optional.
The mapped subresource (see DataBox). If DoNotWait is used and the resource is still being used by the GPU, this method return an empty DataBox whose property IsEmpty returns true.
Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.
public DataBox MapSubresource(Resource resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out int mipSize)
resource ResourceThe resource.
mipSlice intThe mip slice.
arraySlice intThe array slice.
mode MapModeThe mode.
flags MapFlagsThe flags.
mipSize intSize of the selected miplevel.
Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.
public DataBox MapSubresource(Texture1D resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out DataStream stream)
resource Texture1DThe resource.
mipSlice intThe mip slice.
arraySlice intThe array slice.
mode MapModeThe mode.
flags MapFlagsThe flags.
stream DataStreamThe output stream containing the pointer.
Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.
public DataBox MapSubresource(Texture2D resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out DataStream stream)
resource Texture2DThe resource.
mipSlice intThe mip slice.
arraySlice intThe array slice.
mode MapModeThe mode.
flags MapFlagsThe flags.
stream DataStreamThe output stream containing the pointer.
Maps the data contained in a subresource to a memory pointer, and denies the GPU access to that subresource.
public DataBox MapSubresource(Texture3D resource, int mipSlice, int arraySlice, MapMode mode, MapFlags flags, out DataStream stream)
resource Texture3DThe resource.
mipSlice intThe mip slice.
arraySlice intThe array slice.
mode MapModeThe mode.
flags MapFlagsThe flags.
stream DataStreamThe output stream containing the pointer.
Method called when the NativePointer is updated.
protected override void NativePointerUpdated(IntPtr oldPointer)
oldPointer System.IntPtrvoid ID3D11DeviceContext::ResolveSubresource([In] ID3D11Resource* pDstResource,[In] unsigned int DstSubresource,[In] ID3D11Resource* pSrcResource,[In] unsigned int SrcSubresource,[In] DXGI_FORMAT Format)
public void ResolveSubresource_(Resource dstResourceRef, int dstSubresource, Resource srcResourceRef, int srcSubresource, Format format)
Copy a multisampled resource into a non-multisampled resource.
public void ResolveSubresource(Resource source, int sourceSubresource, Resource destination, int destinationSubresource, Format format)
source ResourceSource resource. Must be multisampled.
sourceSubresource intThe source subresource of the source resource.
destination ResourceDestination resource. Must be a created with the Default flag and be single-sampled. See Resource.
destinationSubresource intA zero-based index, that identifies the destination subresource. Use {{D3D11CalcSubresource}} to calculate the index.
format FormatA Format that indicates how the multisampled resource will be resolved to a single-sampled resource. See remarks.
void ID3D11DeviceContext::SetResourceMinLOD([In] ID3D11Resource* pResource,[In] float MinLOD)
public void SetMinimumLod(Resource resourceRef, float minLOD)
resourceRef ResourceminLOD floatvoid ID3D11DeviceContext::SetPredication([In, Optional] ID3D11Predicate* pPredicate,[In] BOOL PredicateValue)
public void SetPredication(Predicate predicateRef, Bool predicateValue)
void ID3D11DeviceContext::Unmap([In] ID3D11Resource* pResource,[In] unsigned int Subresource)
public void UnmapSubresource(Resource resourceRef, int subresource)
resourceRef Resourcesubresource intCopies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresource(DataBox source, Resource resource, int subresource, ResourceRegion region)
source DataBoxThe source data.
resource ResourceThe destination resource.
subresource intThe destination subresource.
region ResourceRegionThe destination region within the resource.
Copies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresource(DataBox source, Resource resource, int subresource = 0)
source DataBoxThe source data.
resource ResourceThe destination resource.
subresource intThe destination subresource.
void ID3D11DeviceContext::UpdateSubresource([In] ID3D11Resource* pDstResource,[In] unsigned int DstSubresource,[In, Optional] const D3D11_BOX* pDstBox,[In] const void* pSrcData,[In] unsigned int SrcRowPitch,[In] unsigned int SrcDepthPitch)
public void UpdateSubresource(Resource dstResourceRef, int dstSubresource, ResourceRegion? dstBoxRef, IntPtr srcDataRef, int srcRowPitch, int srcDepthPitch)
dstResourceRef ResourcedstSubresource intdstBoxRef ResourceRegion?srcDataRef System.IntPtrsrcRowPitch intsrcDepthPitch intCopies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresource<T>(T[] data, Resource resource, int subresource = 0, int rowPitch = 0, int depthPitch = 0, ResourceRegion? region = null) where T : struct
data T[]A reference to the data to upload.
resource ResourceThe destination resource.
subresource intThe destination subresource.
rowPitch intThe row pitch.
depthPitch intThe depth pitch.
region ResourceRegion?A region that defines the portion of the destination subresource to copy the resource data into. Coordinates are in bytes for buffers and in texels for textures.
TType of the data to upload
Copies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresource<T>(ref T data, Resource resource, int subresource = 0, int rowPitch = 0, int depthPitch = 0, ResourceRegion? region = null) where T : struct
data TA reference to the data to upload.
resource ResourceThe destination resource.
subresource intThe destination subresource.
rowPitch intThe row pitch.
depthPitch intThe depth pitch.
region ResourceRegion?The region
TType of the data to upload
Copies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresourceSafe(DataBox source, Resource resource, int srcBytesPerElement, int subresource, ResourceRegion region, bool isCompressedResource = false)
source DataBoxThe source data.
resource ResourceThe destination resource.
srcBytesPerElement intThe size in bytes per pixel/block element.
subresource intThe destination subresource.
region ResourceRegionThe destination region within the resource.
isCompressedResource boolif set to true the resource is a block/compressed resource
Copies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresourceSafe(DataBox source, Resource resource, int srcBytesPerElement, int subresource = 0, bool isCompressedResource = false)
source DataBoxThe source data.
resource ResourceThe destination resource.
srcBytesPerElement intThe size in bytes per pixel/block element.
subresource intThe destination subresource.
isCompressedResource boolif set to true the resource is a block/compressed resource
Copies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresourceSafe<T>(T[] data, Resource resource, int srcBytesPerElement, int subresource = 0, int rowPitch = 0, int depthPitch = 0, bool isCompressedResource = false) where T : struct
data T[]A reference to the data to upload.
resource ResourceThe destination resource.
srcBytesPerElement intThe size in bytes per pixel/block element.
subresource intThe destination subresource.
rowPitch intThe row pitch.
depthPitch intThe depth pitch.
isCompressedResource boolif set to true the resource is a block/compressed resource
TType of the data to upload
Copies data from the CPU to to a non-mappable subresource region.
public void UpdateSubresourceSafe<T>(ref T data, Resource resource, int srcBytesPerElement, int subresource = 0, int rowPitch = 0, int depthPitch = 0, bool isCompressedResource = false) where T : struct
data TA reference to the data to upload.
resource ResourceThe destination resource.
srcBytesPerElement intThe size in bytes per pixel/block element.
subresource intThe destination subresource.
rowPitch intThe row pitch.
depthPitch intThe depth pitch.
isCompressedResource boolif set to true the resource is a block/compressed resource
TType of the data to upload
Performs an explicit conversion from System.IntPtr to DeviceContext.
public static explicit operator DeviceContext(IntPtr nativePointer)
nativePointer System.IntPtr