Branching vs Multiple texture fetch and step/mix

This topic contains 1 reply, has 2 voices, and was last updated by  Joe Davis 1 year, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #53275

    Slion
    Member

    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?

    #53277

    Joe Davis
    Member

    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).

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.