util/format: Add some NEON intrinsics-based u_format_unpack.
In looking at the profile of dEQP, GLES3 was spending 5-10% of its time in ReadPixels, and almost all of that is b8g8r8a8_unorm8. It's really slow because we're getting about 47MB/s by doing uncached reads 32 bits at a time in the code-generated unpack. If we use NEON to generate larger bus transactions, we can speed things up to 136MB/s. In comparison, raw ldr/str read/writes with no byte swapping can hit a max of 216MB/sec. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
This commit is contained in:
@@ -166,8 +166,11 @@ def write_format_table(formats):
|
||||
print(" },")
|
||||
|
||||
def generate_table_getter(type):
|
||||
suffix = ""
|
||||
if type == "unpack_":
|
||||
suffix = "_generic"
|
||||
print("const struct util_format_%sdescription *" % type)
|
||||
print("util_format_%sdescription(enum pipe_format format)" % type)
|
||||
print("util_format_%sdescription%s(enum pipe_format format)" % (type, suffix))
|
||||
print("{")
|
||||
print(" if (format >= ARRAY_SIZE(util_format_%sdescriptions))" % (type))
|
||||
print(" return NULL;")
|
||||
@@ -242,7 +245,6 @@ def write_format_table(formats):
|
||||
print("};")
|
||||
print()
|
||||
generate_table_getter("pack_")
|
||||
|
||||
print('static const struct util_format_unpack_description')
|
||||
print('util_format_unpack_descriptions[] = {')
|
||||
for format in formats:
|
||||
|
||||
Reference in New Issue
Block a user