Metal: Add check for invalid shader functions
Bug: skia:8243 Change-Id: Ibcf34d72d06d06cbffc411afade277b6d94991b1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214304 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
9b16f81858
commit
9756c36666
@ -347,6 +347,15 @@ GrMtlPipelineState* GrMtlPipelineStateBuilder::finalize(GrRenderTarget* renderTa
|
||||
id<MTLFunction> vertexFunction = [vertexLibrary newFunctionWithName: @"vertexMain"];
|
||||
id<MTLFunction> fragmentFunction = [fragmentLibrary newFunctionWithName: @"fragmentMain"];
|
||||
|
||||
if (vertexFunction == nil) {
|
||||
SkDebugf("Couldn't find vertexMain() in library\n");
|
||||
return nullptr;
|
||||
}
|
||||
if (fragmentFunction == nil) {
|
||||
SkDebugf("Couldn't find fragmentMain() in library\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
pipelineDescriptor.vertexFunction = vertexFunction;
|
||||
pipelineDescriptor.fragmentFunction = fragmentFunction;
|
||||
pipelineDescriptor.vertexDescriptor = create_vertex_descriptor(primProc);
|
||||
|
Loading…
Reference in New Issue
Block a user