diff options
author | Chet Haase <chet@google.com> | 2012-09-17 17:43:45 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2012-09-18 14:10:10 -0700 |
commit | 0990ffbc4d407e174423a4a04b5902ed83f71db5 (patch) | |
tree | 1296fbc452975cfb910733c9fe7f865fd474dd7b /libs | |
parent | 218e2f199b9ba568a815d64269ea0784e2d32935 (diff) | |
download | frameworks_base-0990ffbc4d407e174423a4a04b5902ed83f71db5.zip frameworks_base-0990ffbc4d407e174423a4a04b5902ed83f71db5.tar.gz frameworks_base-0990ffbc4d407e174423a4a04b5902ed83f71db5.tar.bz2 |
Fix GL shader bugs
Fixing errors in emitted shader code that caused GL errors
at runtime
Change-Id: I267a84398a81329a6688b292505f8779bd750ad1
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/Program.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/ProgramCache.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index 984461c..5b1b57d 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -178,7 +178,7 @@ void Program::setColor(const float r, const float g, const float b, const float void Program::use() { glUseProgram(mProgramId); if (texCoords >= 0 && !mHasSampler) { - glUniform1i(getUniform("sampler"), 0); + glUniform1i(getUniform("baseSampler"), 0); mHasSampler = true; } mUse = true; diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index 2d13f60..6baf448 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -294,8 +294,8 @@ const char* gFS_Main_BlendShaders_Modulate[6] = { ";\n", ";\n", // Modulate - " * fragColor.a;\n", - " * fragColor.a;\n", + " * color.a;\n", + " * color.a;\n", // Modulate with alpha 8 texture " * texture2D(baseSampler, outTexCoords).a;\n", " * pow(texture2D(baseSampler, outTexCoords).a, gamma);\n" @@ -305,8 +305,8 @@ const char* gFS_Main_GradientShader_Modulate[6] = { " fragColor = gradientColor;\n", " fragColor = gradientColor;\n", // Modulate - " fragColor = gradientColor * fragColor.a;\n", - " fragColor = gradientColor * fragColor.a;\n", + " fragColor = gradientColor * color.a;\n", + " fragColor = gradientColor * color.a;\n", // Modulate with alpha 8 texture " fragColor = gradientColor * texture2D(baseSampler, outTexCoords).a;\n", " fragColor = gradientColor * pow(texture2D(baseSampler, outTexCoords).a, gamma);\n" @@ -316,8 +316,8 @@ const char* gFS_Main_BitmapShader_Modulate[6] = { " fragColor = bitmapColor;\n", " fragColor = bitmapColor;\n", // Modulate - " fragColor = bitmapColor * fragColor.a;\n", - " fragColor = bitmapColor * fragColor.a;\n", + " fragColor = bitmapColor * color.a;\n", + " fragColor = bitmapColor * color.a;\n", // Modulate with alpha 8 texture " fragColor = bitmapColor * texture2D(baseSampler, outTexCoords).a;\n", " fragColor = bitmapColor * pow(texture2D(baseSampler, outTexCoords).a, gamma);\n" |