diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/format_info.py | 4 | ||||
-rw-r--r-- | src/mesa/main/format_pack.py | 8 | ||||
-rw-r--r-- | src/mesa/main/format_unpack.py | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py index bbecaa24510..00e27b3fba5 100644 --- a/src/mesa/main/format_info.py +++ b/src/mesa/main/format_info.py @@ -21,7 +21,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -from __future__ import print_function +from __future__ import division, print_function import format_parser as parser import sys @@ -198,7 +198,7 @@ for fmat in formats: chan = fmat.array_element() norm = chan.norm or chan.type == parser.FLOAT print(' .ArrayFormat = MESA_ARRAY_FORMAT({0}),'.format(', '.join([ - str(chan.size / 8), + str(chan.size // 8), str(int(chan.sign)), str(int(chan.type == parser.FLOAT)), str(int(norm)), diff --git a/src/mesa/main/format_pack.py b/src/mesa/main/format_pack.py index d3c8d24acd6..0b9e0d424d9 100644 --- a/src/mesa/main/format_pack.py +++ b/src/mesa/main/format_pack.py @@ -356,7 +356,7 @@ _mesa_pack_ubyte_rgba_row(mesa_format format, GLuint n, case ${f.name}: for (i = 0; i < n; ++i) { pack_ubyte_${f.short_name()}(src[i], d); - d += ${f.block_size() / 8}; + d += ${f.block_size() // 8}; } break; %endfor @@ -388,7 +388,7 @@ _mesa_pack_uint_rgba_row(mesa_format format, GLuint n, case ${f.name}: for (i = 0; i < n; ++i) { pack_uint_${f.short_name()}(src[i], d); - d += ${f.block_size() / 8}; + d += ${f.block_size() // 8}; } break; %endfor @@ -418,7 +418,7 @@ _mesa_pack_float_rgba_row(mesa_format format, GLuint n, case ${f.name}: for (i = 0; i < n; ++i) { pack_float_${f.short_name()}(src[i], d); - d += ${f.block_size() / 8}; + d += ${f.block_size() // 8}; } break; %endfor @@ -1000,6 +1000,6 @@ _mesa_pack_colormask(mesa_format format, const GLubyte colorMask[4], void *dst) } """ -template = Template(string); +template = Template(string, future_imports=['division']); print(template.render(argv = argv[0:])) diff --git a/src/mesa/main/format_unpack.py b/src/mesa/main/format_unpack.py index 286c08e6219..c254b74149c 100644 --- a/src/mesa/main/format_unpack.py +++ b/src/mesa/main/format_unpack.py @@ -322,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 @@ -355,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 @@ -397,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 @@ -890,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:])) |