Fix Cycles MetalRT access of macOS 11 features when unavailable #104976
|
@ -225,11 +225,15 @@ MetalDevice::MetalDevice(const DeviceInfo &info, Stats &stats, Profiler &profile
|
||||||
mtlAncillaryArgEncoder = [mtlDevice newArgumentEncoderWithArguments:ancillary_desc];
|
mtlAncillaryArgEncoder = [mtlDevice newArgumentEncoderWithArguments:ancillary_desc];
|
||||||
|
|
||||||
// preparing the blas arg encoder
|
// preparing the blas arg encoder
|
||||||
MTLArgumentDescriptor *arg_desc_blas = [[MTLArgumentDescriptor alloc] init];
|
if (@available(macos 11.0, *)) {
|
||||||
arg_desc_blas.dataType = MTLDataTypeInstanceAccelerationStructure;
|
if (use_metalrt) {
|
||||||
arg_desc_blas.access = MTLArgumentAccessReadOnly;
|
MTLArgumentDescriptor *arg_desc_blas = [[MTLArgumentDescriptor alloc] init];
|
||||||
mtlBlasArgEncoder = [mtlDevice newArgumentEncoderWithArguments:@[ arg_desc_blas ]];
|
arg_desc_blas.dataType = MTLDataTypeInstanceAccelerationStructure;
|
||||||
[arg_desc_blas release];
|
arg_desc_blas.access = MTLArgumentAccessReadOnly;
|
||||||
|
mtlBlasArgEncoder = [mtlDevice newArgumentEncoderWithArguments:@[ arg_desc_blas ]];
|
||||||
|
[arg_desc_blas release];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ancillary_desc.count; i++) {
|
for (int i = 0; i < ancillary_desc.count; i++) {
|
||||||
[ancillary_desc[i] release];
|
[ancillary_desc[i] release];
|
||||||
|
|
Loading…
Reference in New Issue