OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
(...skipping 8802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8813 DiscardFramebufferEXTImmediate& cmd = | 8813 DiscardFramebufferEXTImmediate& cmd = |
8814 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); | 8814 *GetImmediateAs<DiscardFramebufferEXTImmediate>(); |
8815 cmd.Init(target, count, attachments); | 8815 cmd.Init(target, count, attachments); |
8816 | 8816 |
8817 // Should not result into a call into GL. | 8817 // Should not result into a call into GL. |
8818 EXPECT_EQ(error::kNoError, | 8818 EXPECT_EQ(error::kNoError, |
8819 ExecuteImmediateCmd(cmd, sizeof(attachments))); | 8819 ExecuteImmediateCmd(cmd, sizeof(attachments))); |
8820 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 8820 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
8821 } | 8821 } |
8822 | 8822 |
| 8823 TEST_F(GLES2DecoderManualInitTest, ClearUniformsBeforeFirstProgramUse) { |
| 8824 CommandLine command_line(0, NULL); |
| 8825 command_line.AppendSwitchASCII( |
| 8826 switches::kGpuDriverBugWorkarounds, |
| 8827 base::IntToString(gpu::CLEAR_UNIFORMS_BEFORE_FIRST_PROGRAM_USE)); |
| 8828 InitDecoderWithCommandLine( |
| 8829 "", // extensions |
| 8830 "3.0", // gl version |
| 8831 true, // has alpha |
| 8832 false, // has depth |
| 8833 false, // has stencil |
| 8834 true, // request alpha |
| 8835 false, // request depth |
| 8836 false, // request stencil |
| 8837 true, // bind generates resource |
| 8838 &command_line); |
| 8839 { |
| 8840 static AttribInfo attribs[] = { |
| 8841 { kAttrib1Name, kAttrib1Size, kAttrib1Type, kAttrib1Location, }, |
| 8842 { kAttrib2Name, kAttrib2Size, kAttrib2Type, kAttrib2Location, }, |
| 8843 { kAttrib3Name, kAttrib3Size, kAttrib3Type, kAttrib3Location, }, |
| 8844 }; |
| 8845 static UniformInfo uniforms[] = { |
| 8846 { kUniform1Name, kUniform1Size, kUniform1Type, |
| 8847 kUniform1FakeLocation, kUniform1RealLocation, |
| 8848 kUniform1DesiredLocation }, |
| 8849 { kUniform2Name, kUniform2Size, kUniform2Type, |
| 8850 kUniform2FakeLocation, kUniform2RealLocation, |
| 8851 kUniform2DesiredLocation }, |
| 8852 { kUniform3Name, kUniform3Size, kUniform3Type, |
| 8853 kUniform3FakeLocation, kUniform3RealLocation, |
| 8854 kUniform3DesiredLocation }, |
| 8855 }; |
| 8856 SetupShader(attribs, arraysize(attribs), uniforms, arraysize(uniforms), |
| 8857 client_program_id_, kServiceProgramId, |
| 8858 client_vertex_shader_id_, kServiceVertexShaderId, |
| 8859 client_fragment_shader_id_, kServiceFragmentShaderId); |
| 8860 TestHelper::SetupExpectationsForClearingUniforms( |
| 8861 gl_.get(), uniforms, arraysize(uniforms)); |
| 8862 } |
| 8863 |
| 8864 { |
| 8865 EXPECT_CALL(*gl_, UseProgram(kServiceProgramId)) |
| 8866 .Times(1) |
| 8867 .RetiresOnSaturation(); |
| 8868 cmds::UseProgram cmd; |
| 8869 cmd.Init(client_program_id_); |
| 8870 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 8871 } |
| 8872 } |
| 8873 |
8823 // TODO(gman): Complete this test. | 8874 // TODO(gman): Complete this test. |
8824 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { | 8875 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { |
8825 // } | 8876 // } |
8826 | 8877 |
8827 // TODO(gman): BufferData | 8878 // TODO(gman): BufferData |
8828 | 8879 |
8829 // TODO(gman): BufferDataImmediate | 8880 // TODO(gman): BufferDataImmediate |
8830 | 8881 |
8831 // TODO(gman): BufferSubData | 8882 // TODO(gman): BufferSubData |
8832 | 8883 |
(...skipping 16 matching lines...) Expand all Loading... |
8849 // TODO(gman): TexImage2DImmediate | 8900 // TODO(gman): TexImage2DImmediate |
8850 | 8901 |
8851 // TODO(gman): TexSubImage2DImmediate | 8902 // TODO(gman): TexSubImage2DImmediate |
8852 | 8903 |
8853 // TODO(gman): UseProgram | 8904 // TODO(gman): UseProgram |
8854 | 8905 |
8855 // TODO(gman): SwapBuffers | 8906 // TODO(gman): SwapBuffers |
8856 | 8907 |
8857 } // namespace gles2 | 8908 } // namespace gles2 |
8858 } // namespace gpu | 8909 } // namespace gpu |
OLD | NEW |