From 614493268556df4cd8cca16551d60b152f504e54 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 19 Jun 2022 15:29:21 +0200 Subject: [PATCH] Add USE_PIX conditional attributes to PIX APIs --- src/ComputeSharp.Pix/ComputeContextExtensions.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.Pix/ComputeContextExtensions.cs b/src/ComputeSharp.Pix/ComputeContextExtensions.cs index bafaa338..804009f8 100644 --- a/src/ComputeSharp.Pix/ComputeContextExtensions.cs +++ b/src/ComputeSharp.Pix/ComputeContextExtensions.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System.Diagnostics; +using System.Drawing; using ComputeSharp.Graphics.Commands; using ComputeSharp.Interop; @@ -15,6 +16,7 @@ public static class ComputeContextExtensions /// The to use to start the PIX event. /// The color to use for the event (the alpha channel will be ignored). /// The message to use for the event. + [Conditional("USE_PIX")] public static unsafe void BeginEvent(this in ComputeContext context, Color color, string message) { ref CommandList commandList = ref ComputeContext.GetCommandList(in context, pipelineState: null); @@ -31,6 +33,7 @@ public static class ComputeContextExtensions /// The to use to start the PIX event. /// The index to identify the group this event belongs to (PIX will choose a color to represent all entries in the group). /// The message to use for the event. + [Conditional("USE_PIX")] public static unsafe void BeginEvent(this in ComputeContext context, byte index, string message) { ref CommandList commandList = ref ComputeContext.GetCommandList(in context, pipelineState: null); @@ -45,6 +48,7 @@ public static class ComputeContextExtensions /// /// The to use to start the PIX event. /// The message to use for the event. + [Conditional("USE_PIX")] public static unsafe void BeginEvent(this in ComputeContext context, string message) { ref CommandList commandList = ref ComputeContext.GetCommandList(in context, pipelineState: null); @@ -56,6 +60,7 @@ public static class ComputeContextExtensions /// Ends a PIX event on a target object. /// /// The to use to end the PIX event. + [Conditional("USE_PIX")] public static unsafe void EndEvent(this in ComputeContext context) { ref CommandList commandList = ref ComputeContext.GetCommandList(in context, pipelineState: null); @@ -69,6 +74,7 @@ public static class ComputeContextExtensions /// The to use to insert the PIX marker. /// The color to use for the log (the alpha channel will be ignored). /// The message to use for the marker. + [Conditional("USE_PIX")] public static unsafe void Log(this in ComputeContext context, Color color, string message) { ref CommandList commandList = ref ComputeContext.GetCommandList(in context, pipelineState: null); @@ -85,6 +91,7 @@ public static class ComputeContextExtensions /// The to use to insert the PIX marker. /// The index to identify the group this log belongs to (PIX will choose a color to represent all entries in the group). /// The message to use for the marker. + [Conditional("USE_PIX")] public static unsafe void Log(this in ComputeContext context, byte index, string message) { ref CommandList commandList = ref ComputeContext.GetCommandList(in context, pipelineState: null); @@ -99,6 +106,7 @@ public static class ComputeContextExtensions /// /// The to use to insert the PIX marker. /// The message to use for the marker. + [Conditional("USE_PIX")] public static unsafe void Log(this in ComputeContext context, string message) { ref CommandList commandList = ref ComputeContext.GetCommandList(in context, pipelineState: null);