Loading libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs +2 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,7 @@ void setupCustomShaderLights() { gVSConstants->light1_Diffuse = 1.0f; gVSConstants->light1_Specular = 0.7f; gVSConstants->light1_CosinePower = 50.0f; rsAllocationMarkDirty(rsGetAllocation(gVSConstants)); // Update fragmetn shader constants // Set light 0 colors Loading @@ -377,6 +378,7 @@ void setupCustomShaderLights() { // Set light 1 colors gFSConstants->light1_DiffuseColor = light1DiffCol; gFSConstants->light1_SpecularColor = light1SpecCol; rsAllocationMarkDirty(rsGetAllocation(gFSConstants)); } void displayCustomShaderSamples() { Loading libs/rs/rsAllocation.h +1 −1 Original line number Diff line number Diff line Loading @@ -89,9 +89,9 @@ public: void incRefs(const void *ptr, size_t ct) const; void decRefs(const void *ptr, size_t ct) const; protected: void sendDirty() const; protected: ObjectBaseRef<const Type> mType; void * mPtr; Loading libs/rs/rsScriptC_Lib.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,11 @@ int SC_getAllocation(const void *ptr) return (int)alloc; } void SC_allocationMarkDirty(RsAllocation a) { Allocation *alloc = static_cast<Allocation *>(a); alloc->sendDirty(); } void SC_ForEach(RsScript vs, RsAllocation vin, Loading Loading @@ -422,6 +427,8 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z13rsClearObjectP13rs_allocation", (void *)&SC_clearObject }, { "_Z10rsIsObject13rs_allocation", (void *)&SC_isObject }, { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_allocationMarkDirty }, // Debug { "_Z7rsDebugPKcf", (void *)&SC_debugF }, Loading libs/rs/scriptc/rs_math.rsh +4 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,10 @@ extern bool __attribute__((overloadable)) extern rs_allocation __attribute__((overloadable)) rsGetAllocation(const void *); // Mark the allocation dirty and notify those using it extern void __attribute__((overloadable)) rsAllocationMarkDirty(rs_allocation); // Return the dimensions associated with an allocation. extern uint32_t __attribute__((overloadable)) rsAllocationGetDimX(rs_allocation); Loading Loading
libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs +2 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,7 @@ void setupCustomShaderLights() { gVSConstants->light1_Diffuse = 1.0f; gVSConstants->light1_Specular = 0.7f; gVSConstants->light1_CosinePower = 50.0f; rsAllocationMarkDirty(rsGetAllocation(gVSConstants)); // Update fragmetn shader constants // Set light 0 colors Loading @@ -377,6 +378,7 @@ void setupCustomShaderLights() { // Set light 1 colors gFSConstants->light1_DiffuseColor = light1DiffCol; gFSConstants->light1_SpecularColor = light1SpecCol; rsAllocationMarkDirty(rsGetAllocation(gFSConstants)); } void displayCustomShaderSamples() { Loading
libs/rs/rsAllocation.h +1 −1 Original line number Diff line number Diff line Loading @@ -89,9 +89,9 @@ public: void incRefs(const void *ptr, size_t ct) const; void decRefs(const void *ptr, size_t ct) const; protected: void sendDirty() const; protected: ObjectBaseRef<const Type> mType; void * mPtr; Loading
libs/rs/rsScriptC_Lib.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,11 @@ int SC_getAllocation(const void *ptr) return (int)alloc; } void SC_allocationMarkDirty(RsAllocation a) { Allocation *alloc = static_cast<Allocation *>(a); alloc->sendDirty(); } void SC_ForEach(RsScript vs, RsAllocation vin, Loading Loading @@ -422,6 +427,8 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "_Z13rsClearObjectP13rs_allocation", (void *)&SC_clearObject }, { "_Z10rsIsObject13rs_allocation", (void *)&SC_isObject }, { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_allocationMarkDirty }, // Debug { "_Z7rsDebugPKcf", (void *)&SC_debugF }, Loading
libs/rs/scriptc/rs_math.rsh +4 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,10 @@ extern bool __attribute__((overloadable)) extern rs_allocation __attribute__((overloadable)) rsGetAllocation(const void *); // Mark the allocation dirty and notify those using it extern void __attribute__((overloadable)) rsAllocationMarkDirty(rs_allocation); // Return the dimensions associated with an allocation. extern uint32_t __attribute__((overloadable)) rsAllocationGetDimX(rs_allocation); Loading