P4 to Git Change 1310014 by gandryey@gera-w8 on 2016/09/01 17:32:18
SWDEV-101621 - [CQE OCL][OpenCL on PAL] 6 WF Conformance tests are failing - Make sure the rowPitch is aligned to pixels for images created from buffer Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#20 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#10 edit
Tá an tiomantas seo le fáil i:
@@ -347,7 +347,7 @@ void NullDevice::fillDeviceInfo(
|
||||
info_.image3DMaxHeight_ = std::min(2 * Ki, maxTextureSize);
|
||||
info_.image3DMaxDepth_ = std::min(2 * Ki, maxTextureSize);
|
||||
|
||||
info_.imagePitchAlignment_ = 1; // PAL uses LINEAR_GENERAL
|
||||
info_.imagePitchAlignment_ = 256; // PAL uses LINEAR_ALIGNED
|
||||
info_.imageBaseAddressAlignment_ = 256; // XXX: 256 byte base address alignment for now
|
||||
|
||||
info_.bufferFromImageSupport_ = CL_TRUE;
|
||||
|
||||
@@ -819,6 +819,21 @@ Resource::create(MemoryType memType, CreateParams* params)
|
||||
else if (memoryType() == ImageView) {
|
||||
tiling = viewOwner_->image_->GetImageCreateInfo().tiling;
|
||||
}
|
||||
|
||||
if (memoryType() == ImageBuffer) {
|
||||
uint32_t rowPitch;
|
||||
if ((params->owner_ != NULL) && params->owner_->asImage() &&
|
||||
(params->owner_->asImage()->getRowPitch() != 0)) {
|
||||
rowPitch = params->owner_->asImage()->getRowPitch() / elementSize();
|
||||
}
|
||||
else {
|
||||
rowPitch = desc().width_;
|
||||
}
|
||||
// Make sure the row pitch is aligned to pixels
|
||||
imgCreateInfo.rowPitch = elementSize() *
|
||||
amd::alignUp(rowPitch, dev().info().imagePitchAlignment_);
|
||||
imgCreateInfo.depthPitch = imgCreateInfo.rowPitch * desc().height_;
|
||||
}
|
||||
imgCreateInfo.tiling = tiling;
|
||||
|
||||
size_t imageSize = dev().iDev()->GetImageSize(imgCreateInfo, &result);
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir