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

Commit 62f258f1 authored by Jason Sams's avatar Jason Sams
Browse files

Clean up RS samples for SDK, bug 2943369

Fix bug 3403965 rsgSyncAll would not mark constants as changed
found by inspection.

Only rsAllocation.cpp affects on device bits.

Change-Id: I6b7ec0df87e42687b24384aaf54dc04976cb84f7

doc update

Change-Id: Id5841f08868557e086f185024470924ef202d19f
parent 35e70263
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ int root(int launchID) {
    rsgProgramVertexLoadModelMatrix(&robot2Ptr->globalMat);
    rsgDrawMesh(gTestMesh);

    color(0.3f, 0.3f, 0.3f, 1.0f);
    //color(0.3f, 0.3f, 0.3f, 1.0f);
    rsgDrawText("Renderscript transform test", 30, 695);

    rsgBindFont(gItalic);
+0 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ int root(int launchID) {

    rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
    rsgBindFont(gItalic);
    color(0.2, 0.2, 0.2, 0);

    rs_allocation listAlloc;
    rsSetObject(&listAlloc, rsGetAllocation(gList));
+4 −4
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ static void setupCustomShaderLights() {
    gVSConstants->light1_Diffuse = 1.0f;
    gVSConstants->light1_Specular = 0.7f;
    gVSConstants->light1_CosinePower = 25.0f;
    rsAllocationMarkDirty(rsGetAllocation(gVSConstants));
    rsgAllocationSyncAll(rsGetAllocation(gVSConstants));

    gVSConstants2->light_Posision[0] = light0Pos;
    gVSConstants2->light_Diffuse[0] = 1.0f;
@@ -417,7 +417,7 @@ static void setupCustomShaderLights() {
    gVSConstants2->light_Diffuse[1] = 1.0f;
    gVSConstants2->light_Specular[1] = 0.7f;
    gVSConstants2->light_CosinePower[1] = 25.0f;
    rsAllocationMarkDirty(rsGetAllocation(gVSConstants2));
    rsgAllocationSyncAll(rsGetAllocation(gVSConstants2));

    // Update fragmetn shader constants
    // Set light 0 colors
@@ -426,14 +426,14 @@ static void setupCustomShaderLights() {
    // Set light 1 colors
    gFSConstants->light1_DiffuseColor = light1DiffCol;
    gFSConstants->light1_SpecularColor = light1SpecCol;
    rsAllocationMarkDirty(rsGetAllocation(gFSConstants));
    rsgAllocationSyncAll(rsGetAllocation(gFSConstants));

    gFSConstants2->light_DiffuseColor[0] = light0DiffCol;
    gFSConstants2->light_SpecularColor[0] = light0SpecCol;
    // Set light 1 colors
    gFSConstants2->light_DiffuseColor[1] = light1DiffCol;
    gFSConstants2->light_SpecularColor[1] = light1SpecCol;
    rsAllocationMarkDirty(rsGetAllocation(gFSConstants2));
    rsgAllocationSyncAll(rsGetAllocation(gFSConstants2));
}

static void displayCustomShaderSamples() {
+0 −1
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ int root(int launchID) {

    rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
    rsgBindFont(gFont);
    color(0.2, 0.2, 0.2, 0);

    rs_allocation listAlloc;
    rsSetObject(&listAlloc, rsGetAllocation(gList));
+1 −0
Original line number Diff line number Diff line
@@ -679,6 +679,7 @@ static void mip(const Adapter2D &out, const Adapter2D &in) {
void rsi_AllocationSyncAll(Context *rsc, RsAllocation va, RsAllocationUsageType src) {
    Allocation *a = static_cast<Allocation *>(va);
    a->syncAll(rsc, src);
    a->sendDirty();
}

void rsi_AllocationGenerateMipmaps(Context *rsc, RsAllocation va) {
Loading