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);