OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
7 #include <GLES2/gl2extchromium.h> | 7 #include <GLES2/gl2extchromium.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // come from non-deterministic rendering. | 188 // come from non-deterministic rendering. |
189 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); | 189 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); |
190 } | 190 } |
191 | 191 |
192 TEST_F(EXTMultisampleCompatibilityTest, DrawAlphaOneAndResolve) { | 192 TEST_F(EXTMultisampleCompatibilityTest, DrawAlphaOneAndResolve) { |
193 // Test that enabling GL_SAMPLE_ALPHA_TO_ONE_EXT affects rendering. | 193 // Test that enabling GL_SAMPLE_ALPHA_TO_ONE_EXT affects rendering. |
194 if (!IsApplicable()) { | 194 if (!IsApplicable()) { |
195 return; | 195 return; |
196 } | 196 } |
197 | 197 |
| 198 #if defined(OS_ANDROID) |
| 199 // TODO: Figure out why this fails on NVIDIA Shield. crbug.com/700060. |
| 200 std::string renderer(reinterpret_cast<const char*>(glGetString(GL_RENDERER))); |
| 201 std::string version(reinterpret_cast<const char*>(glGetString(GL_VERSION))); |
| 202 if (renderer.find("NVIDIA Tegra") != std::string::npos && |
| 203 version.find("OpenGL ES 3.2 NVIDIA 361.00") != std::string::npos) |
| 204 return; |
| 205 #endif |
| 206 |
198 // SAMPLE_ALPHA_TO_ONE is specified to transform alpha values of | 207 // SAMPLE_ALPHA_TO_ONE is specified to transform alpha values of |
199 // covered samples to 1.0. In order to detect it, we use non-1.0 | 208 // covered samples to 1.0. In order to detect it, we use non-1.0 |
200 // alpha. | 209 // alpha. |
201 static const float kBlue[] = {0.0f, 0.0f, 1.0f, 0.5f}; | 210 static const float kBlue[] = {0.0f, 0.0f, 1.0f, 0.5f}; |
202 static const float kGreen[] = {0.0f, 1.0f, 0.0f, 0.5f}; | 211 static const float kGreen[] = {0.0f, 1.0f, 0.0f, 0.5f}; |
203 static const float kRed[] = {1.0f, 0.0f, 0.0f, 0.5f}; | 212 static const float kRed[] = {1.0f, 0.0f, 0.0f, 0.5f}; |
204 | 213 |
205 // Different drivers seem to behave differently with respect to resulting | 214 // Different drivers seem to behave differently with respect to resulting |
206 // alpha value. These might be due to different MSAA sample counts causing | 215 // alpha value. These might be due to different MSAA sample counts causing |
207 // different samples to hit. Other option is driver bugs. Testing exact or | 216 // different samples to hit. Other option is driver bugs. Testing exact or |
(...skipping 28 matching lines...) Expand all Loading... |
236 glDisable(GL_SAMPLE_ALPHA_TO_ONE_EXT); | 245 glDisable(GL_SAMPLE_ALPHA_TO_ONE_EXT); |
237 } | 246 } |
238 } | 247 } |
239 EXPECT_NE(0, memcmp(results[0].get(), results[1].get(), kResultSize)); | 248 EXPECT_NE(0, memcmp(results[0].get(), results[1].get(), kResultSize)); |
240 // Verify that rendering is deterministic, so that the pass above does not | 249 // Verify that rendering is deterministic, so that the pass above does not |
241 // come from non-deterministic rendering. | 250 // come from non-deterministic rendering. |
242 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); | 251 EXPECT_EQ(0, memcmp(results[0].get(), results[2].get(), kResultSize)); |
243 } | 252 } |
244 | 253 |
245 } // namespace gpu | 254 } // namespace gpu |
OLD | NEW |