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

Commit c854b9c0 authored by Jason Sams's avatar Jason Sams Committed by Android (Google) Code Review
Browse files

Merge "Add size param to rsForEach bug 5074640"

parents 01391cc0 cf57dec8
Loading
Loading
Loading
Loading
+40 −12
Original line number Diff line number Diff line
@@ -365,16 +365,22 @@ static const Allocation * SC_GetAllocation(const void *ptr) {
    return rsrGetAllocation(rsc, sc, ptr);
}

static void SC_ForEach(Script *target,
static void SC_ForEach_SAA(Script *target,
                            Allocation *in,
                            Allocation *out) {
    GET_TLS();
    rsrForEach(rsc, sc, target, in, out, NULL, 0, NULL);
}

static void SC_ForEach_SAAU(Script *target,
                            Allocation *in,
                            Allocation *out,
                const void *usr,
                const RsScriptCall *call) {
                            const void *usr) {
    GET_TLS();
    rsrForEach(rsc, sc, target, in, out, usr, 0, NULL);
}

static void SC_ForEach2(Script *target,
static void SC_ForEach_SAAUS(Script *target,
                             Allocation *in,
                             Allocation *out,
                             const void *usr,
@@ -383,6 +389,25 @@ static void SC_ForEach2(Script *target,
    rsrForEach(rsc, sc, target, in, out, usr, 0, call);
}

static void SC_ForEach_SAAUL(Script *target,
                             Allocation *in,
                             Allocation *out,
                             const void *usr,
                             uint32_t usrLen) {
    GET_TLS();
    rsrForEach(rsc, sc, target, in, out, usr, usrLen, NULL);
}

static void SC_ForEach_SAAULS(Script *target,
                              Allocation *in,
                              Allocation *out,
                              const void *usr,
                              uint32_t usrLen,
                              const RsScriptCall *call) {
    GET_TLS();
    rsrForEach(rsc, sc, target, in, out, usr, usrLen, call);
}



//////////////////////////////////////////////////////////////////////////////
@@ -648,8 +673,11 @@ static RsdSymbolTable gSyms[] = {
    { "_Z19rsgClearDepthTargetv", (void *)&SC_ClearFrameBufferObjectDepthTarget, false },
    { "_Z24rsgClearAllRenderTargetsv", (void *)&SC_ClearFrameBufferObjectTargets, false },

    { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach, false },
    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach2, false },
    { "_Z9rsForEach9rs_script13rs_allocationS0_", (void *)&SC_ForEach_SAA, false },
    { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach_SAAU, false },
    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvPK16rs_script_call_t", (void *)&SC_ForEach_SAAUS, false },
    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvj", (void *)&SC_ForEach_SAAUL, false },
    { "_Z9rsForEach9rs_script13rs_allocationS0_PKvjPK16rs_script_call_t", (void *)&SC_ForEach_SAAULS, false },

    // time
    { "_Z6rsTimePi", (void *)&SC_Time, true },
+15 −2
Original line number Diff line number Diff line
@@ -249,15 +249,28 @@ typedef struct rs_script_call {
    uint32_t arrayEnd;
} rs_script_call_t;

#if 1//(RS_VERSION >= 14)
extern void __attribute__((overloadable))
    rsForEach(rs_script script, rs_allocation input,
              rs_allocation output, const void * usrData);
    rsForEach(rs_script script, rs_allocation input, rs_allocation output);

extern void __attribute__((overloadable))
    rsForEach(rs_script script, rs_allocation input, rs_allocation output,
              const void * usrData, size_t usrDataLen);

extern void __attribute__((overloadable))
    rsForEach(rs_script script, rs_allocation input, rs_allocation output,
              const void * usrData, size_t usrDataLen, const rs_script_call_t *);
#else
extern void __attribute__((overloadable))
    rsForEach(rs_script script, rs_allocation input,
              rs_allocation output, const void * usrData,
              const rs_script_call_t *);
#endif

// Move me once dependant changes are in.
extern void __attribute__((overloadable))
    rsForEach(rs_script script, rs_allocation input,
              rs_allocation output, const void * usrData);


/**
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ typedef uint16_t ushort;
typedef uint32_t uint;
typedef uint64_t ulong;

typedef uint32_t size_t;
typedef int32_t ssize_t;

typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_element;
typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_type;
typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_allocation;
@@ -88,6 +91,8 @@ typedef float4 rs_quaternion;

#define RS_PACKED __attribute__((packed, aligned(4)))

#define NULL ((const void *)0)

typedef enum {
    RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
    RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
+2 −2
Original line number Diff line number Diff line
@@ -84,10 +84,10 @@ void filter() {
    fs.radius = radius;

    fs.ain = rsGetAllocation(ScratchPixel1);
    rsForEach(hBlurScript, fs.ain, rsGetAllocation(ScratchPixel2), &fs);
    rsForEach(hBlurScript, fs.ain, rsGetAllocation(ScratchPixel2), &fs, sizeof(fs));

    fs.ain = rsGetAllocation(ScratchPixel2);
    rsForEach(vBlurScript, fs.ain, rsGetAllocation(OutPixel), &fs);
    rsForEach(vBlurScript, fs.ain, rsGetAllocation(OutPixel), &fs, sizeof(fs));
    rsSendToClientBlocking(CMD_FINISHED);
}
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ int root(void) {
    robot2Ptr->transforms[1].w += 2.5f;
    robot2Ptr->isDirty = 1;

    rsForEach(gTransformRS, gRootNode->children, gRootNode->children, 0);
    rsForEach(gTransformRS, gRootNode->children, gRootNode->children, NULL, 0);

    rsgClearColor(1.0f, 1.0f, 1.0f, 1.0f);
    rsgClearDepth(1.0f);
Loading