Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2698536b authored by Jason Sams's avatar Jason Sams
Browse files

Fix error checks on compute context creation.

Remove GL init for compute scripts.

Change-Id: I1bce8e4112babf4345fa56a30a9bed753734d8d6
parent e98c27e5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -839,6 +839,9 @@ public class RenderScript {

        rs.mDev = rs.nDeviceCreate();
        rs.mContext = rs.nContextCreate(rs.mDev, 0);
        if (rs.mContext == 0) {
            throw new RSDriverException("Failed to create RS context.");
        }
        rs.mMessageThread = new MessageThread(rs);
        rs.mMessageThread.start();
        return rs;
+6 −5
Original line number Diff line number Diff line
@@ -270,17 +270,18 @@ void * Context::threadProc(void *vrsc) {
    rsc->props.mLogVisual = getProp("debug.rs.visual");

    if (!rsdHalInit(rsc, 0, 0)) {
        rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed initializing GL");
        LOGE("Hal init failed");
        return NULL;
    }
    rsc->mHal.funcs.setPriority(rsc, rsc->mThreadPriority);

    if (rsc->mIsGraphicsContext) {
        if (!rsc->initGLThread()) {
            rsc->setError(RS_ERROR_OUT_OF_MEMORY, "Failed initializing GL");
            return NULL;
        }

    if (rsc->mIsGraphicsContext) {
        rsc->mStateRaster.init(rsc);
        rsc->setProgramRaster(NULL);
        rsc->mStateVertex.init(rsc);