Toggled ID3D12InfoQueue output to DEBUG only

このコミットが含まれているのは:
Sergio Pedri committed 2021-02-15 01:46:18 +01:00
1 親 7ff9f3dcf0
コミット 501ab5f570
5ファイル変更
+129 -86

検索条件に一致するファイルはありません

+13 -10
ファイルの表示
@@ -18,24 +18,19 @@ namespace ComputeSharp.Sample
array[i] = i + 1;
}
// Print the initial matrix
Console.WriteLine("===================== BEFORE =====================");
PrintMatrix(array, width, height);
Console.WriteLine("==================================================");
Console.WriteLine();
using ReadWriteBuffer<float> gpuBuffer = Gpu.Default.AllocateReadWriteBuffer(array);
// Run the shader
Gpu.Default.For(100, new MainKernel(gpuBuffer));
// Print the initial matrix
PrintMatrix(array, width, height, "BEFORE");
// Get the data back
gpuBuffer.CopyTo(array);
// Print the updated matrix
Console.WriteLine("===================== AFTER ======================");
PrintMatrix(array, width, height);
Console.WriteLine("==================================================");
PrintMatrix(array, width, height, "AFTER");
}
/// <summary>
@@ -59,8 +54,14 @@ namespace ComputeSharp.Sample
/// <param name="array">The input <see langword="float"/> array representing the matrix to print.</param>
/// <param name="width">The width of the array to print.</param>
/// <param name="height">The height of the array to print.</param>
private static void PrintMatrix(float[] array, int width, int height)
/// <param name="name">The name of the matrix to print.</param>
private static void PrintMatrix(float[] array, int width, int height, string name)
{
int pad = 48 - name.Length;
string title = $"{new string('=', pad / 2)} {name} {new string('=', (pad + 1) / 2)}";
Console.WriteLine(title);
int length = width * height;
int numberWidth = array.Max().ToString(CultureInfo.InvariantCulture).Length;
ref float r = ref array[0];
@@ -73,6 +74,8 @@ namespace ComputeSharp.Sample
if (i < length - 1) Console.Write(", ");
if (i > 0 && (i + 1) % width == 0) Console.WriteLine();
}
Console.WriteLine(new string('=', 50));
}
}
}