"""Script to install megadriver symlinks for meson."""
-from __future__ import print_function
import argparse
import os
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-from __future__ import print_function
import os
Script that generates the mapping from Gallium PIPE_FORMAT_xxx to GFX10_FORMAT_xxx enums.
"""
-from __future__ import absolute_import, division, print_function, unicode_literals
-
import json
import mako.template
import os
-from __future__ import print_function, division, unicode_literals
-
CopyRight = '''
/*
* Copyright 2015-2019 Advanced Micro Devices, Inc.
stdout.
"""
-from __future__ import absolute_import, division, print_function, unicode_literals
-
from collections import defaultdict
import json
import re
-from __future__ import absolute_import, division, print_function, unicode_literals
-
COPYRIGHT = '''
/*
* Copyright 2015-2019 Advanced Micro Devices, Inc.
Will merge the given JSON files and output the result on stdout.
"""
-from __future__ import absolute_import, division, print_function, unicode_literals
-
from collections import defaultdict
import json
import re
the future.
"""
-from __future__ import absolute_import, division, print_function, unicode_literals
-
import json
import math
import re
Python package containing common tools for manipulating register JSON.
"""
-from __future__ import absolute_import, division, print_function, unicode_literals
-
import itertools
import json
import re
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import (
- absolute_import, division, print_function, unicode_literals
-)
import xml.parsers.expat
import re
import sys
"""Run glcpp tests with various line endings."""
-from __future__ import print_function
import argparse
import difflib
import errno
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-from __future__ import print_function
import sys
import subprocess
import tempfile
"""Script to generate and run glsl optimization tests."""
-from __future__ import print_function
import argparse
import difflib
import errno
import re
import sys
-if sys.version_info >= (3, 0, 0):
- STRING_TYPE = str
-else:
- STRING_TYPE = unicode
def check_sexp(sexp):
"""Verify that the argument is a proper sexp.
if isinstance(sexp, list):
for s in sexp:
check_sexp(s)
- elif not isinstance(sexp, (STRING_TYPE, bytes)):
+ elif not isinstance(sexp, (str, bytes)):
raise Exception('Not a sexp: {0!r}'.format(sexp))
def parse_sexp(sexp):
"""Convert a sexp, represented as nested lists containing strings,
into a single string of the form parseable by mesa.
"""
- if isinstance(sexp, STRING_TYPE):
+ if isinstance(sexp, str):
return sexp
if isinstance(sexp, bytes):
return sexp.encode('utf-8')
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-from __future__ import print_function
import argparse
import errno
import os
# Authors:
# Jason Ekstrand (jason@jlekstrand.net)
-from __future__ import print_function
import ast
from collections import defaultdict
import itertools
else:
return 'nir_op_' + op
-
-if sys.version_info < (3, 0):
- integer_types = (int, long)
- string_type = unicode
-
-else:
- integer_types = (int, )
- string_type = str
-
_type_re = re.compile(r"(?P<type>int|uint|bool|float)?(?P<bits>\d+)?")
def type_bits(type_str):
return Expression(val, name_base, varset)
elif isinstance(val, Expression):
return val
- elif isinstance(val, string_type):
+ elif isinstance(val, str):
return Variable(val, name_base, varset)
- elif isinstance(val, (bool, float) + integer_types):
+ elif isinstance(val, (bool, float, int)):
return Constant(val, name_base)
def __init__(self, val, name, type_str):
def hex(self):
if isinstance(self.value, (bool)):
return 'NIR_TRUE' if self.value else 'NIR_FALSE'
- if isinstance(self.value, integer_types):
+ if isinstance(self.value, int):
return hex(self.value)
elif isinstance(self.value, float):
i = struct.unpack('Q', struct.pack('d', self.value))[0]
def type(self):
if isinstance(self.value, (bool)):
return "nir_type_bool"
- elif isinstance(self.value, integer_types):
+ elif isinstance(self.value, int):
return "nir_type_int"
elif isinstance(self.value, float):
return "nir_type_float"
-from __future__ import print_function
-
template = """\
/* Copyright (C) 2015 Broadcom
*
-from __future__ import print_function
-
import re
from nir_opcodes import opcodes
from nir_opcodes import type_has_size, type_size, type_sizes, type_base_type
# Authors:
# Connor Abbott (cwabbott0@gmail.com)
-from __future__ import print_function
-
from nir_opcodes import opcodes, type_sizes
from mako.template import Template
-from __future__ import print_function
-
template = """\
/* Copyright (C) 2014 Connor Abbott
*
# Authors:
# Jason Ekstrand (jason@jlekstrand.net)
-from __future__ import print_function
-
from collections import OrderedDict
import nir_algebraic
from nir_opcodes import type_sizes
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import print_function
-
import argparse
import sys
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import print_function
-
import argparse
import sys
-from __future__ import print_function
-
copyright = '''
/*
* Copyright 2009 VMware, Inc.
-from __future__ import print_function
-
copyright = '''
/*
* Copyright 2009 VMware, Inc.
-from __future__ import print_function
-
CopyRight = '''
/*
* Copyright 2015 Advanced Micro Devices, Inc.
# IN THE SOFTWARE.
# Python source
-from __future__ import print_function
import os
import sys
import re
# IN THE SOFTWARE.
# Python source
-# Compatible with Python2.X and Python3.X
-from __future__ import print_function
import itertools
import os
import sys
# IN THE SOFTWARE.
# Python source
-from __future__ import print_function
import os
import errno
import sys
# IN THE SOFTWARE.
# Python source
-from __future__ import print_function
import os
import sys
import knob_defs
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import print_function
import os, sys, re
from gen_common import *
from argparse import FileType
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import print_function
import os, sys, re
from gen_common import *
from argparse import FileType
# amplitude slightly. Apparently this also minimizes the error function,
# reducing the maximum error from 0.00006 to about 0.00003.
-from __future__ import print_function
-
import argparse
import sys
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-from __future__ import (
- absolute_import, division, print_function, unicode_literals
-)
-
import argparse
import os
import xml.parsers.expat
#encoding=utf-8
-from __future__ import (
- absolute_import, division, print_function, unicode_literals
-)
import argparse
import ast
import xml.parsers.expat
# IN THE SOFTWARE.
#
-from __future__ import print_function
import sys
import zlib
import xml.etree.ElementTree as et
"""Generates isl_format_layout.c."""
-from __future__ import absolute_import, division, print_function
import argparse
import csv
import re
from mako import template
-# Load the template, ensure that __future__.division is imported, and set the
-# bytes encoding to be utf-8. This last bit is important to getting simple
-# consistent behavior for python 3 when we get there.
-TEMPLATE = template.Template(future_imports=['division'],
- output_encoding='utf-8',
+# Load the template and set the bytes encoding to be utf-8.
+TEMPLATE = template.Template(output_encoding='utf-8',
text="""\
/* This file is autogenerated by gen_format_layout.py. DO NOT EDIT! */
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import gl_XML, glX_XML
# Ian Romanick <idr@us.ibm.com>
# Jeremy Kolb <jkolb@brandeis.edu>
-from __future__ import division, print_function
-
import argparse
import gl_XML, glX_XML, glX_proto_common, license
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import sys, string
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import license
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
from collections import OrderedDict
from decimal import Decimal
import xml.etree.ElementTree as ET
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import gl_XML, glX_XML
# Authors:
# Zack Rusin <zack@kde.org>
-from __future__ import print_function
-
import argparse
import license
# _mesa_initialize_exec_table(). It is responsible for populating all
# entries in the "exec" dispatch table that aren't dynamic.
-from __future__ import print_function
-
import argparse
import collections
import license
# Based on code ogiginally by:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import license
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import print_function
-
import contextlib
import getopt
import gl_XML
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import print_function
-
import getopt
import gl_XML
import license
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import license
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import gl_XML
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import copy
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import argparse
import license
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from __future__ import print_function
-
import argparse
import license
# Authors:
# Ian Romanick <idr@us.ibm.com>
-from __future__ import print_function
-
import copy
class type_node(object):
# Authors:
# Chia-I Wu <olv@lunarg.com>
-from __future__ import print_function
-
import sys
# make it possible to import glapi
import os
# 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 division, print_function
-
import format_parser as parser
import sys
# Generate a C header file containing hash tables of glGet parameter
# names for each GL API. The generated file is to be included by glGet.c
-from __future__ import print_function
-
import os, sys, getopt
from collections import defaultdict
import get_hash_params
*/
'''
-
-from __future__ import division, print_function
-
import sys
from u_format_parse import *
-if sys.version_info < (3, 0):
- integer_types = (int, long)
-
-else:
- integer_types = (int, )
-
def inv_swizzles(swizzles):
'''Return an array[4] of inverse swizzle terms'''
'''Only pick the first matching value to avoid l8 getting blue and i8 getting alpha'''
'''Truncate an integer so it can be represented exactly with a floating
point mantissa'''
- assert isinstance(x, integer_types)
+ assert isinstance(x, int)
s = 1
if x < 0:
'''Get the value of unity for this type.'''
if type.type == FLOAT:
if type.size <= 32 \
- and isinstance(value, integer_types):
+ and isinstance(value, int):
return truncate_mantissa(value, 23)
return value
if type.type == FIXED:
'''
-from __future__ import division
import copy
VOID, UNSIGNED, SIGNED, FIXED, FLOAT = range(5)
-from __future__ import print_function
-
CopyRight = '''
/**************************************************************************
*
-from __future__ import print_function
-
CopyRight = '''
/**************************************************************************
*
# Converts a file to a C/C++ #include containing a string
-from __future__ import unicode_literals
import argparse
import io
import os
"""Create enum to string functions for vulkan using vk.xml."""
-from __future__ import print_function
import argparse
import os
import textwrap