mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
radv/gfx10: tidy up gfx10_format_table.py
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
958390a9bf
commit
1650e747c6
1 changed files with 9 additions and 11 deletions
|
|
@ -21,7 +21,7 @@
|
|||
# USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
"""
|
||||
Script that generates the mapping from Gallium PIPE_FORMAT_xxx to gfx10
|
||||
Script that generates the mapping from Vulkan VK_FORMAT_xxx to gfx10
|
||||
IMG_FORMAT_xxx enums.
|
||||
"""
|
||||
|
||||
|
|
@ -34,12 +34,10 @@ import re
|
|||
import sys
|
||||
|
||||
AMD_REGISTERS = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../registers"))
|
||||
#GALLIUM_UTIL = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../../auxiliary/util"))
|
||||
sys.path.extend([AMD_REGISTERS])
|
||||
|
||||
from regdb import Object, RegisterDatabase
|
||||
from vk_format_parse import *
|
||||
#from u_format_parse import *
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Hard-coded mappings
|
||||
|
|
@ -82,11 +80,11 @@ header_template = mako.template.Template("""\
|
|||
##__VA_ARGS__ }
|
||||
|
||||
static const struct gfx10_format gfx10_format_table[VK_FORMAT_RANGE_SIZE] = {
|
||||
% for pipe_format, args in formats:
|
||||
% for vk_format, args in formats:
|
||||
% if args is not None:
|
||||
[${pipe_format}] = FMT(${args}),
|
||||
[${vk_format}] = FMT(${args}),
|
||||
% else:
|
||||
/* ${pipe_format} is not supported */
|
||||
/* ${vk_format} is not supported */
|
||||
% endif
|
||||
% endfor
|
||||
};
|
||||
|
|
@ -114,8 +112,8 @@ class Gfx10Format(object):
|
|||
|
||||
|
||||
class Gfx10FormatMapping(object):
|
||||
def __init__(self, pipe_formats, gfx10_formats):
|
||||
self.pipe_formats = pipe_formats
|
||||
def __init__(self, vk_formats, gfx10_formats):
|
||||
self.vk_formats = vk_formats
|
||||
self.gfx10_formats = gfx10_formats
|
||||
|
||||
self.plain_gfx10_formats = dict(
|
||||
|
|
@ -219,17 +217,17 @@ class Gfx10FormatMapping(object):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pipe_formats = parse(sys.argv[1])
|
||||
vk_formats = parse(sys.argv[1])
|
||||
|
||||
with open(sys.argv[2], 'r') as filp:
|
||||
db = RegisterDatabase.from_json(json.load(filp))
|
||||
|
||||
gfx10_formats = [Gfx10Format(entry) for entry in db.enum('IMG_FORMAT').entries]
|
||||
|
||||
mapping = Gfx10FormatMapping(pipe_formats, gfx10_formats)
|
||||
mapping = Gfx10FormatMapping(vk_formats, gfx10_formats)
|
||||
|
||||
formats = []
|
||||
for fmt in pipe_formats:
|
||||
for fmt in vk_formats:
|
||||
if fmt.name in HARDCODED:
|
||||
obj = HARDCODED[fmt.name]
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue