summaryrefslogtreecommitdiffstats
path: root/tools/render-test/render-d3d11.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-09-21 10:53:56 -0700
committerTim Foley <tfoley@nvidia.com>2017-09-21 10:53:56 -0700
commit289a71e7c3109a8f85fda5599d77230e5a4c90ee (patch)
tree9738c2125766886b2e9a1eac7b437d7f0c0fbb7f /tools/render-test/render-d3d11.cpp
parent0116717524291491d09d924b236aabada4d40d07 (diff)
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.
Diffstat (limited to 'tools/render-test/render-d3d11.cpp')
-rw-r--r--tools/render-test/render-d3d11.cpp26
1 files changed, 21 insertions, 5 deletions
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: