Example #1
0
DEF_GPUTEST(GLPrograms, reporter, factory) {
    // Set a locale that would cause shader compilation to fail because of , as decimal separator.
    // skbug 3330
#ifdef SK_BUILD_FOR_WIN
    GrAutoLocaleSetter als("sv-SE");
#else
    GrAutoLocaleSetter als("sv_SE.UTF-8");
#endif

    // We suppress prints to avoid spew
    GrContextOptions opts;
    opts.fSuppressPrints = true;
    GrContextFactory debugFactory(opts);
    for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
        GrContext* context = debugFactory.get(static_cast<GrContextFactory::GLContextType>(type));
        if (context) {
            GrGLGpu* gpu = static_cast<GrGLGpu*>(context->getGpu());

            /*
             * For the time being, we only support the test with desktop GL or for android on
             * ARM platforms
             * TODO When we run ES 3.00 GLSL in more places, test again
             */
            int maxStages;
            if (kGL_GrGLStandard == gpu->glStandard() ||
                kARM_GrGLVendor == gpu->ctxInfo().vendor()) {
                maxStages = 6;
            } else if (kTegra3_GrGLRenderer == gpu->ctxInfo().renderer() ||
                       kOther_GrGLRenderer == gpu->ctxInfo().renderer()) {
                maxStages = 1;
            } else {
                return;
            }
#if SK_ANGLE
            // Some long shaders run out of temporary registers in the D3D compiler on ANGLE.
            if (type == GrContextFactory::kANGLE_GLContextType) {
                maxStages = 2;
            }
#endif
#if SK_COMMAND_BUFFER
            // Some long shaders run out of temporary registers in the D3D compiler on ANGLE.
            // TODO(hendrikw): This only needs to happen with the ANGLE comand buffer backend.
            if (type == GrContextFactory::kCommandBuffer_GLContextType) {
                maxStages = 2;
            }
#endif
            GrTestTarget testTarget;
            context->getTestTarget(&testTarget);
            REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(
                                            context, testTarget.target(), maxStages));
        }
    }
}
Example #2
0
DEF_GPUTEST(GLPrograms, reporter, options) {
    // Set a locale that would cause shader compilation to fail because of , as decimal separator.
    // skbug 3330
#ifdef SK_BUILD_FOR_WIN
    GrAutoLocaleSetter als("sv-SE");
#else
    GrAutoLocaleSetter als("sv_SE.UTF-8");
#endif

    // We suppress prints to avoid spew
    GrContextOptions opts = options;
    opts.fSuppressPrints = true;
    sk_gpu_test::GrContextFactory debugFactory(opts);
    skiatest::RunWithGPUTestContexts(test_glprograms, &skiatest::IsRenderingGLContextType, reporter,
                                     opts);
}
Example #3
0
DEF_GPUTEST(VkClearTests, reporter, factory) {
    GrContextOptions opts;
    opts.fSuppressPrints = true;
    GrContextFactory debugFactory(opts);
    for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
        if (static_cast<GrContextFactory::GLContextType>(type) !=
            GrContextFactory::kNative_GLContextType) {
            continue;
        }
        GrContext* context = debugFactory.get(static_cast<GrContextFactory::GLContextType>(type));
        if (context) {
            basic_clear_test(reporter, context, kRGBA_8888_GrPixelConfig);
            basic_clear_test(reporter, context, kBGRA_8888_GrPixelConfig);
            sub_clear_test(reporter, context, kRGBA_8888_GrPixelConfig);
            sub_clear_test(reporter, context, kBGRA_8888_GrPixelConfig);
        }

    }
}