Changing Launcher2 to use more generic shader param binding.
Change-Id: I5550a5ce88e5edc5ce11689e828001e28bb29e04
diff --git a/src/com/android/launcher2/allapps.rs b/src/com/android/launcher2/allapps.rs
index b07e1fe..acee82b 100644
--- a/src/com/android/launcher2/allapps.rs
+++ b/src/com/android/launcher2/allapps.rs
@@ -28,6 +28,7 @@
rs_allocation *gLabelIDs;
typedef struct VpConsts {
+ rs_matrix4x4 Proj;
float4 Position;
float4 ScaleOffset;
float2 BendPos;
@@ -65,6 +66,8 @@
static int g_Cols;
static int g_Rows;
+rs_allocation g_VPConstAlloc;
+
// Drawing constants, should be parameters ======
#define VIEW_ANGLE 1.28700222f
@@ -300,6 +303,7 @@
vpConstants->ImgSize.y = rsAllocationGetDimY(gSelectedIconTexture);
vpConstants->Position.y = y - (rsAllocationGetDimY(gSelectedIconTexture)
- rsAllocationGetDimY(gIconIDs[iconNum])) * 0.5f;
+ rsAllocationMarkDirty(g_VPConstAlloc);
rsgDrawMesh(gSMCell);
}
@@ -307,6 +311,7 @@
vpConstants->ImgSize.x = rsAllocationGetDimX(gIconIDs[iconNum]);
vpConstants->ImgSize.y = rsAllocationGetDimY(gIconIDs[iconNum]);
vpConstants->Position.y = y - 0.2f;
+ rsAllocationMarkDirty(g_VPConstAlloc);
rsgBindTexture(gPFTexMip, 0, gIconIDs[iconNum]);
rsgDrawMesh(gSMCell);
@@ -314,6 +319,7 @@
vpConstants->ImgSize.x = rsAllocationGetDimX(gLabelIDs[iconNum]);
vpConstants->ImgSize.y = rsAllocationGetDimY(gLabelIDs[iconNum]);
vpConstants->Position.y = y - 64.f - 0.2f;
+ rsAllocationMarkDirty(g_VPConstAlloc);
rsgBindTexture(gPFTexMipAlpha, 0, gLabelIDs[iconNum]);
rsgDrawMesh(gSMCell);
}
@@ -328,6 +334,7 @@
// Compute dt in seconds.
// physics may break if DT is large.
g_DT = min(rsGetDt(), 0.1f);
+ g_VPConstAlloc = rsGetAllocation(vpConstants);
if (g_Zoom != gZoomTarget) {
float dz = g_DT * 1.7f;