From 289a71e7c3109a8f85fda5599d77230e5a4c90ee Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 21 Sep 2017 10:53:56 -0700 Subject: Use WARP for D3D rendering tests. This should in principle allow for the D3D-only tests to run on AppVeyor so that we can validate running things for CI purposes (and is probably a whole lot easier than trying to plug the VM up to the rendering tests). I've switched up one of the tests so that it should run even on AppVeyor, so fingers crossed that it will actually run. --- tests/render/render0.hlsl | 2 +- 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: -- cgit v1.2.3