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

Unified Diff: gpu/command_buffer/tests/gl_program_unittest.cc

Issue 957403004: Compile shader upon deletion if attached. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/shader_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_program_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_program_unittest.cc b/gpu/command_buffer/tests/gl_program_unittest.cc
index d243994855823f368d4d06d9a5154a33b525f796..c0abb12aa81688a9d60fd55ebca18f6e92bc8fee 100644
--- a/gpu/command_buffer/tests/gl_program_unittest.cc
+++ b/gpu/command_buffer/tests/gl_program_unittest.cc
@@ -251,5 +251,38 @@ TEST_F(GLProgramTest, DeferCompileWithExt) {
EXPECT_NE(0u, program_good2);
}
+TEST_F(GLProgramTest, DeleteAttachedShaderLinks) {
+ static const char* v_shdr_str = R"(
+ attribute vec4 vPosition;
+ void main()
+ {
+ gl_Position = vPosition;
+ }
+ )";
+ static const char* f_shdr_str = R"(
+ void main()
+ {
+ gl_FragColor = vec4(1, 1, 1, 1);
+ }
+ )";
+
+ // Compiling the shaders, attaching, then deleting before linking should work.
+ GLuint vs = GLTestHelper::CompileShader(GL_VERTEX_SHADER, v_shdr_str);
+ GLuint fs = GLTestHelper::CompileShader(GL_FRAGMENT_SHADER, f_shdr_str);
+
+ GLuint program = glCreateProgram();
+ glAttachShader(program, vs);
+ glAttachShader(program, fs);
+
+ glDeleteShader(vs);
+ glDeleteShader(fs);
+
+ glLinkProgram(program);
+
+ GLint linked = 0;
+ glGetProgramiv(program, GL_LINK_STATUS, &linked);
+ EXPECT_NE(0, linked);
+}
+
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/shader_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698