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: src/content/docs/current/Reference/Constants/workGroups.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: workGroups
3
-
description: Used to define a fixed number of work groups in a compute shader.
3
+
description: Defines a fixed number of compute shader work groups to be dispatched.
4
4
sidebar:
5
5
label: workGroups
6
6
order: 4
@@ -15,4 +15,4 @@ sidebar:
15
15
16
16
---
17
17
18
-
Used to define a fixed number of work groups in a compute shader. Replace `<groups_x>`, `<groups_y>`, and `<groups_z>` with the number of work groups in each dimension. For more info, see the [compute shader](/current/reference/programs/overview/#compute-shaders) section.
18
+
Defines a fixed number of compute shader work groups to be dispatched. Replace `<groups_x>`, `<groups_y>`, and `<groups_z>` with the number of work groups in each dimension. For more info, see the [compute shader](/current/reference/programs/overview/#compute-shaders) section.
Copy file name to clipboardExpand all lines: src/content/docs/current/Reference/Constants/workGroupsRender.mdx
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: workGroupsRender
3
-
description: Used to define number of work groups in a compute shader based on a multiple of the screen resolution.
3
+
description: Defines a variable number of compute shader work groups to be dispatched based on a multiple of screen resolution.
4
4
sidebar:
5
5
label: workGroupsRender
6
6
order: 4
@@ -15,4 +15,10 @@ sidebar:
15
15
16
16
---
17
17
18
-
Used to define number of work groups in a compute shader based on a multiple of the screen resolution. Replace `<x_mult>` and `<y_mult>` with a multiplier for each screen dimension. For example, `1.0` would mean there would be the same number of work groups in that dimension as pixels in the screen in that dimension. For more info, see the [compute shader](/current/reference/programs/overview/#compute-shaders) section.
18
+
Defines a variable number of compute shader work groups to be dispatched based on a multiple of screen resolution. If neither this directive nor [`workGroups`](/current/reference/constants/workGroups/) is defined, work groups will be dispatched as if `workGroupsRender == vec2(1.0, 1.0)`, which means that the smallest number of work groups will be dispatched to completely cover the screen with one shader invocation per pixel when arranged in a grid. If the screen resolution isn't a multiple of `vec2(gl_WorkGroupSize.xy) / workGroupsRender`, the number of invocations dispatched will be greater than the amount of pixels on the screen.
Copy file name to clipboardExpand all lines: src/content/docs/current/Reference/Programs/overview.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,16 +55,16 @@ Composite-style programs render a single quad covering the output texture (unles
55
55
Composite-style programs support vertex, fragment, geometry, and compute stages. Usually composite-style programs require vertex and fragment shaders, however if a compute shader is present these are optional. Compute shaders (if present) will be executed before the vertex stage of a given program.
56
56
57
57
#### Compute-only
58
-
As the name suggests, compute-only programs only support compute shaders. The only such programs are in the [setup](/current/reference/programs/setup/) pass, which are executed once after shader load and during window resize. Like composite passes, [setup](/current/reference/programs/setup/) supports suffixes (1 to 99) in addition to a program with no suffix.
58
+
As the name suggests, compute-only programs only support compute shaders. The only such programs are in the [setup](/current/reference/programs/setup/) pass, which are executed once after shader pack load and during window resize. Like composite passes, [setup](/current/reference/programs/setup/) supports suffixes (1 to 99) in addition to a program with no suffix.
59
59
60
60
## Compute Shaders
61
61
Compute shaders break the OpenGL fixed pipeline and allow more direct access to graphics hardware. For more information, see the [Khronos Wiki](https://www.khronos.org/opengl/wiki/Compute_Shader).
62
62
63
63
:::caution[Warning]
64
-
Compute shaders require OpenGL 4.3 support, which macOS does not have. For more information, see the [macOS](/current/reference/miscellaneous/macos/) page.
64
+
Compute shaders require OpenGL 4.3 support, which macOS does not provide. For more information, see the [macOS](/current/reference/miscellaneous/macos/) page.
65
65
:::
66
66
67
-
In Iris, compute shaders can be used in compute only pass, or included in composite-style passes, using the `.csh` file extension. In composite-style passes, compute shaders will always execute first (before the vertex stage if present). Up to 27 compute shaders files can be included in a single pass by appending the `_a` through `_z` suffixes to the filename in addition to a shader file with no suffix. These shaders will execute one after the other in alphabetical order (starting with the no-suffix file if present), unless [`allowConcurrentCompute`](/current/reference/shadersproperties/ordering/#allowconcurrentcompute) is used (in which case they will execute potentially simultaneously but will all finish before starting the vertex stage).
67
+
In Iris, compute shaders can be used in compute only passes, or included in composite-style passes, and are stored with the `.csh` file extension. In composite-style passes, compute shaders will always execute first (before the vertex stage if present). Up to 27 compute shaders can be included in a single pass, by appending `_a` through `_z` suffixes to the filename, in addition to a shader file with no suffix. These shaders will execute one after the other in alphabetical order (starting with the suffixless file if present), unless [`allowConcurrentCompute`](/current/reference/shadersproperties/ordering/#allowconcurrentcompute) is enabled, in which case they will execute potentially simultaneously but will all finish before the vertex stage begins execution.
68
68
69
69
Local size is defined as follows: `layout (local_size_x = <size_x>, local_size_y = <size_x>, local_size_z = <size_z>) in;`.
70
70
@@ -73,9 +73,9 @@ Work group count can be defined one of three ways:
If no work group count is provided, the default value of one work group per pixel will be used (`const vec2 workGroupsRender = vec2(1.0, 1.0);`).
76
+
If no work group count is provided, a default value of (`const vec2 workGroupsRender = vec2(1.0, 1.0);`) will be used.
77
77
78
-
Unlike fragment shaders, compute shaders cannot directly write to color attachments, instead they can only write to [colortex](/current/reference/buffers/colortex/) and [shadowcolor](/current/reference/programs/shadowcolor/) buffers through [`imageStore`](https://www.khronos.org/opengl/wiki/Image_Load_Store). Additionally, if multiple shader invocations are writing/reading to the same location in memory simultaneously, atomic operations (on [images](https://www.khronos.org/opengl/wiki/Image_Load_Store#Atomic_operations) and/or [shared memory](https://www.khronos.org/opengl/wiki/Compute_Shader#Atomic_operations)) or [memory barriers](https://www.khronos.org/opengl/wiki/Compute_Shader#Shared_memory_coherency) should be used.
78
+
Unlike fragment shaders, compute shaders cannot directly write to color attachments. Writing to [colortex](/current/reference/buffers/colortex) and [shadowcolor](/current/reference/programs/shadowcolor/) buffers needs to be done with [`imageStore`](https://www.khronos.org/opengl/wiki/Image_Load_Store).
0 commit comments