Esempio n. 1
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
"""Generate fp64 vertex shader input tests."""

import abc
import argparse
import itertools
import os
import types

from templates import template_dir
from modules import utils
from modules import types as glsltypes

TEMPLATES = template_dir(os.path.basename(os.path.splitext(__file__)[0]))

# Hard limit so we don't generate useless tests that cannot be run in any existing HW.
MAX_VERTEX_ATTRIBS = 32

# pylint: disable=bad-whitespace,line-too-long
DOUBLE_INFS = [
    '0xfff0000000000000',  # -inf
    '0x7ff0000000000000'
]  # +inf

DOUBLE_NEG_ZERO = ['0x8000000000000000']  # Negative underflow (-0.0)

DOUBLE_POS_ZERO = ['0x0000000000000000']  # Positive underflow (+0.0)

# Double values causing an underflow to zero in any other type
"""

from __future__ import (
    print_function, absolute_import, division, unicode_literals
)
import copy
import itertools
import os

from six.moves import range  # pylint: disable=redefined-builtin

from modules import utils, glsl
from templates import template_dir

_TEMPLATES = template_dir(os.path.basename(os.path.splitext(__file__)[0]))
_VS_TEMPLATE = _TEMPLATES.get_template('vs.shader_test.mako')
_FS_TEMPLATE = _TEMPLATES.get_template('fs.shader_test.mako')
_DIRNAME = os.path.join('spec', 'glsl-{}', 'execution', 'variable-indexing')


class TestParams(object):
    """Object representing all of the parameters of a single test instance.

    Provides all of the values using lazy properties, which tie in with the
    ParamsFactory to store all of the values, speeding up run times.

    """
    def __init__(self, mode, array_dim, matrix_dim, index_value, col,
                 value_type, glsl_version):
        # pylint: disable=too-many-arguments