summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'gpu')
-rw-r--r--gpu/GLES2/gl2chromium_autogen.h1
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py100
-rw-r--r--gpu/command_buffer/client/client_context_state_autogen.h1
-rw-r--r--gpu/command_buffer/client/client_context_state_impl_autogen.h12
-rw-r--r--gpu/command_buffer/client/gles2_c_lib_autogen.h7
-rw-r--r--gpu/command_buffer/client/gles2_cmd_helper_autogen.h9
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc12
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h1
-rw-r--r--gpu/command_buffer/client/gles2_implementation_autogen.h2
-rw-r--r--gpu/command_buffer/client/gles2_implementation_impl_autogen.h25
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest.cc6
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest_autogen.h194
-rw-r--r--gpu/command_buffer/client/gles2_interface_autogen.h1
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_autogen.h1
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h3
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_autogen.h1
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h5
-rw-r--r--gpu/command_buffer/cmd_buffer_functions.txt1
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format.h1
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_autogen.h49
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_test_autogen.h14
-rw-r--r--gpu/command_buffer/common/gles2_cmd_ids_autogen.h387
-rw-r--r--gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h89
-rw-r--r--gpu/command_buffer/service/context_state.cc30
-rw-r--r--gpu/command_buffer/service/context_state.h6
-rw-r--r--gpu/command_buffer/service/context_state_autogen.h8
-rw-r--r--gpu/command_buffer/service/context_state_impl_autogen.h27
-rw-r--r--gpu/command_buffer/service/feature_info.cc54
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc15
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_autogen.h40
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h1
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h22
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h15
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h14
-rw-r--r--gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h84
35 files changed, 925 insertions, 313 deletions
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h
index c425c52..a6083d6 100644
--- a/gpu/GLES2/gl2chromium_autogen.h
+++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -100,6 +100,7 @@
#define glGetFragDataLocation GLES2_GET_FUN(GetFragDataLocation)
#define glGetFramebufferAttachmentParameteriv \
GLES2_GET_FUN(GetFramebufferAttachmentParameteriv)
+#define glGetInteger64v GLES2_GET_FUN(GetInteger64v)
#define glGetIntegerv GLES2_GET_FUN(GetIntegerv)
#define glGetInternalformativ GLES2_GET_FUN(GetInternalformativ)
#define glGetProgramiv GLES2_GET_FUN(GetProgramiv)
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 1bac988..2a56576 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -83,6 +83,7 @@ _CAPABILITY_FLAGS = [
{'name': 'stencil_test',
'state_flag': 'framebuffer_state_.clear_state_dirty'},
{'name': 'rasterizer_discard', 'es3': True},
+ {'name': 'primitive_restart_fixed_index', 'es3': True},
]
_STATES = {
@@ -735,6 +736,87 @@ _NAMED_TYPE_INFO = {
'GL_VERTEX_ARRAY_BINDING_OES',
'GL_VIEWPORT',
],
+ 'valid_es3': [
+ 'GL_COPY_READ_BUFFER_BINDING',
+ 'GL_COPY_WRITE_BUFFER_BINDING',
+ 'GL_DRAW_BUFFER0',
+ 'GL_DRAW_BUFFER1',
+ 'GL_DRAW_BUFFER2',
+ 'GL_DRAW_BUFFER3',
+ 'GL_DRAW_BUFFER4',
+ 'GL_DRAW_BUFFER5',
+ 'GL_DRAW_BUFFER6',
+ 'GL_DRAW_BUFFER7',
+ 'GL_DRAW_BUFFER8',
+ 'GL_DRAW_BUFFER9',
+ 'GL_DRAW_BUFFER10',
+ 'GL_DRAW_BUFFER11',
+ 'GL_DRAW_BUFFER12',
+ 'GL_DRAW_BUFFER13',
+ 'GL_DRAW_BUFFER14',
+ 'GL_DRAW_BUFFER15',
+ 'GL_DRAW_FRAMEBUFFER_BINDING',
+ 'GL_FRAGMENT_SHADER_DERIVATIVE_HINT',
+ 'GL_MAJOR_VERSION',
+ 'GL_MAX_3D_TEXTURE_SIZE',
+ 'GL_MAX_ARRAY_TEXTURE_LAYERS',
+ 'GL_MAX_COLOR_ATTACHMENTS',
+ 'GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS',
+ 'GL_MAX_COMBINED_UNIFORM_BLOCKS',
+ 'GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS',
+ 'GL_MAX_DRAW_BUFFERS',
+ 'GL_MAX_ELEMENT_INDEX',
+ 'GL_MAX_ELEMENTS_INDICES',
+ 'GL_MAX_ELEMENTS_VERTICES',
+ 'GL_MAX_FRAGMENT_INPUT_COMPONENTS',
+ 'GL_MAX_FRAGMENT_UNIFORM_BLOCKS',
+ 'GL_MAX_FRAGMENT_UNIFORM_COMPONENTS',
+ 'GL_MAX_PROGRAM_TEXEL_OFFSET',
+ 'GL_MAX_SAMPLES',
+ 'GL_MAX_SERVER_WAIT_TIMEOUT',
+ 'GL_MAX_TEXTURE_LOD_BIAS',
+ 'GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS',
+ 'GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS',
+ 'GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS',
+ 'GL_MAX_UNIFORM_BLOCK_SIZE',
+ 'GL_MAX_UNIFORM_BUFFER_BINDINGS',
+ 'GL_MAX_VARYING_COMPONENTS',
+ 'GL_MAX_VERTEX_OUTPUT_COMPONENTS',
+ 'GL_MAX_VERTEX_UNIFORM_BLOCKS',
+ 'GL_MAX_VERTEX_UNIFORM_COMPONENTS',
+ 'GL_MIN_PROGRAM_TEXEL_OFFSET',
+ 'GL_MINOR_VERSION',
+ 'GL_NUM_EXTENSIONS',
+ 'GL_NUM_PROGRAM_BINARY_FORMATS',
+ 'GL_PACK_ROW_LENGTH',
+ 'GL_PACK_SKIP_PIXELS',
+ 'GL_PACK_SKIP_ROWS',
+ 'GL_PIXEL_PACK_BUFFER_BINDING',
+ 'GL_PIXEL_UNPACK_BUFFER_BINDING',
+ 'GL_PROGRAM_BINARY_FORMATS',
+ 'GL_READ_BUFFER',
+ 'GL_READ_FRAMEBUFFER_BINDING',
+ 'GL_SAMPLER_BINDING',
+ 'GL_TEXTURE_BINDING_2D_ARRAY',
+ 'GL_TEXTURE_BINDING_3D',
+ 'GL_TRANSFORM_FEEDBACK_BINDING',
+ 'GL_TRANSFORM_FEEDBACK_ACTIVE',
+ 'GL_TRANSFORM_FEEDBACK_BUFFER_BINDING',
+ 'GL_TRANSFORM_FEEDBACK_PAUSED',
+ 'GL_TRANSFORM_FEEDBACK_BUFFER_SIZE',
+ 'GL_TRANSFORM_FEEDBACK_BUFFER_START',
+ 'GL_UNIFORM_BUFFER_BINDING',
+ 'GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT',
+ 'GL_UNIFORM_BUFFER_SIZE',
+ 'GL_UNIFORM_BUFFER_START',
+ 'GL_UNPACK_IMAGE_HEIGHT',
+ 'GL_UNPACK_ROW_LENGTH',
+ 'GL_UNPACK_SKIP_IMAGES',
+ 'GL_UNPACK_SKIP_PIXELS',
+ 'GL_UNPACK_SKIP_ROWS',
+ # GL_VERTEX_ARRAY_BINDING is the same as GL_VERTEX_ARRAY_BINDING_OES
+ # 'GL_VERTEX_ARRAY_BINDING',
+ ],
'invalid': [
'GL_FOG_HINT',
],
@@ -2367,6 +2449,13 @@ _FUNCTION_INFO = {
'gl_test_func': 'glGetFramebufferAttachmentParameterivEXT',
'result': ['SizedResult<GLint>'],
},
+ 'GetInteger64v': {
+ 'type': 'GETn',
+ 'result': ['SizedResult<GLint64>'],
+ 'client_test': False,
+ 'decoder_func': 'DoGetInteger64v',
+ 'unsafe': True
+ },
'GetIntegerv': {
'type': 'GETn',
'result': ['SizedResult<GLint>'],
@@ -6054,17 +6143,18 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
struct Cmds {
cmds::%(name)s cmd;
};
- typedef cmds::%(name)s::Result Result;
- Result::Type result = 0;
+ typedef cmds::%(name)s::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 = GetExpectedResultMemory(
+ sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(%(cmd_args)s, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->%(name)s(%(args)s, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
"""
first_cmd_arg = func.GetCmdArgs()[0].GetValidNonCachedClientSideCmdArg(func)
diff --git a/gpu/command_buffer/client/client_context_state_autogen.h b/gpu/command_buffer/client/client_context_state_autogen.h
index aa4b8fd..3084fb3 100644
--- a/gpu/command_buffer/client/client_context_state_autogen.h
+++ b/gpu/command_buffer/client/client_context_state_autogen.h
@@ -24,6 +24,7 @@ struct EnableFlags {
bool scissor_test;
bool stencil_test;
bool rasterizer_discard;
+ bool primitive_restart_fixed_index;
};
#endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/client_context_state_impl_autogen.h b/gpu/command_buffer/client/client_context_state_impl_autogen.h
index d0ce722..036f92c 100644
--- a/gpu/command_buffer/client/client_context_state_impl_autogen.h
+++ b/gpu/command_buffer/client/client_context_state_impl_autogen.h
@@ -22,7 +22,8 @@ ClientContextState::EnableFlags::EnableFlags()
sample_coverage(false),
scissor_test(false),
stencil_test(false),
- rasterizer_discard(false) {
+ rasterizer_discard(false),
+ primitive_restart_fixed_index(false) {
}
bool ClientContextState::SetCapabilityState(GLenum cap,
@@ -90,6 +91,12 @@ bool ClientContextState::SetCapabilityState(GLenum cap,
enable_flags.rasterizer_discard = enabled;
}
return true;
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+ if (enable_flags.primitive_restart_fixed_index != enabled) {
+ *changed = true;
+ enable_flags.primitive_restart_fixed_index = enabled;
+ }
+ return true;
default:
return false;
}
@@ -126,6 +133,9 @@ bool ClientContextState::GetEnabled(GLenum cap, bool* enabled) const {
case GL_RASTERIZER_DISCARD:
*enabled = enable_flags.rasterizer_discard;
return true;
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+ *enabled = enable_flags.primitive_restart_fixed_index;
+ return true;
default:
return false;
}
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h
index ff3dde1..f03d224 100644
--- a/gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -403,6 +403,9 @@ void GLES2GetFramebufferAttachmentParameteriv(GLenum target,
gles2::GetGLContext()->GetFramebufferAttachmentParameteriv(target, attachment,
pname, params);
}
+void GLES2GetInteger64v(GLenum pname, GLint64* params) {
+ gles2::GetGLContext()->GetInteger64v(pname, params);
+}
void GLES2GetIntegerv(GLenum pname, GLint* params) {
gles2::GetGLContext()->GetIntegerv(pname, params);
}
@@ -1696,6 +1699,10 @@ extern const NameToFunc g_gles2_function_table[] = {
glGetFramebufferAttachmentParameteriv),
},
{
+ "glGetInteger64v",
+ reinterpret_cast<GLES2FunctionPointer>(glGetInteger64v),
+ },
+ {
"glGetIntegerv",
reinterpret_cast<GLES2FunctionPointer>(glGetIntegerv),
},
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index bd40e41..a798425 100644
--- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -833,6 +833,15 @@ void GetFramebufferAttachmentParameteriv(GLenum target,
}
}
+void GetInteger64v(GLenum pname,
+ uint32_t params_shm_id,
+ uint32_t params_shm_offset) {
+ gles2::cmds::GetInteger64v* c = GetCmdSpace<gles2::cmds::GetInteger64v>();
+ if (c) {
+ c->Init(pname, params_shm_id, params_shm_offset);
+ }
+}
+
void GetIntegerv(GLenum pname,
uint32_t params_shm_id,
uint32_t params_shm_offset) {
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 766f522..e5d78f1 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -740,6 +740,7 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) {
case GL_SAMPLES:
case GL_SCISSOR_BOX:
case GL_SCISSOR_TEST:
+ case GL_SHADER_BINARY_FORMATS:
case GL_SHADER_COMPILER:
case GL_STENCIL_BACK_FAIL:
case GL_STENCIL_BACK_FUNC:
@@ -899,7 +900,6 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) {
case GL_READ_BUFFER:
case GL_READ_FRAMEBUFFER_BINDING:
case GL_SAMPLER_BINDING:
- case GL_SHADER_BINARY_FORMATS:
case GL_TEXTURE_BINDING_2D_ARRAY:
case GL_TEXTURE_BINDING_3D:
case GL_TRANSFORM_FEEDBACK_BINDING:
@@ -943,6 +943,16 @@ bool GLES2Implementation::GetFloatvHelper(GLenum pname, GLfloat* params) {
return true;
}
+bool GLES2Implementation::GetInteger64vHelper(GLenum pname, GLint64* params) {
+ // TODO(zmo): we limit values to 32-bit, which is OK for now.
+ GLint value;
+ if (!GetHelper(pname, &value)) {
+ return false;
+ }
+ *params = value;
+ return true;
+}
+
bool GLES2Implementation::GetIntegervHelper(GLenum pname, GLint* params) {
return GetHelper(pname, params);
}
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 39b5870..2c50624 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -566,6 +566,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
bool GetFloatvHelper(GLenum pname, GLfloat* params);
bool GetFramebufferAttachmentParameterivHelper(
GLenum target, GLenum attachment, GLenum pname, GLint* params);
+ bool GetInteger64vHelper(GLenum pname, GLint64* params);
bool GetIntegervHelper(GLenum pname, GLint* params);
bool GetInternalformativHelper(
GLenum target, GLenum format, GLenum pname, GLsizei bufSize,
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index 24236bc..e5672a8 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -303,6 +303,8 @@ void GetFramebufferAttachmentParameteriv(GLenum target,
GLenum pname,
GLint* params) override;
+void GetInteger64v(GLenum pname, GLint64* params) override;
+
void GetIntegerv(GLenum pname, GLint* params) override;
void GetInternalformativ(GLenum target,
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index 98447bf..918db99 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -996,6 +996,31 @@ void GLES2Implementation::GetFramebufferAttachmentParameteriv(GLenum target,
});
CheckGLError();
}
+void GLES2Implementation::GetInteger64v(GLenum pname, GLint64* params) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetInteger64v("
+ << GLES2Util::GetStringGLState(pname) << ", "
+ << static_cast<const void*>(params) << ")");
+ TRACE_EVENT0("gpu", "GLES2Implementation::GetInteger64v");
+ if (GetInteger64vHelper(pname, params)) {
+ return;
+ }
+ typedef cmds::GetInteger64v::Result Result;
+ Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return;
+ }
+ result->SetNumResults(0);
+ helper_->GetInteger64v(pname, GetResultShmId(), GetResultShmOffset());
+ WaitForCmd();
+ result->CopyResult(params);
+ GPU_CLIENT_LOG_CODE_BLOCK({
+ for (int32_t i = 0; i < result->GetNumResults(); ++i) {
+ GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
+ }
+ });
+ CheckGLError();
+}
void GLES2Implementation::GetIntegerv(GLenum pname, GLint* params) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 4fecbbc..0b02f94 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -51,13 +51,13 @@ template <typename T>
class SizedResultHelper {
public:
explicit SizedResultHelper(T result)
- : size_(sizeof(result)),
- result_(result) {
+ : size_(sizeof(result)) {
+ memcpy(result_, &result, sizeof(T));
}
private:
uint32 size_;
- T result_;
+ char result_[sizeof(T)];
};
// Struct to make it easy to pass a vec4 worth of floats.
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index a0c908f..51aea3a 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -763,51 +763,54 @@ TEST_F(GLES2ImplementationTest, GetBooleanv) {
struct Cmds {
cmds::GetBooleanv cmd;
};
- typedef cmds::GetBooleanv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetBooleanv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetBooleanv(123, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetBufferParameteriv) {
struct Cmds {
cmds::GetBufferParameteriv cmd;
};
- typedef cmds::GetBufferParameteriv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetBufferParameteriv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_BUFFER_SIZE, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetBufferParameteriv(123, GL_BUFFER_SIZE, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetFloatv) {
struct Cmds {
cmds::GetFloatv cmd;
};
- typedef cmds::GetFloatv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetFloatv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetFloatv(123, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
// TODO(zmo): Implement unit test for GetFragDataLocation
@@ -815,73 +818,95 @@ TEST_F(GLES2ImplementationTest, GetFramebufferAttachmentParameteriv) {
struct Cmds {
cmds::GetFramebufferAttachmentParameteriv cmd;
};
- typedef cmds::GetFramebufferAttachmentParameteriv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetFramebufferAttachmentParameteriv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_COLOR_ATTACHMENT0,
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, result1.id,
result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetFramebufferAttachmentParameteriv(
123, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,
&result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
+}
+
+TEST_F(GLES2ImplementationTest, GetInteger64v) {
+ struct Cmds {
+ cmds::GetInteger64v cmd;
+ };
+ typedef cmds::GetInteger64v::Result::Type ResultType;
+ ResultType result = 0;
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
+ expected.cmd.Init(123, result1.id, result1.offset);
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
+ .RetiresOnSaturation();
+ gl_->GetInteger64v(123, &result);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetIntegerv) {
struct Cmds {
cmds::GetIntegerv cmd;
};
- typedef cmds::GetIntegerv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetIntegerv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetIntegerv(123, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetInternalformativ) {
struct Cmds {
cmds::GetInternalformativ cmd;
};
- typedef cmds::GetInternalformativ::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetInternalformativ::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_RGBA4, GL_RENDERBUFFER_RED_SIZE, 4, result1.id,
result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetInternalformativ(123, GL_RGBA4, GL_RENDERBUFFER_RED_SIZE, 4, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetProgramiv) {
struct Cmds {
cmds::GetProgramiv cmd;
};
- typedef cmds::GetProgramiv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetProgramiv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_DELETE_STATUS, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetProgramiv(123, GL_DELETE_STATUS, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
// TODO(zmo): Implement unit test for GetProgramInfoLog
@@ -889,68 +914,72 @@ TEST_F(GLES2ImplementationTest, GetRenderbufferParameteriv) {
struct Cmds {
cmds::GetRenderbufferParameteriv cmd;
};
- typedef cmds::GetRenderbufferParameteriv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetRenderbufferParameteriv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_RENDERBUFFER_RED_SIZE, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetRenderbufferParameteriv(123, GL_RENDERBUFFER_RED_SIZE, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetSamplerParameterfv) {
struct Cmds {
cmds::GetSamplerParameterfv cmd;
};
- typedef cmds::GetSamplerParameterfv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetSamplerParameterfv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetSamplerParameterfv(123, GL_TEXTURE_MAG_FILTER, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetSamplerParameteriv) {
struct Cmds {
cmds::GetSamplerParameteriv cmd;
};
- typedef cmds::GetSamplerParameteriv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetSamplerParameteriv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetSamplerParameteriv(123, GL_TEXTURE_MAG_FILTER, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetShaderiv) {
struct Cmds {
cmds::GetShaderiv cmd;
};
- typedef cmds::GetShaderiv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetShaderiv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_SHADER_TYPE, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetShaderiv(123, GL_SHADER_TYPE, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
// TODO(zmo): Implement unit test for GetShaderInfoLog
// TODO(zmo): Implement unit test for GetShaderPrecisionFormat
@@ -959,52 +988,55 @@ TEST_F(GLES2ImplementationTest, GetSynciv) {
struct Cmds {
cmds::GetSynciv cmd;
};
- typedef cmds::GetSynciv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetSynciv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_SYNC_STATUS, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetSynciv(reinterpret_cast<GLsync>(123), GL_SYNC_STATUS, 3, nullptr,
&result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetTexParameterfv) {
struct Cmds {
cmds::GetTexParameterfv cmd;
};
- typedef cmds::GetTexParameterfv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetTexParameterfv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetTexParameterfv(123, GL_TEXTURE_MAG_FILTER, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetTexParameteriv) {
struct Cmds {
cmds::GetTexParameteriv cmd;
};
- typedef cmds::GetTexParameteriv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetTexParameteriv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetTexParameteriv(123, GL_TEXTURE_MAG_FILTER, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
// TODO(zmo): Implement unit test for GetTransformFeedbackVarying
// TODO(zmo): Implement unit test for GetUniformBlockIndex
@@ -1017,36 +1049,38 @@ TEST_F(GLES2ImplementationTest, GetVertexAttribfv) {
struct Cmds {
cmds::GetVertexAttribfv cmd;
};
- typedef cmds::GetVertexAttribfv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetVertexAttribfv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id,
result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetVertexAttribfv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, GetVertexAttribiv) {
struct Cmds {
cmds::GetVertexAttribiv cmd;
};
- typedef cmds::GetVertexAttribiv::Result Result;
- Result::Type result = 0;
+ typedef cmds::GetVertexAttribiv::Result::Type ResultType;
+ ResultType result = 0;
Cmds expected;
- ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
expected.cmd.Init(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, result1.id,
result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+ .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
.RetiresOnSaturation();
gl_->GetVertexAttribiv(123, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &result);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
- EXPECT_EQ(static_cast<Result::Type>(1), result);
+ EXPECT_EQ(static_cast<ResultType>(1), result);
}
TEST_F(GLES2ImplementationTest, Hint) {
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h
index 3da9e22..c4be43e 100644
--- a/gpu/command_buffer/client/gles2_interface_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -225,6 +225,7 @@ virtual void GetFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname,
GLint* params) = 0;
+virtual void GetInteger64v(GLenum pname, GLint64* params) = 0;
virtual void GetIntegerv(GLenum pname, GLint* params) = 0;
virtual void GetInternalformativ(GLenum target,
GLenum format,
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
index 14ac101..6dad2b3 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -220,6 +220,7 @@ void GetFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname,
GLint* params) override;
+void GetInteger64v(GLenum pname, GLint64* params) override;
void GetIntegerv(GLenum pname, GLint* params) override;
void GetInternalformativ(GLenum target,
GLenum format,
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 7b9569d..5e34714 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -346,6 +346,9 @@ void GLES2InterfaceStub::GetFramebufferAttachmentParameteriv(
GLenum /* pname */,
GLint* /* params */) {
}
+void GLES2InterfaceStub::GetInteger64v(GLenum /* pname */,
+ GLint64* /* params */) {
+}
void GLES2InterfaceStub::GetIntegerv(GLenum /* pname */, GLint* /* params */) {
}
void GLES2InterfaceStub::GetInternalformativ(GLenum /* target */,
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index 1e5660e..26a6a22 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -220,6 +220,7 @@ void GetFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname,
GLint* params) override;
+void GetInteger64v(GLenum pname, GLint64* params) override;
void GetIntegerv(GLenum pname, GLint* params) override;
void GetInternalformativ(GLenum target,
GLenum format,
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 627c90e..e650034 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -595,6 +595,11 @@ void GLES2TraceImplementation::GetFramebufferAttachmentParameteriv(
gl_->GetFramebufferAttachmentParameteriv(target, attachment, pname, params);
}
+void GLES2TraceImplementation::GetInteger64v(GLenum pname, GLint64* params) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GetInteger64v");
+ gl_->GetInteger64v(pname, params);
+}
+
void GLES2TraceImplementation::GetIntegerv(GLenum pname, GLint* params) {
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GetIntegerv");
gl_->GetIntegerv(pname, params);
diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt
index 87eed68..c008678 100644
--- a/gpu/command_buffer/cmd_buffer_functions.txt
+++ b/gpu/command_buffer/cmd_buffer_functions.txt
@@ -90,6 +90,7 @@ GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenumGLState pname, GLfloat* params);
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 glGetInteger64v (GLenumGLState pname, GLint64* params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenumGLState pname, 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);
diff --git a/gpu/command_buffer/common/gles2_cmd_format.h b/gpu/command_buffer/common/gles2_cmd_format.h
index d0faf14..0cf77e7 100644
--- a/gpu/command_buffer/common/gles2_cmd_format.h
+++ b/gpu/command_buffer/common/gles2_cmd_format.h
@@ -43,6 +43,7 @@ typedef void GLvoid;
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
typedef struct __GLsync *GLsync;
+typedef int64_t GLint64;
typedef uint64_t GLuint64;
namespace gpu {
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index a829dcb..ab93ed5 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -4050,6 +4050,55 @@ static_assert(offsetof(GetFramebufferAttachmentParameteriv,
"offset of GetFramebufferAttachmentParameteriv params_shm_offset "
"should be 20");
+struct GetInteger64v {
+ typedef GetInteger64v ValueType;
+ static const CommandId kCmdId = kGetInteger64v;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3);
+
+ typedef SizedResult<GLint64> Result;
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLenum _pname,
+ uint32_t _params_shm_id,
+ uint32_t _params_shm_offset) {
+ SetHeader();
+ pname = _pname;
+ params_shm_id = _params_shm_id;
+ params_shm_offset = _params_shm_offset;
+ }
+
+ void* Set(void* cmd,
+ GLenum _pname,
+ uint32_t _params_shm_id,
+ uint32_t _params_shm_offset) {
+ static_cast<ValueType*>(cmd)
+ ->Init(_pname, _params_shm_id, _params_shm_offset);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t pname;
+ uint32_t params_shm_id;
+ uint32_t params_shm_offset;
+};
+
+static_assert(sizeof(GetInteger64v) == 16,
+ "size of GetInteger64v should be 16");
+static_assert(offsetof(GetInteger64v, header) == 0,
+ "offset of GetInteger64v header should be 0");
+static_assert(offsetof(GetInteger64v, pname) == 4,
+ "offset of GetInteger64v pname should be 4");
+static_assert(offsetof(GetInteger64v, params_shm_id) == 8,
+ "offset of GetInteger64v params_shm_id should be 8");
+static_assert(offsetof(GetInteger64v, params_shm_offset) == 12,
+ "offset of GetInteger64v params_shm_offset should be 12");
+
struct GetIntegerv {
typedef GetIntegerv ValueType;
static const CommandId kCmdId = kGetIntegerv;
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 d14f48df..2cc8dd9 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -1283,6 +1283,20 @@ TEST_F(GLES2FormatTest, GetFramebufferAttachmentParameteriv) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, GetInteger64v) {
+ cmds::GetInteger64v& cmd = *GetBufferAs<cmds::GetInteger64v>();
+ void* next_cmd =
+ cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<uint32_t>(12),
+ static_cast<uint32_t>(13));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GetInteger64v::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLenum>(11), cmd.pname);
+ EXPECT_EQ(static_cast<uint32_t>(12), cmd.params_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.params_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, GetIntegerv) {
cmds::GetIntegerv& cmd = *GetBufferAs<cmds::GetIntegerv>();
void* next_cmd =
diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
index ea62be1..993a6c3 100644
--- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -99,199 +99,200 @@
OP(GetFloatv) /* 340 */ \
OP(GetFragDataLocation) /* 341 */ \
OP(GetFramebufferAttachmentParameteriv) /* 342 */ \
- OP(GetIntegerv) /* 343 */ \
- OP(GetInternalformativ) /* 344 */ \
- OP(GetProgramiv) /* 345 */ \
- OP(GetProgramInfoLog) /* 346 */ \
- OP(GetRenderbufferParameteriv) /* 347 */ \
- OP(GetSamplerParameterfv) /* 348 */ \
- OP(GetSamplerParameteriv) /* 349 */ \
- OP(GetShaderiv) /* 350 */ \
- OP(GetShaderInfoLog) /* 351 */ \
- OP(GetShaderPrecisionFormat) /* 352 */ \
- OP(GetShaderSource) /* 353 */ \
- OP(GetString) /* 354 */ \
- OP(GetSynciv) /* 355 */ \
- OP(GetTexParameterfv) /* 356 */ \
- OP(GetTexParameteriv) /* 357 */ \
- OP(GetTransformFeedbackVarying) /* 358 */ \
- OP(GetUniformBlockIndex) /* 359 */ \
- OP(GetUniformfv) /* 360 */ \
- OP(GetUniformiv) /* 361 */ \
- OP(GetUniformIndices) /* 362 */ \
- OP(GetUniformLocation) /* 363 */ \
- OP(GetVertexAttribfv) /* 364 */ \
- OP(GetVertexAttribiv) /* 365 */ \
- OP(GetVertexAttribPointerv) /* 366 */ \
- OP(Hint) /* 367 */ \
- OP(InvalidateFramebufferImmediate) /* 368 */ \
- OP(InvalidateSubFramebufferImmediate) /* 369 */ \
- OP(IsBuffer) /* 370 */ \
- OP(IsEnabled) /* 371 */ \
- OP(IsFramebuffer) /* 372 */ \
- OP(IsProgram) /* 373 */ \
- OP(IsRenderbuffer) /* 374 */ \
- OP(IsSampler) /* 375 */ \
- OP(IsShader) /* 376 */ \
- OP(IsSync) /* 377 */ \
- OP(IsTexture) /* 378 */ \
- OP(IsTransformFeedback) /* 379 */ \
- OP(LineWidth) /* 380 */ \
- OP(LinkProgram) /* 381 */ \
- OP(PauseTransformFeedback) /* 382 */ \
- OP(PixelStorei) /* 383 */ \
- OP(PolygonOffset) /* 384 */ \
- OP(ReadBuffer) /* 385 */ \
- OP(ReadPixels) /* 386 */ \
- OP(ReleaseShaderCompiler) /* 387 */ \
- OP(RenderbufferStorage) /* 388 */ \
- OP(ResumeTransformFeedback) /* 389 */ \
- OP(SampleCoverage) /* 390 */ \
- OP(SamplerParameterf) /* 391 */ \
- OP(SamplerParameterfvImmediate) /* 392 */ \
- OP(SamplerParameteri) /* 393 */ \
- OP(SamplerParameterivImmediate) /* 394 */ \
- OP(Scissor) /* 395 */ \
- OP(ShaderBinary) /* 396 */ \
- OP(ShaderSourceBucket) /* 397 */ \
- OP(StencilFunc) /* 398 */ \
- OP(StencilFuncSeparate) /* 399 */ \
- OP(StencilMask) /* 400 */ \
- OP(StencilMaskSeparate) /* 401 */ \
- OP(StencilOp) /* 402 */ \
- OP(StencilOpSeparate) /* 403 */ \
- OP(TexImage2D) /* 404 */ \
- OP(TexImage3D) /* 405 */ \
- OP(TexParameterf) /* 406 */ \
- OP(TexParameterfvImmediate) /* 407 */ \
- OP(TexParameteri) /* 408 */ \
- OP(TexParameterivImmediate) /* 409 */ \
- OP(TexStorage3D) /* 410 */ \
- OP(TexSubImage2D) /* 411 */ \
- OP(TexSubImage3D) /* 412 */ \
- OP(TransformFeedbackVaryingsBucket) /* 413 */ \
- OP(Uniform1f) /* 414 */ \
- OP(Uniform1fvImmediate) /* 415 */ \
- OP(Uniform1i) /* 416 */ \
- OP(Uniform1ivImmediate) /* 417 */ \
- OP(Uniform1ui) /* 418 */ \
- OP(Uniform1uivImmediate) /* 419 */ \
- OP(Uniform2f) /* 420 */ \
- OP(Uniform2fvImmediate) /* 421 */ \
- OP(Uniform2i) /* 422 */ \
- OP(Uniform2ivImmediate) /* 423 */ \
- OP(Uniform2ui) /* 424 */ \
- OP(Uniform2uivImmediate) /* 425 */ \
- OP(Uniform3f) /* 426 */ \
- OP(Uniform3fvImmediate) /* 427 */ \
- OP(Uniform3i) /* 428 */ \
- OP(Uniform3ivImmediate) /* 429 */ \
- OP(Uniform3ui) /* 430 */ \
- OP(Uniform3uivImmediate) /* 431 */ \
- OP(Uniform4f) /* 432 */ \
- OP(Uniform4fvImmediate) /* 433 */ \
- OP(Uniform4i) /* 434 */ \
- OP(Uniform4ivImmediate) /* 435 */ \
- OP(Uniform4ui) /* 436 */ \
- OP(Uniform4uivImmediate) /* 437 */ \
- OP(UniformBlockBinding) /* 438 */ \
- OP(UniformMatrix2fvImmediate) /* 439 */ \
- OP(UniformMatrix2x3fvImmediate) /* 440 */ \
- OP(UniformMatrix2x4fvImmediate) /* 441 */ \
- OP(UniformMatrix3fvImmediate) /* 442 */ \
- OP(UniformMatrix3x2fvImmediate) /* 443 */ \
- OP(UniformMatrix3x4fvImmediate) /* 444 */ \
- OP(UniformMatrix4fvImmediate) /* 445 */ \
- OP(UniformMatrix4x2fvImmediate) /* 446 */ \
- OP(UniformMatrix4x3fvImmediate) /* 447 */ \
- OP(UseProgram) /* 448 */ \
- OP(ValidateProgram) /* 449 */ \
- OP(VertexAttrib1f) /* 450 */ \
- OP(VertexAttrib1fvImmediate) /* 451 */ \
- OP(VertexAttrib2f) /* 452 */ \
- OP(VertexAttrib2fvImmediate) /* 453 */ \
- OP(VertexAttrib3f) /* 454 */ \
- OP(VertexAttrib3fvImmediate) /* 455 */ \
- OP(VertexAttrib4f) /* 456 */ \
- OP(VertexAttrib4fvImmediate) /* 457 */ \
- OP(VertexAttribI4i) /* 458 */ \
- OP(VertexAttribI4ivImmediate) /* 459 */ \
- OP(VertexAttribI4ui) /* 460 */ \
- OP(VertexAttribI4uivImmediate) /* 461 */ \
- OP(VertexAttribIPointer) /* 462 */ \
- OP(VertexAttribPointer) /* 463 */ \
- OP(Viewport) /* 464 */ \
- OP(WaitSync) /* 465 */ \
- OP(BlitFramebufferCHROMIUM) /* 466 */ \
- OP(RenderbufferStorageMultisampleCHROMIUM) /* 467 */ \
- OP(RenderbufferStorageMultisampleEXT) /* 468 */ \
- OP(FramebufferTexture2DMultisampleEXT) /* 469 */ \
- OP(TexStorage2DEXT) /* 470 */ \
- OP(GenQueriesEXTImmediate) /* 471 */ \
- OP(DeleteQueriesEXTImmediate) /* 472 */ \
- OP(BeginQueryEXT) /* 473 */ \
- OP(BeginTransformFeedback) /* 474 */ \
- OP(EndQueryEXT) /* 475 */ \
- OP(EndTransformFeedback) /* 476 */ \
- OP(InsertEventMarkerEXT) /* 477 */ \
- OP(PushGroupMarkerEXT) /* 478 */ \
- OP(PopGroupMarkerEXT) /* 479 */ \
- OP(GenVertexArraysOESImmediate) /* 480 */ \
- OP(DeleteVertexArraysOESImmediate) /* 481 */ \
- OP(IsVertexArrayOES) /* 482 */ \
- OP(BindVertexArrayOES) /* 483 */ \
- OP(SwapBuffers) /* 484 */ \
- OP(GetMaxValueInBufferCHROMIUM) /* 485 */ \
- OP(EnableFeatureCHROMIUM) /* 486 */ \
- OP(MapBufferRange) /* 487 */ \
- OP(UnmapBuffer) /* 488 */ \
- OP(ResizeCHROMIUM) /* 489 */ \
- OP(GetRequestableExtensionsCHROMIUM) /* 490 */ \
- OP(RequestExtensionCHROMIUM) /* 491 */ \
- OP(GetProgramInfoCHROMIUM) /* 492 */ \
- OP(GetUniformBlocksCHROMIUM) /* 493 */ \
- OP(GetTransformFeedbackVaryingsCHROMIUM) /* 494 */ \
- OP(GetUniformsES3CHROMIUM) /* 495 */ \
- OP(GetTranslatedShaderSourceANGLE) /* 496 */ \
- OP(PostSubBufferCHROMIUM) /* 497 */ \
- OP(TexImageIOSurface2DCHROMIUM) /* 498 */ \
- OP(CopyTextureCHROMIUM) /* 499 */ \
- OP(CopySubTextureCHROMIUM) /* 500 */ \
- OP(DrawArraysInstancedANGLE) /* 501 */ \
- OP(DrawElementsInstancedANGLE) /* 502 */ \
- OP(VertexAttribDivisorANGLE) /* 503 */ \
- OP(GenMailboxCHROMIUM) /* 504 */ \
- OP(ProduceTextureCHROMIUMImmediate) /* 505 */ \
- OP(ProduceTextureDirectCHROMIUMImmediate) /* 506 */ \
- OP(ConsumeTextureCHROMIUMImmediate) /* 507 */ \
- OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 508 */ \
- OP(BindUniformLocationCHROMIUMBucket) /* 509 */ \
- OP(GenValuebuffersCHROMIUMImmediate) /* 510 */ \
- OP(DeleteValuebuffersCHROMIUMImmediate) /* 511 */ \
- OP(IsValuebufferCHROMIUM) /* 512 */ \
- OP(BindValuebufferCHROMIUM) /* 513 */ \
- OP(SubscribeValueCHROMIUM) /* 514 */ \
- OP(PopulateSubscribedValuesCHROMIUM) /* 515 */ \
- OP(UniformValuebufferCHROMIUM) /* 516 */ \
- OP(BindTexImage2DCHROMIUM) /* 517 */ \
- OP(ReleaseTexImage2DCHROMIUM) /* 518 */ \
- OP(TraceBeginCHROMIUM) /* 519 */ \
- OP(TraceEndCHROMIUM) /* 520 */ \
- OP(AsyncTexSubImage2DCHROMIUM) /* 521 */ \
- OP(AsyncTexImage2DCHROMIUM) /* 522 */ \
- OP(WaitAsyncTexImage2DCHROMIUM) /* 523 */ \
- OP(WaitAllAsyncTexImage2DCHROMIUM) /* 524 */ \
- OP(DiscardFramebufferEXTImmediate) /* 525 */ \
- OP(LoseContextCHROMIUM) /* 526 */ \
- OP(InsertSyncPointCHROMIUM) /* 527 */ \
- OP(WaitSyncPointCHROMIUM) /* 528 */ \
- OP(DrawBuffersEXTImmediate) /* 529 */ \
- OP(DiscardBackbufferCHROMIUM) /* 530 */ \
- OP(ScheduleOverlayPlaneCHROMIUM) /* 531 */ \
- OP(SwapInterval) /* 532 */ \
- OP(MatrixLoadfCHROMIUMImmediate) /* 533 */ \
- OP(MatrixLoadIdentityCHROMIUM) /* 534 */ \
- OP(BlendBarrierKHR) /* 535 */
+ OP(GetInteger64v) /* 343 */ \
+ OP(GetIntegerv) /* 344 */ \
+ OP(GetInternalformativ) /* 345 */ \
+ OP(GetProgramiv) /* 346 */ \
+ OP(GetProgramInfoLog) /* 347 */ \
+ OP(GetRenderbufferParameteriv) /* 348 */ \
+ OP(GetSamplerParameterfv) /* 349 */ \
+ OP(GetSamplerParameteriv) /* 350 */ \
+ OP(GetShaderiv) /* 351 */ \
+ OP(GetShaderInfoLog) /* 352 */ \
+ OP(GetShaderPrecisionFormat) /* 353 */ \
+ OP(GetShaderSource) /* 354 */ \
+ OP(GetString) /* 355 */ \
+ OP(GetSynciv) /* 356 */ \
+ OP(GetTexParameterfv) /* 357 */ \
+ OP(GetTexParameteriv) /* 358 */ \
+ OP(GetTransformFeedbackVarying) /* 359 */ \
+ OP(GetUniformBlockIndex) /* 360 */ \
+ OP(GetUniformfv) /* 361 */ \
+ OP(GetUniformiv) /* 362 */ \
+ OP(GetUniformIndices) /* 363 */ \
+ OP(GetUniformLocation) /* 364 */ \
+ OP(GetVertexAttribfv) /* 365 */ \
+ OP(GetVertexAttribiv) /* 366 */ \
+ OP(GetVertexAttribPointerv) /* 367 */ \
+ OP(Hint) /* 368 */ \
+ OP(InvalidateFramebufferImmediate) /* 369 */ \
+ OP(InvalidateSubFramebufferImmediate) /* 370 */ \
+ OP(IsBuffer) /* 371 */ \
+ OP(IsEnabled) /* 372 */ \
+ OP(IsFramebuffer) /* 373 */ \
+ OP(IsProgram) /* 374 */ \
+ OP(IsRenderbuffer) /* 375 */ \
+ OP(IsSampler) /* 376 */ \
+ OP(IsShader) /* 377 */ \
+ OP(IsSync) /* 378 */ \
+ OP(IsTexture) /* 379 */ \
+ OP(IsTransformFeedback) /* 380 */ \
+ OP(LineWidth) /* 381 */ \
+ OP(LinkProgram) /* 382 */ \
+ OP(PauseTransformFeedback) /* 383 */ \
+ OP(PixelStorei) /* 384 */ \
+ OP(PolygonOffset) /* 385 */ \
+ OP(ReadBuffer) /* 386 */ \
+ OP(ReadPixels) /* 387 */ \
+ OP(ReleaseShaderCompiler) /* 388 */ \
+ OP(RenderbufferStorage) /* 389 */ \
+ OP(ResumeTransformFeedback) /* 390 */ \
+ OP(SampleCoverage) /* 391 */ \
+ OP(SamplerParameterf) /* 392 */ \
+ OP(SamplerParameterfvImmediate) /* 393 */ \
+ OP(SamplerParameteri) /* 394 */ \
+ OP(SamplerParameterivImmediate) /* 395 */ \
+ OP(Scissor) /* 396 */ \
+ OP(ShaderBinary) /* 397 */ \
+ OP(ShaderSourceBucket) /* 398 */ \
+ OP(StencilFunc) /* 399 */ \
+ OP(StencilFuncSeparate) /* 400 */ \
+ OP(StencilMask) /* 401 */ \
+ OP(StencilMaskSeparate) /* 402 */ \
+ OP(StencilOp) /* 403 */ \
+ OP(StencilOpSeparate) /* 404 */ \
+ OP(TexImage2D) /* 405 */ \
+ OP(TexImage3D) /* 406 */ \
+ OP(TexParameterf) /* 407 */ \
+ OP(TexParameterfvImmediate) /* 408 */ \
+ OP(TexParameteri) /* 409 */ \
+ OP(TexParameterivImmediate) /* 410 */ \
+ OP(TexStorage3D) /* 411 */ \
+ OP(TexSubImage2D) /* 412 */ \
+ OP(TexSubImage3D) /* 413 */ \
+ OP(TransformFeedbackVaryingsBucket) /* 414 */ \
+ OP(Uniform1f) /* 415 */ \
+ OP(Uniform1fvImmediate) /* 416 */ \
+ OP(Uniform1i) /* 417 */ \
+ OP(Uniform1ivImmediate) /* 418 */ \
+ OP(Uniform1ui) /* 419 */ \
+ OP(Uniform1uivImmediate) /* 420 */ \
+ OP(Uniform2f) /* 421 */ \
+ OP(Uniform2fvImmediate) /* 422 */ \
+ OP(Uniform2i) /* 423 */ \
+ OP(Uniform2ivImmediate) /* 424 */ \
+ OP(Uniform2ui) /* 425 */ \
+ OP(Uniform2uivImmediate) /* 426 */ \
+ OP(Uniform3f) /* 427 */ \
+ OP(Uniform3fvImmediate) /* 428 */ \
+ OP(Uniform3i) /* 429 */ \
+ OP(Uniform3ivImmediate) /* 430 */ \
+ OP(Uniform3ui) /* 431 */ \
+ OP(Uniform3uivImmediate) /* 432 */ \
+ OP(Uniform4f) /* 433 */ \
+ OP(Uniform4fvImmediate) /* 434 */ \
+ OP(Uniform4i) /* 435 */ \
+ OP(Uniform4ivImmediate) /* 436 */ \
+ OP(Uniform4ui) /* 437 */ \
+ OP(Uniform4uivImmediate) /* 438 */ \
+ OP(UniformBlockBinding) /* 439 */ \
+ OP(UniformMatrix2fvImmediate) /* 440 */ \
+ OP(UniformMatrix2x3fvImmediate) /* 441 */ \
+ OP(UniformMatrix2x4fvImmediate) /* 442 */ \
+ OP(UniformMatrix3fvImmediate) /* 443 */ \
+ OP(UniformMatrix3x2fvImmediate) /* 444 */ \
+ OP(UniformMatrix3x4fvImmediate) /* 445 */ \
+ OP(UniformMatrix4fvImmediate) /* 446 */ \
+ OP(UniformMatrix4x2fvImmediate) /* 447 */ \
+ OP(UniformMatrix4x3fvImmediate) /* 448 */ \
+ OP(UseProgram) /* 449 */ \
+ OP(ValidateProgram) /* 450 */ \
+ OP(VertexAttrib1f) /* 451 */ \
+ OP(VertexAttrib1fvImmediate) /* 452 */ \
+ OP(VertexAttrib2f) /* 453 */ \
+ OP(VertexAttrib2fvImmediate) /* 454 */ \
+ OP(VertexAttrib3f) /* 455 */ \
+ OP(VertexAttrib3fvImmediate) /* 456 */ \
+ OP(VertexAttrib4f) /* 457 */ \
+ OP(VertexAttrib4fvImmediate) /* 458 */ \
+ OP(VertexAttribI4i) /* 459 */ \
+ OP(VertexAttribI4ivImmediate) /* 460 */ \
+ OP(VertexAttribI4ui) /* 461 */ \
+ OP(VertexAttribI4uivImmediate) /* 462 */ \
+ OP(VertexAttribIPointer) /* 463 */ \
+ OP(VertexAttribPointer) /* 464 */ \
+ OP(Viewport) /* 465 */ \
+ OP(WaitSync) /* 466 */ \
+ OP(BlitFramebufferCHROMIUM) /* 467 */ \
+ OP(RenderbufferStorageMultisampleCHROMIUM) /* 468 */ \
+ OP(RenderbufferStorageMultisampleEXT) /* 469 */ \
+ OP(FramebufferTexture2DMultisampleEXT) /* 470 */ \
+ OP(TexStorage2DEXT) /* 471 */ \
+ OP(GenQueriesEXTImmediate) /* 472 */ \
+ OP(DeleteQueriesEXTImmediate) /* 473 */ \
+ OP(BeginQueryEXT) /* 474 */ \
+ OP(BeginTransformFeedback) /* 475 */ \
+ OP(EndQueryEXT) /* 476 */ \
+ OP(EndTransformFeedback) /* 477 */ \
+ OP(InsertEventMarkerEXT) /* 478 */ \
+ OP(PushGroupMarkerEXT) /* 479 */ \
+ OP(PopGroupMarkerEXT) /* 480 */ \
+ OP(GenVertexArraysOESImmediate) /* 481 */ \
+ OP(DeleteVertexArraysOESImmediate) /* 482 */ \
+ OP(IsVertexArrayOES) /* 483 */ \
+ OP(BindVertexArrayOES) /* 484 */ \
+ OP(SwapBuffers) /* 485 */ \
+ OP(GetMaxValueInBufferCHROMIUM) /* 486 */ \
+ OP(EnableFeatureCHROMIUM) /* 487 */ \
+ OP(MapBufferRange) /* 488 */ \
+ OP(UnmapBuffer) /* 489 */ \
+ OP(ResizeCHROMIUM) /* 490 */ \
+ OP(GetRequestableExtensionsCHROMIUM) /* 491 */ \
+ OP(RequestExtensionCHROMIUM) /* 492 */ \
+ OP(GetProgramInfoCHROMIUM) /* 493 */ \
+ OP(GetUniformBlocksCHROMIUM) /* 494 */ \
+ OP(GetTransformFeedbackVaryingsCHROMIUM) /* 495 */ \
+ OP(GetUniformsES3CHROMIUM) /* 496 */ \
+ OP(GetTranslatedShaderSourceANGLE) /* 497 */ \
+ OP(PostSubBufferCHROMIUM) /* 498 */ \
+ OP(TexImageIOSurface2DCHROMIUM) /* 499 */ \
+ OP(CopyTextureCHROMIUM) /* 500 */ \
+ OP(CopySubTextureCHROMIUM) /* 501 */ \
+ OP(DrawArraysInstancedANGLE) /* 502 */ \
+ OP(DrawElementsInstancedANGLE) /* 503 */ \
+ OP(VertexAttribDivisorANGLE) /* 504 */ \
+ OP(GenMailboxCHROMIUM) /* 505 */ \
+ OP(ProduceTextureCHROMIUMImmediate) /* 506 */ \
+ OP(ProduceTextureDirectCHROMIUMImmediate) /* 507 */ \
+ OP(ConsumeTextureCHROMIUMImmediate) /* 508 */ \
+ OP(CreateAndConsumeTextureCHROMIUMImmediate) /* 509 */ \
+ OP(BindUniformLocationCHROMIUMBucket) /* 510 */ \
+ OP(GenValuebuffersCHROMIUMImmediate) /* 511 */ \
+ OP(DeleteValuebuffersCHROMIUMImmediate) /* 512 */ \
+ OP(IsValuebufferCHROMIUM) /* 513 */ \
+ OP(BindValuebufferCHROMIUM) /* 514 */ \
+ OP(SubscribeValueCHROMIUM) /* 515 */ \
+ OP(PopulateSubscribedValuesCHROMIUM) /* 516 */ \
+ OP(UniformValuebufferCHROMIUM) /* 517 */ \
+ OP(BindTexImage2DCHROMIUM) /* 518 */ \
+ OP(ReleaseTexImage2DCHROMIUM) /* 519 */ \
+ OP(TraceBeginCHROMIUM) /* 520 */ \
+ OP(TraceEndCHROMIUM) /* 521 */ \
+ OP(AsyncTexSubImage2DCHROMIUM) /* 522 */ \
+ OP(AsyncTexImage2DCHROMIUM) /* 523 */ \
+ OP(WaitAsyncTexImage2DCHROMIUM) /* 524 */ \
+ OP(WaitAllAsyncTexImage2DCHROMIUM) /* 525 */ \
+ OP(DiscardFramebufferEXTImmediate) /* 526 */ \
+ OP(LoseContextCHROMIUM) /* 527 */ \
+ OP(InsertSyncPointCHROMIUM) /* 528 */ \
+ OP(WaitSyncPointCHROMIUM) /* 529 */ \
+ OP(DrawBuffersEXTImmediate) /* 530 */ \
+ OP(DiscardBackbufferCHROMIUM) /* 531 */ \
+ OP(ScheduleOverlayPlaneCHROMIUM) /* 532 */ \
+ OP(SwapInterval) /* 533 */ \
+ OP(MatrixLoadfCHROMIUMImmediate) /* 534 */ \
+ OP(MatrixLoadIdentityCHROMIUM) /* 535 */ \
+ OP(BlendBarrierKHR) /* 536 */
enum CommandId {
kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this.
diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
index 6240c4f..89b32c6 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h
@@ -4565,6 +4565,7 @@ std::string GLES2Util::GetStringCapability(uint32_t value) {
{GL_SCISSOR_TEST, "GL_SCISSOR_TEST"},
{GL_STENCIL_TEST, "GL_STENCIL_TEST"},
{GL_RASTERIZER_DISCARD, "GL_RASTERIZER_DISCARD"},
+ {GL_PRIMITIVE_RESTART_FIXED_INDEX, "GL_PRIMITIVE_RESTART_FIXED_INDEX"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
@@ -4774,6 +4775,94 @@ std::string GLES2Util::GetStringGLState(uint32_t value) {
{GL_SCISSOR_TEST, "GL_SCISSOR_TEST"},
{GL_STENCIL_TEST, "GL_STENCIL_TEST"},
{GL_RASTERIZER_DISCARD, "GL_RASTERIZER_DISCARD"},
+ {GL_PRIMITIVE_RESTART_FIXED_INDEX, "GL_PRIMITIVE_RESTART_FIXED_INDEX"},
+ {GL_COPY_READ_BUFFER_BINDING, "GL_COPY_READ_BUFFER_BINDING"},
+ {GL_COPY_WRITE_BUFFER_BINDING, "GL_COPY_WRITE_BUFFER_BINDING"},
+ {GL_DRAW_BUFFER0, "GL_DRAW_BUFFER0"},
+ {GL_DRAW_BUFFER1, "GL_DRAW_BUFFER1"},
+ {GL_DRAW_BUFFER2, "GL_DRAW_BUFFER2"},
+ {GL_DRAW_BUFFER3, "GL_DRAW_BUFFER3"},
+ {GL_DRAW_BUFFER4, "GL_DRAW_BUFFER4"},
+ {GL_DRAW_BUFFER5, "GL_DRAW_BUFFER5"},
+ {GL_DRAW_BUFFER6, "GL_DRAW_BUFFER6"},
+ {GL_DRAW_BUFFER7, "GL_DRAW_BUFFER7"},
+ {GL_DRAW_BUFFER8, "GL_DRAW_BUFFER8"},
+ {GL_DRAW_BUFFER9, "GL_DRAW_BUFFER9"},
+ {GL_DRAW_BUFFER10, "GL_DRAW_BUFFER10"},
+ {GL_DRAW_BUFFER11, "GL_DRAW_BUFFER11"},
+ {GL_DRAW_BUFFER12, "GL_DRAW_BUFFER12"},
+ {GL_DRAW_BUFFER13, "GL_DRAW_BUFFER13"},
+ {GL_DRAW_BUFFER14, "GL_DRAW_BUFFER14"},
+ {GL_DRAW_BUFFER15, "GL_DRAW_BUFFER15"},
+ {GL_DRAW_FRAMEBUFFER_BINDING, "GL_DRAW_FRAMEBUFFER_BINDING"},
+ {GL_FRAGMENT_SHADER_DERIVATIVE_HINT,
+ "GL_FRAGMENT_SHADER_DERIVATIVE_HINT"},
+ {GL_MAJOR_VERSION, "GL_MAJOR_VERSION"},
+ {GL_MAX_3D_TEXTURE_SIZE, "GL_MAX_3D_TEXTURE_SIZE"},
+ {GL_MAX_ARRAY_TEXTURE_LAYERS, "GL_MAX_ARRAY_TEXTURE_LAYERS"},
+ {GL_MAX_COLOR_ATTACHMENTS, "GL_MAX_COLOR_ATTACHMENTS"},
+ {GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,
+ "GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS"},
+ {GL_MAX_COMBINED_UNIFORM_BLOCKS, "GL_MAX_COMBINED_UNIFORM_BLOCKS"},
+ {GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,
+ "GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS"},
+ {GL_MAX_DRAW_BUFFERS, "GL_MAX_DRAW_BUFFERS"},
+ {GL_MAX_ELEMENT_INDEX, "GL_MAX_ELEMENT_INDEX"},
+ {GL_MAX_ELEMENTS_INDICES, "GL_MAX_ELEMENTS_INDICES"},
+ {GL_MAX_ELEMENTS_VERTICES, "GL_MAX_ELEMENTS_VERTICES"},
+ {GL_MAX_FRAGMENT_INPUT_COMPONENTS, "GL_MAX_FRAGMENT_INPUT_COMPONENTS"},
+ {GL_MAX_FRAGMENT_UNIFORM_BLOCKS, "GL_MAX_FRAGMENT_UNIFORM_BLOCKS"},
+ {GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
+ "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS"},
+ {GL_MAX_PROGRAM_TEXEL_OFFSET, "GL_MAX_PROGRAM_TEXEL_OFFSET"},
+ {GL_MAX_SAMPLES, "GL_MAX_SAMPLES"},
+ {GL_MAX_SERVER_WAIT_TIMEOUT, "GL_MAX_SERVER_WAIT_TIMEOUT"},
+ {GL_MAX_TEXTURE_LOD_BIAS, "GL_MAX_TEXTURE_LOD_BIAS"},
+ {GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,
+ "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS"},
+ {GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
+ "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS"},
+ {GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,
+ "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS"},
+ {GL_MAX_UNIFORM_BLOCK_SIZE, "GL_MAX_UNIFORM_BLOCK_SIZE"},
+ {GL_MAX_UNIFORM_BUFFER_BINDINGS, "GL_MAX_UNIFORM_BUFFER_BINDINGS"},
+ {GL_MAX_VARYING_COMPONENTS, "GL_MAX_VARYING_COMPONENTS"},
+ {GL_MAX_VERTEX_OUTPUT_COMPONENTS, "GL_MAX_VERTEX_OUTPUT_COMPONENTS"},
+ {GL_MAX_VERTEX_UNIFORM_BLOCKS, "GL_MAX_VERTEX_UNIFORM_BLOCKS"},
+ {GL_MAX_VERTEX_UNIFORM_COMPONENTS, "GL_MAX_VERTEX_UNIFORM_COMPONENTS"},
+ {GL_MIN_PROGRAM_TEXEL_OFFSET, "GL_MIN_PROGRAM_TEXEL_OFFSET"},
+ {GL_MINOR_VERSION, "GL_MINOR_VERSION"},
+ {GL_NUM_EXTENSIONS, "GL_NUM_EXTENSIONS"},
+ {GL_NUM_PROGRAM_BINARY_FORMATS, "GL_NUM_PROGRAM_BINARY_FORMATS"},
+ {GL_PACK_ROW_LENGTH, "GL_PACK_ROW_LENGTH"},
+ {GL_PACK_SKIP_PIXELS, "GL_PACK_SKIP_PIXELS"},
+ {GL_PACK_SKIP_ROWS, "GL_PACK_SKIP_ROWS"},
+ {GL_PIXEL_PACK_BUFFER_BINDING, "GL_PIXEL_PACK_BUFFER_BINDING"},
+ {GL_PIXEL_UNPACK_BUFFER_BINDING, "GL_PIXEL_UNPACK_BUFFER_BINDING"},
+ {GL_PROGRAM_BINARY_FORMATS, "GL_PROGRAM_BINARY_FORMATS"},
+ {GL_READ_BUFFER, "GL_READ_BUFFER"},
+ {GL_READ_FRAMEBUFFER_BINDING, "GL_READ_FRAMEBUFFER_BINDING"},
+ {GL_SAMPLER_BINDING, "GL_SAMPLER_BINDING"},
+ {GL_TEXTURE_BINDING_2D_ARRAY, "GL_TEXTURE_BINDING_2D_ARRAY"},
+ {GL_TEXTURE_BINDING_3D, "GL_TEXTURE_BINDING_3D"},
+ {GL_TRANSFORM_FEEDBACK_BINDING, "GL_TRANSFORM_FEEDBACK_BINDING"},
+ {GL_TRANSFORM_FEEDBACK_ACTIVE, "GL_TRANSFORM_FEEDBACK_ACTIVE"},
+ {GL_TRANSFORM_FEEDBACK_BUFFER_BINDING,
+ "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING"},
+ {GL_TRANSFORM_FEEDBACK_PAUSED, "GL_TRANSFORM_FEEDBACK_PAUSED"},
+ {GL_TRANSFORM_FEEDBACK_BUFFER_SIZE, "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE"},
+ {GL_TRANSFORM_FEEDBACK_BUFFER_START,
+ "GL_TRANSFORM_FEEDBACK_BUFFER_START"},
+ {GL_UNIFORM_BUFFER_BINDING, "GL_UNIFORM_BUFFER_BINDING"},
+ {GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT,
+ "GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT"},
+ {GL_UNIFORM_BUFFER_SIZE, "GL_UNIFORM_BUFFER_SIZE"},
+ {GL_UNIFORM_BUFFER_START, "GL_UNIFORM_BUFFER_START"},
+ {GL_UNPACK_IMAGE_HEIGHT, "GL_UNPACK_IMAGE_HEIGHT"},
+ {GL_UNPACK_ROW_LENGTH, "GL_UNPACK_ROW_LENGTH"},
+ {GL_UNPACK_SKIP_IMAGES, "GL_UNPACK_SKIP_IMAGES"},
+ {GL_UNPACK_SKIP_PIXELS, "GL_UNPACK_SKIP_PIXELS"},
+ {GL_UNPACK_SKIP_ROWS, "GL_UNPACK_SKIP_ROWS"},
};
return GLES2Util::GetQualifiedEnumString(string_table,
arraysize(string_table), value);
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index eb7fc49..05ea8af 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -20,14 +20,6 @@ namespace gles2 {
namespace {
-static void EnableDisable(GLenum pname, bool enable) {
- if (enable) {
- glEnable(pname);
- } else {
- glDisable(pname);
- }
-}
-
GLuint Get2dServiceId(const TextureUnit& unit) {
return unit.bound_texture_2d.get()
? unit.bound_texture_2d->service_id() : 0;
@@ -96,7 +88,7 @@ ContextState::ContextState(FeatureInfo* feature_info,
bound_renderbuffer_valid(false),
pack_reverse_row_order(false),
ignore_cached_state(false),
- fbo_binding_for_scissor_workaround_dirty_(false),
+ fbo_binding_for_scissor_workaround_dirty(false),
feature_info_(feature_info),
error_state_(ErrorState::Create(error_state_client, logger)) {
Initialize();
@@ -291,6 +283,26 @@ ErrorState* ContextState::GetErrorState() {
return error_state_.get();
}
+void ContextState::EnableDisable(GLenum pname, bool enable) const {
+ if (pname == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
+ // This is only available on Desktop GL 4.3+, but we emulate ES 3.0 on top
+ // of Desktop GL 4.2+.
+ const gfx::GLVersionInfo& gl_version = feature_info_->gl_version_info();
+ if (!gl_version.is_es &&
+ (gl_version.major_version < 4 ||
+ (gl_version.major_version == 4 && gl_version.minor_version < 3))) {
+ // TODO(zmo): Ignoring it may not be the best emulation.
+ NOTIMPLEMENTED();
+ return;
+ }
+ }
+ if (enable) {
+ glEnable(pname);
+ } else {
+ glDisable(pname);
+ }
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.
diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h
index b4e812c..47b3dbf 100644
--- a/gpu/command_buffer/service/context_state.h
+++ b/gpu/command_buffer/service/context_state.h
@@ -211,10 +211,12 @@ struct GPU_EXPORT ContextState {
bool pack_reverse_row_order;
bool ignore_cached_state;
- mutable bool fbo_binding_for_scissor_workaround_dirty_;
- FeatureInfo* feature_info_;
+ mutable bool fbo_binding_for_scissor_workaround_dirty;
private:
+ void EnableDisable(GLenum pname, bool enable) const;
+
+ FeatureInfo* feature_info_;
scoped_ptr<ErrorState> error_state_;
};
diff --git a/gpu/command_buffer/service/context_state_autogen.h b/gpu/command_buffer/service/context_state_autogen.h
index 405addd..e2b65bf 100644
--- a/gpu/command_buffer/service/context_state_autogen.h
+++ b/gpu/command_buffer/service/context_state_autogen.h
@@ -34,6 +34,8 @@ struct EnableFlags {
bool cached_stencil_test;
bool rasterizer_discard;
bool cached_rasterizer_discard;
+ bool primitive_restart_fixed_index;
+ bool cached_primitive_restart_fixed_index;
};
GLfloat blend_color_red;
@@ -158,6 +160,12 @@ inline void SetDeviceCapabilityState(GLenum cap, bool enable) {
return;
enable_flags.cached_rasterizer_discard = enable;
break;
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+ if (enable_flags.cached_primitive_restart_fixed_index == enable &&
+ !ignore_cached_state)
+ return;
+ enable_flags.cached_primitive_restart_fixed_index = enable;
+ break;
default:
NOTREACHED();
return;
diff --git a/gpu/command_buffer/service/context_state_impl_autogen.h b/gpu/command_buffer/service/context_state_impl_autogen.h
index e6c63a6..fa5462f 100644
--- a/gpu/command_buffer/service/context_state_impl_autogen.h
+++ b/gpu/command_buffer/service/context_state_impl_autogen.h
@@ -32,7 +32,9 @@ ContextState::EnableFlags::EnableFlags()
stencil_test(false),
cached_stencil_test(false),
rasterizer_discard(false),
- cached_rasterizer_discard(false) {
+ cached_rasterizer_discard(false),
+ primitive_restart_fixed_index(false),
+ cached_primitive_restart_fixed_index(false) {
}
void ContextState::Initialize() {
@@ -178,6 +180,11 @@ void ContextState::InitCapabilities(const ContextState* prev_state) const {
EnableDisable(GL_RASTERIZER_DISCARD,
enable_flags.cached_rasterizer_discard);
}
+ if (prev_state->enable_flags.cached_primitive_restart_fixed_index !=
+ enable_flags.cached_primitive_restart_fixed_index) {
+ EnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX,
+ enable_flags.cached_primitive_restart_fixed_index);
+ }
}
} else {
EnableDisable(GL_BLEND, enable_flags.cached_blend);
@@ -194,6 +201,8 @@ void ContextState::InitCapabilities(const ContextState* prev_state) const {
if (feature_info_->IsES3Capable()) {
EnableDisable(GL_RASTERIZER_DISCARD,
enable_flags.cached_rasterizer_discard);
+ EnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX,
+ enable_flags.cached_primitive_restart_fixed_index);
}
}
}
@@ -386,6 +395,8 @@ bool ContextState::GetEnabled(GLenum cap) const {
return enable_flags.stencil_test;
case GL_RASTERIZER_DISCARD:
return enable_flags.rasterizer_discard;
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+ return enable_flags.primitive_restart_fixed_index;
default:
NOTREACHED();
return false;
@@ -734,6 +745,13 @@ bool ContextState::GetStateAsGLint(GLenum pname,
params[0] = static_cast<GLint>(enable_flags.rasterizer_discard);
}
return true;
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+ *num_written = 1;
+ if (params) {
+ params[0] =
+ static_cast<GLint>(enable_flags.primitive_restart_fixed_index);
+ }
+ return true;
default:
return false;
}
@@ -1077,6 +1095,13 @@ bool ContextState::GetStateAsGLfloat(GLenum pname,
params[0] = static_cast<GLfloat>(enable_flags.rasterizer_discard);
}
return true;
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+ *num_written = 1;
+ if (params) {
+ params[0] =
+ static_cast<GLfloat>(enable_flags.primitive_restart_fixed_index);
+ }
+ return true;
default:
return false;
}
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 84fc2e4..c6220bb 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -1118,6 +1118,60 @@ bool FeatureInfo::IsES3Capable() const {
void FeatureInfo::EnableES3Validators() {
DCHECK(IsES3Capable());
validators_.UpdateValuesES3();
+
+ GLint max_color_attachments = 0;
+ glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &max_color_attachments);
+ const int kTotalColorAttachmentEnums = 16;
+ const GLenum kColorAttachments[] = {
+ GL_COLOR_ATTACHMENT0,
+ GL_COLOR_ATTACHMENT1,
+ GL_COLOR_ATTACHMENT2,
+ GL_COLOR_ATTACHMENT3,
+ GL_COLOR_ATTACHMENT4,
+ GL_COLOR_ATTACHMENT5,
+ GL_COLOR_ATTACHMENT6,
+ GL_COLOR_ATTACHMENT7,
+ GL_COLOR_ATTACHMENT8,
+ GL_COLOR_ATTACHMENT9,
+ GL_COLOR_ATTACHMENT10,
+ GL_COLOR_ATTACHMENT11,
+ GL_COLOR_ATTACHMENT12,
+ GL_COLOR_ATTACHMENT13,
+ GL_COLOR_ATTACHMENT14,
+ GL_COLOR_ATTACHMENT15,
+ };
+ if (max_color_attachments < kTotalColorAttachmentEnums) {
+ validators_.attachment.RemoveValues(
+ kColorAttachments + max_color_attachments,
+ kTotalColorAttachmentEnums - max_color_attachments);
+ }
+
+ GLint max_draw_buffers = 0;
+ glGetIntegerv(GL_MAX_DRAW_BUFFERS, &max_draw_buffers);
+ const int kTotalDrawBufferEnums = 16;
+ const GLenum kDrawBuffers[] = {
+ GL_DRAW_BUFFER0,
+ GL_DRAW_BUFFER1,
+ GL_DRAW_BUFFER2,
+ GL_DRAW_BUFFER3,
+ GL_DRAW_BUFFER4,
+ GL_DRAW_BUFFER5,
+ GL_DRAW_BUFFER6,
+ GL_DRAW_BUFFER7,
+ GL_DRAW_BUFFER8,
+ GL_DRAW_BUFFER9,
+ GL_DRAW_BUFFER10,
+ GL_DRAW_BUFFER11,
+ GL_DRAW_BUFFER12,
+ GL_DRAW_BUFFER13,
+ GL_DRAW_BUFFER14,
+ GL_DRAW_BUFFER15,
+ };
+ if (max_draw_buffers < kTotalDrawBufferEnums) {
+ validators_.g_l_state.RemoveValues(
+ kDrawBuffers + max_draw_buffers,
+ kTotalDrawBufferEnums - max_draw_buffers);
+ }
}
void FeatureInfo::AddExtensionString(const char* s) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 0e9866d..04a9eb2 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1412,6 +1412,9 @@ class GLES2DecoderImpl : public GLES2Decoder,
void DoGetFramebufferAttachmentParameteriv(
GLenum target, GLenum attachment, GLenum pname, GLint* params);
+ // Wrapper for glGetInteger64v.
+ void DoGetInteger64v(GLenum pname, GLint64* params);
+
// Wrapper for glGetIntegerv.
void DoGetIntegerv(GLenum pname, GLint* params);
@@ -4387,7 +4390,7 @@ void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) {
void GLES2DecoderImpl::OnFboChanged() const {
if (workarounds().restore_scissor_on_fbo_change)
- state_.fbo_binding_for_scissor_workaround_dirty_ = true;
+ state_.fbo_binding_for_scissor_workaround_dirty = true;
if (workarounds().gl_begin_gl_end_on_fbo_change_to_backbuffer) {
GLint bound_fbo_unsigned = -1;
@@ -4400,8 +4403,8 @@ void GLES2DecoderImpl::OnFboChanged() const {
// Called after the FBO is checked for completeness.
void GLES2DecoderImpl::OnUseFramebuffer() const {
- if (state_.fbo_binding_for_scissor_workaround_dirty_) {
- state_.fbo_binding_for_scissor_workaround_dirty_ = false;
+ if (state_.fbo_binding_for_scissor_workaround_dirty) {
+ state_.fbo_binding_for_scissor_workaround_dirty = false;
// The driver forgets the correct scissor when modifying the FBO binding.
glScissor(state_.scissor_x,
state_.scissor_y,
@@ -5179,6 +5182,12 @@ void GLES2DecoderImpl::DoGetFloatv(GLenum pname, GLfloat* params) {
}
}
+void GLES2DecoderImpl::DoGetInteger64v(GLenum pname, GLint64* params) {
+ DCHECK(params);
+ pname = AdjustGetPname(pname);
+ glGetInteger64v(pname, params);
+}
+
void GLES2DecoderImpl::DoGetIntegerv(GLenum pname, GLint* params) {
DCHECK(params);
GLsizei num_written;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
index 9a27c2f..8d763d4 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -1492,6 +1492,38 @@ error::Error GLES2DecoderImpl::HandleGetFramebufferAttachmentParameteriv(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleGetInteger64v(uint32_t immediate_data_size,
+ const void* cmd_data) {
+ if (!unsafe_es3_apis_enabled())
+ return error::kUnknownCommand;
+ const gles2::cmds::GetInteger64v& c =
+ *static_cast<const gles2::cmds::GetInteger64v*>(cmd_data);
+ (void)c;
+ GLenum pname = static_cast<GLenum>(c.pname);
+ typedef cmds::GetInteger64v::Result Result;
+ GLsizei num_values = 0;
+ GetNumValuesReturnedForGLGet(pname, &num_values);
+ Result* result = GetSharedMemoryAs<Result*>(
+ c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values));
+ GLint64* params = result ? result->GetData() : NULL;
+ if (params == NULL) {
+ return error::kOutOfBounds;
+ }
+ LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetInteger64v");
+ // Check that the client initialized the result.
+ if (result->size != 0) {
+ return error::kInvalidArguments;
+ }
+ DoGetInteger64v(pname, params);
+ GLenum error = glGetError();
+ if (error == GL_NO_ERROR) {
+ result->SetNumResults(num_values);
+ } else {
+ LOCAL_SET_GL_ERROR(error, "GetInteger64v", "");
+ }
+ return error::kNoError;
+}
+
error::Error GLES2DecoderImpl::HandleGetIntegerv(uint32_t immediate_data_size,
const void* cmd_data) {
const gles2::cmds::GetIntegerv& c =
@@ -4879,6 +4911,14 @@ bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
return true;
}
return false;
+ case GL_PRIMITIVE_RESTART_FIXED_INDEX:
+ state_.enable_flags.primitive_restart_fixed_index = enabled;
+ if (state_.enable_flags.cached_primitive_restart_fixed_index != enabled ||
+ state_.ignore_cached_state) {
+ state_.enable_flags.cached_primitive_restart_fixed_index = enabled;
+ return true;
+ }
+ return false;
default:
NOTREACHED();
return false;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h
index b76e7bf..1620423 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h
@@ -24,6 +24,7 @@ void GLES2DecoderTestBase::SetupInitCapabilitiesExpectations(bool es3_capable) {
ExpectEnableDisable(GL_STENCIL_TEST, false);
if (es3_capable) {
ExpectEnableDisable(GL_RASTERIZER_DISCARD, false);
+ ExpectEnableDisable(GL_PRIMITIVE_RESTART_FIXED_INDEX, false);
}
}
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 f03d3a5..d06348e 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
@@ -1505,6 +1505,27 @@ TEST_P(GLES2DecoderTest1, GetFramebufferAttachmentParameterivInvalidArgs3_1) {
EXPECT_EQ(0u, result->size);
}
+TEST_P(GLES2DecoderTest1, GetInteger64vValidArgs) {
+ EXPECT_CALL(*gl_, GetError())
+ .WillOnce(Return(GL_NO_ERROR))
+ .WillOnce(Return(GL_NO_ERROR))
+ .RetiresOnSaturation();
+ SpecializedSetup<cmds::GetInteger64v, 0>(true);
+ typedef cmds::GetInteger64v::Result Result;
+ Result* result = static_cast<Result*>(shared_memory_address_);
+ EXPECT_CALL(*gl_, GetInteger64v(GL_ACTIVE_TEXTURE, result->GetData()));
+ result->size = 0;
+ cmds::GetInteger64v cmd;
+ cmd.Init(GL_ACTIVE_TEXTURE, shared_memory_id_, shared_memory_offset_);
+ decoder_->set_unsafe_es3_apis_enabled(true);
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
+ EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ACTIVE_TEXTURE),
+ result->GetNumResults());
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ decoder_->set_unsafe_es3_apis_enabled(false);
+ EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
+}
+
TEST_P(GLES2DecoderTest1, GetIntegervValidArgs) {
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -1810,5 +1831,4 @@ TEST_P(GLES2DecoderTest1, GetShaderivInvalidArgs2_1) {
// TODO(gman): GetShaderInfoLog
// TODO(gman): GetShaderPrecisionFormat
-// TODO(gman): GetShaderSource
#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 1f23b8d..e7948d1 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,7 @@
#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): GetShaderSource
// TODO(gman): GetString
TEST_P(GLES2DecoderTest2, GetSyncivValidArgs) {
@@ -1586,18 +1587,4 @@ TEST_P(GLES2DecoderTest2, VertexAttrib1fValidArgs) {
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
-
-TEST_P(GLES2DecoderTest2, VertexAttrib1fvImmediateValidArgs) {
- cmds::VertexAttrib1fvImmediate& cmd =
- *GetImmediateAs<cmds::VertexAttrib1fvImmediate>();
- SpecializedSetup<cmds::VertexAttrib1fvImmediate, 0>(true);
- GLfloat temp[1] = {
- 0,
- };
- cmd.Init(1, &temp[0]);
- EXPECT_CALL(*gl_, VertexAttrib1fv(1, reinterpret_cast<GLfloat*>(
- ImmediateDataAddress(&cmd))));
- EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
-}
#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 2e153b4..2261f5c 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,20 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
+TEST_P(GLES2DecoderTest3, VertexAttrib1fvImmediateValidArgs) {
+ cmds::VertexAttrib1fvImmediate& cmd =
+ *GetImmediateAs<cmds::VertexAttrib1fvImmediate>();
+ SpecializedSetup<cmds::VertexAttrib1fvImmediate, 0>(true);
+ GLfloat temp[1] = {
+ 0,
+ };
+ cmd.Init(1, &temp[0]);
+ EXPECT_CALL(*gl_, VertexAttrib1fv(1, reinterpret_cast<GLfloat*>(
+ ImmediateDataAddress(&cmd))));
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+}
+
TEST_P(GLES2DecoderTest3, VertexAttrib2fValidArgs) {
EXPECT_CALL(*gl_, VertexAttrib2f(1, 2, 3));
SpecializedSetup<cmds::VertexAttrib2f, 0>(true);
diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
index dfa7a59..6b8d4e6 100644
--- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h
@@ -90,6 +90,7 @@ static const GLenum valid_capability_table[] = {
static const GLenum valid_capability_table_es3[] = {
GL_RASTERIZER_DISCARD,
+ GL_PRIMITIVE_RESTART_FIXED_INDEX,
};
static const GLenum valid_cmp_function_table[] = {
@@ -251,6 +252,87 @@ static const GLenum valid_g_l_state_table[] = {
GL_SCISSOR_TEST,
GL_STENCIL_TEST,
GL_RASTERIZER_DISCARD,
+ GL_PRIMITIVE_RESTART_FIXED_INDEX,
+};
+
+static const GLenum valid_g_l_state_table_es3[] = {
+ GL_COPY_READ_BUFFER_BINDING,
+ GL_COPY_WRITE_BUFFER_BINDING,
+ GL_DRAW_BUFFER0,
+ GL_DRAW_BUFFER1,
+ GL_DRAW_BUFFER2,
+ GL_DRAW_BUFFER3,
+ GL_DRAW_BUFFER4,
+ GL_DRAW_BUFFER5,
+ GL_DRAW_BUFFER6,
+ GL_DRAW_BUFFER7,
+ GL_DRAW_BUFFER8,
+ GL_DRAW_BUFFER9,
+ GL_DRAW_BUFFER10,
+ GL_DRAW_BUFFER11,
+ GL_DRAW_BUFFER12,
+ GL_DRAW_BUFFER13,
+ GL_DRAW_BUFFER14,
+ GL_DRAW_BUFFER15,
+ GL_DRAW_FRAMEBUFFER_BINDING,
+ GL_FRAGMENT_SHADER_DERIVATIVE_HINT,
+ GL_MAJOR_VERSION,
+ GL_MAX_3D_TEXTURE_SIZE,
+ GL_MAX_ARRAY_TEXTURE_LAYERS,
+ GL_MAX_COLOR_ATTACHMENTS,
+ GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,
+ GL_MAX_COMBINED_UNIFORM_BLOCKS,
+ GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,
+ GL_MAX_DRAW_BUFFERS,
+ GL_MAX_ELEMENT_INDEX,
+ GL_MAX_ELEMENTS_INDICES,
+ GL_MAX_ELEMENTS_VERTICES,
+ GL_MAX_FRAGMENT_INPUT_COMPONENTS,
+ GL_MAX_FRAGMENT_UNIFORM_BLOCKS,
+ GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
+ GL_MAX_PROGRAM_TEXEL_OFFSET,
+ GL_MAX_SAMPLES,
+ GL_MAX_SERVER_WAIT_TIMEOUT,
+ GL_MAX_TEXTURE_LOD_BIAS,
+ GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,
+ GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
+ GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,
+ GL_MAX_UNIFORM_BLOCK_SIZE,
+ GL_MAX_UNIFORM_BUFFER_BINDINGS,
+ GL_MAX_VARYING_COMPONENTS,
+ GL_MAX_VERTEX_OUTPUT_COMPONENTS,
+ GL_MAX_VERTEX_UNIFORM_BLOCKS,
+ GL_MAX_VERTEX_UNIFORM_COMPONENTS,
+ GL_MIN_PROGRAM_TEXEL_OFFSET,
+ GL_MINOR_VERSION,
+ GL_NUM_EXTENSIONS,
+ GL_NUM_PROGRAM_BINARY_FORMATS,
+ GL_PACK_ROW_LENGTH,
+ GL_PACK_SKIP_PIXELS,
+ GL_PACK_SKIP_ROWS,
+ GL_PIXEL_PACK_BUFFER_BINDING,
+ GL_PIXEL_UNPACK_BUFFER_BINDING,
+ GL_PROGRAM_BINARY_FORMATS,
+ GL_READ_BUFFER,
+ GL_READ_FRAMEBUFFER_BINDING,
+ GL_SAMPLER_BINDING,
+ GL_TEXTURE_BINDING_2D_ARRAY,
+ GL_TEXTURE_BINDING_3D,
+ GL_TRANSFORM_FEEDBACK_BINDING,
+ GL_TRANSFORM_FEEDBACK_ACTIVE,
+ GL_TRANSFORM_FEEDBACK_BUFFER_BINDING,
+ GL_TRANSFORM_FEEDBACK_PAUSED,
+ GL_TRANSFORM_FEEDBACK_BUFFER_SIZE,
+ GL_TRANSFORM_FEEDBACK_BUFFER_START,
+ GL_UNIFORM_BUFFER_BINDING,
+ GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT,
+ GL_UNIFORM_BUFFER_SIZE,
+ GL_UNIFORM_BUFFER_START,
+ GL_UNPACK_IMAGE_HEIGHT,
+ GL_UNPACK_ROW_LENGTH,
+ GL_UNPACK_SKIP_IMAGES,
+ GL_UNPACK_SKIP_PIXELS,
+ GL_UNPACK_SKIP_ROWS,
};
static const GLenum valid_get_max_index_type_table[] = {
@@ -944,6 +1026,8 @@ void Validators::UpdateValuesES3() {
arraysize(valid_buffer_target_table_es3));
capability.AddValues(valid_capability_table_es3,
arraysize(valid_capability_table_es3));
+ g_l_state.AddValues(valid_g_l_state_table_es3,
+ arraysize(valid_g_l_state_table_es3));
pixel_type.AddValues(valid_pixel_type_table_es3,
arraysize(valid_pixel_type_table_es3));
texture_bind_target.AddValues(valid_texture_bind_target_table_es3,