[Mesa-dev] [PATCH 1/2] radv/gfx10: tidy up gfx10_format_table.py

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Aug 20 13:23:11 UTC 2019


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/vulkan/gfx10_format_table.py | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/amd/vulkan/gfx10_format_table.py b/src/amd/vulkan/gfx10_format_table.py
index 34ad5f6cdf2..81b0bed92aa 100644
--- a/src/amd/vulkan/gfx10_format_table.py
+++ b/src/amd/vulkan/gfx10_format_table.py
@@ -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:
-- 
2.22.1



More information about the mesa-dev mailing list