summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 18:26:29 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 18:26:29 +0000
commit3bb078951654ca9161207ac6afd375210beaddbb (patch)
tree670fdd5b7ff121e0fce1afe2fd879f4811620e34 /ppapi
parent5b06972b052fae4c12675bf3ba984ed8500b620b (diff)
downloadchromium_src-3bb078951654ca9161207ac6afd375210beaddbb.zip
chromium_src-3bb078951654ca9161207ac6afd375210beaddbb.tar.gz
chromium_src-3bb078951654ca9161207ac6afd375210beaddbb.tar.bz2
Execute all GL commands up to the put offset reported by a each flush.This means glFlush is a barrier that prevents reordering of GL commands issued on different command buffers. I used it to replace latches for synchronizing the rendering of WebGL canvas and Pepper 3D with the accelerated compositor. The primary advantage is it is more robust than latches and there is no possibility of deadlock. It should also be possible for WebGL and Pepper 3D to use it whereas exposing SetLatch and WaitLatch would be dangerous.The calls to SetLatch and WaitLatch are still in webkit but they are no-ops. SetLatch and WaitLatch are completely removed elsewhere.I changed CommandBuffer::FlushSync to Finish to reflect the new semantics. Going forward, I will add a synchronous CommandBuffer::WaitForToken and WaitForAvailableEntries, which should eliminate the need to call Finish unless glFinish is called by the client. The Pepper interface is unchanged because I don't want to break binary compatibility.I fixed a bug where the last read token in CmdBufferHelper was stale after receiving a ReportState IPC. That was causing a redundant synchronous flush in the client side SwapBuffers throttling.I removed Yield because it does not make sense with the new semantics. There is no round robin scheduling.Tested with WebGL on Windows and Mac and checked that 72672 did not regress.
Review URL: http://codereview.chromium.org/7253052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppb_context_3d_proxy.cc5
-rw-r--r--ppapi/proxy/ppb_opengles2_proxy.cc8
2 files changed, 5 insertions, 8 deletions
diff --git a/ppapi/proxy/ppb_context_3d_proxy.cc b/ppapi/proxy/ppb_context_3d_proxy.cc
index ff2fe93..4881aa9 100644
--- a/ppapi/proxy/ppb_context_3d_proxy.cc
+++ b/ppapi/proxy/ppb_context_3d_proxy.cc
@@ -87,6 +87,7 @@ class PepperCommandBuffer : public gpu::CommandBuffer {
virtual bool Initialize(base::SharedMemory* buffer, int32 size);
virtual gpu::Buffer GetRingBuffer();
virtual State GetState();
+ virtual State GetLastState();
virtual void Flush(int32 put_offset);
virtual State FlushSync(int32 put_offset, int32 last_known_get);
virtual void SetGetOffset(int32 get_offset);
@@ -186,6 +187,10 @@ gpu::CommandBuffer::State PepperCommandBuffer::GetState() {
return last_state_;
}
+gpu::CommandBuffer::State PepperCommandBuffer::GetLastState() {
+ return last_state_;
+}
+
void PepperCommandBuffer::Flush(int32 put_offset) {
if (last_state_.error != gpu::error::kNoError)
return;
diff --git a/ppapi/proxy/ppb_opengles2_proxy.cc b/ppapi/proxy/ppb_opengles2_proxy.cc
index ce301c6..79527e4 100644
--- a/ppapi/proxy/ppb_opengles2_proxy.cc
+++ b/ppapi/proxy/ppb_opengles2_proxy.cc
@@ -750,14 +750,6 @@ void Viewport(
GetGLES(context_id)->Viewport(x, y, width, height);
}
-void SetLatchCHROMIUM(PP_Resource context_id, GLuint latch_id) {
- GetGLES(context_id)->SetLatchCHROMIUM(latch_id);
-}
-
-void WaitLatchCHROMIUM(PP_Resource context_id, GLuint latch_id) {
- GetGLES(context_id)->WaitLatchCHROMIUM(latch_id);
-}
-
const struct PPB_OpenGLES2_Dev opengles2_interface = {
&ActiveTexture,
&AttachShader,