XLE  v0.02.0
Namespaces | Classes | Typedefs | Functions
RenderCore::Metal_DX11 Namespace Reference

This is the implementation of RenderCore::Metal for DX11 platforms. More...

Namespaces

 AddressMode
 Container for AddressMode::Enum.
 
 Blend
 Container for Blend::Enum.
 
 BlendOp
 Container for BlendOp::Enum.
 
 CullMode
 Container for CullMode::Enum.
 
 FillMode
 Container for FillMode::Enum.
 
 FilterMode
 Container for FilterMode::Enum.
 
 FormatComponents
 Container for FormatComponents::Enum.
 
 FormatComponentType
 Container for FormatComponentType::Enum.
 
 FormatCompressionType
 Container for FormatCompressionType::Enum.
 
 FormatPrefix
 Container for FormatPrefix::Enum.
 
 GlobalInputLayouts
 Contains some common reusable vertex input layouts.
 
 GPUProfiler
 Low level GPU profiler implementation (for DirectX11)
 
 InputClassification
 Container for InputClassification::Enum.
 
 NativeFormat
 Container for NativeFormat::Enum.
 
 Topology
 Container for Topology::Enum.
 

Classes

class  ArraySlice
 
class  BlendState
 States used while drawing pixels to the render targets More...
 
class  BoundClassInterfaces
 
class  BoundInputLayout
 
class  BoundUniforms
 
class  CommandList
 
class  ComputeShader
 
class  ConstantBuffer
 
class  ConstantBufferLayout
 
class  ConstantBufferLayoutElement
 
class  ConstantBufferLayoutElementHash
 
class  CopyPartial_Dest
 
class  CopyPartial_Src
 
class  D3DTypeInfo
 
class  D3DTypeInfo< ID3D::Buffer >
 
class  D3DTypeInfo< ID3D::Texture1D >
 
class  D3DTypeInfo< ID3D::Texture2D >
 
class  D3DTypeInfo< ID3D::Texture3D >
 
class  DeepShaderProgram
 A shader program with tessellation support More...
 
class  DepthStencilState
 States used reading and writing to the depth buffer More...
 
class  DepthStencilView
 
class  DeviceContext
 
class  DomainShader
 
class  GeometryShader
 
class  HullShader
 
class  IndexBuffer
 
class  InputElementDesc
 
class  MipSlice
 
class  ObjectFactory
 
class  PixelCoord
 
class  PixelShader
 
class  RasterizerState
 States used while rasterising triangles More...
 
class  RenderTargetView
 
class  SamplerState
 States for sampling from textures More...
 
class  ShaderProgram
 A set of shaders for each stage of the shader pipeline More...
 
class  ShaderResourceView
 
class  StencilMode
 
class  TextureDesc
 
class  UniformsStream
 
class  UnorderedAccessView
 
class  VertexBuffer
 
class  VertexShader
 
class  ViewportDesc
 Utility for querying low level viewport More...
 

Typedefs

typedef TextureDesc< ID3D::Texture1D > TextureDesc1D
 
typedef TextureDesc< ID3D::Texture2D > TextureDesc2D
 
typedef TextureDesc< ID3D::Texture3D > TextureDesc3D
 
typedef TextureDesc< ID3D::Buffer > D3DBufferDesc
 
typedef SharedPkt ConstantBufferPacket
 
typedef std::pair< const InputElementDesc *, size_t > InputLayout
 
typedef intrusive_ptr< ID3D::Query > UnderlyingQuery
 

Functions

intrusive_ptr< ID3D::ShaderReflection > CreateReflection (const CompiledShaderByteCode &shaderCode)
 
std::shared_ptr< ShaderService::ILowLevelCompilerCreateLowLevelShaderCompiler ()
 
ImpliedTyping::TypeDesc GetType (D3D11_SHADER_TYPE_DESC typeDesc)
 
template<typename ResourceType >
intrusive_ptr< ResourceType > ExtractResource (ID3D::RenderTargetView *rtv)
 
template<typename ResourceType >
intrusive_ptr< ResourceType > ExtractResource (ID3D::ShaderResourceView *srv)
 
template<typename ResourceType >
intrusive_ptr< ResourceType > ExtractResource (ID3D::UnorderedAccessView *uav)
 
template<typename ResourceType >
intrusive_ptr< ResourceType > ExtractResource (ID3D::DepthStencilView *dsv)
 
template<typename DestinationType , typename SourceType >
intrusive_ptr< DestinationType > QueryInterfaceCast (SourceType *sourceObject)
 
template<typename DestinationType , typename SourceType >
intrusive_ptr< DestinationType > QueryInterfaceCast (intrusive_ptr< SourceType > &sourceObject)
 
template<typename Type >
intrusive_ptr< Type > DuplicateResource (ID3D::DeviceContext *context, Type *inputResource)
 
template<>
intrusive_ptr< ID3D::Resource > DuplicateResource (ID3D::DeviceContext *context, ID3D::Resource *inputResource)
 
template<>
intrusive_ptr< ID3D::Buffer > DuplicateResource (ID3D::DeviceContext *context, ID3D::Buffer *inputResource)
 
FormatCompressionType::Enum GetCompressionType (NativeFormat::Enum format)
 
FormatComponents::Enum GetComponents (NativeFormat::Enum format)
 
FormatComponentType::Enum GetComponentType (NativeFormat::Enum format)
 
unsigned BitsPerPixel (NativeFormat::Enum format)
 
unsigned GetComponentPrecision (NativeFormat::Enum format)
 
unsigned GetDecompressedComponentPrecision (NativeFormat::Enum format)
 
unsigned GetComponentCount (FormatComponents::Enum components)
 
NativeFormat::Enum FindFormat (FormatCompressionType::Enum compression, FormatComponents::Enum components, FormatComponentType::Enum componentType, unsigned precision)
 
NativeFormat::Enum AsSRGBFormat (NativeFormat::Enum inputFormat)
 
NativeFormat::Enum AsLinearFormat (NativeFormat::Enum inputFormat)
 
NativeFormat::Enum AsTypelessFormat (NativeFormat::Enum inputFormat)
 
bool HasLinearAndSRGBFormats (NativeFormat::Enum inputFormat)
 
NativeFormat::Enum AsNativeFormat (const ImpliedTyping::TypeDesc &type, ShaderNormalizationMode::Enum norm)
 
const char * AsString (NativeFormat::Enum format)
 
NativeFormat::Enum AsNativeFormat (const char name[])
 
DXGI_FORMAT AsDXGIFormat (NativeFormat::Enum format)
 
NativeFormat::Enum AsNativeFormat (DXGI_FORMAT format)
 
unsigned CalculateVertexStride (const InputElementDesc *start, const InputElementDesc *end, unsigned slot)
 
unsigned HasElement (const InputElementDesc *begin, const InputElementDesc *end, const char elementSemantic[])
 
unsigned FindElement (const InputElementDesc *begin, const InputElementDesc *end, const char elementSemantic[], unsigned semanticIndex)
 
void Copy (DeviceContext &context, ID3D::Resource *dst, ID3D::Resource *src)
 
void CopyPartial (DeviceContext &context, const CopyPartial_Dest &dst, const CopyPartial_Src &src)
 
intrusive_ptr< ID3D::Resource > Duplicate (DeviceContext &context, ID3D::Resource *inputResource)
 

Detailed Description

This is the implementation of RenderCore::Metal for DX11 platforms.

When DX11 is enabled, RenderCore::Metal is renamed to mean RenderCore::Metal_DX11

namespace RendeCore {
using Metal = Metal_DX11;
}

This means that DX11 implementations of the "metal" interfaces can be accessed via RenderCore::Metal:...

For example, RenderCore::Metal::DeviceContext will be a rename for RenderCore::Metal_DX11::DeviceContext. This allows compile-time polymorphism: client code isn't strongly bound to any single implementation of RenderCore::Metal, and we can change which implementation is used with compile time switches.

Important classes

The classes RenderCore::Metal_DX11 implement a thin layer over an underlying graphics API. The architecture is designed to be roughly in-line with modern thinking about GPU hardware, striking a balance between dominant APIs (like DX11, DX12, OpenGL4, OpenGLES) as well as providing flexibility for future APIs.

Here are some example classes;

RenderCore::Metal_DX11::DeviceContext
This is very similar to the DX11 DeviceContext, and closely tied with the higher level RenderCore::IThreadContext. It is strongly associated with a single CPU thread. And for that thread, it represents the GPU state. Important operations are: "Bind" (which changes the GPU state), and "Draw" (which executes an operation on the GPU.
RenderCore::Metal_DX11::ShaderProgram
This represents a fully configured set of shaders, for use with a draw operation. ShaderPrograms can be used with the Assets::GetAsset API, or stored independently. While we can interact with VertexShader and PixelShader objects individually, the ShaderProgram interface is easiest to use across multiple platforms.
RenderCore::Metal_DX11::BoundUniforms
This interface allows the CPU to associate resources and constants with the input interface of a shader. This interface uses shader reflection to find the correct shader input slots for resources (so the CPU code is does not have to know them). But querying shader reflection is expensive. So generally BoundUniforms should only be constructed during loading events (or in a background thread), and not every frame.
RenderCore::Metal_DX11::ShaderResourceView
A ShaderResourceView configures the way a shader will see a part of GPU memory. Typically the GPU memory in question is a texture. ShaderResourceView tells the shader the dimensions of the texture, pixel format, mipmap counts, etc. We call a block of GPU memory a "resource." In modern graphics API designs, resources are mostly opaque. It's the view that determines how we interpret that memory. We can have multiple views per resource – and this is important when we want to be able to different pixel formats for the same memory (or different mipmap settings, etc).

DirectX11 specific code

This namespace is designed to encourage platform-generic coding practices. But it also provides access to allow platform-specific clients. Some effects and methods require special implementations for certain platforms. And some platform concepts are difficult to create truly generic wrappers for.

This is a advantage of the polymorphism method used for RenderCore::Metal. RenderCore::Metal_DX11::DeviceContext and RenderCore::Metal_OpenGLES::DeviceContext are actually unrelated types (they have no common base classes). So we can extend the base functionality with platform specific addition when needed.