util: Switch the non-block formats to unpacking rgba rows instead of rects.
We have only a few callers of unpack that do rects, so add a helper that iterates over y adding the strides. This saves us 36kb of generated code and means that adding cpu-specific variants for RGBA format unpack will be much simpler. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
This commit is contained in:
@@ -255,10 +255,17 @@ def write_format_table(formats):
|
||||
print(" [%s] = {" % (format.name,))
|
||||
|
||||
if format.colorspace != ZS and not format.is_pure_color():
|
||||
print(" .unpack_rgba_8unorm = &util_format_%s_unpack_rgba_8unorm," % sn)
|
||||
if format.layout == 's3tc' or format.layout == 'rgtc':
|
||||
print(" .fetch_rgba_8unorm = &util_format_%s_fetch_rgba_8unorm," % sn)
|
||||
print(" .unpack_rgba = &util_format_%s_unpack_rgba_float," % sn)
|
||||
if format.block_width > 1:
|
||||
print(
|
||||
" .unpack_rgba_8unorm_rect = &util_format_%s_unpack_rgba_8unorm," % sn)
|
||||
print(
|
||||
" .unpack_rgba_rect = &util_format_%s_unpack_rgba_float," % sn)
|
||||
else:
|
||||
print(
|
||||
" .unpack_rgba_8unorm = &util_format_%s_unpack_rgba_8unorm," % sn)
|
||||
print(" .unpack_rgba = &util_format_%s_unpack_rgba_float," % sn)
|
||||
|
||||
if format.has_depth():
|
||||
print(" .unpack_z_32unorm = &util_format_%s_unpack_z_32unorm," % sn)
|
||||
|
||||
Reference in New Issue
Block a user