Correct pitch alignment calculation

When we're aligning rowPitch to imagePitchAlignment, rowPitch is in pixels,
but imagePitchAlignment_ is bytes, so we end up overaligning the pitch.

Convert imagePitchAlignment_ to pixels before doing any logic.

Change-Id: Ia5ab9d54bed150fe974e86b060dbadc196165b29
Šī revīzija ir iekļauta:
Vladislav Sytchenko
2020-02-20 18:00:27 -05:00
vecāks 5de65ba4a0
revīzija 696d00e71b
+1 -1
Parādīt failu
@@ -1143,7 +1143,7 @@ bool Image::createView(const Memory& parent) {
}
// Make sure the row pitch is aligned to pixels
rowPitch = elementSize * amd::alignUp(rowPitch, dev().info().imagePitchAlignment_);
rowPitch = elementSize * amd::alignUp(rowPitch, (dev().info().imagePitchAlignment_ / elementSize));
status = hsa_ext_image_create_with_layout(
dev().getBackendDevice(), &imageDescriptor_, deviceMemory_, permission_,