Skip to content

Commit

Permalink
sampler access fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YuAo committed Mar 1, 2018
1 parent c023c78 commit 578e871
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Frameworks/MetalPetal/Kernels/MTIMultilayerCompositeKernel.m
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,16 @@ - (MTIImagePromiseRenderTarget *)resolveWithContext:(MTIImageRenderingContext *)
for (NSUInteger index = 0; index < self.layers.count; index += 1) {
MTILayer *layer = self.layers[index];
{
id<MTLSamplerState> samplerState = [renderingContext.context samplerStateWithDescriptor:layer.compositingMask.content.samplerDescriptor error:&error];
if (error) {
if (inOutError) {
*inOutError = error;
if (layer.compositingMask) {
id<MTLSamplerState> samplerState = [renderingContext.context samplerStateWithDescriptor:layer.compositingMask.content.samplerDescriptor error:&error];
if (error) {
if (inOutError) {
*inOutError = error;
}
return nil;
}
return nil;
compositingMaskSamplerStates[index] = samplerState;
}
compositingMaskSamplerStates[index] = samplerState;
}
{
id<MTLSamplerState> samplerState = [renderingContext.context samplerStateWithDescriptor:layer.content.samplerDescriptor error:&error];
Expand Down

0 comments on commit 578e871

Please sign in to comment.