0
Commit Graph

88 Commits

Author SHA1 Message Date
3bd19b38cc Implemented window class on linux. Standalone demos are working on linux now.
Review URL: http://codereview.chromium.org/565041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38106 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-04 15:59:35 +00:00
9a298ada39 Added support for lost context recovery on the client side. None of our service side GL implementations actually report lost contexts (yet).
Added pglGetError to PGL library.

pglSwapBuffers returns false on a lost context or other non-recoverable error and pglGetError reports PGL_CONTEXT_LOST.

Updated demo plugins to reset their PGL contexts on context lost. Standalone plugins cannot currently recover from lost context because they don't use PGL.

Added error code to NPDeviceContext3D for lost context.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/566021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38039 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-03 23:27:43 +00:00
84352455e7 Changes necessary to compile gpu demos on linux. It is not functional yet just compiling.
BUG=26099
Review URL: http://codereview.chromium.org/552240

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37977 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-03 17:02:27 +00:00
43f28f83bc [GPU] Get GPU process running on the mac
Initial port of GPU process / plugin to Mac OS X. Uses new IOSurface
APIs and therefore currently runs only on 10.6. Alternate strategy
will need to be devised for 10.5.

Slight UI issues remain such as GPU plugins initially showing up in
the wrong place on the page. These will be fixed in follow-on bugs.

Minimal changes made to command buffer code to get it to compile on
Mac OS X. Commented out use of nested anonymous namespaces in
gles2_cmd_decoder.cc which were causing the linker to crash with a seg
fault.

Refactored gyp files so the OS test enabling the GPU plugin is in one
place, common.gypi, and other files test only the variable enable_gpu.

Slight change to gles2_demo_cc.cc to add some simple animation to
verify that updates from the GPU plugin are reaching the screen.
Changed Pepper test plugin to use 3D view by default and commented out
use of audio context because of recent issues.

TEST=none (ran Pepper Test Plugin with 3D view enabled)
BUG=http://crbug.com/25988

Review URL: http://codereview.chromium.org/558035

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37934 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-03 02:28:48 +00:00
f7b85373ba Implements glGetUniformiv and glGetUniformfv.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/566019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37918 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-03 01:11:37 +00:00
acc3ffb784 This file was missing from the last CL as it was sitting
in another CL.  Fortunately it didn't seem to break the
build.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/568024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37892 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-02 22:12:03 +00:00
b0c8acf8a8 Change the GLES2Implementation Flush and Finish functions
to emluate the GLES2 glFlush and glFinish more correctly.

I don't like the fact that the GLES2CmdHelper::Finish
autogeneated from glFinish overrides 
CommandBufferHelper::Finish but I'm not sure I'm feeling
like making all those functions start with gl or something
and all the fixes required just to avoid that.


TEST=none
BUG=none

Review URL: http://codereview.chromium.org/561012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37863 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-02 19:39:27 +00:00
5e5952e18f Fixed compile/link errors for gpu unit-tests. I had to mostly fix signed/unsigned mismatch and link failures due to non-definition of static member variables. I still do not understand why gcc is behaving arbitrarily for only a few static member variables. AFAIK the standard says that static const numeric types do not need to be defined anymore.
Review URL: http://codereview.chromium.org/560002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37837 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-02 16:30:28 +00:00
872fe72140 Fixed compile error for unit-tests on linux. We do not include any glew file for unitests. They are mocked in gl_mock.h. gles2_cmd_decoder.cc included x_utils.h which in turn included glxew.h.
Review URL: http://codereview.chromium.org/557087

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37834 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-02 16:03:33 +00:00
de5a6120e5 Moved the initialization of static variable outside the class declaration. Necessary to make gcc happy.
Review URL: http://codereview.chromium.org/567005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37766 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-02 00:08:31 +00:00
9c6326456b Fixes a broken build (missing newline).
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/562002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37756 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-01 22:35:46 +00:00
f7a64eee4a Renamed ParseError -> Error, parse_error -> error, kParseNoError -> kNoError, commandBufferEntries -> commandBufferSize.
Added NPDevice3DContextError enumeration.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/558054

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37751 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-01 22:24:14 +00:00
c0c4565b3c Remove trailing comma to allow compilation with Native Client's higher warning level.
Review URL: http://codereview.chromium.org/552266

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37749 0039d316-1c4b-4281-b951-d872f2087c98
2010-02-01 22:15:56 +00:00
c77ea36637 Redesigned CommandBuffer and NPDevice3D interfaces.
All status is now in the Device3D context.
It can be retreived with fewer IPC messages.
It can be now be accessed off the main plugin thread, which is necessary to run OpenGL in another thread.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/555020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37545 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-29 22:02:36 +00:00
8bf5a3eff3 Implements glGetVertexAttribPointerv
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/549201

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37496 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-29 04:21:36 +00:00
67e5077346 Add commands Jump, Call and Return
This is the minimal change version.

There were 3 possible solution:

) Remove these commands

) Change the command buffers so the client side
can not see the "get" pointer and therefore force
the client side to use tokens to say in sync.

It's the cleaner solution. It lets you put commands
in any shared memory thereby getting rid of the ring
buffer commands. 

But, it required major changes. After going down
that path for an entire day I punted for...

) Implement the commands assuming there is only
one buffer the commands can be in (what is currently
called the ring_buffer). With the jump commands
available it no longer has to be used as a ring
buffer. A Pepper or NaCl app can use it however
they want but, unlike solution  they only get
the one buffer.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/555129

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37446 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-28 21:50:24 +00:00
1b1bba77bb Windows now uses the TLS API instead of __declspec(thread) for client side command buffer code compiled into DLLs. Other platforms use the pthreads API. This is because the __declspec(thread) approach does not on some platforms, including Windows XP and Mac.
This is used for thread local pointers to the GL and PGL contexts. This unfortunate because the PGL and GL APIs do not generally explicitly reference a context. The current context is set with a call to pglMakeCurrent.

An unfortunate consequence is that now in Pepper plugins, every call to a GL function will call TlsGetValue to get the thread's current context, which could have performance issues.

I can't use base::ThreadLocalPointer because this code is compiled into an untrusted NaCl module and we don't want Chromium dependencies.

TEST=try
BUG=none

Review URL: http://codereview.chromium.org/553050

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37300 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-27 20:30:45 +00:00
984a4d1367 Hooked all demos to gpu/demos.gyp. Now all demos run as both - standalone executables and pepper plugin.
BUG=26099
Review URL: http://codereview.chromium.org/549159

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37119 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-26 18:13:25 +00:00
326975bc6d Added infrastructure to run gpu demos under Pepper3D. Created a Demo class that can be run as both standalone apps (exe) or pepper plugins (dll). Created entry points and framework classes for both platforms - exe and pepper. A demo application has three layers:
1. Entry point
   - standalone (main_exe.cc): Contains the main function for console applications. Instantiates and runs a window.
   - pepper (main_pepper.cc): Contains NPAPI entry points. Instantiates pepper plugin object.
2. Framework that hosts demo
   - standalone: Window
   - pepper: Plugin
3. Demo - One demo class for all platforms. This does all the rendering and event handling.

BUG=26099
Review URL: http://codereview.chromium.org/554053

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37082 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-26 02:53:54 +00:00
c76723a1f4 linux: enable pepper plugin
This is CL 36399 that was reverted in 36969 because it caused an ICE on the official builders.
This adds a workaround for the ICE.

Review URL: http://codereview.chromium.org/546136

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37055 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-25 23:10:58 +00:00
b656d73aaa Revert 36399 - linux: enable pepper_test_plugin
This is breaking official x64 builds, notified team of break earlier in the 
week, but haven't seen a fix.  I'm reverting now.  

Please fix before re-enabling.

Original message:
This includes a way to build it with full support on x64 (and arm ?), by specifying linux_fpic=1 in GYP_DEFINES and rerunning gyp.

Review URL: http://codereview.chromium.org/551041

TBR=piman@chromium.org
Review URL: http://codereview.chromium.org/548133

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36969 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-23 22:08:50 +00:00
eb54a569a3 Call xglMakeCurrent for each command buffer to allow for multiple GL contexts.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/551073

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36683 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-20 21:55:18 +00:00
98c41b12a3 Added pglGetCurrentContext. Make gles2 implementation pointer global variable thread local.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/549090

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36560 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-19 22:15:39 +00:00
6907f19acc Fixed gles2 demo by switching it from a console application to a windowed one. The HINSTANCE it was getting from the console was invalid for some reason.
TEST=none
BUG=none

Review URL: http://codereview.chromium.org/542119

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36558 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-19 22:15:21 +00:00
0192d0455d Converted all demos to use gpu::demos::Example base class.
Review URL: http://codereview.chromium.org/542120

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36551 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-19 21:23:59 +00:00
76fbe71725 Created a base class for examples taken from gles2 book. It encapsulates the well-defined pattern followed by the examples to eliminate duplicated code. Once we finalize this CL, I will go ahead and change all demos to use this base class.
Review URL: http://codereview.chromium.org/543110

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36542 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-19 20:59:41 +00:00
b78e6049b8 Change some paths, include files to make the sources build on Native Client.
Needed for Pepper progress.

Review URL: http://codereview.chromium.org/552024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36458 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-16 16:22:27 +00:00
cb79b334b4 Added stencil-test demo.
PS: I have not moved the repeated code to the base class for this demo because this is the last one I intend to submit before starting to port the demos to pepper. I will refactor all the demos to eliminate repeating code in light of pepper framework.
BUG=26099
TEST=Run stencil_test executable. You should see four different-colored quads.
Review URL: http://codereview.chromium.org/545092

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36410 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-15 21:32:20 +00:00
c4514c3c57 linux: enable pepper_test_plugin
This includes a way to build it with full support on x64 (and arm ?), by specifying linux_fpic=1 in GYP_DEFINES and re-running gyp.

Review URL: http://codereview.chromium.org/551041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36399 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-15 20:19:06 +00:00
799b5e78c6 Added texture wrap demo.
BUG=26099
TEST=Run texture_wrap executable. You should see three quads, each with a different texture wrapping mode.
Review URL: http://codereview.chromium.org/552012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36394 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-15 19:54:01 +00:00
df9aeeca85 Added variable name as required by style guide.
Review URL: http://codereview.chromium.org/549071

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36387 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-15 19:34:18 +00:00
46180e667b Added cubemap demo.
BUG=26099
Review URL: http://codereview.chromium.org/549063

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36356 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-15 16:32:01 +00:00
bc36e991df Resubmitting r36268 with a fix for mac:
Implemented PGL library, an EGL like API for Pepper. Updated Pepper test plugin to use it.

TEST=trybots
BUG=none

Review URL: http://codereview.chromium.org/552007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36318 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-15 00:53:02 +00:00
8e14284ed8 Set disabled style on GPU window and plugin intermediate window so mouse messages pass through to the browser window.
TEST=trybots
BUG=none

Review URL: http://codereview.chromium.org/549025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36311 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-15 00:10:09 +00:00
a1de87d247 Revert 36268 - Implemented PGL library, an EGL like API for Pepper. Updated Pepper test plugin to use it.
TEST=none yet
BUG=none

Review URL: http://codereview.chromium.org/545052

TBR=alokp@chromium.org
Review URL: http://codereview.chromium.org/550048

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36270 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-14 21:50:00 +00:00
34d9cbe433 Implemented PGL library, an EGL like API for Pepper. Updated Pepper test plugin to use it.
TEST=none yet
BUG=none

Review URL: http://codereview.chromium.org/545052

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36268 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-14 21:06:47 +00:00
c1823aa513 Added simple texture demo.
BUG=26099
TEST=Run simple_texture_2d executable. You should see a square with checker-board pattern.
Review URL: http://codereview.chromium.org/543063

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36267 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-14 21:06:11 +00:00
d8c0ef76d0 Added mip-mapping demo.
BUG=26099
TEST=Run mip_map_2d executable. You should see two quads with checker-board pattern. The left will exhibit aliasing but right one will be anti-aliased.
Review URL: http://codereview.chromium.org/542067

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36209 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-14 01:08:54 +00:00
1d32bc8881 Adds unit tests for glDrawArrays and glDrawBuffers
in the GLES2Decoder class of command buffers.

Also fixes a few bugs related to validating buffer
access and reporting GL errors

I also separated out the id mapping, buffer tracking
and program tracking into separate classes as
different decoders will need to share instances of
those classes once we allow sharing of resources.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/546026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36178 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-13 22:06:46 +00:00
a37dd5e0de Adds a sync to glFinish and SwapBuffers at the
GLES2Implementation level.

You can still call these async from a gh GLES2Helper level.

Review URL: http://codereview.chromium.org/545041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36160 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-13 20:06:09 +00:00
5ba06f1d77 Changed the signature of Application::Draw to accept elapsed time. It will be used to update key frames or making the application frame-rate independent. However I think there is some bug somewhere. It takes an eternity for the cube in simple-vertex-shader demo to start rotating. Even when the cube starts rotatiing the performance is quite choppy.
Review URL: http://codereview.chromium.org/551011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36156 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-13 19:55:52 +00:00
bd0dae9836 Added simple vertex shader demo. I had to make the following modifications to third-party code:
- Changed client-side vertex array to VBO
- Used GL_UNSIGNED_SHORT instead of GL_UNSIGNED_INT in glDrawElements because GL_UNSIGNED_INT is not supported for by OpenGL ES 2.0 for indices
BUG=26099
TEST=Run simple_vertex_shader executable, you should see a rotating cube.
Review URL: http://codereview.chromium.org/543015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36127 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-13 17:20:44 +00:00
48e7f7fc8e Renamed gles_book_examples.gyp to gles2_book.gyp and hooked eveything back together.
TBR=apatrick

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35876 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-09 18:15:32 +00:00
efb8f2987c Renamed gles_book_examples to gles2_book to make it shorter and more correct. I still need to rename gles_book_examples.gyp to gles2_book.gyp. I will do it in another CL as svn does not like changes in renamed directories.
TBR=apatrick
Review URL: http://codereview.chromium.org/543002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35875 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-09 17:06:42 +00:00
714be33609 Added hello-triangle demo.
BUG=26099
TEST=Try running hello_triangle executable, you should see a red triangle
Review URL: http://codereview.chromium.org/539001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35873 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-09 13:40:59 +00:00
7684ec15c2 linux: dynamically load libGL.so.1, and use glew to dynamically resolve symbols
This is to workaround NVIDIA's broken dlsym hook.

BUG=16800

Review URL: http://codereview.chromium.org/525109

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35863 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-09 02:45:56 +00:00
43cee51d23 Removing the dependency of command-buffer client on base/task.h. This file includes base/logging.h which is difficult to compile under nacl. base-logging is stubbed in gpu by gpu/common/logging.h.
BUG=26104

Review URL: http://codereview.chromium.org/527009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35860 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-09 01:30:16 +00:00
03f882aa62 Fixed some bugs that prevented the GPU plugin from shutting down without crashing.
TEST=trybots
BUG=none

Review URL: http://codereview.chromium.org/529004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35819 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-08 20:46:37 +00:00
23e5795717 White space change to trigger a build.
TEST=none
BUG=none

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35799 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-08 17:37:47 +00:00
a098077e79 Dummy whitespace change to force a build.
TEST=none
BUG=none

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35797 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-08 17:18:29 +00:00