summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorzmo <zmo@chromium.org>2015-01-27 14:33:31 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-27 22:34:15 +0000
commit66f3677cddf1524f3dde9107c9aa9be1e432b911 (patch)
tree27dabdd8139f696a32f5e12b5aca6e8505929ede /gpu
parent916c3afeac23071ede96c90a0c4df4988f6df11f (diff)
downloadchromium_src-66f3677cddf1524f3dde9107c9aa9be1e432b911.zip
chromium_src-66f3677cddf1524f3dde9107c9aa9be1e432b911.tar.gz
chromium_src-66f3677cddf1524f3dde9107c9aa9be1e432b911.tar.bz2
Add CopyTexSubImage3D to GPU command buffer.
BUG=429053 TEST=gpu_unittests R=piman@chromium.org NOTRY=true Review URL: https://codereview.chromium.org/878793002 Cr-Commit-Position: refs/heads/master@{#313380}
Diffstat (limited to 'gpu')
-rw-r--r--gpu/GLES2/gl2chromium_autogen.h1
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py36
-rw-r--r--gpu/command_buffer/client/gles2_c_lib_autogen.h16
-rw-r--r--gpu/command_buffer/client/gles2_cmd_helper_autogen.h16
-rw-r--r--gpu/command_buffer/client/gles2_implementation_autogen.h10
-rw-r--r--gpu/command_buffer/client/gles2_implementation_impl_autogen.h28
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest_autogen.h11
-rw-r--r--gpu/command_buffer/client/gles2_interface_autogen.h9
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_autogen.h9
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h10
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_autogen.h9
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h14
-rw-r--r--gpu/command_buffer/cmd_buffer_functions.txt7
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_autogen.h83
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_test_autogen.h22
-rw-r--r--gpu/command_buffer/common/gles2_cmd_ids_autogen.h453
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_autogen.h65
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h14
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h4
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h2
20 files changed, 535 insertions, 284 deletions
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h
index 1110c0a..f84d959 100644
--- a/gpu/GLES2/gl2chromium_autogen.h
+++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -47,6 +47,7 @@
#define glCopyBufferSubData GLES2_GET_FUN(CopyBufferSubData)
#define glCopyTexImage2D GLES2_GET_FUN(CopyTexImage2D)
#define glCopyTexSubImage2D GLES2_GET_FUN(CopyTexSubImage2D)
+#define glCopyTexSubImage3D GLES2_GET_FUN(CopyTexSubImage3D)
#define glCreateProgram GLES2_GET_FUN(CreateProgram)
#define glCreateShader GLES2_GET_FUN(CreateShader)
#define glCullFace GLES2_GET_FUN(CullFace)
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 577861a..a2dc137 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1712,6 +1712,10 @@ _FUNCTION_INFO = {
'decoder_func': 'DoCopyTexSubImage2D',
'defer_reads': True,
},
+ 'CopyTexSubImage3D': {
+ 'defer_reads': True,
+ 'unsafe': True,
+ },
'CreateImageCHROMIUM': {
'type': 'Manual',
'cmd_args':
@@ -7551,21 +7555,29 @@ class SizeArgument(Argument):
def WriteValidationCode(self, file, func):
"""overridden from Argument."""
- file.Write(" if (%s < 0) {\n" % self.name)
- file.Write(
- " LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, \"gl%s\", \"%s < 0\");\n" %
- (func.original_name, self.name))
- file.Write(" return error::kNoError;\n")
- file.Write(" }\n")
+ if func.IsUnsafe():
+ return
+ code = """ if (%(var_name)s < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "gl%(func_name)s", "%(var_name)s < 0");
+ return error::kNoError;
+ }
+"""
+ file.Write(code % {
+ "var_name": self.name,
+ "func_name": func.original_name,
+ })
def WriteClientSideValidationCode(self, file, func):
"""overridden from Argument."""
- file.Write(" if (%s < 0) {\n" % self.name)
- file.Write(
- " SetGLError(GL_INVALID_VALUE, \"gl%s\", \"%s < 0\");\n" %
- (func.original_name, self.name))
- file.Write(" return;\n")
- file.Write(" }\n")
+ code = """ if (%(var_name)s < 0) {
+ SetGLError(GL_INVALID_VALUE, "gl%(func_name)s", "%(var_name)s < 0");
+ return;
+ }
+"""
+ file.Write(code % {
+ "var_name": self.name,
+ "func_name": func.original_name,
+ })
class SizeNotNegativeArgument(SizeArgument):
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h
index 0158cf6..3834527 100644
--- a/gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -181,6 +181,18 @@ void GLES2CopyTexSubImage2D(GLenum target,
gles2::GetGLContext()->CopyTexSubImage2D(target, level, xoffset, yoffset, x,
y, width, height);
}
+void GLES2CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ gles2::GetGLContext()->CopyTexSubImage3D(target, level, xoffset, yoffset,
+ zoffset, x, y, width, height);
+}
GLuint GLES2CreateProgram() {
return gles2::GetGLContext()->CreateProgram();
}
@@ -1364,6 +1376,10 @@ extern const NameToFunc g_gles2_function_table[] = {
reinterpret_cast<GLES2FunctionPointer>(glCopyTexSubImage2D),
},
{
+ "glCopyTexSubImage3D",
+ reinterpret_cast<GLES2FunctionPointer>(glCopyTexSubImage3D),
+ },
+ {
"glCreateProgram",
reinterpret_cast<GLES2FunctionPointer>(glCreateProgram),
},
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index 2b9cd8b..186a5a5 100644
--- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -359,6 +359,22 @@ void CopyTexSubImage2D(GLenum target,
}
}
+void CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ gles2::cmds::CopyTexSubImage3D* c =
+ GetCmdSpace<gles2::cmds::CopyTexSubImage3D>();
+ if (c) {
+ c->Init(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+ }
+}
+
void CreateProgram(uint32_t client_id) {
gles2::cmds::CreateProgram* c = GetCmdSpace<gles2::cmds::CreateProgram>();
if (c) {
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index b32dd44..7d7b0a7 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -147,6 +147,16 @@ void CopyTexSubImage2D(GLenum target,
GLsizei width,
GLsizei height) override;
+void CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) override;
+
GLuint CreateProgram() override;
GLuint CreateShader(GLenum type) override;
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index 90f91c5..67b88bf 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -413,6 +413,34 @@ void GLES2Implementation::CopyTexSubImage2D(GLenum target,
CheckGLError();
}
+void GLES2Implementation::CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCopyTexSubImage3D("
+ << GLES2Util::GetStringTexture3DTarget(target) << ", "
+ << level << ", " << xoffset << ", " << yoffset << ", "
+ << zoffset << ", " << x << ", " << y << ", " << width
+ << ", " << height << ")");
+ if (width < 0) {
+ SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage3D", "width < 0");
+ return;
+ }
+ if (height < 0) {
+ SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage3D", "height < 0");
+ return;
+ }
+ helper_->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y,
+ width, height);
+ CheckGLError();
+}
+
GLuint GLES2Implementation::CreateProgram() {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateProgram("
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index 845ab06..cc9c795 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -351,6 +351,17 @@ TEST_F(GLES2ImplementationTest, CopyTexSubImage2D) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationTest, CopyTexSubImage3D) {
+ struct Cmds {
+ cmds::CopyTexSubImage3D cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(GL_TEXTURE_3D, 2, 3, 4, 5, 6, 7, 8, 9);
+
+ gl_->CopyTexSubImage3D(GL_TEXTURE_3D, 2, 3, 4, 5, 6, 7, 8, 9);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
TEST_F(GLES2ImplementationTest, CullFace) {
struct Cmds {
cmds::CullFace cmd;
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h
index c15ae64..4de273d 100644
--- a/gpu/command_buffer/client/gles2_interface_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -113,6 +113,15 @@ virtual void CopyTexSubImage2D(GLenum target,
GLint y,
GLsizei width,
GLsizei height) = 0;
+virtual void CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) = 0;
virtual GLuint CreateProgram() = 0;
virtual GLuint CreateShader(GLenum type) = 0;
virtual void CullFace(GLenum mode) = 0;
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
index 58de603..8bc24d0 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -112,6 +112,15 @@ void CopyTexSubImage2D(GLenum target,
GLint y,
GLsizei width,
GLsizei height) override;
+void CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) override;
GLuint CreateProgram() override;
GLuint CreateShader(GLenum type) override;
void CullFace(GLenum mode) override;
diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
index 59dc75f..44a0ec1 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -155,6 +155,16 @@ void GLES2InterfaceStub::CopyTexSubImage2D(GLenum /* target */,
GLsizei /* width */,
GLsizei /* height */) {
}
+void GLES2InterfaceStub::CopyTexSubImage3D(GLenum /* target */,
+ GLint /* level */,
+ GLint /* xoffset */,
+ GLint /* yoffset */,
+ GLint /* zoffset */,
+ GLint /* x */,
+ GLint /* y */,
+ GLsizei /* width */,
+ GLsizei /* height */) {
+}
GLuint GLES2InterfaceStub::CreateProgram() {
return 0;
}
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index e7d2979..aae81ef 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -112,6 +112,15 @@ void CopyTexSubImage2D(GLenum target,
GLint y,
GLsizei width,
GLsizei height) override;
+void CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) override;
GLuint CreateProgram() override;
GLuint CreateShader(GLenum type) override;
void CullFace(GLenum mode) override;
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
index 2623339..85be302 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -258,6 +258,20 @@ void GLES2TraceImplementation::CopyTexSubImage2D(GLenum target,
gl_->CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}
+void GLES2TraceImplementation::CopyTexSubImage3D(GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLint zoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CopyTexSubImage3D");
+ gl_->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width,
+ height);
+}
+
GLuint GLES2TraceImplementation::CreateProgram() {
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CreateProgram");
return gl_->CreateProgram();
diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt
index a744074..720e8db 100644
--- a/gpu/command_buffer/cmd_buffer_functions.txt
+++ b/gpu/command_buffer/cmd_buffer_functions.txt
@@ -38,6 +38,7 @@ GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenumTextureTarg
GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenumBufferTarget readtarget, GLenumBufferTarget writetarget, GLintptrNotNegative readoffset, GLintptrNotNegative writeoffset, GLsizeiptr size);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenumTextureTarget target, GLint level, GLenumTextureInternalFormat internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLintTextureBorder border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenumTextureTarget target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenumTexture3DTarget target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenumShaderType type);
GL_APICALL void GL_APIENTRY glCullFace (GLenumFaceType mode);
@@ -85,7 +86,7 @@ GL_APICALL void GL_APIENTRY glGetFloatv (GLenumGLState pname, GLfloat* p
GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLidProgram program, const char* name);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenumFrameBufferTarget target, GLenumAttachment attachment, GLenumFrameBufferParameter pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenumGLState pname, GLint* params);
-GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, GLenumRenderBufferParameter pname, GLsizei bufSize, GLint* params);
+GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, GLenumRenderBufferParameter pname, GLsizeiNotNegative bufSize, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLidProgram program, GLenumProgramParameter pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLidProgram program, GLsizeiNotNegative bufsize, GLsizeiOptional* length, char* infolog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenumRenderBufferTarget target, GLenumRenderBufferParameter pname, GLint* params);
@@ -144,14 +145,14 @@ GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenumFaceType face,
GL_APICALL void GL_APIENTRY glStencilOp (GLenumStencilOp fail, GLenumStencilOp zfail, GLenumStencilOp zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenumFaceType face, GLenumStencilOp fail, GLenumStencilOp zfail, GLenumStencilOp zpass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenumTextureTarget target, GLint level, GLintTextureInternalFormat internalformat, GLsizei width, GLsizei height, GLintTextureBorder border, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
-GL_APICALL void GL_APIENTRY glTexImage3D (GLenumTextureTarget target, GLint level, GLintTextureInternalFormat internalformat, GLsizei width, GLsizei height, GLsizei depth, GLintTextureBorder border, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
+GL_APICALL void GL_APIENTRY glTexImage3D (GLenumTexture3DTarget target, GLint level, GLintTextureInternalFormat internalformat, GLsizei width, GLsizei height, GLsizei depth, GLintTextureBorder border, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenumTextureBindTarget target, GLenumTextureParameter pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenumTextureBindTarget target, GLenumTextureParameter pname, const GLfloat* params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenumTextureBindTarget target, GLenumTextureParameter pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenumTextureBindTarget target, GLenumTextureParameter pname, const GLint* params);
GL_APICALL void GL_APIENTRY glTexStorage3D (GLenumTexture3DTarget target, GLsizei levels, GLenumTextureInternalFormatStorage internalFormat, GLsizei width, GLsizei height, GLsizei depth);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenumTextureTarget target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
-GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenumTextureTarget target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenumTexture3DTarget target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLintUniformLocation location, GLfloat x);
GL_APICALL void GL_APIENTRY glUniform1fv (GLintUniformLocation location, GLsizeiNotNegative count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform1i (GLintUniformLocation location, GLint x);
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index 00ee1b5..5d9a818 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -1773,6 +1773,89 @@ static_assert(offsetof(CopyTexSubImage2D, width) == 28,
static_assert(offsetof(CopyTexSubImage2D, height) == 32,
"offset of CopyTexSubImage2D height should be 32");
+struct CopyTexSubImage3D {
+ typedef CopyTexSubImage3D ValueType;
+ static const CommandId kCmdId = kCopyTexSubImage3D;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLenum _target,
+ GLint _level,
+ GLint _xoffset,
+ GLint _yoffset,
+ GLint _zoffset,
+ GLint _x,
+ GLint _y,
+ GLsizei _width,
+ GLsizei _height) {
+ SetHeader();
+ target = _target;
+ level = _level;
+ xoffset = _xoffset;
+ yoffset = _yoffset;
+ zoffset = _zoffset;
+ x = _x;
+ y = _y;
+ width = _width;
+ height = _height;
+ }
+
+ void* Set(void* cmd,
+ GLenum _target,
+ GLint _level,
+ GLint _xoffset,
+ GLint _yoffset,
+ GLint _zoffset,
+ GLint _x,
+ GLint _y,
+ GLsizei _width,
+ GLsizei _height) {
+ static_cast<ValueType*>(cmd)->Init(_target, _level, _xoffset, _yoffset,
+ _zoffset, _x, _y, _width, _height);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t target;
+ int32_t level;
+ int32_t xoffset;
+ int32_t yoffset;
+ int32_t zoffset;
+ int32_t x;
+ int32_t y;
+ int32_t width;
+ int32_t height;
+};
+
+static_assert(sizeof(CopyTexSubImage3D) == 40,
+ "size of CopyTexSubImage3D should be 40");
+static_assert(offsetof(CopyTexSubImage3D, header) == 0,
+ "offset of CopyTexSubImage3D header should be 0");
+static_assert(offsetof(CopyTexSubImage3D, target) == 4,
+ "offset of CopyTexSubImage3D target should be 4");
+static_assert(offsetof(CopyTexSubImage3D, level) == 8,
+ "offset of CopyTexSubImage3D level should be 8");
+static_assert(offsetof(CopyTexSubImage3D, xoffset) == 12,
+ "offset of CopyTexSubImage3D xoffset should be 12");
+static_assert(offsetof(CopyTexSubImage3D, yoffset) == 16,
+ "offset of CopyTexSubImage3D yoffset should be 16");
+static_assert(offsetof(CopyTexSubImage3D, zoffset) == 20,
+ "offset of CopyTexSubImage3D zoffset should be 20");
+static_assert(offsetof(CopyTexSubImage3D, x) == 24,
+ "offset of CopyTexSubImage3D x should be 24");
+static_assert(offsetof(CopyTexSubImage3D, y) == 28,
+ "offset of CopyTexSubImage3D y should be 28");
+static_assert(offsetof(CopyTexSubImage3D, width) == 32,
+ "offset of CopyTexSubImage3D width should be 32");
+static_assert(offsetof(CopyTexSubImage3D, height) == 36,
+ "offset of CopyTexSubImage3D height should be 36");
+
struct CreateProgram {
typedef CreateProgram ValueType;
static const CommandId kCmdId = kCreateProgram;
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index 5fc1672..67f6dd8 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -562,6 +562,28 @@ TEST_F(GLES2FormatTest, CopyTexSubImage2D) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, CopyTexSubImage3D) {
+ cmds::CopyTexSubImage3D& cmd = *GetBufferAs<cmds::CopyTexSubImage3D>();
+ void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11),
+ static_cast<GLint>(12), static_cast<GLint>(13),
+ static_cast<GLint>(14), static_cast<GLint>(15),
+ static_cast<GLint>(16), static_cast<GLint>(17),
+ static_cast<GLsizei>(18), static_cast<GLsizei>(19));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::CopyTexSubImage3D::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.target);
+ EXPECT_EQ(static_cast<GLint>(12), cmd.level);
+ EXPECT_EQ(static_cast<GLint>(13), cmd.xoffset);
+ EXPECT_EQ(static_cast<GLint>(14), cmd.yoffset);
+ EXPECT_EQ(static_cast<GLint>(15), cmd.zoffset);
+ EXPECT_EQ(static_cast<GLint>(16), cmd.x);
+ EXPECT_EQ(static_cast<GLint>(17), cmd.y);
+ EXPECT_EQ(static_cast<GLsizei>(18), cmd.width);
+ EXPECT_EQ(static_cast<GLsizei>(19), cmd.height);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, CreateProgram) {
cmds::CreateProgram& cmd = *GetBufferAs<cmds::CreateProgram>();
void* next_cmd = cmd.Set(&cmd, static_cast<uint32_t>(11));
diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
index 6f90f73..2a9a0fe 100644
--- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -48,232 +48,233 @@
OP(CopyBufferSubData) /* 289 */ \
OP(CopyTexImage2D) /* 290 */ \
OP(CopyTexSubImage2D) /* 291 */ \
- OP(CreateProgram) /* 292 */ \
- OP(CreateShader) /* 293 */ \
- OP(CullFace) /* 294 */ \
- OP(DeleteBuffersImmediate) /* 295 */ \
- OP(DeleteFramebuffersImmediate) /* 296 */ \
- OP(DeleteProgram) /* 297 */ \
- OP(DeleteRenderbuffersImmediate) /* 298 */ \
- OP(DeleteSamplersImmediate) /* 299 */ \
- OP(DeleteSync) /* 300 */ \
- OP(DeleteShader) /* 301 */ \
- OP(DeleteTexturesImmediate) /* 302 */ \
- OP(DeleteTransformFeedbacksImmediate) /* 303 */ \
- OP(DepthFunc) /* 304 */ \
- OP(DepthMask) /* 305 */ \
- OP(DepthRangef) /* 306 */ \
- OP(DetachShader) /* 307 */ \
- OP(Disable) /* 308 */ \
- OP(DisableVertexAttribArray) /* 309 */ \
- OP(DrawArrays) /* 310 */ \
- OP(DrawElements) /* 311 */ \
- OP(Enable) /* 312 */ \
- OP(EnableVertexAttribArray) /* 313 */ \
- OP(FenceSync) /* 314 */ \
- OP(Finish) /* 315 */ \
- OP(Flush) /* 316 */ \
- OP(FramebufferRenderbuffer) /* 317 */ \
- OP(FramebufferTexture2D) /* 318 */ \
- OP(FramebufferTextureLayer) /* 319 */ \
- OP(FrontFace) /* 320 */ \
- OP(GenBuffersImmediate) /* 321 */ \
- OP(GenerateMipmap) /* 322 */ \
- OP(GenFramebuffersImmediate) /* 323 */ \
- OP(GenRenderbuffersImmediate) /* 324 */ \
- OP(GenSamplersImmediate) /* 325 */ \
- OP(GenTexturesImmediate) /* 326 */ \
- OP(GenTransformFeedbacksImmediate) /* 327 */ \
- OP(GetActiveAttrib) /* 328 */ \
- OP(GetActiveUniform) /* 329 */ \
- OP(GetAttachedShaders) /* 330 */ \
- OP(GetAttribLocation) /* 331 */ \
- OP(GetBooleanv) /* 332 */ \
- OP(GetBufferParameteriv) /* 333 */ \
- OP(GetError) /* 334 */ \
- OP(GetFloatv) /* 335 */ \
- OP(GetFragDataLocation) /* 336 */ \
- OP(GetFramebufferAttachmentParameteriv) /* 337 */ \
- OP(GetIntegerv) /* 338 */ \
- OP(GetInternalformativ) /* 339 */ \
- OP(GetProgramiv) /* 340 */ \
- OP(GetProgramInfoLog) /* 341 */ \
- OP(GetRenderbufferParameteriv) /* 342 */ \
- OP(GetSamplerParameterfv) /* 343 */ \
- OP(GetSamplerParameteriv) /* 344 */ \
- OP(GetShaderiv) /* 345 */ \
- OP(GetShaderInfoLog) /* 346 */ \
- OP(GetShaderPrecisionFormat) /* 347 */ \
- OP(GetShaderSource) /* 348 */ \
- OP(GetString) /* 349 */ \
- OP(GetTexParameterfv) /* 350 */ \
- OP(GetTexParameteriv) /* 351 */ \
- OP(GetUniformfv) /* 352 */ \
- OP(GetUniformiv) /* 353 */ \
- OP(GetUniformLocation) /* 354 */ \
- OP(GetVertexAttribfv) /* 355 */ \
- OP(GetVertexAttribiv) /* 356 */ \
- OP(GetVertexAttribPointerv) /* 357 */ \
- OP(Hint) /* 358 */ \
- OP(InvalidateFramebufferImmediate) /* 359 */ \
- OP(InvalidateSubFramebufferImmediate) /* 360 */ \
- OP(IsBuffer) /* 361 */ \
- OP(IsEnabled) /* 362 */ \
- OP(IsFramebuffer) /* 363 */ \
- OP(IsProgram) /* 364 */ \
- OP(IsRenderbuffer) /* 365 */ \
- OP(IsSampler) /* 366 */ \
- OP(IsShader) /* 367 */ \
- OP(IsSync) /* 368 */ \
- OP(IsTexture) /* 369 */ \
- OP(IsTransformFeedback) /* 370 */ \
- OP(LineWidth) /* 371 */ \
- OP(LinkProgram) /* 372 */ \
- OP(PauseTransformFeedback) /* 373 */ \
- OP(PixelStorei) /* 374 */ \
- OP(PolygonOffset) /* 375 */ \
- OP(ReadBuffer) /* 376 */ \
- OP(ReadPixels) /* 377 */ \
- OP(ReleaseShaderCompiler) /* 378 */ \
- OP(RenderbufferStorage) /* 379 */ \
- OP(ResumeTransformFeedback) /* 380 */ \
- OP(SampleCoverage) /* 381 */ \
- OP(SamplerParameterf) /* 382 */ \
- OP(SamplerParameterfvImmediate) /* 383 */ \
- OP(SamplerParameteri) /* 384 */ \
- OP(SamplerParameterivImmediate) /* 385 */ \
- OP(Scissor) /* 386 */ \
- OP(ShaderBinary) /* 387 */ \
- OP(ShaderSourceBucket) /* 388 */ \
- OP(StencilFunc) /* 389 */ \
- OP(StencilFuncSeparate) /* 390 */ \
- OP(StencilMask) /* 391 */ \
- OP(StencilMaskSeparate) /* 392 */ \
- OP(StencilOp) /* 393 */ \
- OP(StencilOpSeparate) /* 394 */ \
- OP(TexImage2D) /* 395 */ \
- OP(TexImage3D) /* 396 */ \
- OP(TexParameterf) /* 397 */ \
- OP(TexParameterfvImmediate) /* 398 */ \
- OP(TexParameteri) /* 399 */ \
- OP(TexParameterivImmediate) /* 400 */ \
- OP(TexStorage3D) /* 401 */ \
- OP(TexSubImage2D) /* 402 */ \
- OP(TexSubImage3D) /* 403 */ \
- OP(Uniform1f) /* 404 */ \
- OP(Uniform1fvImmediate) /* 405 */ \
- OP(Uniform1i) /* 406 */ \
- OP(Uniform1ivImmediate) /* 407 */ \
- OP(Uniform1ui) /* 408 */ \
- OP(Uniform1uivImmediate) /* 409 */ \
- OP(Uniform2f) /* 410 */ \
- OP(Uniform2fvImmediate) /* 411 */ \
- OP(Uniform2i) /* 412 */ \
- OP(Uniform2ivImmediate) /* 413 */ \
- OP(Uniform2ui) /* 414 */ \
- OP(Uniform2uivImmediate) /* 415 */ \
- OP(Uniform3f) /* 416 */ \
- OP(Uniform3fvImmediate) /* 417 */ \
- OP(Uniform3i) /* 418 */ \
- OP(Uniform3ivImmediate) /* 419 */ \
- OP(Uniform3ui) /* 420 */ \
- OP(Uniform3uivImmediate) /* 421 */ \
- OP(Uniform4f) /* 422 */ \
- OP(Uniform4fvImmediate) /* 423 */ \
- OP(Uniform4i) /* 424 */ \
- OP(Uniform4ivImmediate) /* 425 */ \
- OP(Uniform4ui) /* 426 */ \
- OP(Uniform4uivImmediate) /* 427 */ \
- OP(UniformMatrix2fvImmediate) /* 428 */ \
- OP(UniformMatrix2x3fvImmediate) /* 429 */ \
- OP(UniformMatrix2x4fvImmediate) /* 430 */ \
- OP(UniformMatrix3fvImmediate) /* 431 */ \
- OP(UniformMatrix3x2fvImmediate) /* 432 */ \
- OP(UniformMatrix3x4fvImmediate) /* 433 */ \
- OP(UniformMatrix4fvImmediate) /* 434 */ \
- OP(UniformMatrix4x2fvImmediate) /* 435 */ \
- OP(UniformMatrix4x3fvImmediate) /* 436 */ \
- OP(UseProgram) /* 437 */ \
- OP(ValidateProgram) /* 438 */ \
- OP(VertexAttrib1f) /* 439 */ \
- OP(VertexAttrib1fvImmediate) /* 440 */ \
- OP(VertexAttrib2f) /* 441 */ \
- OP(VertexAttrib2fvImmediate) /* 442 */ \
- OP(VertexAttrib3f) /* 443 */ \
- OP(VertexAttrib3fvImmediate) /* 444 */ \
- OP(VertexAttrib4f) /* 445 */ \
- OP(VertexAttrib4fvImmediate) /* 446 */ \
- OP(VertexAttribI4i) /* 447 */ \
- OP(VertexAttribI4ivImmediate) /* 448 */ \
- OP(VertexAttribI4ui) /* 449 */ \
- OP(VertexAttribI4uivImmediate) /* 450 */ \
- OP(VertexAttribIPointer) /* 451 */ \
- OP(VertexAttribPointer) /* 452 */ \
- OP(Viewport) /* 453 */ \
- OP(BlitFramebufferCHROMIUM) /* 454 */ \
- OP(RenderbufferStorageMultisampleCHROMIUM) /* 455 */ \
- OP(RenderbufferStorageMultisampleEXT) /* 456 */ \
- OP(FramebufferTexture2DMultisampleEXT) /* 457 */ \
- OP(TexStorage2DEXT) /* 458 */ \
- OP(GenQueriesEXTImmediate) /* 459 */ \
- OP(DeleteQueriesEXTImmediate) /* 460 */ \
- OP(BeginQueryEXT) /* 461 */ \
- OP(BeginTransformFeedback) /* 462 */ \
- OP(EndQueryEXT) /* 463 */ \
- OP(EndTransformFeedback) /* 464 */ \
- OP(InsertEventMarkerEXT) /* 465 */ \
- OP(PushGroupMarkerEXT) /* 466 */ \
- OP(PopGroupMarkerEXT) /* 467 */ \
- OP(GenVertexArraysOESImmediate) /* 468 */ \
- OP(DeleteVertexArraysOESImmediate) /* 469 */ \
- OP(IsVertexArrayOES) /* 470 */ \
- OP(BindVertexArrayOES) /* 471 */ \
- OP(SwapBuffers) /* 472 */ \
- OP(GetMaxValueInBufferCHROMIUM) /* 473 */ \
- OP(EnableFeatureCHROMIUM) /* 474 */ \
- OP(ResizeCHROMIUM) /* 475 */ \
- OP(GetRequestableExtensionsCHROMIUM) /* 476 */ \
- OP(RequestExtensionCHROMIUM) /* 477 */ \
- OP(GetProgramInfoCHROMIUM) /* 478 */ \
- OP(GetTranslatedShaderSourceANGLE) /* 479 */ \
- OP(PostSubBufferCHROMIUM) /* 480 */ \
- OP(TexImageIOSurface2DCHROMIUM) /* 481 */ \
- OP(CopyTextureCHROMIUM) /* 482 */ \
- OP(DrawArraysInstancedANGLE) /* 483 */ \
- OP(DrawElementsInstancedANGLE) /* 484 */ \
- OP(VertexAttribDivisorANGLE) /* 485 */ \
- OP(GenMailboxCHROMIUM) /* 486 */ \
- OP(ProduceTextureCHROMIUMImmediate) /* 487 */ \
- OP(ProduceTextureDirectCHROMIUMImmediate) /* 488 */ \
- OP(ConsumeTextureCHROMIUMImmediate) /* 489 */ \
- OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 490 */ \
- OP(BindUniformLocationCHROMIUMBucket) /* 491 */ \
- OP(GenValuebuffersCHROMIUMImmediate) /* 492 */ \
- OP(DeleteValuebuffersCHROMIUMImmediate) /* 493 */ \
- OP(IsValuebufferCHROMIUM) /* 494 */ \
- OP(BindValuebufferCHROMIUM) /* 495 */ \
- OP(SubscribeValueCHROMIUM) /* 496 */ \
- OP(PopulateSubscribedValuesCHROMIUM) /* 497 */ \
- OP(UniformValuebufferCHROMIUM) /* 498 */ \
- OP(BindTexImage2DCHROMIUM) /* 499 */ \
- OP(ReleaseTexImage2DCHROMIUM) /* 500 */ \
- OP(TraceBeginCHROMIUM) /* 501 */ \
- OP(TraceEndCHROMIUM) /* 502 */ \
- OP(AsyncTexSubImage2DCHROMIUM) /* 503 */ \
- OP(AsyncTexImage2DCHROMIUM) /* 504 */ \
- OP(WaitAsyncTexImage2DCHROMIUM) /* 505 */ \
- OP(WaitAllAsyncTexImage2DCHROMIUM) /* 506 */ \
- OP(DiscardFramebufferEXTImmediate) /* 507 */ \
- OP(LoseContextCHROMIUM) /* 508 */ \
- OP(InsertSyncPointCHROMIUM) /* 509 */ \
- OP(WaitSyncPointCHROMIUM) /* 510 */ \
- OP(DrawBuffersEXTImmediate) /* 511 */ \
- OP(DiscardBackbufferCHROMIUM) /* 512 */ \
- OP(ScheduleOverlayPlaneCHROMIUM) /* 513 */ \
- OP(SwapInterval) /* 514 */ \
- OP(MatrixLoadfCHROMIUMImmediate) /* 515 */ \
- OP(MatrixLoadIdentityCHROMIUM) /* 516 */ \
- OP(BlendBarrierKHR) /* 517 */
+ OP(CopyTexSubImage3D) /* 292 */ \
+ OP(CreateProgram) /* 293 */ \
+ OP(CreateShader) /* 294 */ \
+ OP(CullFace) /* 295 */ \
+ OP(DeleteBuffersImmediate) /* 296 */ \
+ OP(DeleteFramebuffersImmediate) /* 297 */ \
+ OP(DeleteProgram) /* 298 */ \
+ OP(DeleteRenderbuffersImmediate) /* 299 */ \
+ OP(DeleteSamplersImmediate) /* 300 */ \
+ OP(DeleteSync) /* 301 */ \
+ OP(DeleteShader) /* 302 */ \
+ OP(DeleteTexturesImmediate) /* 303 */ \
+ OP(DeleteTransformFeedbacksImmediate) /* 304 */ \
+ OP(DepthFunc) /* 305 */ \
+ OP(DepthMask) /* 306 */ \
+ OP(DepthRangef) /* 307 */ \
+ OP(DetachShader) /* 308 */ \
+ OP(Disable) /* 309 */ \
+ OP(DisableVertexAttribArray) /* 310 */ \
+ OP(DrawArrays) /* 311 */ \
+ OP(DrawElements) /* 312 */ \
+ OP(Enable) /* 313 */ \
+ OP(EnableVertexAttribArray) /* 314 */ \
+ OP(FenceSync) /* 315 */ \
+ OP(Finish) /* 316 */ \
+ OP(Flush) /* 317 */ \
+ OP(FramebufferRenderbuffer) /* 318 */ \
+ OP(FramebufferTexture2D) /* 319 */ \
+ OP(FramebufferTextureLayer) /* 320 */ \
+ OP(FrontFace) /* 321 */ \
+ OP(GenBuffersImmediate) /* 322 */ \
+ OP(GenerateMipmap) /* 323 */ \
+ OP(GenFramebuffersImmediate) /* 324 */ \
+ OP(GenRenderbuffersImmediate) /* 325 */ \
+ OP(GenSamplersImmediate) /* 326 */ \
+ OP(GenTexturesImmediate) /* 327 */ \
+ OP(GenTransformFeedbacksImmediate) /* 328 */ \
+ OP(GetActiveAttrib) /* 329 */ \
+ OP(GetActiveUniform) /* 330 */ \
+ OP(GetAttachedShaders) /* 331 */ \
+ OP(GetAttribLocation) /* 332 */ \
+ OP(GetBooleanv) /* 333 */ \
+ OP(GetBufferParameteriv) /* 334 */ \
+ OP(GetError) /* 335 */ \
+ OP(GetFloatv) /* 336 */ \
+ OP(GetFragDataLocation) /* 337 */ \
+ OP(GetFramebufferAttachmentParameteriv) /* 338 */ \
+ OP(GetIntegerv) /* 339 */ \
+ OP(GetInternalformativ) /* 340 */ \
+ OP(GetProgramiv) /* 341 */ \
+ OP(GetProgramInfoLog) /* 342 */ \
+ OP(GetRenderbufferParameteriv) /* 343 */ \
+ OP(GetSamplerParameterfv) /* 344 */ \
+ OP(GetSamplerParameteriv) /* 345 */ \
+ OP(GetShaderiv) /* 346 */ \
+ OP(GetShaderInfoLog) /* 347 */ \
+ OP(GetShaderPrecisionFormat) /* 348 */ \
+ OP(GetShaderSource) /* 349 */ \
+ OP(GetString) /* 350 */ \
+ OP(GetTexParameterfv) /* 351 */ \
+ OP(GetTexParameteriv) /* 352 */ \
+ OP(GetUniformfv) /* 353 */ \
+ OP(GetUniformiv) /* 354 */ \
+ OP(GetUniformLocation) /* 355 */ \
+ OP(GetVertexAttribfv) /* 356 */ \
+ OP(GetVertexAttribiv) /* 357 */ \
+ OP(GetVertexAttribPointerv) /* 358 */ \
+ OP(Hint) /* 359 */ \
+ OP(InvalidateFramebufferImmediate) /* 360 */ \
+ OP(InvalidateSubFramebufferImmediate) /* 361 */ \
+ OP(IsBuffer) /* 362 */ \
+ OP(IsEnabled) /* 363 */ \
+ OP(IsFramebuffer) /* 364 */ \
+ OP(IsProgram) /* 365 */ \
+ OP(IsRenderbuffer) /* 366 */ \
+ OP(IsSampler) /* 367 */ \
+ OP(IsShader) /* 368 */ \
+ OP(IsSync) /* 369 */ \
+ OP(IsTexture) /* 370 */ \
+ OP(IsTransformFeedback) /* 371 */ \
+ OP(LineWidth) /* 372 */ \
+ OP(LinkProgram) /* 373 */ \
+ OP(PauseTransformFeedback) /* 374 */ \
+ OP(PixelStorei) /* 375 */ \
+ OP(PolygonOffset) /* 376 */ \
+ OP(ReadBuffer) /* 377 */ \
+ OP(ReadPixels) /* 378 */ \
+ OP(ReleaseShaderCompiler) /* 379 */ \
+ OP(RenderbufferStorage) /* 380 */ \
+ OP(ResumeTransformFeedback) /* 381 */ \
+ OP(SampleCoverage) /* 382 */ \
+ OP(SamplerParameterf) /* 383 */ \
+ OP(SamplerParameterfvImmediate) /* 384 */ \
+ OP(SamplerParameteri) /* 385 */ \
+ OP(SamplerParameterivImmediate) /* 386 */ \
+ OP(Scissor) /* 387 */ \
+ OP(ShaderBinary) /* 388 */ \
+ OP(ShaderSourceBucket) /* 389 */ \
+ OP(StencilFunc) /* 390 */ \
+ OP(StencilFuncSeparate) /* 391 */ \
+ OP(StencilMask) /* 392 */ \
+ OP(StencilMaskSeparate) /* 393 */ \
+ OP(StencilOp) /* 394 */ \
+ OP(StencilOpSeparate) /* 395 */ \
+ OP(TexImage2D) /* 396 */ \
+ OP(TexImage3D) /* 397 */ \
+ OP(TexParameterf) /* 398 */ \
+ OP(TexParameterfvImmediate) /* 399 */ \
+ OP(TexParameteri) /* 400 */ \
+ OP(TexParameterivImmediate) /* 401 */ \
+ OP(TexStorage3D) /* 402 */ \
+ OP(TexSubImage2D) /* 403 */ \
+ OP(TexSubImage3D) /* 404 */ \
+ OP(Uniform1f) /* 405 */ \
+ OP(Uniform1fvImmediate) /* 406 */ \
+ OP(Uniform1i) /* 407 */ \
+ OP(Uniform1ivImmediate) /* 408 */ \
+ OP(Uniform1ui) /* 409 */ \
+ OP(Uniform1uivImmediate) /* 410 */ \
+ OP(Uniform2f) /* 411 */ \
+ OP(Uniform2fvImmediate) /* 412 */ \
+ OP(Uniform2i) /* 413 */ \
+ OP(Uniform2ivImmediate) /* 414 */ \
+ OP(Uniform2ui) /* 415 */ \
+ OP(Uniform2uivImmediate) /* 416 */ \
+ OP(Uniform3f) /* 417 */ \
+ OP(Uniform3fvImmediate) /* 418 */ \
+ OP(Uniform3i) /* 419 */ \
+ OP(Uniform3ivImmediate) /* 420 */ \
+ OP(Uniform3ui) /* 421 */ \
+ OP(Uniform3uivImmediate) /* 422 */ \
+ OP(Uniform4f) /* 423 */ \
+ OP(Uniform4fvImmediate) /* 424 */ \
+ OP(Uniform4i) /* 425 */ \
+ OP(Uniform4ivImmediate) /* 426 */ \
+ OP(Uniform4ui) /* 427 */ \
+ OP(Uniform4uivImmediate) /* 428 */ \
+ OP(UniformMatrix2fvImmediate) /* 429 */ \
+ OP(UniformMatrix2x3fvImmediate) /* 430 */ \
+ OP(UniformMatrix2x4fvImmediate) /* 431 */ \
+ OP(UniformMatrix3fvImmediate) /* 432 */ \
+ OP(UniformMatrix3x2fvImmediate) /* 433 */ \
+ OP(UniformMatrix3x4fvImmediate) /* 434 */ \
+ OP(UniformMatrix4fvImmediate) /* 435 */ \
+ OP(UniformMatrix4x2fvImmediate) /* 436 */ \
+ OP(UniformMatrix4x3fvImmediate) /* 437 */ \
+ OP(UseProgram) /* 438 */ \
+ OP(ValidateProgram) /* 439 */ \
+ OP(VertexAttrib1f) /* 440 */ \
+ OP(VertexAttrib1fvImmediate) /* 441 */ \
+ OP(VertexAttrib2f) /* 442 */ \
+ OP(VertexAttrib2fvImmediate) /* 443 */ \
+ OP(VertexAttrib3f) /* 444 */ \
+ OP(VertexAttrib3fvImmediate) /* 445 */ \
+ OP(VertexAttrib4f) /* 446 */ \
+ OP(VertexAttrib4fvImmediate) /* 447 */ \
+ OP(VertexAttribI4i) /* 448 */ \
+ OP(VertexAttribI4ivImmediate) /* 449 */ \
+ OP(VertexAttribI4ui) /* 450 */ \
+ OP(VertexAttribI4uivImmediate) /* 451 */ \
+ OP(VertexAttribIPointer) /* 452 */ \
+ OP(VertexAttribPointer) /* 453 */ \
+ OP(Viewport) /* 454 */ \
+ OP(BlitFramebufferCHROMIUM) /* 455 */ \
+ OP(RenderbufferStorageMultisampleCHROMIUM) /* 456 */ \
+ OP(RenderbufferStorageMultisampleEXT) /* 457 */ \
+ OP(FramebufferTexture2DMultisampleEXT) /* 458 */ \
+ OP(TexStorage2DEXT) /* 459 */ \
+ OP(GenQueriesEXTImmediate) /* 460 */ \
+ OP(DeleteQueriesEXTImmediate) /* 461 */ \
+ OP(BeginQueryEXT) /* 462 */ \
+ OP(BeginTransformFeedback) /* 463 */ \
+ OP(EndQueryEXT) /* 464 */ \
+ OP(EndTransformFeedback) /* 465 */ \
+ OP(InsertEventMarkerEXT) /* 466 */ \
+ OP(PushGroupMarkerEXT) /* 467 */ \
+ OP(PopGroupMarkerEXT) /* 468 */ \
+ OP(GenVertexArraysOESImmediate) /* 469 */ \
+ OP(DeleteVertexArraysOESImmediate) /* 470 */ \
+ OP(IsVertexArrayOES) /* 471 */ \
+ OP(BindVertexArrayOES) /* 472 */ \
+ OP(SwapBuffers) /* 473 */ \
+ OP(GetMaxValueInBufferCHROMIUM) /* 474 */ \
+ OP(EnableFeatureCHROMIUM) /* 475 */ \
+ OP(ResizeCHROMIUM) /* 476 */ \
+ OP(GetRequestableExtensionsCHROMIUM) /* 477 */ \
+ OP(RequestExtensionCHROMIUM) /* 478 */ \
+ OP(GetProgramInfoCHROMIUM) /* 479 */ \
+ OP(GetTranslatedShaderSourceANGLE) /* 480 */ \
+ OP(PostSubBufferCHROMIUM) /* 481 */ \
+ OP(TexImageIOSurface2DCHROMIUM) /* 482 */ \
+ OP(CopyTextureCHROMIUM) /* 483 */ \
+ OP(DrawArraysInstancedANGLE) /* 484 */ \
+ OP(DrawElementsInstancedANGLE) /* 485 */ \
+ OP(VertexAttribDivisorANGLE) /* 486 */ \
+ OP(GenMailboxCHROMIUM) /* 487 */ \
+ OP(ProduceTextureCHROMIUMImmediate) /* 488 */ \
+ OP(ProduceTextureDirectCHROMIUMImmediate) /* 489 */ \
+ OP(ConsumeTextureCHROMIUMImmediate) /* 490 */ \
+ OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 491 */ \
+ OP(BindUniformLocationCHROMIUMBucket) /* 492 */ \
+ OP(GenValuebuffersCHROMIUMImmediate) /* 493 */ \
+ OP(DeleteValuebuffersCHROMIUMImmediate) /* 494 */ \
+ OP(IsValuebufferCHROMIUM) /* 495 */ \
+ OP(BindValuebufferCHROMIUM) /* 496 */ \
+ OP(SubscribeValueCHROMIUM) /* 497 */ \
+ OP(PopulateSubscribedValuesCHROMIUM) /* 498 */ \
+ OP(UniformValuebufferCHROMIUM) /* 499 */ \
+ OP(BindTexImage2DCHROMIUM) /* 500 */ \
+ OP(ReleaseTexImage2DCHROMIUM) /* 501 */ \
+ OP(TraceBeginCHROMIUM) /* 502 */ \
+ OP(TraceEndCHROMIUM) /* 503 */ \
+ OP(AsyncTexSubImage2DCHROMIUM) /* 504 */ \
+ OP(AsyncTexImage2DCHROMIUM) /* 505 */ \
+ OP(WaitAsyncTexImage2DCHROMIUM) /* 506 */ \
+ OP(WaitAllAsyncTexImage2DCHROMIUM) /* 507 */ \
+ OP(DiscardFramebufferEXTImmediate) /* 508 */ \
+ OP(LoseContextCHROMIUM) /* 509 */ \
+ OP(InsertSyncPointCHROMIUM) /* 510 */ \
+ OP(WaitSyncPointCHROMIUM) /* 511 */ \
+ OP(DrawBuffersEXTImmediate) /* 512 */ \
+ OP(DiscardBackbufferCHROMIUM) /* 513 */ \
+ OP(ScheduleOverlayPlaneCHROMIUM) /* 514 */ \
+ OP(SwapInterval) /* 515 */ \
+ OP(MatrixLoadfCHROMIUMImmediate) /* 516 */ \
+ OP(MatrixLoadIdentityCHROMIUM) /* 517 */ \
+ OP(BlendBarrierKHR) /* 518 */
enum CommandId {
kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this.
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
index a1947f4..86a9c52 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -86,10 +86,6 @@ error::Error GLES2DecoderImpl::HandleBindBufferRange(
GLuint buffer = c.buffer;
GLintptr offset = static_cast<GLintptr>(c.offset);
GLsizeiptr size = static_cast<GLsizeiptr>(c.size);
- if (size < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glBindBufferRange", "size < 0");
- return error::kNoError;
- }
if (!group_->GetBufferServiceId(buffer, &buffer)) {
if (!group_->bind_generates_resource()) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBindBufferRange",
@@ -616,10 +612,6 @@ error::Error GLES2DecoderImpl::HandleCopyBufferSubData(
GLintptr readoffset = static_cast<GLintptr>(c.readoffset);
GLintptr writeoffset = static_cast<GLintptr>(c.writeoffset);
GLsizeiptr size = static_cast<GLsizeiptr>(c.size);
- if (size < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopyBufferSubData", "size < 0");
- return error::kNoError;
- }
glCopyBufferSubData(readtarget, writetarget, readoffset, writeoffset, size);
return error::kNoError;
}
@@ -697,6 +689,32 @@ error::Error GLES2DecoderImpl::HandleCopyTexSubImage2D(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleCopyTexSubImage3D(
+ uint32_t immediate_data_size,
+ const void* cmd_data) {
+ if (!unsafe_es3_apis_enabled())
+ return error::kUnknownCommand;
+ const gles2::cmds::CopyTexSubImage3D& c =
+ *static_cast<const gles2::cmds::CopyTexSubImage3D*>(cmd_data);
+ (void)c;
+ error::Error error;
+ error = WillAccessBoundFramebufferForRead();
+ if (error != error::kNoError)
+ return error;
+ GLenum target = static_cast<GLenum>(c.target);
+ GLint level = static_cast<GLint>(c.level);
+ GLint xoffset = static_cast<GLint>(c.xoffset);
+ GLint yoffset = static_cast<GLint>(c.yoffset);
+ GLint zoffset = static_cast<GLint>(c.zoffset);
+ GLint x = static_cast<GLint>(c.x);
+ GLint y = static_cast<GLint>(c.y);
+ GLsizei width = static_cast<GLsizei>(c.width);
+ GLsizei height = static_cast<GLsizei>(c.height);
+ glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width,
+ height);
+ return error::kNoError;
+}
+
error::Error GLES2DecoderImpl::HandleCreateProgram(uint32_t immediate_data_size,
const void* cmd_data) {
const gles2::cmds::CreateProgram& c =
@@ -1526,11 +1544,6 @@ error::Error GLES2DecoderImpl::HandleGetInternalformativ(
Result* result = GetSharedMemoryAs<Result*>(
c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values));
GLint* params = result ? result->GetData() : NULL;
- if (bufSize < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glGetInternalformativ",
- "bufSize < 0");
- return error::kNoError;
- }
if (params == NULL) {
return error::kOutOfBounds;
}
@@ -1978,16 +1991,6 @@ error::Error GLES2DecoderImpl::HandleInvalidateSubFramebufferImmediate(
if (attachments == NULL) {
return error::kOutOfBounds;
}
- if (width < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glInvalidateSubFramebuffer",
- "width < 0");
- return error::kNoError;
- }
- if (height < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glInvalidateSubFramebuffer",
- "height < 0");
- return error::kNoError;
- }
glInvalidateSubFramebuffer(target, count, attachments, x, y, width, height);
return error::kNoError;
}
@@ -2799,22 +2802,6 @@ error::Error GLES2DecoderImpl::HandleTexStorage3D(uint32_t immediate_data_size,
GLsizei width = static_cast<GLsizei>(c.width);
GLsizei height = static_cast<GLsizei>(c.height);
GLsizei depth = static_cast<GLsizei>(c.depth);
- if (levels < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage3D", "levels < 0");
- return error::kNoError;
- }
- if (width < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage3D", "width < 0");
- return error::kNoError;
- }
- if (height < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage3D", "height < 0");
- return error::kNoError;
- }
- if (depth < 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage3D", "depth < 0");
- return error::kNoError;
- }
glTexStorage3D(target, levels, internalFormat, width, height, depth);
return error::kNoError;
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
index 18a6105..2b6a38f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
@@ -551,6 +551,18 @@ TEST_P(GLES2DecoderTest1, CopyTexSubImage2DInvalidArgs7_0) {
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
+TEST_P(GLES2DecoderTest1, CopyTexSubImage3DValidArgs) {
+ EXPECT_CALL(*gl_, CopyTexSubImage3D(GL_TEXTURE_3D, 2, 3, 4, 5, 6, 7, 8, 9));
+ SpecializedSetup<cmds::CopyTexSubImage3D, 0>(true);
+ cmds::CopyTexSubImage3D cmd;
+ cmd.Init(GL_TEXTURE_3D, 2, 3, 4, 5, 6, 7, 8, 9);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
TEST_P(GLES2DecoderTest1, CreateProgramValidArgs) {
EXPECT_CALL(*gl_, CreateProgram()).WillOnce(Return(kNewServiceId));
SpecializedSetup<cmds::CreateProgram, 0>(true);
@@ -1943,6 +1955,4 @@ TEST_P(GLES2DecoderTest1, GetTexParameterivInvalidArgs2_1) {
}
// TODO(gman): GetUniformfv
-// TODO(gman): GetUniformiv
-
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h
index a5831d6..50db95c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h
@@ -12,6 +12,8 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
+// TODO(gman): GetUniformiv
+
// TODO(gman): GetUniformLocation
TEST_P(GLES2DecoderTest2, GetVertexAttribfvValidArgs) {
@@ -1484,6 +1486,4 @@ TEST_P(GLES2DecoderTest2, VertexAttribI4uivImmediateValidArgs) {
decoder_->set_unsafe_es3_apis_enabled(false);
EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, sizeof(temp)));
}
-// TODO(gman): VertexAttribIPointer
-
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
index 20c09f6..be13c7c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
@@ -12,6 +12,8 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
+// TODO(gman): VertexAttribIPointer
+
// TODO(gman): VertexAttribPointer
TEST_P(GLES2DecoderTest3, ViewportValidArgs) {