[1/n] Mipmap support

* adding support for map/unmap
* adding support for origin/region validation with mipmaps
* fixing slices returned in map/unmap
* removing ambiguity around mipLevel naming
* enabling cl_khr_mipmap_image in current shape
* enabling cl_khr_mipmap_image_writes in current shape

* fixing CompileProgramWithReraFlag test

Change-Id: I0c9d83028c5c376f638e45151755fd2c7d0fb0ab
This commit is contained in:
Chodor, Jaroslaw
2018-04-04 09:29:48 +02:00
parent 6506df559b
commit 0a97dfbb2f
44 changed files with 777 additions and 246 deletions

View File

@@ -25,6 +25,7 @@
#include "runtime/context/context.h"
#include "runtime/event/event_builder.h"
#include "runtime/helpers/get_info.h"
#include "runtime/helpers/mipmap.h"
#include "runtime/mem_obj/buffer.h"
#include "runtime/mem_obj/image.h"
@@ -41,10 +42,10 @@ void *CommandQueue::cpuDataTransferHandler(TransferProperties &transferPropertie
if (mapOperation) {
returnPtr = ptrOffset(transferProperties.memObj->getCpuAddressForMapping(),
transferProperties.memObj->calculateOffsetForMapping(transferProperties.offset));
transferProperties.memObj->calculateOffsetForMapping(transferProperties.offset) + transferProperties.mipPtrOffset);
if (!transferProperties.memObj->addMappedPtr(returnPtr, transferProperties.memObj->calculateMappedPtrLength(transferProperties.size),
transferProperties.mapFlags, transferProperties.size, transferProperties.offset)) {
transferProperties.mapFlags, transferProperties.size, transferProperties.offset, transferProperties.mipLevel)) {
err.set(CL_INVALID_OPERATION);
return nullptr;
}
@@ -115,6 +116,7 @@ void *CommandQueue::cpuDataTransferHandler(TransferProperties &transferPropertie
outEventObj->setStartTimeStamp();
}
UNRECOVERABLE_IF((transferProperties.memObj->isMemObjZeroCopy() == false) && isMipMapped(transferProperties.memObj));
switch (transferProperties.cmdType) {
case CL_COMMAND_MAP_BUFFER:
if (!transferProperties.memObj->isMemObjZeroCopy()) {