On Wed, 7 Apr 2021 05:24:30 GMT, Denis Konoplev <dkonop...@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

Reply via email to