Faster image sampler fetch from key
This cl makes a tradeoff of a one time conversion of the
LRUCache to a constant unordered map to save time on a
costly per pixel imageSampler fetch operation.
When the renderer is idle, the device copies the LRUCache
to an unordered map, which has faster fetch times. This
cache is always constant throughout any rendering
operation, so it can be fetched without a mutex. This copy
operation happens only if the LRUCache was modified since
the last copy occurred, so, if all sampling variations
happened on the first frame, all subsequent frames can
render much faster.
On MacOS, the Glass demo goes from 2.6 FPS to 20 FPS.
Bug b/129523279 b/137649247
Change-Id: I195ca8b2ead59eb5cc9e75e8b0dc5119c794d717
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34348
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by:
Alexis Hétu <sugoi@google.com>
Reviewed-by:
Ben Clayton <bclayton@google.com>
Showing
Please
register
or
sign in
to comment