diff options
author | kkinnunen <kkinnunen@nvidia.com> | 2015-12-04 01:36:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-04 09:37:12 +0000 |
commit | 8cefb231216c2777281f37a30e3fb8e67513ee2b (patch) | |
tree | 2d0163eed0729e5f7a8fb55fb03b034eddcb5305 /gpu/command_buffer/client/gles2_implementation.cc | |
parent | 91db68e8cb2080d1e9e07858efea3f7e198112a9 (diff) | |
download | chromium_src-8cefb231216c2777281f37a30e3fb8e67513ee2b.zip chromium_src-8cefb231216c2777281f37a30e3fb8e67513ee2b.tar.gz chromium_src-8cefb231216c2777281f37a30e3fb8e67513ee2b.tar.bz2 |
command_buffer: Implement EXT_blend_func_extended
Implement EXT_blend_func_extended for command buffer ES 2.0 and ES 3.0
contexts.
For the ES 2.0 context, the extension supports dual-source blending with
pre-defined gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT
variables.
Currently EXT_blend_func_extended is only exposed if the service context
supports program interface query. This means OpenGL context or OpenGL
ES 3.1 context. This is to simplify the unit test expectation conditions.
Theoretically also ES 2.0 and ES 3.0 service contexts could support
EXT_blend_func_extended, but probably there will never be such a driver.
BUG=506765
Review URL: https://codereview.chromium.org/1309743005
Cr-Commit-Position: refs/heads/master@{#363175}
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation.cc')
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.cc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 6a00426..7c7f99d 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -1396,6 +1396,33 @@ void GLES2Implementation::BindAttribLocation( CheckGLError(); } +void GLES2Implementation::BindFragDataLocationEXT(GLuint program, + GLuint colorName, + const char* name) { + GPU_CLIENT_SINGLE_THREAD_CHECK(); + GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindFragDataLocationEXT(" + << program << ", " << colorName << ", " << name << ")"); + SetBucketAsString(kResultBucketId, name); + helper_->BindFragDataLocationEXTBucket(program, colorName, kResultBucketId); + helper_->SetBucketSize(kResultBucketId, 0); + CheckGLError(); +} + +void GLES2Implementation::BindFragDataLocationIndexedEXT(GLuint program, + GLuint colorName, + GLuint index, + const char* name) { + GPU_CLIENT_SINGLE_THREAD_CHECK(); + GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindFragDataLocationEXT(" + << program << ", " << colorName << ", " << index << ", " + << name << ")"); + SetBucketAsString(kResultBucketId, name); + helper_->BindFragDataLocationIndexedEXTBucket(program, colorName, index, + kResultBucketId); + helper_->SetBucketSize(kResultBucketId, 0); + CheckGLError(); +} + void GLES2Implementation::BindUniformLocationCHROMIUM( GLuint program, GLint location, const char* name) { GPU_CLIENT_SINGLE_THREAD_CHECK(); @@ -1607,6 +1634,35 @@ bool GLES2Implementation::GetProgramivHelper( return got_value; } +GLint GLES2Implementation::GetFragDataIndexEXTHelper(GLuint program, + const char* name) { + typedef cmds::GetFragDataIndexEXT::Result Result; + Result* result = GetResultAs<Result*>(); + if (!result) { + return -1; + } + *result = -1; + SetBucketAsCString(kResultBucketId, name); + helper_->GetFragDataIndexEXT(program, kResultBucketId, GetResultShmId(), + GetResultShmOffset()); + WaitForCmd(); + helper_->SetBucketSize(kResultBucketId, 0); + return *result; +} + +GLint GLES2Implementation::GetFragDataIndexEXT(GLuint program, + const char* name) { + GPU_CLIENT_SINGLE_THREAD_CHECK(); + GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetFragDataIndexEXT(" << program + << ", " << name << ")"); + TRACE_EVENT0("gpu", "GLES2::GetFragDataIndexEXT"); + GLint loc = share_group_->program_info_manager()->GetFragDataIndex( + this, program, name); + GPU_CLIENT_LOG("returned " << loc); + CheckGLError(); + return loc; +} + GLint GLES2Implementation::GetFragDataLocationHelper( GLuint program, const char* name) { typedef cmds::GetFragDataLocation::Result Result; |