Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] remove emulation of clamp, repeat, and mirror tile modes #39948

Merged
merged 3 commits into from
Feb 28, 2023

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Feb 28, 2023

Most tile modes can be implemented entirely with the addressing mode. Removing the other branches improves performance

Malioc Diff:

Changes found in shader flutter/impeller/entity/gles/tiled_texture_fill.frag.gles on core Mali-G78:
In variant Main:
  fp16_arithmetic: 100 <- before
  fp16_arithmetic: 33 <- after
longest_path_cycles in variant Main
        arith_total arith_fma   arith_cvt   arith_sfu   load_store  varying     texture     bound       
before  0.500000    0.203125    0.500000    0.000000    0.000000    0.125000    0.250000    arith_total,arith_cvt
after   0.265625    0.031250    0.265625    0.000000    0.000000    0.250000    0.250000    arith_total,arith_cvt

shortest_path_cycles in variant Main
        arith_total arith_fma   arith_cvt   arith_sfu   load_store  varying     texture     bound       
before  0.109375    0.031250    0.109375    0.000000    0.000000    0.125000    0.000000    varying
after   0.062500    0.031250    0.062500    0.000000    0.000000    0.250000    0.250000    varying,texture

total_cycles in variant Main
        arith_total arith_fma   arith_cvt   arith_sfu   load_store  varying     texture     bound       
before  0.625000    0.265625    0.625000    0.000000    0.000000    0.125000    0.250000    arith_total,arith_cvt
after   0.265625    0.031250    0.265625    0.000000    0.000000    0.250000    0.250000    arith_total,arith_cvt

In variant Main:
  uniform_registers_used: 8 <- before
  uniform_registers_used: 4 <- after

For a full report, run:
  $ malioc --fragment --core Mali-G78 /b/s/w/ir/cache/builder/src/out/android_debug_unopt/gen/flutter/impeller/entity/gles/tiled_texture_fill.frag.gles

Changes found in shader flutter/impeller/entity/gles/tiled_texture_fill.frag.gles on core Mali-T880:
longest_path_cycles in variant Main
        arithmetic  load_store  texture     bound       
before  7.920000    1.000000    1.000000    arithmetic
after   3.300000    1.000000    1.000000    arithmetic

total_cycles in variant Main
        arithmetic  load_store  texture     bound       
before  9.666667    1.000000    1.000000    arithmetic
after   3.666667    1.000000    1.000000    arithmetic


For a full report, run:
  $ malioc --fragment --core Mali-T880 /b/s/w/ir/cache/builder/src/out/android_debug_unopt/gen/flutter/impeller/entity/gles/tiled_texture_fill.frag.gles

Changes found in shader flutter/impeller/entity/gles/tiled_texture_fill.vert.gles on core Mali-G78:
In variant Position:
  uniform_registers_used: 24 <- before
  uniform_registers_used: 22 <- after
In variant Varying:
  fp16_arithmetic: 18 <- before
  fp16_arithmetic: 100 <- after
longest_path_cycles in variant Varying
        arith_total arith_fma   arith_cvt   arith_sfu   load_store  texture     bound       
before  0.156250    0.156250    0.000000    0.062500    3.000000    0.000000    load_store
after   0.125000    0.125000    0.031250    0.062500    3.000000    0.000000    load_store

shortest_path_cycles in variant Varying
        arith_total arith_fma   arith_cvt   arith_sfu   load_store  texture     bound       
before  0.156250    0.156250    0.000000    0.062500    3.000000    0.000000    load_store
after   0.125000    0.125000    0.031250    0.062500    3.000000    0.000000    load_store

total_cycles in variant Varying
        arith_total arith_fma   arith_cvt   arith_sfu   load_store  texture     bound       
before  0.156250    0.156250    0.000000    0.062500    3.000000    0.000000    load_store
after   0.125000    0.125000    0.031250    0.062500    3.000000    0.000000    load_store

In variant Varying:
  uniform_registers_used: 18 <- before
  uniform_registers_used: 16 <- after
In variant Varying:
  work_registers_used: 9 <- before
  work_registers_used: 8 <- after

For a full report, run:
  $ malioc --vertex --core Mali-G78 /b/s/w/ir/cache/builder/src/out/android_debug_unopt/gen/flutter/impeller/entity/gles/tiled_texture_fill.vert.gles

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller needs tests
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants