DX11 software mode.

Started by
24 comments, last by _Flame1_ 11 years, 9 months ago

WARP isn't a debugging tool, it's intended to be deployed. So I'm pretty sure you don't need to install the SDK to use it.

Indeed it is part of the D3D runtime - my mistake. Thanks MJP.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Advertisement
Yes. It's not good if it will be nessesary to install DirectX SDK but it's alright.
Ok, here is my code.

D3D_DRIVER_TYPE driver = D3D_DRIVER_TYPE_REFERENCE;
D3D11CreateDevice(pAdapter, driver, 0, 0, 0, 0, D3D11_SDK_VERSION, &pDevice, NULL, NULL );


Also i've tried D3D_DRIVER_TYPE_WARP. And i have HRESULT - 0x80070057(The parameter is incorrect. ) all time.
Yes, i have installed latest DirectX Sdk.
Maybe you need the other 2 [font=courier new,courier,monospace]out[/font] params to not be [font=courier new,courier,monospace]NULL[/font]?D3D_FEATURE_LEVEL level = 0;
ID3D11DeviceContext* pContext = 0;
D3D_DRIVER_TYPE driver = D3D_DRIVER_TYPE_REFERENCE;
D3D11CreateDevice(pAdapter, driver, 0, 0, 0, 0, D3D11_SDK_VERSION, &pDevice, &level, &pContext );

[Edit] Also, did you see this restriction? It implies that [font=courier new,courier,monospace]pAdapter[/font] should be [font=courier new,courier,monospace]NULL[/font] for a reference driver.
If you set the pAdapter parameter to a non-NULL value, you must also set the DriverType parameter to the D3D_DRIVER_TYPE_UNKNOWN value.[/quote]
Thanks. D3D_DRIVER_TYPE_REFERENCE is working now with NULL adapter.

But i can't create swap chain now.
The function CreateSwapChain returns error - 0x887A0001(DXGI_ERROR_INVALID_CALL).


Also i can't run my application with WARP.
D3D_DRIVER_TYPE driver = D3D_DRIVER_TYPE_WARP;
D3D11CreateDevice(0, driver, 0, 0, 0, 0, D3D10_SDK_VERSION, &pDevice, NULL, NULL );

I have an error "The parameter is incorrect" again.
Any ideas? Firstly i invoke D3D11CreateDevice and secondly IDXGIFactory->CreateSwapChain;

My SwapChainDescription is quite simple.

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;


I took it from msdn example.
Turns out that it's impossible to create ref device and after that create a swap chain. Only D3D11CreateDeviceAndSwapChain works properly with ref device. It must be bug of DirectX.

This topic is closed to new replies.

Advertisement