mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Add alignment check to CL_DEVICE_MEM_BASE_ADDR_ALIGN for compressed buffers
Change-Id: I44fa231411a754fb24398a4a9727ca16f257220e Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
e9a35fbf88
commit
cefa3e3119
@@ -61,12 +61,17 @@ bool Buffer::isSubBuffer() {
|
||||
}
|
||||
|
||||
bool Buffer::isValidSubBufferOffset(size_t offset) {
|
||||
for (size_t i = 0; i < context->getNumDevices(); ++i) {
|
||||
cl_uint address_align = 32; // 4 byte alignment
|
||||
if ((offset & (address_align / 8 - 1)) == 0) {
|
||||
return true;
|
||||
if (this->getGraphicsAllocation()->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {
|
||||
// From spec: "origin value is aligned to the CL_DEVICE_MEM_BASE_ADDR_ALIGN value"
|
||||
if (!isAligned(offset, this->getContext()->getDevice(0)->getDeviceInfo().memBaseAddressAlign)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
cl_uint address_align = 32; // 4 byte alignment
|
||||
if ((offset & (address_align / 8 - 1)) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user