diff options
author | dyen <dyen@chromium.org> | 2015-02-24 21:24:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-25 05:25:25 +0000 |
commit | c6a36cdd86305aa691641fcfd6ded5a571510834 (patch) | |
tree | b833fa48f13f0649b88eeede0daab620689842ec /gpu/command_buffer/tests | |
parent | 586e3dbe02974966b7a3adaf0aebfbcc4d6983ba (diff) | |
download | chromium_src-c6a36cdd86305aa691641fcfd6ded5a571510834.zip chromium_src-c6a36cdd86305aa691641fcfd6ded5a571510834.tar.gz chromium_src-c6a36cdd86305aa691641fcfd6ded5a571510834.tar.bz2 |
Compile shader upon deletion if attached.
R=kbr@chromium.org, vmiura@chromium.org
BUG=459778
TEST=chromote locally with enableVideoDecodeRenderer
Review URL: https://codereview.chromium.org/954073002
Cr-Commit-Position: refs/heads/master@{#317985}
Diffstat (limited to 'gpu/command_buffer/tests')
-rw-r--r-- | gpu/command_buffer/tests/gl_program_unittest.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gpu/command_buffer/tests/gl_program_unittest.cc b/gpu/command_buffer/tests/gl_program_unittest.cc index d243994..c0abb12 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 |