Commit 6ba451ba by Jamie Madill

Fix single buffer copies.

In D3D11, the device doesn't allow overlapped buffer copies unless the D3D11_FEATURE_DATA_D3D11_OPTIONS::CopyWithOverlap feature is enabled. This isn't technically available until D3D11.1. Get around the restriction by using a different storage buffer as the source of the copy. Fixes funcional.buffer.copy.single_buffer.* in dEQP. BUG=angle:715 Change-Id: I03fea8a1c6180a29e07e05022e3454524e320803 Reviewed-on: https://chromium-review.googlesource.com/210902Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarNicolas Capens <capn@chromium.org>
parent 778d5279
...@@ -304,6 +304,21 @@ void Buffer11::copySubData(BufferImpl* source, GLintptr sourceOffset, GLintptr d ...@@ -304,6 +304,21 @@ void Buffer11::copySubData(BufferImpl* source, GLintptr sourceOffset, GLintptr d
dest = getStagingBuffer(); dest = getStagingBuffer();
} }
// D3D11 does not allow overlapped copies until 11.1, and only if the
// device supports D3D11_FEATURE_DATA_D3D11_OPTIONS::CopyWithOverlap
// Get around this via a different source buffer
if (source == dest)
{
if (source->getUsage() == BUFFER_USAGE_STAGING)
{
source = getBufferStorage(BUFFER_USAGE_VERTEX_OR_TRANSFORM_FEEDBACK);
}
else
{
source = getStagingBuffer();
}
}
dest->copyFromStorage(source, sourceOffset, size, destOffset); dest->copyFromStorage(source, sourceOffset, size, destOffset);
dest->setDataRevision(dest->getDataRevision() + 1); dest->setDataRevision(dest->getDataRevision() + 1);
} }
...@@ -598,7 +613,7 @@ Buffer11::NativeBuffer11::~NativeBuffer11() ...@@ -598,7 +613,7 @@ Buffer11::NativeBuffer11::~NativeBuffer11()
// Returns true if it recreates the direct buffer // Returns true if it recreates the direct buffer
bool Buffer11::NativeBuffer11::copyFromStorage(BufferStorage11 *source, size_t sourceOffset, bool Buffer11::NativeBuffer11::copyFromStorage(BufferStorage11 *source, size_t sourceOffset,
size_t size, size_t destOffset) size_t size, size_t destOffset)
{ {
ID3D11DeviceContext *context = mRenderer->getDeviceContext(); ID3D11DeviceContext *context = mRenderer->getDeviceContext();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment