From 3e263fac8c9c0e0fb242186b514a7af8efb40961 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 12 Dec 2011 16:47:48 -0800 Subject: Keep shaders to render properly I don't know who's to blame, SGX or Tegra2 but one of those two GPUs is not following the OpenGL ES 2.0 spec. Change-Id: I2624e0efbc9c57d571c55c8b440a5e43f08a54f2 --- libs/hwui/Program.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libs/hwui/Program.h') diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h index edd12093f474..9e59621eef30 100644 --- a/libs/hwui/Program.h +++ b/libs/hwui/Program.h @@ -33,6 +33,11 @@ namespace uirenderer { */ class Program { public: + enum ShaderBindings { + kBindingPosition, + kBindingTexCoords + }; + /** * Creates a new program with the specified vertex and fragment * shaders sources. @@ -106,6 +111,11 @@ protected: */ int addAttrib(const char* name); + /** + * Binds the specified attribute name to the specified slot. + */ + int bindAttrib(const char* name, ShaderBindings bindingSlot); + /** * Adds a uniform with the specified name. * @@ -121,8 +131,10 @@ private: */ GLuint buildShader(const char* source, GLenum type); - // Name of the OpenGL program + // Name of the OpenGL program and shaders GLuint mProgramId; + GLuint mVertexShader; + GLuint mFragmentShader; // Keeps track of attributes and uniforms slots KeyedVector mAttributes; -- cgit v1.2.3-59-g8ed1b