Documentation  

Last Update: Dec 2012

ShaderReflection Class (SharpDX.D3DCompiler)

A shader-reflection interface accesses shader information.

System.Object
   SharpDX.DisposeBase
      SharpDX.CppObject
         SharpDX.ComObject
            SharpDX.D3DCompiler.ShaderReflection

Assembly: SharpDX.D3DCompiler (SharpDX.D3DCompiler.dll 2.4.2.0)
Namespace: SharpDX.D3DCompiler
Unmanaged: ID3D11ShaderReflection
Documentation for unmanaged references are generated from MSDN documentation. Please refer to the original documentation for further details.
  • C#
  • VB
  • C++
  • F#
[GuidAttribute("0a233719-3960-4578-9d7c-203b8b1d9cc1")]
public class ShaderReflection : ComObject

Syntax for VB is not yet implemented.

Syntax for C++ is not yet implemented

Syntax for F# is not yet implemented.

The ShaderReflection type exposes the following members.

  Platforms Name Description
ShaderReflection(IntPtr) Initializes a new instance of the ShaderReflection class. 
ShaderReflection(Byte[]) Initializes a new instance of the ShaderReflection class from a ShaderBytecode
Top
  Platforms Name Unmanaged Description
BitwiseInstructionCount GetBitwiseInstructionCount

Gets the number of bitwise instructions.

 
ConditionalMoveInstructionCount GetMovcInstructionCount

Gets the number of Movc instructions.

 
ConversionInstructionCount GetConversionInstructionCount

Gets the number of conversion instructions.

 
Description GetDesc

Get a shader description.

 
GeometryShaderSInputPrimitive GetGSInputPrimitive

Gets the geometry-shader input-primitive description.

 
InterfaceSlotCount GetNumInterfaceSlots

Gets the number of interface slots in a shader.

 
IsDisposed Gets a value indicating whether this instance is disposed. (Inherited from DisposeBase.)
IsSampleFrequencyShader IsSampleFrequencyShader

Indicates whether a shader is a sample frequency shader.

 
MinFeatureLevel GetMinFeatureLevel

Gets the minimum feature level.

 
MoveInstructionCount GetMovInstructionCount

Gets the number of Mov instructions.

 
NativePointer Get a pointer to the underlying Cpp Object (Inherited from CppObject.)
RequiresFlags GetRequiresFlags No documentation. 
Top
  Platforms Name Unmanaged Description
As<T>(IntPtr) IUnknown::QueryInterface Queries a managed object for a particular COM interface support (This method is a shortcut to QueryInterface) (Inherited from ComObject.)
As<T>(object) IUnknown::QueryInterface Queries a managed object for a particular COM interface support (This method is a shortcut to QueryInterface) (Inherited from ComObject.)
Dispose(bool) IUnknown::Release Releases unmanaged and - optionally - managed resources (Inherited from ComObject.)
Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from DisposeBase.)
Dispose<T> Safely dispose a referencem if not null, and set it to null after dispose. (Inherited from ComObject.)
Finalize() Releases unmanaged resources and performs other cleanup operations before the DisposeBase is reclaimed by garbage collection. (Inherited from DisposeBase.)
FromPointer<T> Instantiate a ComObject from a native pointer. (Inherited from CppObject.)
FromTemp(IntPtr) Initializes this instance with a pointer from a temporary object and set the pointer of the temporary object to IntPtr.Zero. (Inherited from CppObject.)
FromTemp(CppObject) Initializes this instance with a pointer from a temporary object and set the pointer of the temporary object to IntPtr.Zero. (Inherited from CppObject.)
GetConstantBuffer(string) ID3D11ShaderReflection::GetConstantBufferByName

Get a constant buffer by name.

 
GetConstantBuffer(int) ID3D11ShaderReflection::GetConstantBufferByIndex

Get a constant buffer by index.

 
GetInputParameterDescription ID3D11ShaderReflection::GetInputParameterDesc

Get an input-parameter description for a shader.

 
GetOutputParameterDescription ID3D11ShaderReflection::GetOutputParameterDesc

Get an output-parameter description for a shader.

 
GetPatchConstantParameterDescription ID3D11ShaderReflection::GetPatchConstantParameterDesc

Get a patch-constant parameter description for a shader.

 
GetResourceBindingDescription(string) ID3D11ShaderReflection::GetResourceBindingDescByName

Get a description of how a resource is bound to a shader.

 
GetResourceBindingDescription(int) ID3D11ShaderReflection::GetResourceBindingDesc

Get a description of how a resource is bound to a shader.

 
GetThreadGroupSize ID3D11ShaderReflection::GetThreadGroupSize

Retrieves the sizes, in thread groups, of the X, Y, and Z dimensions of the shader's thread-group grid.

 
GetVariable ID3D11ShaderReflection::GetVariableByName

Gets a variable by name.

 
NativePointerUpdated Method called when the NativePointer is updated. (Inherited from ComObject.)
NativePointerUpdating Method called when NativePointer is going to be update. (Inherited from ComObject.)
QueryInterface IUnknown::QueryInterface Query this instance for a particular COM GUID/interface support. (Inherited from ComObject.)
QueryInterface<T>() IUnknown::QueryInterface Query this instance for a particular COM interface support. (Inherited from ComObject.)
QueryInterface<T>(object) IUnknown::QueryInterface Queries a managed object for a particular COM interface support. (Inherited from ComObject.)
QueryInterfaceFrom<T> Query Interface for a particular interface support and attach to the given instance. (Inherited from ComObject.)
QueryInterfaceOrNull IUnknown::QueryInterface Query instance for a particular COM GUID/interface support. (Inherited from ComObject.)
QueryInterfaceOrNull<T> IUnknown::QueryInterface Query Interface for a particular interface support. (Inherited from ComObject.)
Top
  Platforms Name Description
Disposed Occurs when this instance is fully disposed. (Inherited from DisposeBase.)
Disposing Occurs when this instance is starting to be disposed. (Inherited from DisposeBase.)
Top
  Platforms Name Description
Explicit(IntPtr) Performs an explicit conversion from System.IntPtr to ShaderReflection. (This method is a shortcut to NativePointer
Top

An ShaderReflection interface can be retrieved for a shader by using SharpDX.D3DCompiler.D3D.Reflect. The following code illustrates retrieving a ShaderReflection from a shader.

 pd3dDevice->CreatePixelShader( pPixelShaderBuffer->GetBufferPointer(), pPixelShaderBuffer->GetBufferSize(), g_pPSClassLinkage, &g_pPixelShader ); ShaderReflection* pReflector = null; 	
            SharpDX.D3DCompiler.D3D.Reflect( pPixelShaderBuffer->GetBufferPointer(), pPixelShaderBuffer->GetBufferSize(),  IID_ID3D11ShaderReflection, (void**) &pReflector); 
Supported in:

    
 All Windows Desktop - .NET 2.0+ - .NET 4.0+
    
 Windows 8 Metro - DirectX11.1 - .NET 4.5 Core
    
 Windows 8 Desktop - DirectX11.1 - .NET 4.0+