[OpenJDK 2D-Dev] RFR: 8264318 Lanai: DrawHugeImageTest.java fails on apple M1

Sergey Bylokhov serb at openjdk.java.net
Wed Apr 7 19:59:38 UTC 2021


On Wed, 7 Apr 2021 05:24:30 GMT, Denis Konoplev <dkonoplev at openjdk.org> wrote:

> Check if blit sizes are less than MTL_GPU_FAMILY_MAC_TXT_SIZE.
> 
> It's safe since we copy tile from the image with memcpy. 
> // copy src pixels inside src bounds to buff
> for (int row = 0; row < sh; row++) {
>     memcpy(buff.contents + (row * sw * srcInfo->pixelStride), raster, sw * srcInfo->pixelStride);
>     raster += (NSUInteger)srcInfo->scanStride;
> }

I wonder why we have two similar but different constants:
#define MaxTextureSize 16384
#define MTL_GPU_FAMILY_MAC_TXT_SIZE 16384

src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m line 162:

> 160:     const int sh = MIN(srcInfo->bounds.y2 - srcInfo->bounds.y1, MTL_GPU_FAMILY_MAC_TXT_SIZE);
> 161:     const int dw = MIN(dx2 - dx1, MTL_GPU_FAMILY_MAC_TXT_SIZE);
> 162:     const int dh = MIN(dy2 - dy1, MTL_GPU_FAMILY_MAC_TXT_SIZE);

Just curious why such big coordinates are passed here. We should not be able to create a window of such size, as well as a volatile image.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3369


More information about the 2d-dev mailing list