Skip to content

Commit 21c56cd

Browse files
committed
Link to mip-mapping sample
1 parent 2f3cafe commit 21c56cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

guide/src/descriptor_sets/texture.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,15 @@ out_color = vec4(in_color, 1.0) * texture(tex, in_uv);
233233
```
234234

235235
![RGBY Texture](./rgby_texture.png)
236+
237+
For generating mip-maps, follow the [sample in the Vulkan docs](https://docs.vulkan.org/samples/latest/samples/api/hpp_texture_mipmap_generation/README.html#_generating_the_mip_chain). The high-level steps are:
238+
239+
1. Compute mip levels based on image size
240+
1. Create an image with the desired mip levels
241+
1. Copy the source data to the first mip level as usual
242+
1. Transition the first mip level to TransferSrc
243+
1. Iterate through all the remaining mip levels:
244+
1. Transition the current mip level to TransferDst
245+
1. Record an image blit operation from previous to current mip levels
246+
1. Transition the current mip level to TransferSrc
247+
1. Transition all levels (entire image) to ShaderRead

0 commit comments

Comments
 (0)