diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-02-01 12:06:06 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-01 12:06:06 -0800 |
| commit | 4583e395ad503b63343a14adaeb621dee8a8da71 (patch) | |
| tree | 8dc7ea0861ee11c5742925785ecb7b312c242599 /tools/render-test/render-d3d11.cpp | |
| parent | b6bc0837ba6e7fb42280bf6289f4dab633c88392 (diff) | |
Implement type splitting for raw buffers (#393)
* Fix render-test to handle raw buffers
I don't know if this fix will work for UAVs that are neither structured nor raw, but it fixes the code that currently only really works if every UAV is structured (since it doesn't set a format).
* Make type legalization consider raw buffer types
The type layout logic was already handling these, but the type splitting logic in legalization was failing to split structure types that contain, e.g., `RWByteAddressBuffer`.
A compute test case has been added to confirm the fix.
Diffstat (limited to 'tools/render-test/render-d3d11.cpp')
| -rw-r--r-- | tools/render-test/render-d3d11.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/render-test/render-d3d11.cpp b/tools/render-test/render-d3d11.cpp index d0280a770..7d5c79b19 100644 --- a/tools/render-test/render-d3d11.cpp +++ b/tools/render-test/render-d3d11.cpp @@ -815,6 +815,16 @@ public: viewDesc.Buffer.Flags = 0; viewDesc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; viewDesc.Format = DXGI_FORMAT_UNKNOWN; + + if( bufferDesc.stride == 0 ) + { + // TODO: are there UAV cases we need to handle that are neither + // raw nor structured? RWBuffer<T> would be one... + + viewDesc.Buffer.Flags |= D3D11_BUFFER_UAV_FLAG_RAW; + viewDesc.Format = DXGI_FORMAT_R32_TYPELESS; + } + dxDevice->CreateUnorderedAccessView(bufferOut, &viewDesc, &viewOut); } if (bufferDesc.type != InputBufferType::ConstantBuffer) |
