Skip to content

Commit 2a22079

Browse files
committed
addressing more comments.
1 parent 921eed4 commit 2a22079

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

en/Building_a_Simple_Engine/Mobile_Development/04_rendering_approaches.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ vk::RenderPass render_pass = device.createRenderPass(render_pass_info);
9999

100100
==== Best Practices for TBR
101101

102-
* *Avoid Framebuffer Reads*: Reading from the framebuffer can force the tile to be written to main memory and then read back, which is expensive.
102+
* *Avoid External Framebuffer Reads*: Avoid reading from images that require the tile to be flushed to external memory and reloaded; this is expensive on TBR.
103+
- Local, same-pixel reads from on-chip/tile memory are fine and encouraged on tile-based GPUs.
104+
- In Vulkan, use input attachments within subpasses or the `VK_KHR_dynamic_rendering_local_read` capability to perform tile-local reads without leaving tile memory. This is often referred to as pixel-local storage (PLS) on tile-based architectures.
103105

104-
* *Optimize for Tile Size*: Consider the tile size when designing your
105-
rendering algorithm. For example, if you know the tile size is 16x16, you
106-
might organize your data or algorithms to work efficiently with that size.
106+
* *Optimize for Tile Size*: Consider the tile size when designing your rendering algorithm. For example, if you know the tile size is 16x16, you might organize your data or algorithms to work efficiently with that size.
107107

108108
===== Memory Management
109109

en/Building_a_Simple_Engine/Mobile_Development/05_vulkan_extensions.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Dynamic rendering is a game-changing extension that simplifies the Vulkan render
1212

1313
==== Overview
1414

15-
The `VK_KHR_dynamic_rendering` extension (now part of Vulkan 1.3 core) allows you to begin and end rendering operations directly within a command buffer, without creating render pass and framebuffer objects. This is particularly beneficial for mobile development as it:
15+
The `VK_KHR_dynamic_rendering` extension (now part of Vulkan 1.3 core) allows you to begin and end rendering operations directly within a command buffer, without creating render pass and framebuffer objects. This benefits a wide range of platforms (desktop and mobile) because it:
1616

1717
1. *Simplifies Code*: Reduces the complexity of managing render passes and framebuffers.
1818
2. *Enables More Flexible Rendering*: Makes it easier to implement techniques that don't fit well into the traditional render pass model.
19-
3. *Reduces API Overhead*: Fewer objects to create and manage means less CPU overhead.
19+
3. *Potentially Lowers API Overhead*: Fewer objects to create and manage can simplify setup; any CPU savings are usually small and workload-dependent.
2020

2121
==== Implementation (Step-by-step)
2222

@@ -158,11 +158,11 @@ The `VK_KHR_dynamic_rendering_local_read` extension is particularly effective at
158158

159159
1. *Eliminates Tile Flush Operations*: Without this extension, when a shader needs to read from a previously written attachment, the GPU must flush the entire tile to main memory and then read it back. This extension allows the shader to read directly from the tile memory, eliminating these costly flush operations.
160160

161-
2. *Optimizes Post-Processing Effects*: Effects like bloom, tone mapping, and depth-of-field that require reading from rendered images can be performed without leaving the tile memory.
161+
2. *Supports Per-Pixel Local Reads*: It enables fragment shaders to read the value written at the same pixel from attachments within the current rendering scope/tile. This suits per-pixel operations (e.g., tone mapping or reading depth/previous color).
162162

163-
3. *Bandwidth Reduction Measurements*: In real-world applications, this extension has been shown to reduce memory bandwidth by up to 30% for post-processing heavy workloads. This is particularly significant on mobile devices where memory bandwidth is often a bottleneck and directly impacts battery life.
163+
3. *Bandwidth Reduction Measurements*: In real-world applications, this extension has been shown to reduce memory bandwidth for workloads that benefit from per-pixel local reads. The benefit is workload- and GPU-dependent.
164164

165-
4. *Practical Example*: Consider a deferred rendering pipeline that needs to read G-buffer data. Without this extension, the G-buffer would need to be written to main memory and then read back for the lighting pass. With this extension, the lighting pass can read directly from the G-buffer in tile memory, saving significant bandwidth.
165+
4. *Practical Example*: Consider a deferred rendering pipeline that needs to read G-buffer data at the same pixel for lighting. Without this extension, the G-buffer would need to be written to main memory and then read back for the lighting pass. With this extension, the lighting pass can read directly from the G-buffer in tile memory, saving bandwidth.
166166

167167
==== Implementation
168168

0 commit comments

Comments
 (0)