mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
[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:
committed by
sys_ocldev
parent
8cb486e821
commit
618472c23e
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user