Direct3D 11.1 Features
[This documentation is preliminary and is subject to change.]
The following functionality has been added in Direct3D 11.1.
- Shader tracing and compiler enhancements
- Direct3D device sharing
- Check support of new Direct3D 11.1 features and formats
- Create larger constant buffers than a shader can access
- Use logical operations in a render target
- Force the sample count to create a rasterizer state
- Process video resources with shaders
- Extended support for shared Texture2D resources
- Change subresources with new copy options
- Discard resources and resource views
- Support a larger number of UAVs
- Bind a subrange of a constant buffer to a shader
- Retrieve the subrange of a constant buffer that is bound to a shader
- Clear all or part of a resource view
- Map SRVs of dynamic buffers with NO_OVERWRITE
- Use UAVs at every pipeline stage
Shader tracing and compiler enhancements
Direct3D 11.1 lets you use shader tracing to ensure that your code is performing as intended and if it isn’t you can discover and remedy the problem. The SDK for Windows 8 Consumer Preview contains HLSL compiler enhancements. Shader tracing and the HLSL compiler are implemented in D3dcompiler_nn.dll.
The shader tracing API and the enhancements to the HLSL compiler consists of the following methods and functions.
- ID3D11RefDefaultTrackingOptions::SetTrackingOptions
- ID3D11RefTrackingOptions::SetTrackingOptions
- ID3D11TracingDevice::SetShaderTrackingOptions
- ID3D11TracingDevice::SetShaderTrackingOptionsByType
- ID3D11ShaderTraceFactory::CreateShaderTrace
- ID3D11ShaderTrace::TraceReady
- ID3D11ShaderTrace::ResetTrace
- ID3D11ShaderTrace::GetTraceStats
- ID3D11ShaderTrace::PSSelectStamp
- ID3D11ShaderTrace::GetInitialRegisterContents
- ID3D11ShaderTrace::GetStep
- ID3D11ShaderTrace::GetWrittenRegister
- ID3D11ShaderTrace::GetReadRegister
- D3DCompile2
- D3DCompileFromFile
- D3DDisassemble11Trace
- D3DDisassembleRegion
- D3DGetTraceInstructionOffsets
- D3DReadFileToBlob
- D3DSetBlobPart
- D3DWriteBlobToFile
The D3dcompiler.lib library requires D3dcompiler_nn.dll. This DLL is not part of Windows 8; it is in the \bin folder of the SDK for Windows 8 along with the Fxc.exe command-line version of the HLSL compiler.
Note While you can use this library and DLL combination for development, you can't deploy Metro style apps that use this combination. Therefore, you must instead compile HLSL shaders before you ship your Metro style app. You can write HLSL compilation binaries to disk, or the compiler can generate headers with static byte arrays that contain the shader blob data. You use the ID3DBlob interface to access the blob data. To develop your Metro style app, call D3DCompile2 or D3DCompileFromFile to compile the raw HLSL source, and then feed the resulting blob data to Direct3D.
Direct3D device sharing
Direct3D 11.1 enables Direct3D 10 APIs and Direct3D 11 APIs to use one underlying rendering device.
This Direct3D 11.1 feature consists of the following methods and interface.
- ID3D11Device1::CreateDeviceContextState
- ID3D11DeviceContext1::SwapDeviceContextState
- ID3DDeviceContextState
Check support of new Direct3D 11.1 features and formats
Direct3D 11.1 lets you check for new features that the graphics driver might support and new ways that a format is supported on a device. Microsoft DirectX Graphics Infrastructure (DXGI) 1.2 also specifies new DXGI_FORMAT values.
This Direct3D 11.1 feature consists of the following API.
- ID3D11Device::CheckFeatureSupport with D3D11_FEATURE_DATA_D3D11_OPTIONS, D3D11_FEATURE_DATA_ARCHITECTURE_INFO, D3D11_FEATURE_DATA_D3D9_OPTIONS, and D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT structures
- ID3D11Device::CheckFormatSupport with D3D11_FORMAT_SUPPORT_DECODER_OUTPUT, D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT, D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT, D3D11_FORMAT_SUPPORT_VIDEO_ENCODER, and D3D11_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP
Create larger constant buffers than a shader can access
Direct3D 11.1 lets you create constant buffers that are larger than the maximum constant buffer size that a shader can access (4096 32-bit*4-component constants – 64KB). Later, when you bind the buffers to the pipeline, for example, via PSSetConstantBuffers or PSSetConstantBuffers1, you can specify a range of buffers that the shader can access that fits within the 4096 limit.
Direct3D 11.1 updates the ID3D11Device::CreateBuffer method for this feature.
Use logical operations in a render target
Direct3D 11.1 lets you use logical operations rather than blending in a render target. However, you can’t mix logic operations with blending across multiple render targets.
This Direct3D 11.1 feature consists of the following API.
Force the sample count to create a rasterizer state
Direct3D 11.1 lets you specify a force sample count when you create a rasterizer state.
This Direct3D 11.1 feature consists of the following API.
Process video resources with shaders
Direct3D 11.1 lets you create views (SRV/RTV/UAV) to video resources so that Direct3D shaders can process those video resources. The format of an underlying video resource restricts the formats that the view can use. The DXGI_FORMAT enumeration contains new video resource format values. These DXGI_FORMAT values specify the valid view formats that you can create and how the Direct3D 11.1 runtime maps the view. You can create multiple views of different parts of the same surface, and depending on the format, the sizes of the views can differ from each other.
Direct3D 11.1 updates the following methods for this feature.
- ID3D11Device::CreateShaderResourceView
- ID3D11Device::CreateRenderTargetView
- ID3D11Device::CreateUnorderedAccessView
Extended support for shared Texture2D resources
Direct3D 11.1 lets you share a greater variety of Texture2D resource types and formats. To share Texture2D resources, use the D3D11_RESOURCE_MISC_SHARED, D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX, or a combination of the D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX and D3D11_RESOURCE_MISC_SHARED_NTHANDLE (new for Windows 8) flags when you create those resources.
Direct3D 11.1 lets you share resources that you created with these DXGI_FORMAT values:
- DXGI_FORMAT_R32G32B32A32_TYPELESS
- DXGI_FORMAT_R32G32B32A32_FLOAT
- DXGI_FORMAT_R32G32B32A32_UINT
- DXGI_FORMAT_R32G32B32A32_SINT
- DXGI_FORMAT_R16G16B16A16_TYPELESS
- DXGI_FORMAT_R16G16B16A16_FLOAT
- DXGI_FORMAT_R16G16B16A16_UNORM
- DXGI_FORMAT_R16G16B16A16_UINT
- DXGI_FORMAT_R16G16B16A16_SNORM
- DXGI_FORMAT_R16G16B16A16_SINT
- DXGI_FORMAT_R10G10B10A2_UNORM
- DXGI_FORMAT_R10G10B10A2_UINT
- DXGI_FORMAT_R8G8B8A8_TYPELESS
- DXGI_FORMAT_R8G8B8A8_UNORM
- DXGI_FORMAT_R8G8B8A8_UNORM_SRGB
- DXGI_FORMAT_R8G8B8A8_UINT
- DXGI_FORMAT_R8G8B8A8_SNORM
- DXGI_FORMAT_R8G8B8A8_SINT
- DXGI_FORMAT_B8G8R8A8_TYPELESS
- DXGI_FORMAT_B8G8R8A8_UNORM
- DXGI_FORMAT_B8G8R8A8_UNORM_SRGB
- DXGI_FORMAT_R32_TYPELESS
- DXGI_FORMAT_R32_FLOAT
- DXGI_FORMAT_R32_UINT
- DXGI_FORMAT_R32_SINT
- DXGI_FORMAT_R16_TYPELESS
- DXGI_FORMAT_R16_FLOAT
- DXGI_FORMAT_R16_UNORM
- DXGI_FORMAT_R16_UINT
- DXGI_FORMAT_R16_SNORM
- DXGI_FORMAT_R16_SINT
- DXGI_FORMAT_R8_TYPELESS
- DXGI_FORMAT_R8_UNORM
- DXGI_FORMAT_R8_UINT
- DXGI_FORMAT_R8_SNORM
- DXGI_FORMAT_R8_SINT
- DXGI_FORMAT_A8_UNORM
- DXGI_FORMAT_AYUV
- DXGI_FORMAT_YUY2
- DXGI_FORMAT_NV12
- DXGI_FORMAT_NV11
- DXGI_FORMAT_P016
- DXGI_FORMAT_P010
- DXGI_FORMAT_Y216
- DXGI_FORMAT_Y210
- DXGI_FORMAT_Y416
- DXGI_FORMAT_Y410
Direct3D 11.1 lets you share resources that you created with these features and flags:
- D3D11_USAGE_DEFAULT
- D3D11_BIND_SHADER_RESOURCE
- D3D11_BIND_RENDER_TARGET
- D3D11_RESOURCE_MISC_GENERATE_MIPS
- D3D11_BIND_UNORDERED_ACCESS
- Mipmap levels in the 2D texture resources (specified in the MipLevels member of D3D11_TEXTURE2D_DESC)
- Arrays of 2D texture resources (specified in the ArraySize member of D3D11_TEXTURE2D_DESC)
- D3D11_BIND_DECODER
- D3D11_RESOURCE_MISC_RESTRICTED_CONTENT
- D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE
- D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER
Direct3D 11.1 doesn't let you share resources that you created with these features and flags:
- D3D11_BIND_DEPTH_STENCIL
- 2D texture resources in multisample antialiasing (MSAA) mode (specified with DXGI_SAMPLE_DESC)
- D3D11_RESOURCE_MISC_RESOURCE_CLAMP
- D3D11_USAGE_IMMUTABLE, D3D11_USAGE_DYNAMIC, or D3D11_USAGE_STAGING (that is, mappable)
- D3D11_RESOURCE_MISC_TEXTURECUBE
Change subresources with new copy options
Direct3D 11.1 lets you use new copy flags to copy and update subresources. When you copy a subresource, the source and destination resources can be identical and the source and destination regions can overlap.
This Direct3D 11.1 feature consists of the following API.
Discard resources and resource views
Direct3D 11.1 lets you discard resources and views of resources from the device context. This new functionality informs the GPU that existing content in resources or resource views are no longer needed.
This Direct3D 11.1 feature consists of the following API.
Support a larger number of UAVs
Direct3D 11.1 lets you use a larger number of UAVs when you bind resources to the output-merger stage and when you set an array of views for an unordered resource.
Direct3D 11.1 updates the following methods for this feature.
- ID3D11DeviceContext::OMSetRenderTargetsAndUnorderedAccessViews
- ID3D11DeviceContext::CSSetUnorderedAccessViews
Bind a subrange of a constant buffer to a shader
Direct3D 11.1 lets you bind a subrange of a constant buffer for a shader to access. You can supply a larger constant buffer and specify the subrange that the shader can use.
This Direct3D 11.1 feature consists of the following API.
- ID3D11DeviceContext1::CSSetConstantBuffers1
- ID3D11DeviceContext1::DSSetConstantBuffers1
- ID3D11DeviceContext1::GSSetConstantBuffers1
- ID3D11DeviceContext1::HSSetConstantBuffers1
- ID3D11DeviceContext1::PSSetConstantBuffers1
- ID3D11DeviceContext1::VSSetConstantBuffers1
Retrieve the subrange of a constant buffer that is bound to a shader
Direct3D 11.1 lets you retrieve the subrange of a constant buffer that is bound to a shader.
This Direct3D 11.1 feature consists of the following API.
- ID3D11DeviceContext1::CSGetConstantBuffers1
- ID3D11DeviceContext1::DSGetConstantBuffers1
- ID3D11DeviceContext1::GSGetConstantBuffers1
- ID3D11DeviceContext1::HSGetConstantBuffers1
- ID3D11DeviceContext1::PSGetConstantBuffers1
- ID3D11DeviceContext1::VSGetConstantBuffers1
Clear all or part of a resource view
Direct3D 11.1 lets you clear a resource view (RTV, UAV, or any video view of a Texture2D surface). You apply the same color value to all parts of the view.
This Direct3D 11.1 feature consists of the following API.
Map SRVs of dynamic buffers with NO_OVERWRITE
Direct3D 11.1 lets you map shader resource views (SRV) of dynamic buffers with D3D11_MAP_WRITE_NO_OVERWRITE. The Direct3D 11 and earlier runtimes limited mapping to vertex or index buffers.
Direct3D 11.1 updates the ID3D11DeviceContext::Map method for this feature.
Use UAVs at every pipeline stage
Direct3D 11.1 lets you use the following shader model 5.0 instructions at all shader stages that were previously used in just pixel shaders and compute shaders.
- dcl_uav_typed
- dcl_uav_raw
- dcl_uav_structured
- ld_raw
- ld_structured
- ld_uav_typed
- store_raw
- store_structured
- store_uav_typed
- sync_uglobal
- All atomics and immediate atomics (for example, atomic_and and imm_atomic_and)
Direct3D 11.1 updates the following methods for this feature.
- ID3D11DeviceContext::CreateDomainShader
- ID3D11DeviceContext::CreateGeometryShader
- ID3D11DeviceContext::CreateGeometryShaderWithStreamOutput
- ID3D11DeviceContext::CreateHullShader
- ID3D11DeviceContext::CreateVertexShader
These instructions existed in Direct3D 11.0 in ps_5_0 and cs_5_0. Because Direct3D 11.1 makes UAVs available at all shader stages, these instructions are available at all shader stages.
If you pass compiled shaders (VS/HS/DS/HS) that use any of these instructions to a create-shader function, like CreateVertexShader, on devices that don’t support UAVs at every stage (including existing drivers that are not implemented with this feature), the create-shader function fails. The create-shader function also fails if the shader tries to use a UAV slot beyond the set of UAV slots that the hardware supports.
The UAVs that are referenced by these instructions are shared across all pipeline stages. For example, a UAV that is bound at slot 0 at the output-merger stage is available at slot 0 to VS/HS/DS/GS/PS.
Build date: 3/6/2012
Actually OpenGL has already support for most of them:
- UAVs (aka load/store images) and atomic counters in every shader stage
- large constant buffers (aka uniform buffers) and binding with offset
- clearing all layers of a texture
- mapping texture buffer data
etc.
- 10/7/2011
- Daniel Rákos
- 11/20/2011
- Thomas Lee