panfrost: Prepare some code for MRT
[mesa.git] / src / mesa / main / format_unpack.py
index fc7ea3b4ab71967bd5f0f7b02856d33da75fc380..c254b74149cf6bdf6c13f0cd62e8290d712cb718 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+from __future__ import print_function
 
 from mako.template import Template
 from sys import argv
@@ -43,11 +43,12 @@ string = """/*
 
 #include <stdint.h>
 
+#include "errors.h"
 #include "format_unpack.h"
 #include "format_utils.h"
 #include "macros.h"
 #include "util/format_rgb9e5.h"
-#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
+#include "util/format_r11g11b10f.h"
 #include "util/format_srgb.h"
 
 #define UNPACK(SRC, OFFSET, BITS) (((SRC) >> (OFFSET)) & MAX_UINT(BITS))
@@ -321,7 +322,7 @@ _mesa_unpack_rgba_row(mesa_format format, GLuint n,
    case ${f.name}:
       for (i = 0; i < n; ++i) {
          unpack_float_${f.short_name()}(s, dst[i]);
-         s += ${f.block_size() / 8};
+         s += ${f.block_size() // 8};
       }
       break;
 %endfor
@@ -354,7 +355,7 @@ _mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n,
    case ${f.name}:
       for (i = 0; i < n; ++i) {
          unpack_ubyte_${f.short_name()}(s, dst[i]);
-         s += ${f.block_size() / 8};
+         s += ${f.block_size() // 8};
       }
       break;
 %endfor
@@ -396,7 +397,7 @@ _mesa_unpack_uint_rgba_row(mesa_format format, GLuint n,
    case ${f.name}:
       for (i = 0; i < n; ++i) {
          unpack_int_${f.short_name()}(s, dst[i]);
-         s += ${f.block_size() / 8};
+         s += ${f.block_size() // 8};
       }
       break;
 %endfor
@@ -889,6 +890,6 @@ _mesa_unpack_depth_stencil_row(mesa_format format, GLuint n,
 }
 """
 
-template = Template(string);
+template = Template(string, future_imports=['division']);
 
-print template.render(argv = argv[0:])
+print(template.render(argv = argv[0:]))