def do_test(requirements, packing):
    path = os.path.join("spec", "arb_uniform_buffer_object", "execution")

    try:
        os.makedirs(path)
    except OSError as exc:
        if exc.errno == errno.EEXIST and os.path.isdir(path):
            pass
        else:
            raise
        pass

    basename = random_ubo.generate_file_name(requirements, packing)
    fullname = os.path.join(path, basename)

    file = open(fullname, "w", 0)

    fields, required_layouts = random_ubo.generate_ubo(
        requirements,
        random_ubo.ALL130_TYPES)

    layouts = random_ubo.generate_layouts(
        fields,
        required_layouts,
        # Due to bugs in the NVIDIA closed-source driver, do not randomly
        # generate layout(row_major) on structures.  Several tests will,
        # however, do this explicitly.
        False)

    blocks = random_ubo.generate_block_list(
        130,
        packing,
        fields,
        layouts)

    print basename
    file.write(random_ubo.emit_shader_test(
        blocks,
        packing,
        130,
        ["GL_ARB_uniform_buffer_object"]))

    file.close()
def do_test(requirements, packing):
    path = os.path.join("spec", "arb_uniform_buffer_object", "execution")

    try:
        os.makedirs(path)
    except OSError as exc:
        if exc.errno == errno.EEXIST and os.path.isdir(path):
            pass
        else:
            raise
        pass

    basename = random_ubo.generate_file_name(requirements, packing)
    fullname = os.path.join(path, basename)

    file = open(fullname, "w", 0)

    fields, required_layouts = random_ubo.generate_ubo(
        requirements,
        random_ubo.ALL130_TYPES)

    layouts = random_ubo.generate_layouts(
        fields,
        required_layouts,
        # Due to bugs in the NVIDIA closed-source driver, do not randomly
        # generate layout(row_major) on structures.  Several tests will,
        # however, do this explicitly.
        False)

    blocks = random_ubo.generate_block_list(
        130,
        packing,
        fields,
        layouts)

    print basename
    file.write(random_ubo.emit_shader_test(
        blocks,
        packing,
        130,
        ["GL_ARB_uniform_buffer_object","GL_ARB_arrays_of_arrays"]))

    file.close()
        elif packing_str == "std140":
            packing = random_ubo.std140_packing_rules()
        else:
            print("Invalid packing string '{}'.".format(packing_str))
            sys.exit(1)
    elif line.startswith("# STRUCT"):
        struct_name, struct_fields = ast.literal_eval(line[8:].strip())
        struct_types[struct_name] = struct_fields
    elif line.startswith("# UBO"):
        blocks.append(ast.literal_eval(line[5:].strip()))
    elif line.startswith("# DATA END"):
        break
    else:
        pass

file_in.close()

if not remove_random_field(blocks):
    sys.exit(1)

if len(blocks) == 0:
    sys.exit(1)

file_out.write(random_ubo.emit_shader_test(
        blocks,
        packing,
        glsl_version,
        extensions))
file_out.write("\n")
file_out.close()
Beispiel #4
0
        elif packing_str == "std140":
            packing = random_ubo.std140_packing_rules()
        else:
            print("Invalid packing string '{}'.".format(packing_str))
            sys.exit(1)
    elif line.startswith("# STRUCT"):
        struct_name, struct_fields = ast.literal_eval(line[8:].strip())
        struct_types[struct_name] = struct_fields
    elif line.startswith("# UBO"):
        blocks.append(ast.literal_eval(line[5:].strip()))
    elif line.startswith("# DATA END"):
        break
    else:
        pass

file_in.close()

if not remove_random_field(blocks):
    sys.exit(1)

if len(blocks) == 0:
    sys.exit(1)

file_out.write(random_ubo.emit_shader_test(
        blocks,
        packing,
        glsl_version,
        extensions))
file_out.write("\n")
file_out.close()