# 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.
"""
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
##__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
};
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(
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: