Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8247772: Lanai: Several jtreg tests fails with assertion validateText…
  • Loading branch information
prsadhuk committed Jun 17, 2020
1 parent e16e7f0 commit 2947a7c344b7dc6582d82c384d4a5ee27e690f91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
@@ -77,4 +77,10 @@ typedef struct _MTLGraphicsConfigInfo {
MTLContext *context;
} MTLGraphicsConfigInfo;

// From "Metal Feature Set Tables"
// There are 2 GPU families for mac - MTLGPUFamilyMac1 and MTLGPUFamilyMac2
// Both of them support "Maximum 2D texture width and height" of 16384 pixels
// Note : there is no API to get this value, hence hardcoding by reading from the table
#define MaxTextureSize 16384

#endif /* MTLGraphicsConfig_h_Included */
@@ -218,11 +218,5 @@ + (void) _getMTLConfigInfo: (NSMutableArray *)argValue {
{
J2dTraceLn(J2D_TRACE_INFO, "MTLGraphicsConfig_nativeGetMaxTextureSize");

// From "Metal Feature Set Tables"
// There are 2 GPU families for mac - MTLGPUFamilyMac1 and MTLGPUFamilyMac2
// Both of them support "Maximum 2D texture width and height" of 16384 pixels
// Note : there is no API to get this value, hence hardcoding by reading from the table
__block int max = 16384;

return (jint)max;
return (jint)MaxTextureSize;
}
@@ -68,6 +68,9 @@ static jboolean MTLSurfaceData_initTexture(BMTLSDOps *bmtlsdo, jboolean isOpaque

MTLContext* ctx = mtlsdo->configInfo->context;

if (width > MaxTextureSize) {
width = MaxTextureSize;
}
MTLTextureDescriptor *textureDescriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat: MTLPixelFormatBGRA8Unorm width: width height: height mipmapped: NO];
textureDescriptor.usage = MTLTextureUsageUnknown;
bmtlsdo->pTexture = [ctx.device newTextureWithDescriptor: textureDescriptor];

0 comments on commit 2947a7c

Please sign in to comment.