Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: gpu/command_buffer/tests/gl_texture_storage_unittest.cc

Issue 1301053002: gpu: introduce DISABLE_TEXTURE_STORAGE workaround for mesa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 7
8 #include "gpu/command_buffer/tests/gl_manager.h" 8 #include "gpu/command_buffer/tests/gl_manager.h"
9 #include "gpu/command_buffer/tests/gl_test_utils.h" 9 #include "gpu/command_buffer/tests/gl_test_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 GLManager gl_; 42 GLManager gl_;
43 GLuint tex_; 43 GLuint tex_;
44 GLuint fbo_; 44 GLuint fbo_;
45 bool extension_available_; 45 bool extension_available_;
46 }; 46 };
47 47
48 TEST_F(TextureStorageTest, CorrectPixels) { 48 TEST_F(TextureStorageTest, CorrectPixels) {
49 if (!extension_available_) 49 if (!extension_available_)
50 return; 50 return;
51 51
52 // TODO(dshwang): After fixing mesa bug, which crashes on updating immutable
53 // texture bound to FBO, remove this workaround. crbug.com/521904
piman 2015/08/19 21:07:21 Is this something that should be fixed / worked ar
dshwang 2015/08/20 07:47:46 right, client can kill gpu process via this patter
dshwang 2015/08/20 15:41:24 Done.
54 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0,
55 0);
56
52 glTexStorage2DEXT(GL_TEXTURE_2D, 2, GL_RGBA8_OES, 2, 2); 57 glTexStorage2DEXT(GL_TEXTURE_2D, 2, GL_RGBA8_OES, 2, 2);
53 58
54 uint8 source_pixels[16] = { 59 uint8 source_pixels[16] = {
55 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 60 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4
56 }; 61 };
57 glTexSubImage2D(GL_TEXTURE_2D, 62 glTexSubImage2D(GL_TEXTURE_2D,
58 0, 63 0,
59 0, 0, 64 0, 0,
60 2, 2, 65 2, 2,
61 GL_RGBA, GL_UNSIGNED_BYTE, 66 GL_RGBA, GL_UNSIGNED_BYTE,
62 source_pixels); 67 source_pixels);
68
69 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
70 tex_, 0);
71
63 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 2, 2, 0, source_pixels)); 72 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 2, 2, 0, source_pixels));
64 } 73 }
65 74
66 TEST_F(TextureStorageTest, IsImmutable) { 75 TEST_F(TextureStorageTest, IsImmutable) {
67 if (!extension_available_) 76 if (!extension_available_)
68 return; 77 return;
69 78
70 glTexStorage2DEXT(GL_TEXTURE_2D, 1, GL_RGBA8_OES, 4, 4); 79 glTexStorage2DEXT(GL_TEXTURE_2D, 1, GL_RGBA8_OES, 4, 4);
71 80
72 GLint param = 0; 81 GLint param = 0;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 GL_RGBA, 158 GL_RGBA,
150 GL_UNSIGNED_BYTE, 159 GL_UNSIGNED_BYTE,
151 NULL); 160 NULL);
152 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_OPERATION), glGetError()); 161 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_OPERATION), glGetError());
153 } 162 }
154 163
155 } // namespace gpu 164 } // namespace gpu
156 165
157 166
158 167
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698