Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8260553: Lanai: pipeline substates use while loop for resize
Reviewed-by: dkonoplev
  • Loading branch information
Alexey Ushakov committed Jan 28, 2021
1 parent 2a9fcc5 commit 88c1ff807d098b08d8819d1db09401ed43238ccb
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.m
@@ -141,8 +141,9 @@ - (NSPointerArray * ) getSubStates:(NSString *)vertexShaderId fragmentShader:(NS
int index = compositeRule*64 + subIndex;

NSPointerArray * subStates = [self getSubStates:vertexShaderId fragmentShader:fragmentShaderId];
while (index >= [subStates count]) {
[subStates addPointer:NULL]; // obj-c collections haven't resize methods, so do that

if (index >= subStates.count) {
subStates.count = (NSUInteger) (index + 1);
}

id<MTLRenderPipelineState> result = [subStates pointerAtIndex:index];

0 comments on commit 88c1ff8

Please sign in to comment.