[2/n] Refactor CPU copies

- move blocking flag to command queue function
- refactor buffer function for better readability
- add new method to easily state that buffer is compressed.

Change-Id: I62465b7bc8b109f14d0012b5641d4b822e3cc908
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2020-02-21 09:48:51 +01:00
committed by sys_ocldev
parent 8cb486e821
commit 618472c23e
6 changed files with 61 additions and 23 deletions

View File

@@ -562,12 +562,23 @@ bool CommandQueue::bufferCpuCopyAllowed(Buffer *buffer, cl_command_type commandT
return false;
}
if (debugVariableSet && buffer->getGraphicsAllocation()->getAllocationType() != GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {
//if buffer is compressed we cannot do CPU copy
if (buffer->isCompressed()) {
return false;
}
if (debugVariableSet) {
return true;
}
//non blocking transfers are not expected to be serviced by CPU
//we do not want to artifically stall the pipeline to allow CPU access
if (blocking == CL_FALSE) {
return false;
}
//check if buffer is compatible
if (!buffer->isReadWriteOnCpuAllowed(blocking, ptr, size)) {
if (!buffer->isReadWriteOnCpuAllowed(ptr, size)) {
return false;
}