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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc

Issue 2751553002: Check for invalid dimensions in glTexStorage* (Closed)
Patch Set: comment Created 3 years, 9 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/gles2_cmd_decoder.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/service/gles2_cmd_decoder_unittest_textures.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
index f05c197c03fb56ac379c55b7d369259f481011cf..f406797044929a09994165ae752da389cf5ae936 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc
@@ -4363,6 +4363,33 @@ TEST_P(GLES2DecoderManualInitTest, TexStorageInvalidLevels) {
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
+TEST_P(GLES2DecoderManualInitTest, TexStorageInvalidSize) {
+ InitState init;
+ init.gl_version = "OpenGL 4.2";
+ init.extensions = "GL_ARB_texture_storage";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
+ DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
+ {
+ TexStorage2DEXT cmd;
+ cmd.Init(GL_TEXTURE_2D, 1, GL_RGBA8, 0, 4);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ }
+ {
+ TexStorage2DEXT cmd;
+ cmd.Init(GL_TEXTURE_2D, 1, GL_RGBA8, 4, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ }
+ {
+ TexStorage2DEXT cmd;
+ cmd.Init(GL_TEXTURE_2D, 1, GL_RGBA8, 0, 0);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ }
+}
+
class GLES2DecoderTexStorageFormatAndTypeTest
: public GLES2DecoderManualInitTest {
public:
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698