@@ -14,21 +14,7 @@ public WebGPUFactAttribute()
1414 {
1515 if ( ! WebGPUProbe . IsComputeSupported )
1616 {
17- this . Skip = "WebGPU compute is not available on this system." ;
18- }
19- }
20- }
21-
22- /// <summary>
23- /// A <see cref="TheoryAttribute"/> that skips when WebGPU compute is not available on the current system.
24- /// </summary>
25- public class WebGPUTheoryAttribute : TheoryAttribute
26- {
27- public WebGPUTheoryAttribute ( )
28- {
29- if ( ! WebGPUProbe . IsComputeSupported )
30- {
31- this . Skip = "WebGPU compute is not available on this system." ;
17+ this . Skip = WebGPUProbe . ComputeUnsupportedSkipMessage ;
3218 }
3319 }
3420}
@@ -38,8 +24,23 @@ public WebGPUTheoryAttribute()
3824/// </summary>
3925internal static class WebGPUProbe
4026{
41- private static bool ? computeSupported ;
27+ private static WebGPUEnvironmentError ? computeProbeResult ;
28+
29+ /// <summary>
30+ /// Gets the cached WebGPU compute-pipeline probe result.
31+ /// </summary>
32+ internal static WebGPUEnvironmentError ComputeProbeResult
33+ => computeProbeResult ??= WebGPUEnvironment . ProbeComputePipelineSupport ( ) ;
4234
35+ /// <summary>
36+ /// Gets a value indicating whether WebGPU compute is supported on the current system.
37+ /// </summary>
4338 internal static bool IsComputeSupported
44- => computeSupported ??= WebGPUEnvironment . ProbeComputePipelineSupport ( ) == WebGPUEnvironmentError . Success ;
39+ => ComputeProbeResult == WebGPUEnvironmentError . Success ;
40+
41+ /// <summary>
42+ /// Gets the skip message used when WebGPU compute is unavailable.
43+ /// </summary>
44+ internal static string ComputeUnsupportedSkipMessage
45+ => $ "WebGPU compute is not available on this system: { ComputeProbeResult } .";
4546}
0 commit comments