Add GPUResourceMapMode.NoWait flag to control buffer data reading
c68b75a298
This commit is contained in:
@@ -29,12 +29,12 @@ void* GPUBufferDX11::Map(GPUResourceMapMode mode)
|
||||
map.pData = nullptr;
|
||||
D3D11_MAP mapType;
|
||||
UINT mapFlags = 0;
|
||||
switch (mode)
|
||||
switch (mode & GPUResourceMapMode::ReadWrite)
|
||||
{
|
||||
case GPUResourceMapMode::Read:
|
||||
mapType = D3D11_MAP_READ;
|
||||
//if (_desc.Usage == GPUResourceUsage::StagingReadback && isMainThread)
|
||||
// mapFlags = D3D11_MAP_FLAG_DO_NOT_WAIT;
|
||||
if (EnumHasAnyFlags(mode, GPUResourceMapMode::NoWait))
|
||||
mapFlags = D3D11_MAP_FLAG_DO_NOT_WAIT;
|
||||
break;
|
||||
case GPUResourceMapMode::Write:
|
||||
mapType = D3D11_MAP_WRITE_DISCARD;
|
||||
|
||||
Reference in New Issue
Block a user