Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

8261638: Lanai: crash in Clipping tab of J2Demo

  • Loading branch information
Alexey Ushakov committed Feb 12, 2021
1 parent 97ccc3b commit 7653c969c3ed07a9dae264db93c9d39d26af3610
@@ -56,6 +56,11 @@ NSMutableDictionary<NSString*, id<MTLComputePipelineState>> * computeStates;
vertexShaderId:(NSString *)vertexShaderId
fragmentShaderId:(NSString *)fragmentShaderId;

- (id<MTLRenderPipelineState>) getPipelineState:(MTLRenderPipelineDescriptor *) pipelineDescriptor
vertexShaderId:(NSString *)vertexShaderId
fragmentShaderId:(NSString *)fragmentShaderId
stencilNeeded:(bool)stencilNeeded;

- (id<MTLRenderPipelineState>) getPipelineState:(MTLRenderPipelineDescriptor *) pipelineDescriptor
vertexShaderId:(NSString *)vertexShaderId
fragmentShaderId:(NSString *)fragmentShaderId
@@ -93,6 +93,20 @@ - (NSPointerArray * ) getSubStates:(NSString *)vertexShaderId fragmentShader:(NS
stencilNeeded:NO];
}

- (id<MTLRenderPipelineState>) getPipelineState:(MTLRenderPipelineDescriptor *) pipelineDescriptor
vertexShaderId:(NSString *)vertexShaderId
fragmentShaderId:(NSString *)fragmentShaderId
stencilNeeded:(bool)stencilNeeded
{
RenderOptions defaultOptions = {JNI_FALSE, JNI_FALSE, 0/*unused*/, {JNI_FALSE, JNI_TRUE}, {JNI_FALSE, JNI_TRUE}, JNI_FALSE};
return [self getPipelineState:pipelineDescriptor
vertexShaderId:vertexShaderId
fragmentShaderId:fragmentShaderId
composite:nil
renderOptions:&defaultOptions
stencilNeeded:stencilNeeded];
}

// Base method to obtain MTLRenderPipelineState.
// NOTE: parameters compositeRule, srcFlags, dstFlags are used to set MTLRenderPipelineColorAttachmentDescriptor multipliers
- (id<MTLRenderPipelineState>) getPipelineState:(MTLRenderPipelineDescriptor *) pipelineDescriptor
@@ -714,8 +714,9 @@ void MTLRenderer_FillSpans(MTLContext *mtlc, BMTLSDOps * dstOps, jint spanCount,
id<MTLRenderPipelineState> pipelineState =
[mtlc.pipelineStateStorage
getPipelineState:templateAAPipelineDesc
vertexShaderId:@"vert_col_aa"
vertexShaderId:@"vert_col_aa"
fragmentShaderId:@"frag_col_aa"
stencilNeeded:mtlc.clip.isShape
];

[encoder setRenderPipelineState:pipelineState];

0 comments on commit 7653c96

Please sign in to comment.