[Shadows] Add support for shadow attributes (7/n)
There are two types of shadows that need to be drawn, spot and ambient shadows. Each shadow
can support different colors. The GL code generates three vertex attributes for each shadow,
its position, color and shadow params(offset and distance). These can be sent using a single
glDrawElements call.
In order to support this, this change:
- adds a builder to Mesh class to support mixing and matching gl attributes
- adds support to offset VertexArrays so we can attributes for multiple
shadows to one array
- modifies drawLayers to support drawing shadows (actual draw shadow code
will be in a follow up cl)
- adds draw shadow state to render engine
Bug: 136561771
Test: go/wm-smoke
Test: atest librenderengine_test libgui_test SurfaceFlinger_test
Change-Id: I2e70c3dbba3266e44896d5b25e45640defe6353b
diff --git a/libs/renderengine/gl/Program.cpp b/libs/renderengine/gl/Program.cpp
index 4eb5eb6..f4fbf35 100644
--- a/libs/renderengine/gl/Program.cpp
+++ b/libs/renderengine/gl/Program.cpp
@@ -37,6 +37,8 @@
glBindAttribLocation(programId, position, "position");
glBindAttribLocation(programId, texCoords, "texCoords");
glBindAttribLocation(programId, cropCoords, "cropCoords");
+ glBindAttribLocation(programId, shadowColor, "shadowColor");
+ glBindAttribLocation(programId, shadowParams, "shadowParams");
glLinkProgram(programId);
GLint status;