Skip to content

Commit e5fa60d

Browse files
committed
Removed unused code
1 parent 9acf9c6 commit e5fa60d

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

BlazorWASMWebGPUComputeDemo/Pages/ComputeBoidsSample/ComputeBoids.razor

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,4 @@
1717
<div style="padding: 1rem;">
1818
<canvas @ref=canvasRef style="width: 500px; height: 500px;" />
1919
</div>
20-
<div style="padding: 1rem;">
21-
<pre>
22-
@_log
23-
</pre>
24-
</div>
2520

BlazorWASMWebGPUComputeDemo/Pages/ComputeBoidsSample/ComputeBoids.razor.cs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class ComputeBoids : IDisposable
1414
[Inject]
1515
ShaderLoader ShaderLoader { get; set; } = default!;
1616

17-
string _log = "Ready";
17+
string _log = "";
1818
bool _running = false;
1919

2020
ElementReference canvasRef;
@@ -152,30 +152,13 @@ async Task Init()
152152
return;
153153
}
154154

155-
var hasTimestampQuery = adapter.Features.Has("timestamp-query");
156-
device = await adapter.RequestDevice(new GPUDeviceDescriptor
157-
{
158-
RequiredFeatures = hasTimestampQuery ? new List<string> { "timestamp-query" } : null,
159-
});
155+
device = await adapter.RequestDevice();
160156
if (device == null)
161157
{
162158
Log("WebGPU not supported");
163159
return;
164160
}
165161

166-
var perfDisplayContainer = document.CreateElement<HTMLDivElement>("div");
167-
perfDisplayContainer.Style["color"] = "white";
168-
perfDisplayContainer.Style["background"] = "black";
169-
perfDisplayContainer.Style["position"] = "absolute";
170-
perfDisplayContainer.Style["bottom"] = "10px";
171-
perfDisplayContainer.Style["left"] = "10px";
172-
perfDisplayContainer.Style["textAlign"] = "left";
173-
174-
var perfDisplay = document.CreateElement<HTMLElement>("pre");
175-
perfDisplay.Style["margin"] = ".5em";
176-
perfDisplayContainer.AppendChild(perfDisplay);
177-
canvas.ParentNode!.AppendChild(perfDisplayContainer);
178-
179162
context = canvas.GetWebGPUContext();
180163
var devicePixelRatio = window.DevicePixelRatio;
181164
canvas.Width = (int)Math.Round(canvas.ClientWidth * devicePixelRatio);
@@ -270,11 +253,6 @@ async Task Init()
270253

271254
computePassDescriptor = new GPUComputePassDescriptor();
272255

273-
if (hasTimestampQuery)
274-
{
275-
// omitted
276-
}
277-
278256
var vertexBufferData = new float[] {
279257
-0.01f, -0.02f, 0.01f,
280258
-0.02f, 0.0f, 0.02f

0 commit comments

Comments
 (0)