diff options
| author | Tim Foley <tim.foley.is@gmail.com> | 2017-09-21 11:20:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-21 11:20:57 -0700 |
| commit | b206af702cbc8cc42c73052ad690d69984ecd7b7 (patch) | |
| tree | 9738c2125766886b2e9a1eac7b437d7f0c0fbb7f | |
| parent | 0116717524291491d09d924b236aabada4d40d07 (diff) | |
| parent | 289a71e7c3109a8f85fda5599d77230e5a4c90ee (diff) | |
Merge pull request #190 from tfoleyNV/use-warp-for-d3d11-tests
Use WARP for D3D rendering tests.
| -rw-r--r-- | tests/render/render0.hlsl | 2 | ||||
| -rw-r--r-- | tools/render-test/render-d3d11.cpp | 26 |
2 files changed, 22 insertions, 6 deletions
diff --git a/tests/render/render0.hlsl b/tests/render/render0.hlsl index 5e04c7d63..e6849fe60 100644 --- a/tests/render/render0.hlsl +++ b/tests/render/render0.hlsl @@ -1,4 +1,4 @@ -//TEST(smoke,render):COMPARE_HLSL_RENDER: +//TEST(smoke):COMPARE_HLSL_RENDER: // Starting with a basic test for the ability to render stuff... cbuffer Uniforms diff --git a/tools/render-test/render-d3d11.cpp b/tools/render-test/render-d3d11.cpp index 2627d7b1f..456278dd2 100644 --- a/tools/render-test/render-d3d11.cpp +++ b/tools/render-test/render-d3d11.cpp @@ -430,8 +430,11 @@ static HRESULT captureTextureToFile( dxTexture->GetDesc(&dxTextureDesc); // Don't bother supporing MSAA for right now - if(dxTextureDesc.SampleDesc.Count > 1) + if( dxTextureDesc.SampleDesc.Count > 1 ) + { + fprintf(stderr, "ERROR: cannot capture multisample texture\n"); return E_INVALIDARG; + } HRESULT hr = S_OK; ID3D11Texture2D* dxStagingTexture = nullptr; @@ -445,13 +448,16 @@ static HRESULT captureTextureToFile( { // Modify the descriptor to give us a staging texture dxTextureDesc.BindFlags = 0; - dxTextureDesc.MiscFlags &= D3D11_RESOURCE_MISC_TEXTURECUBE; + dxTextureDesc.MiscFlags &= ~D3D11_RESOURCE_MISC_TEXTURECUBE; dxTextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; dxTextureDesc.Usage = D3D11_USAGE_STAGING; hr = dxDevice->CreateTexture2D(&dxTextureDesc, 0, &dxStagingTexture); - if(FAILED(hr)) + if( FAILED(hr) ) + { + fprintf(stderr, "ERROR: failed to create staging texture\n"); return hr; + } dxContext->CopyResource(dxStagingTexture, dxTexture); } @@ -460,8 +466,11 @@ static HRESULT captureTextureToFile( D3D11_MAPPED_SUBRESOURCE dxMappedResource; hr = dxContext->Map(dxStagingTexture, 0, D3D11_MAP_READ, 0, &dxMappedResource); - if(FAILED(hr)) + if( FAILED(hr) ) + { + fprintf(stderr, "ERROR: failed to map texture for read\n"); return hr; + } int stbResult = stbi_write_png( outputPath, @@ -472,6 +481,7 @@ static HRESULT captureTextureToFile( dxMappedResource.RowPitch); if( !stbResult ) { + fprintf(stderr, "ERROR: failed to write texture to file\n"); return E_UNEXPECTED; } @@ -566,7 +576,10 @@ public: { hr = D3D11CreateDeviceAndSwapChain_( NULL, // adapter (use default) - D3D_DRIVER_TYPE_HARDWARE, + + D3D_DRIVER_TYPE_WARP, +// D3D_DRIVER_TYPE_HARDWARE, + NULL, // software deviceFlags, &featureLevels[ii], @@ -674,6 +687,9 @@ public: break; case BufferFlavor::Vertex: + dxBufferDesc.Usage = D3D11_USAGE_DEFAULT; + dxBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + dxBufferDesc.CPUAccessFlags = 0; break; default: |
