Skip to content

Commit 1347219

Browse files
committed
Minor impr
1 parent f2c1990 commit 1347219

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/mtl/capture.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ function stopCapture(manager::MTLCaptureManager=MTLCaptureManager())
152152
@objc [manager::id{MTLCaptureManager} stopCapture]::Nothing
153153
end
154154

155+
"""
156+
supports_destination(manager::MTLCaptureManager, destination::MTLCaptureDestination)
157+
Checks if a given capture destination is supported.
158+
"""
155159
function supports_destination(manager::MTLCaptureManager, destination::MTLCaptureDestination)
156160
@objc [manager::id{MTLCaptureManager} supportsDestination:destination::MTLCaptureDestination]::Bool
157161
end

test/capturing.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ desc.captureObject = dev
3636
desc.destination = MTL.MTLCaptureDestinationGPUTraceDocument
3737
@test desc.destination == MTL.MTLCaptureDestinationGPUTraceDocument
3838

39+
# Capture Manager supports destination
40+
@test !supports_destination(manager, MTL.MTLCaptureDestinationDeveloperTools)
41+
@test supports_destination(manager, MTL.MTLCaptureDestinationGPUTraceDocument)
42+
3943
# Output URL
4044
@test desc.outputURL === nothing
4145
path = joinpath(tmpdir, "test.gputrace")
@@ -65,7 +69,7 @@ bufferA = MtlArray{Float32,1,SharedStorage}(undef, tuple(4))
6569
@test manager.isCapturing == false
6670
startCapture(manager, desc)
6771
@test manager.isCapturing
68-
@test_throws ErrorException startCapture(manager, desc)
72+
@test_throws "Capture manager is already capturing." startCapture(manager, desc)
6973
Metal.@sync @metal threads=4 tester(bufferA)
7074
stopCapture(manager)
7175
synchronize()

0 commit comments

Comments
 (0)