X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=apps%2Fd3d11%2Ftri.cpp;h=b8a2c042903806ebc62b7e0c0a4c0c6001fd1acb;hp=28f930298e2a30b45d0b442947cfb1f2c2ba77f9;hb=36de802ab2d1c9c55530059595fb52a757252ff3;hpb=b3a59f4e0d7ec235cd7dd5d0b38042e5cb23d111 diff --git a/apps/d3d11/tri.cpp b/apps/d3d11/tri.cpp index 28f9302..b8a2c04 100644 --- a/apps/d3d11/tri.cpp +++ b/apps/d3d11/tri.cpp @@ -34,8 +34,8 @@ #include -#include "tri_vs.h" -#include "tri_ps.h" +#include "tri_vs_4_0.h" +#include "tri_ps_4_0.h" static IDXGISwapChain* g_pSwapChain = NULL; @@ -89,6 +89,11 @@ int main(int argc, char *argv[]){ ShowWindow(hWnd, SW_SHOW); + UINT Flags = 0; + if (LoadLibraryA("d3d11sdklayers")) { + Flags |= D3D11_CREATE_DEVICE_DEBUG; + } + DXGI_SWAP_CHAIN_DESC SwapChainDesc; ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc); SwapChainDesc.BufferDesc.Width = WindowWidth; @@ -112,7 +117,7 @@ int main(int argc, char *argv[]){ hr = D3D11CreateDeviceAndSwapChain(NULL, /* pAdapter */ D3D_DRIVER_TYPE_HARDWARE, NULL, /* Software */ - D3D11_CREATE_DEVICE_DEBUG, + Flags, FeatureLevels, sizeof FeatureLevels / sizeof FeatureLevels[0], D3D11_SDK_VERSION, @@ -222,8 +227,12 @@ int main(int argc, char *argv[]){ RasterizerDesc.CullMode = D3D11_CULL_NONE; RasterizerDesc.FillMode = D3D11_FILL_SOLID; RasterizerDesc.FrontCounterClockwise = true; + RasterizerDesc.DepthClipEnable = true; ID3D11RasterizerState* pRasterizerState = NULL; - g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState); + hr = g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState); + if (FAILED(hr)) { + return 1; + } g_pDeviceContext->RSSetState(pRasterizerState); g_pDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);