Merge pull request #1635 from bangnoise/pr/maxTotalThreadsPerThreadgroup-crash-macOS_10_13
Fix crash creating compute pipelines on macOS versions < 10.14
This commit is contained in:
commit
313c64df38
@ -1834,7 +1834,10 @@ MVKComputePipeline::MVKComputePipeline(MVKDevice* device,
|
||||
if (mtlFunc) {
|
||||
MTLComputePipelineDescriptor* plDesc = [MTLComputePipelineDescriptor new]; // temp retain
|
||||
plDesc.computeFunction = mtlFunc;
|
||||
// Only available macOS 10.14+
|
||||
if ([plDesc respondsToSelector:@selector(setMaxTotalThreadsPerThreadgroup:)]) {
|
||||
plDesc.maxTotalThreadsPerThreadgroup = _mtlThreadgroupSize.width * _mtlThreadgroupSize.height * _mtlThreadgroupSize.depth;
|
||||
}
|
||||
plDesc.threadGroupSizeIsMultipleOfThreadExecutionWidth = mvkIsAnyFlagEnabled(pCreateInfo->stage.flags, VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT);
|
||||
|
||||
// Metal does not allow the name of the pipeline to be changed after it has been created,
|
||||
|
Loading…
x
Reference in New Issue
Block a user