← COURSE LIBRARY
Shader Code · 40 min
Texture Fetch Latency and Bandwidth Budgets
AdvancedNeeds: GPU execution modelNeeds: Warp divergence
Sign in to record mastery, quiz results and reviews for this course.Sign in
You will be able to
- Explain why a texture fetch is hundreds of cycles and how the GPU hides that.
- Pack channels to reduce sampler count without losing quality.
- Estimate bandwidth cost for a material before profiling.
The concept
A texture fetch costs hundreds of cycles of latency. The GPU hides it by switching to other warps — which only works if occupancy is high enough. Register pressure lowers occupancy, so a shader with many live values hides latency worse. Channel packing (roughness/metallic/AO into one RGB) is the cheapest large win available in most materials.
In your engine
Check sampler count in the compiled shader; URP limits how many you can bind per pass.
Practice (4)
Concept check
Which packing is standard for ORM?
Tune the value
A material samples 6 textures per pixel. Packing reduces it to 3. What fraction of the original sampler count remains? (decimal)
Concept check
Latency hiding fails primarily when:
Find the bug
A distant surface shimmers and costs more bandwidth than expected. Which is the bug?
Knowledge check
01Texture fetch latency is roughly:
02Occupancy is limited mainly by:
03Channel packing reduces:
04Mipmaps improve performance mainly through:
Build challenge
Take a material with 6+ texture samples and get it under 4 without a visible quality regression at gameplay distance. Report sampler count, instruction count and measured ms before and after.
SELF-CHECK RUBRIC