Skip to content

Commit 65740a6

Browse files
authored
Update buffer handling explanation in rendering.mdx
Clarified potential race conditions in buffer handling.
1 parent 6b5337d commit 65740a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/content/docs/current/Reference/Shaders.Properties

src/content/docs/current/Reference/Shaders.Properties/rendering.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Replace:
6969
```properties
7070
flip.<program>.<bufferName>=<true|false>
7171
```
72-
For each color attachment sampler, there are actually two buffers, the "main" and "alt" buffers. [`gbuffers`](/current/reference/programs/gbuffers/) and [`shadow`](/current/reference/programs/shadow/) programs read from the "main" buffer and write to the "main" buffer, which means that reading to and writing from the same buffer will cause artifacting. [`begin`](/current/reference/programs/begin/), [`shadowcomp`](/current/reference/programs/shadow_comp/), [`prepare`](/current/reference/programs/prepare/), [`deferred`](/current/reference/programs/deferred/), and [`composite`](/current/reference/programs/composite/) passes however read from the "main" buffer and write to the "alt" buffer, allowing them to read and write to the same buffer, and after that program the "main" and "alt" buffers are swapped so data written by the current program is read by the next program.
72+
For each color attachment sampler, there are actually two buffers, the "main" and "alt" buffers. [`gbuffers`](/current/reference/programs/gbuffers/) and [`shadow`](/current/reference/programs/shadow/) programs read from the "main" buffer and write to the "main" buffer, which means that there is the potential for race conditions if reading from one position and writing to another. [`begin`](/current/reference/programs/begin/), [`shadowcomp`](/current/reference/programs/shadow_comp/), [`prepare`](/current/reference/programs/prepare/), [`deferred`](/current/reference/programs/deferred/), and [`composite`](/current/reference/programs/composite/) passes however read from the "main" buffer and write to the "alt" buffer, allowing them to read and write to the same buffer, and after that program the "main" and "alt" buffers are swapped so data written by the current program is read by the next program.
7373

7474
This behavior can be controlled with the `flip.<program>.<bufferName>` directive. Replace `<program>` with the program name (i.e. `composite2`), `<bufferName>` with the sampler name (i.e. `colortex5`), setting the value to `false` will disable the buffer flip that would happen after the end of that program. The default behavior is for buffer flipping to be enabled for all programs.
7575

0 commit comments

Comments
 (0)