# Branching vs Multiple texture fetch and step/mix

**URL:** https://forums.imgtec.com/t/branching-vs-multiple-texture-fetch-and-step-mix/2445
**Category:** PowerVR Insider
**Created:** [March 24, 2016, 10:30am UTC](https://forums.imgtec.com/t/branching-vs-multiple-texture-fetch-and-step-mix/2445 "2016-03-24T10:30:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![slion](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@slion](https://forums.imgtec.com/u/slion)
#### Post date: [March 24, 2016, 10:30am UTC](https://forums.imgtec.com/t/branching-vs-multiple-texture-fetch-and-step-mix/2445/1 "2016-03-24T10:30:40Z")

</div>

On PowerVR SGX 544 MP with OpenGL ES2 I need to selectively tap into 4 different 2D texture samplers.  
Am I better off branching using if statements or fetch all 4 texels and select them using steps and/or mixes?

---

<div class="post-metadata">

### Author: ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)
#### Post date: [March 24, 2016, 3:11pm UTC](https://forums.imgtec.com/t/branching-vs-multiple-texture-fetch-and-step-mix/2445/2 "2016-03-24T15:11:56Z")

</div>

IIRC, Series5 will prefetch all independent taps within branches (both paths) if the conditional cannot be evaluated before fragment shader calculation. This may also apply to conditionals where a uniform value dictates the path, e.g. a uniform bool.

Depending on where your application’s bottlenecks are, dependant texture fetches in the branches should be faster than independent as there will be fewer texel fetches and sampling operations. If you have access to our NDA deliverables, you should be able to confirm this with our Series5XT disassembly compiler (only Series6 onwards disassemblers are public).
