Training
Module
Render a 3D model with Azure Remote Rendering - Training
Use Azure Remote Rendering to render a 3D model in a Unity project. You can deploy the model to HoloLens 2 or use the power of mixed reality with the MRTK.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This topic shows how to create a WARP device that implements a high speed software rasterizer. To create a WARP device, simply specify that the device you are creating will use a WARP driver. This example creates a device and a swap chain at the same time.
To create a WARP device
Define initial parameters for a swap chain.
DXGI_SWAP_CHAIN_DESC sd;
ZeroMemory( &sd, sizeof( sd ) );
sd.BufferCount = 1;
sd.BufferDesc.Width = 640;
sd.BufferDesc.Height = 480;
sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
sd.BufferDesc.RefreshRate.Numerator = 60;
sd.BufferDesc.RefreshRate.Denominator = 1;
sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
sd.OutputWindow = g_hWnd;
sd.SampleDesc.Count = 1;
sd.SampleDesc.Quality = 0;
sd.Windowed = TRUE;
Request a feature level that implements the features your application will need. A WARP device can be successfully created for feature levels D3D_FEATURE_LEVEL_9_1 through D3D_FEATURE_LEVEL_10_1 and starting with Windows 8 for all feature levels.
D3D_FEATURE_LEVEL FeatureLevels = D3D_FEATURE_LEVEL_10_1;
See more about feature levels in the D3D_FEATURE_LEVEL enumeration.
Create the device by calling D3D11CreateDeviceAndSwapChain.
HRESULT hr = S_OK;
if( FAILED (hr = D3D11CreateDeviceAndSwapChain( NULL,
D3D_DRIVER_TYPE_WARP,
NULL,
0,
&FeatureLevels,
1,
D3D11_SDK_VERSION,
&sd,
&g_pSwapChain,
&g_pd3dDevice,
&FeatureLevel,
&g_pImmediateContext )))
{
return hr;
}
You will need to supply the API call with the WARP driver type from the D3D_DRIVER_TYPE enumeration. After the method succeeds, it will return a swap chain interface, a device interface, a pointer to the feature level that was granted by the driver, and an immediate context interface.
For information about limitations creating a WARP device on certain feature levels, see Limitations Creating WARP and Reference Devices.
When a computer's primary display adapter is the "Microsoft Basic Display Adapter" (WARP adapter), that computer also has a second adapter. This second adapter is the render-only device that has no display outputs. For more info about the render-only device, see new info in Windows 8 about enumerating adapters.
Training
Module
Render a 3D model with Azure Remote Rendering - Training
Use Azure Remote Rendering to render a 3D model in a Unity project. You can deploy the model to HoloLens 2 or use the power of mixed reality with the MRTK.
Documentation
How To Create a Device and Immediate Context - Win32 apps
This topics shows how to initialize a device.
How To Create a Reference Device - Win32 apps
This topic shows how to create a reference device that implements a highly accurate, software implementation of the runtime.
How to Use Direct3D 11 - Win32 apps
This section demonstrates how to use the Microsoft Direct3D 11 API to accomplish several common tasks.