summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authorvmiura@chromium.org <vmiura@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-03 23:00:50 +0000
committervmiura@chromium.org <vmiura@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-03 23:00:50 +0000
commit6eda682dba27bd393c3da8a1609336bdf665b3f5 (patch)
tree87beeb8b1e64bac4697ce95d613bc2832d372378 /content/common
parent686c2a5545271c9b985a0a02ea1cc71a112c09c1 (diff)
downloadchromium_src-6eda682dba27bd393c3da8a1609336bdf665b3f5.zip
chromium_src-6eda682dba27bd393c3da8a1609336bdf665b3f5.tar.gz
chromium_src-6eda682dba27bd393c3da8a1609336bdf665b3f5.tar.bz2
Pass GL context bind_generates_resources flag to GPU Service.
GPU Client has been respecting the bind_generates_resources attrib, however the GPU Service has been forcing it to always 'true'. This means glBind semantic validation has been incorrect when bind_generates_resources is 'false' on the Client. This patch passes the bind_generates_resources attrib for WebGraphicsContext3DCommandBufferImpl, and checks that all contexts in the same ContextGroup use the same setting. BUG=333063, 244968 Review URL: https://codereview.chromium.org/213743003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261563 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc9
-rw-r--r--content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h2
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc8
3 files changed, 11 insertions, 8 deletions
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index 425990c..0ece341 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -229,7 +229,6 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
const GURL& active_url,
GpuChannelHost* host,
const Attributes& attributes,
- bool bind_generates_resources,
bool lose_context_when_out_of_memory,
const SharedMemoryLimits& limits,
WebGraphicsContext3DCommandBufferImpl* share_context)
@@ -247,7 +246,6 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
weak_ptr_factory_(this),
initialized_(false),
gl_(NULL),
- bind_generates_resources_(bind_generates_resources),
lose_context_when_out_of_memory_(lose_context_when_out_of_memory),
mem_limits_(limits),
flush_id_(0) {
@@ -354,6 +352,8 @@ bool WebGraphicsContext3DCommandBufferImpl::InitializeCommandBuffer(
attribs.push_back(attributes_.failIfMajorPerformanceCaveat ? 1 : 0);
attribs.push_back(LOSE_CONTEXT_WHEN_OUT_OF_MEMORY);
attribs.push_back(lose_context_when_out_of_memory_ ? 1 : 0);
+ attribs.push_back(BIND_GENERATES_RESOURCES);
+ attribs.push_back(0);
attribs.push_back(NONE);
// Create a proxy to a command buffer in the GPU process.
@@ -428,11 +428,12 @@ bool WebGraphicsContext3DCommandBufferImpl::CreateContext(bool onscreen) {
DCHECK(host_.get());
// Create the object exposing the OpenGL API.
+ bool bind_generates_resources = false;
real_gl_.reset(
new gpu::gles2::GLES2Implementation(gles2_helper_.get(),
gles2_share_group,
transfer_buffer_.get(),
- bind_generates_resources_,
+ bind_generates_resources,
lose_context_when_out_of_memory_,
command_buffer_.get()));
gl_ = real_gl_.get();
@@ -1206,13 +1207,11 @@ WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
if (share_context && share_context->IsCommandBufferContextLost())
return NULL;
- bool bind_generates_resources = false;
return new WebGraphicsContext3DCommandBufferImpl(
0,
active_url,
host,
attributes,
- bind_generates_resources,
lose_context_when_out_of_memory,
limits,
share_context);
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
index dd65b76..a167c64 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
@@ -123,7 +123,6 @@ class WebGraphicsContext3DCommandBufferImpl
const GURL& active_url,
GpuChannelHost* host,
const Attributes& attributes,
- bool bind_generates_resources,
bool lose_context_when_out_of_memory,
const SharedMemoryLimits& limits,
WebGraphicsContext3DCommandBufferImpl* share_context);
@@ -769,7 +768,6 @@ class WebGraphicsContext3DCommandBufferImpl
scoped_ptr<gpu::gles2::GLES2Implementation> real_gl_;
scoped_ptr<gpu::gles2::GLES2Interface> trace_gl_;
Error last_error_;
- bool bind_generates_resources_;
bool lose_context_when_out_of_memory_;
SharedMemoryLimits mem_limits_;
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index ceb7acb..68e4733 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -140,8 +140,14 @@ GpuCommandBufferStub::GpuCommandBufferStub(
total_gpu_memory_(0) {
active_url_hash_ = base::Hash(active_url.possibly_invalid_spec());
FastSetActiveURL(active_url_, active_url_hash_);
+
+ gpu::gles2::ContextCreationAttribHelper attrib_parser;
+ attrib_parser.Parse(requested_attribs_);
+
if (share_group) {
context_group_ = share_group->context_group_;
+ DCHECK(context_group_->bind_generates_resource() ==
+ attrib_parser.bind_generates_resource_);
} else {
context_group_ = new gpu::gles2::ContextGroup(
mailbox_manager,
@@ -149,7 +155,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
new GpuCommandBufferMemoryTracker(channel),
channel_->gpu_channel_manager()->shader_translator_cache(),
NULL,
- true);
+ attrib_parser.bind_generates_resource_);
}
use_virtualized_gl_context_ |=