You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/11_Compute_Shader.adoc
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -443,7 +443,7 @@ This image shows the relation between these two in three dimensions:
443
443
444
444
image::/images/compute_space.svg[]
445
445
446
-
The number of dimensions for work groups (defined by `computeCommandBuffers[currentFrame]->dispatch`) and invocations depends (defined by the local sizes in the compute shader) on how input data is structured.
446
+
The number of dimensions for work groups (defined by `computeCommandBuffers[frameIndex]->dispatch`) and invocations depends (defined by the local sizes in the compute shader) on how input data is structured.
447
447
If you e.g.,
448
448
work on a one-dimensional array, like we do in this chapter, you only have to specify the x dimension for both.
449
449
@@ -534,27 +534,27 @@ We use this to index into our particle array.
534
534
=== Dispatch
535
535
536
536
Now it's time to actually tell the GPU to do some compute.
537
-
This is done by calling `computeCommandBuffers[currentFrame]->dispatch` inside a command buffer.
538
-
While not perfectly true, a dispatch is for compute as a draw call like `commandBuffers[currentFrame]->draw` is for graphics.
537
+
This is done by calling `computeCommandBuffers[frameIndex]->dispatch` inside a command buffer.
538
+
While not perfectly true, a dispatch is for compute as a draw call like `commandBuffers[frameIndex]->draw` is for graphics.
539
539
This dispatches a given number of compute work items in at max.
The first submit to the compute queue updates the particle positions using the compute shader, and the second submit will then use that updated data to draw the particle system.
@@ -623,30 +623,30 @@ We then use these to synchronize the compute buffer submission with the graphics
623
623
----
624
624
{
625
625
// Compute submission
626
-
while ( vk::Result::eTimeout == device->waitForFences(**computeInFlightFences[currentFrame], vk::True, UINT64_MAX) )
626
+
while ( vk::Result::eTimeout == device->waitForFences(**computeInFlightFences[frameIndex], vk::True, UINT64_MAX) )
0 commit comments