Software layer in Direct3D 11

Source: Internet
Author: User

The Direct3D 11 Runtime is composed of layers.

A basic principle is to add features to the layer without affecting existing behaviors. For example, the core functions have the same return values in the independent debugging layer, and even additional debugging information.

CallableD3D11CreateDeviceOrD3D11CreateDeviceAndSwapChainAnd provides one or moreD3D11_CREATE_DEVICE_FLAGThe value is used to create a layer when a device is created.

Direct3D 11 provides the following runtime layers:

# Core Layer)

# Debug Layer)

Core Layer

The core layer exists by default. A thin ing layer is provided between the api and device to minimize the performance impact caused by high-frequency function calls. The core layer is efficiency. It only performs necessary checks. The remaining layers are optional.

Debug Layer

This layer provides a large number of additional parameters and Consistency Verification (such as verifying the connection and resource binding of the shader, parameter consistency, and submission error description ).

To create a device that supports the debugging layer, you must install the DirectX SDK (to obtain D3D11SDKLayers. dll) and then callD3D11CreateDeviceOrD3D11CreateDeviceAndSwapChainSpecifiedD3D11_CREATE_DEVICE_DEBUGMark.

It should be noted that the program runs slowly after the activation of the adjustment layer. You can useDirectX Control PanelTo enable or disable the debugging layer. When the mode layer lists memory leaks, a list of interface pointers associated with friendly names is output. The default friendly name is "<unnamed> ". You can useID3D11DeviceChild: SetPrivateDataAnd WKPDID_D3DDebugObjectName GUID in D3Dcommon. h to set friendly names. For example, use the following code to name a pTexture pointer in mytexture.jpg:

const char c_szName[] = "mytexture.jpg";pTexture->SetPrivateData( WKPDID_D3DDebugObjectName, sizeof( c_szName ) - 1, c_szName );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.