Example #1
0
static int BlankTilesRun()
{
    int result = TEST_PASSED;
    int strategy_index;

    glClearColor(0.25f, 0.25f, 0.25f, 0.25f);

    icetGLDrawCallback(draw);
    icetBoundingBoxd(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5);

    /* Turn on blending and colored background collection.  Even though in
       general this would not work unless you also ordered the compositing, we
       just want to make sure we get the right color in empty tiles for this
       test. */
    icetSetColorFormat(ICET_IMAGE_COLOR_RGBA_FLOAT);
    icetSetDepthFormat(ICET_IMAGE_DEPTH_NONE);
    icetCompositeMode(ICET_COMPOSITE_MODE_BLEND);
    icetEnable(ICET_CORRECT_COLORED_BACKGROUND);

    for (strategy_index = 0;
         strategy_index < STRATEGY_LIST_SIZE; strategy_index++) {
        IceTEnum strategy = strategy_list[strategy_index];
        int single_image_strategy_index;
        int num_single_image_strategy;

        icetStrategy(strategy);
        printstat("\n\nUsing %s strategy.\n", icetGetStrategyName());

        if (strategy_uses_single_image_strategy(strategy)) {
            num_single_image_strategy = SINGLE_IMAGE_STRATEGY_LIST_SIZE;
        } else {
          /* Set to one since single image strategy does not matter. */
            num_single_image_strategy = 1;
        }

        for (single_image_strategy_index = 0;
             single_image_strategy_index < num_single_image_strategy;
             single_image_strategy_index++) {
            IceTEnum single_image_strategy
                = single_image_strategy_list[single_image_strategy_index];
            int test_result;

            icetSingleImageStrategy(single_image_strategy);
            printstat("Using %s single image sub-strategy.\n",
                      icetGetSingleImageStrategyName());

            test_result = BlankTilesDoTest();
            if (test_result != TEST_PASSED) {
                result = test_result;
            }
        }
    }

    return result;
}
static int DisplayNoDrawRun(void)
{
    int strategy_index;

    icetGetIntegerv(ICET_RANK, &global_rank);
    icetGetIntegerv(ICET_NUM_PROCESSES, &global_num_proc);

    printf("Starting DisplayNoDraw.\n");

    global_result = TEST_PASSED;

    DisplayNoDrawInit();

    for (strategy_index = 0;
         strategy_index < STRATEGY_LIST_SIZE; strategy_index++) {
        IceTEnum strategy = strategy_list[strategy_index];
        int single_image_strategy_index;
        int num_single_image_strategy;

        icetStrategy(strategy);
        printf("\n\nUsing %s strategy.\n", icetGetStrategyName());

        if (strategy_uses_single_image_strategy(strategy)) {
            num_single_image_strategy = SINGLE_IMAGE_STRATEGY_LIST_SIZE;
        } else {
          /* Set to one since single image strategy does not matter. */
            num_single_image_strategy = 1;
        }

        for (single_image_strategy_index = 0;
             single_image_strategy_index < num_single_image_strategy;
             single_image_strategy_index++) {
            IceTEnum single_image_strategy
                = single_image_strategy_list[single_image_strategy_index];

            icetSingleImageStrategy(single_image_strategy);
            printf("Using %s single image sub-strategy.\n",
                   icetGetSingleImageStrategyName());

            DisplayNoDrawDoTest();
        }
    }

    return global_result;
}
Example #3
0
void icetStateSetDefaults(void)
{
    IceTInt *int_array;
    int i;
    int comm_size, comm_rank;

    icetDiagnostics(ICET_DIAG_ALL_NODES | ICET_DIAG_WARNINGS);

    comm_size = icetCommSize();
    comm_rank = icetCommRank();
    icetStateSetInteger(ICET_RANK, comm_rank);
    icetStateSetInteger(ICET_NUM_PROCESSES, comm_size);
    /* icetStateSetInteger(ICET_ABSOLUTE_FAR_DEPTH, 1); */
  /*icetStateSetInteger(ICET_ABSOLUTE_FAR_DEPTH, 0xFFFFFFFF);*/
    icetStateSetFloatv(ICET_BACKGROUND_COLOR, 4, black);
    icetStateSetInteger(ICET_BACKGROUND_COLOR_WORD, 0);
    icetStateSetInteger(ICET_COLOR_FORMAT, ICET_IMAGE_COLOR_RGBA_UBYTE);
    icetStateSetInteger(ICET_DEPTH_FORMAT, ICET_IMAGE_DEPTH_FLOAT);

    icetResetTiles();
    icetStateSetIntegerv(ICET_DISPLAY_NODES, 0, NULL);

    icetStateSetDoublev(ICET_GEOMETRY_BOUNDS, 0, NULL);
    icetStateSetInteger(ICET_NUM_BOUNDING_VERTS, 0);
    icetStateSetInteger(ICET_STRATEGY, ICET_STRATEGY_UNDEFINED);
    icetSingleImageStrategy(ICET_SINGLE_IMAGE_STRATEGY_AUTOMATIC);
    icetCompositeMode(ICET_COMPOSITE_MODE_Z_BUFFER);
    int_array = icetStateAllocateInteger(ICET_COMPOSITE_ORDER, comm_size);
    for (i = 0; i < comm_size; i++) {
        int_array[i] = i;
    }
    int_array = icetStateAllocateInteger(ICET_PROCESS_ORDERS, comm_size);
    for (i = 0; i < comm_size; i++) {
        int_array[i] = i;
    }

    icetStateSetInteger(ICET_DATA_REPLICATION_GROUP, comm_rank);
    icetStateSetInteger(ICET_DATA_REPLICATION_GROUP_SIZE, 1);
    icetStateSetInteger(ICET_FRAME_COUNT, 0);

    if (getenv("ICET_MAGIC_K") != NULL) {
        IceTInt magic_k = atoi(getenv("ICET_MAGIC_K"));
        if (magic_k > 1) {
            icetStateSetInteger(ICET_MAGIC_K, magic_k);
        } else {
            icetRaiseError("Environment varible ICET_MAGIC_K must be set"
                           " to an integer greater than 1.",
                           ICET_INVALID_VALUE);
            icetStateSetInteger(ICET_MAGIC_K, ICET_MAGIC_K_DEFAULT);
        }
    } else {
        icetStateSetInteger(ICET_MAGIC_K, ICET_MAGIC_K_DEFAULT);
    }

    if (getenv("ICET_MAX_IMAGE_SPLIT") != NULL) {
        IceTInt max_image_split = atoi(getenv("ICET_MAX_IMAGE_SPLIT"));
        if (max_image_split > 0) {
            icetStateSetInteger(ICET_MAX_IMAGE_SPLIT, max_image_split);
        } else {
            icetRaiseError("Environment variable ICET_MAX_IMAGE_SPLIT must be"
                           " set to an integer greater than 0.",
                           ICET_INVALID_VALUE);
            icetStateSetInteger(ICET_MAX_IMAGE_SPLIT,
                                ICET_MAX_IMAGE_SPLIT_DEFAULT);
        }
    } else {
        icetStateSetInteger(ICET_MAX_IMAGE_SPLIT, ICET_MAX_IMAGE_SPLIT_DEFAULT);
    }

    icetStateSetPointer(ICET_DRAW_FUNCTION, NULL);
    icetStateSetPointer(ICET_RENDER_LAYER_DESTRUCTOR, NULL);

    icetEnable(ICET_FLOATING_VIEWPORT);
    icetDisable(ICET_ORDERED_COMPOSITE);
    icetDisable(ICET_CORRECT_COLORED_BACKGROUND);
    icetEnable(ICET_COMPOSITE_ONE_BUFFER);
    icetEnable(ICET_INTERLACE_IMAGES);
    icetEnable(ICET_COLLECT_IMAGES);
    icetDisable(ICET_RENDER_EMPTY_IMAGES);

    icetStateSetBoolean(ICET_IS_DRAWING_FRAME, 0);
    icetStateSetBoolean(ICET_RENDER_BUFFER_SIZE, 0);

    icetStateSetInteger(ICET_VALID_PIXELS_TILE, -1);
    icetStateSetInteger(ICET_VALID_PIXELS_OFFSET, 0);
    icetStateSetInteger(ICET_VALID_PIXELS_NUM, 0);

    icetStateResetTiming();
}