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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 139013008: Implement support for rendering to 32-bit float textures on ES3 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address review feedback, split extension and add tests Created 6 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 unified diff | Download patch
OLDNEW
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 8806 matching lines...) Expand 10 before | Expand all | Expand 10 after
8817 AddExpectationsForActiveTexture(GL_TEXTURE1); 8817 AddExpectationsForActiveTexture(GL_TEXTURE1);
8818 AddExpectationsForBindTexture(GL_TEXTURE_2D, 8818 AddExpectationsForBindTexture(GL_TEXTURE_2D,
8819 TestHelper::kServiceDefaultTexture2dId); 8819 TestHelper::kServiceDefaultTexture2dId);
8820 8820
8821 // Expect to restore active texture unit to GL_TEXTURE0. 8821 // Expect to restore active texture unit to GL_TEXTURE0.
8822 AddExpectationsForActiveTexture(GL_TEXTURE0); 8822 AddExpectationsForActiveTexture(GL_TEXTURE0);
8823 8823
8824 GetDecoder()->RestoreAllTextureUnitBindings(&prev_state); 8824 GetDecoder()->RestoreAllTextureUnitBindings(&prev_state);
8825 } 8825 }
8826 8826
8827 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES2) {
8828 InitDecoder("GL_OES_texture_float", // extensions
8829 "opengl es 2.0", // gl version
8830 false, // has alpha
8831 false, // has depth
8832 false, // has stencil
8833 false, // request alpha
8834 false, // request depth
8835 false, // request stencil
8836 false); // bind generates resource
8837 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
8838 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0);
8839 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0);
8840 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0, GL_LUMINANCE,
8841 GL_FLOAT, 0, 0);
8842 DoTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0, GL_ALPHA, GL_FLOAT,
8843 0, 0);
8844 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16, 17, 0,
8845 GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0);
8846 }
8847
8848 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES3) {
8849 InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions
8850 "opengl es 3.0", // gl version
8851 false, // has alpha
8852 false, // has depth
8853 false, // has stencil
8854 false, // request alpha
8855 false, // request depth
8856 false, // request stencil
8857 false); // bind generates resource
8858 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
8859 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0);
8860 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0);
8861 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 16, 17, 0, GL_RGBA, GL_FLOAT, 0,
8862 0);
8863 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0, GL_LUMINANCE,
8864 GL_FLOAT, 0, 0);
8865 DoTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0, GL_ALPHA, GL_FLOAT,
8866 0, 0);
8867 DoTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16, 17, 0,
8868 GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0);
8869 }
8870
8871 TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) {
8872 InitDecoder("GL_ARB_texture_float", // extensions
8873 "2.1", // gl version
8874 false, // has alpha
8875 false, // has depth
8876 false, // has stencil
8877 false, // request alpha
8878 false, // request depth
8879 false, // request stencil
8880 false); // bind generates resource
8881 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
8882 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0,
8883 GL_RGBA, GL_FLOAT, 0, 0, GL_RGBA32F_ARB);
8884 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0,
8885 GL_RGB, GL_FLOAT, 0, 0, GL_RGB32F_ARB);
8886 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 17, 0,
8887 GL_LUMINANCE, GL_FLOAT, 0, 0,
8888 GL_LUMINANCE32F_ARB);
8889 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_ALPHA, 16, 17, 0,
8890 GL_ALPHA, GL_FLOAT, 0, 0, GL_ALPHA32F_ARB);
8891 DoTexImage2DConvertInternalFormat(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, 16,
8892 17, 0, GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0,
8893 GL_LUMINANCE_ALPHA32F_ARB);
8894 }
8895
8896
8827 // TODO(gman): Complete this test. 8897 // TODO(gman): Complete this test.
8828 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { 8898 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) {
8829 // } 8899 // }
8830 8900
8831 // TODO(gman): BufferData 8901 // TODO(gman): BufferData
8832 8902
8833 // TODO(gman): BufferDataImmediate 8903 // TODO(gman): BufferDataImmediate
8834 8904
8835 // TODO(gman): BufferSubData 8905 // TODO(gman): BufferSubData
8836 8906
(...skipping 16 matching lines...) Expand all
8853 // TODO(gman): TexImage2DImmediate 8923 // TODO(gman): TexImage2DImmediate
8854 8924
8855 // TODO(gman): TexSubImage2DImmediate 8925 // TODO(gman): TexSubImage2DImmediate
8856 8926
8857 // TODO(gman): UseProgram 8927 // TODO(gman): UseProgram
8858 8928
8859 // TODO(gman): SwapBuffers 8929 // TODO(gman): SwapBuffers
8860 8930
8861 } // namespace gles2 8931 } // namespace gles2
8862 } // namespace gpu 8932 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698