mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8265062: Remove duplication constant MaxTextureSize
This commit is contained in:
committed by
Alexey Ushakov
parent
904a5c3dd4
commit
71e97816b7
@@ -47,10 +47,4 @@ 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 */
|
||||
|
||||
@@ -225,5 +225,5 @@ Java_sun_java2d_metal_MTLGraphicsConfig_nativeGetMaxTextureSize
|
||||
{
|
||||
J2dTraceLn(J2D_TRACE_INFO, "MTLGraphicsConfig_nativeGetMaxTextureSize");
|
||||
|
||||
return (jint)MaxTextureSize;
|
||||
return (jint)MTL_GPU_FAMILY_MAC_TXT_SIZE;
|
||||
}
|
||||
|
||||
@@ -68,11 +68,11 @@ static jboolean MTLSurfaceData_initTexture(BMTLSDOps *bmtlsdo, jboolean isOpaque
|
||||
|
||||
MTLContext* ctx = mtlsdo->configInfo->context;
|
||||
|
||||
width = (width <= MaxTextureSize) ? width : 0;
|
||||
height = (height <= MaxTextureSize) ? height : 0;
|
||||
width = (width <= MTL_GPU_FAMILY_MAC_TXT_SIZE) ? width : 0;
|
||||
height = (height <= MTL_GPU_FAMILY_MAC_TXT_SIZE) ? height : 0;
|
||||
|
||||
J2dTraceLn3(J2D_TRACE_VERBOSE, " desired texture dimensions: w=%d h=%d max=%d",
|
||||
width, height, MaxTextureSize);
|
||||
width, height, MTL_GPU_FAMILY_MAC_TXT_SIZE);
|
||||
|
||||
// if either dimension is 0, we cannot allocate a texture with the
|
||||
// requested dimensions
|
||||
|
||||
Reference in New Issue
Block a user