Commit graph

49 commits

Author SHA1 Message Date
Scott Nations
bc7e48247e Enabled use of client-side memory in vertex, element, indirect, and count buffer
Added support for glArrayElement(EXT|) to the immediate mode layer.
    Support NUM_EXTENSIONS in glGet(Integer|Float|Double|Boolean|Integer64)v(EXT|)
    Added interception for glGetStringi and glGetIntergerv
    Improve loading of GLES and EGL libraries on Android
    Various bug fixes...
    Merged pull requests:
     #131  NaCL Pepper now uses GLES2 prefix for ES2.0 functions, rather than gl
     #130  Copyright bump to 2014
     #129  NaCL-related build tweaks for regaltest, nacl example and pnacl.
     #128  GLEW refresh
     #126  boost::print fix for mapping 'long' and 'long long' to 32-bit or 64-bit for length purposes
     #125  Resolve clang compilation error: lookup of 'Depth' in member access expression is ambiguous
     #124  Add Makefile support for gcc-4.4, gcc-4.6 and clang toolchains on Linux.
     #116  Make it compile with Visual Studio 2013 (VC12)
2014-08-07 12:24:42 -05:00
Scott Nations
8dda434953 Now using glsloptimizer to parse and rewrite shaders.
Major enhancements to the state web server.
Added state-based shader instancing to avoid recompiles.
Fixed issue #113 - Possible bug with REGAL_STATISTICS
Corrected handling of GL_POINT_SIZE_MAX state in RegalState.
Refreshed apitrace, civetweb, libpng, and GLEW from upstream.
2014-03-27 10:14:36 -05:00
Nigel Stewart
5ab0a9b488 Squeeze the footprint of Loader and Missing dispatch for Regal-wrangler purposes, in particular.
More array bounds checking for Emu::Ppa
REGAL_WRANGLER mode for loader-only Regal - initial groundwork.
2013-09-25 15:25:16 -05:00
Nigel Stewart
e6d0d944a4 Split ContextInfo into context and emulation information structs.
Refresh GoogleMock from upstream.
Regal initialization for selected WGL functions.
Assertion fixes.
2013-09-13 10:24:16 -05:00
Nigel Stewart
89ff20c375 Fixes for Android
Update googletest sources
Add ContextInfo support for GL 4.3 and 4.4
Improved Ppca test coverage
Added logging for Regal API methods
Improved layer enable/disable logic in RegalContext
JSON parser updates
Makefile build of tiger example added
Using scoped_ptr for RegalContext data
2013-08-30 18:57:56 -05:00
Nigel Stewart
5157da1820 Emscripten now working for dreamtorus.
Initial scaffolding for GLX emulation on EGL/WGL/CGL.
Ppca refinements.
Add GL_NV_blend_equation_advanced and GL_NV_blend_equation_advanced_coherent support.
RegalX11.cpp added for fake X11 purposes for GLX emulation.
GLEW refresh.
Fixups for REGAL_SYS_EMSCRIPTEN_STATIC mode.
2013-08-23 09:49:09 -05:00
Nigel Stewart
41f9b271b0 Consolidation of environment variable queries at runtime.
ARB_texture_cube_map and EXT_texture_cube_map for ES 2.0
IFF emulation improvements
Emscripten build improvements
Update zlib to version 1.2.8
Update libpng to version 1.6.3
Update mongoose to version 3.8
2013-08-09 16:54:25 -05:00
Nigel Stewart
b1128f1a0c Reorganize Makefile build into a more modular scheme.
Cleanup of RegalDispatchTraceExclude.py for better clarity / TODO purposes.
2013-08-05 14:58:34 -05:00
Nigel Stewart
b79468111a Initial integration of apitrace as Regal dispatch layer
http://apitrace.github.io/
Update current context only when MakeCurrent call succeeds
Check parsed ES version number
2013-07-21 23:51:29 -05:00
Nigel Stewart
47bbe699cd Add Regal support for GL_ANGLE_timer_query and GL_INTEL_map_texture
GLEW refresh to Sourceforge top-of-tree
Codegen refinement - sort enums by name for switch statements, etc
ARB_multitexture emulation for ES 2.0
(ARB|EXT)_texture_env_combine and (ARB|EXT)_texture_env_dot3 for ES 2.0
2013-07-17 16:40:10 -05:00
Nigel Stewart
917b7726b7 Add GL_R and GL_RG formats from ARB_texture_rg and EXT_texture_rg
ARB_multitexture emulation for ES 2.0
2013-07-10 14:21:57 -05:00
Nigel Stewart
20b5c5379d Extend RegalPlugin to provide name based lookup.
Regal.h touch-ups for harmonizing with apitrace.
API database support for maps of per-platform types.
2013-07-06 00:17:05 -05:00
Nigel Stewart
6d683dd297 ARB_draw_buffers emulation for ES 2.0
glReadBuffer emulation for ES 2.0
JSON support for hint emulation layer.
2013-06-29 18:56:47 -05:00
Nigel Stewart
be8dc8b892 Emulation support for DSA gl(Enable|Disable)VertexArrayEXT and VertexArrayOffset commands.
Initial implementation of Draw*Elements*BaseVertex* emulation.
IBM_texture_mirrored_repeat extension emulation for ES 2.0.
Use REGAL_CALL for GLDEBUGPROC* function typedefs.
Fix logging of string in glNamedProgramStringARB.
Fix logging of commands with ref and mask.
2013-06-15 08:52:59 -05:00
Nigel Stewart
0c089bf5bc DispatcherGlobal added for global (GLX/WGL/EGL) API dispatch layering.
Work-in-progress: apitrace dispatch layer for Regal, not enabled yet.
Added All.sln for VC10 purposes.
2013-06-05 23:06:03 -05:00
Nigel Stewart
1105d274ad Initial implementation of statistics gathering dispath. REGAL_STATISTICS=1
FreeGLUT refresh.
RegalClientState functionally complete.
2013-05-30 07:13:53 -05:00
Nigel Stewart
21ad75c27b Revamp TLS (thread local storage) for storing more than context pointer per thread.
Add RegalPlugin private API for plugin dispatch layers to call back into Regal.
Resolve snappy library Windows compilation warnings.
Improvements for filtering emulation.
Support EXT_framebuffer_object on ES 2
2013-05-26 14:19:58 -05:00
Nigel Stewart
ce5591509a Refresh VC projects to resolve TargetPath warnings
GL_TEXTURE_BORDER_COLOR needs to be stored as GLfloat instead of GLint
Fix Dsa emulation of renderbuffer objects
2013-04-08 21:12:19 -05:00
anatoly techtonik
081b6fce64 Use standard Python convention for the entrypoint.
Python is not a Java - no need to use classes where
they are not needed. The __main__ convention makes
it easier to locate entrypoints for experienced
Python users, and also allows to use Export.py as a
library.
2013-02-18 19:18:03 +03:00
Nigel Stewart
9f92aa94e7 Restructure scripts directory - scripts/api for database and Api code
Extend GL database to list per-extension information
EmuFilter layer - selective ES 2.0 filtering
Increase the strictness of emulation regex matching - must be unique
Initial implementation of JSON output
2013-02-12 14:22:00 -06:00
Lloyd Pique
e665896705 Bring in Google Mock
* Integrate Google Mock (at their trunk SVN revision 410 --
    http://code.google.com/p/googlemock/source/detail?r=410). Note only
    a subset of files are included (things like the LICENSE file, the include/
    directory, and the src/ directory)

  * Revise the build rules for libgtest. Just compile gmock-all.cc, and
    also compile gmock-all.cc to build a libgtest that includes both
    Google Test and Google Mock. Initially I had a separate library, but
    I didn't think it made sense to keep them separate.

  * Add a RegalDispatchGMock.py dispatch generator, which generates
    test/RegalDispatchGMock.cpp/.h, which in turn takes the C style
    functions used by the Regal dispatch table and turns them into calls on
    a Google Mock implementation. Modifies scripts/Export.py to know about
    a test source code directory, and to invoke the new code generator.

  * Add testRegalState.cpp which requires Google Mock work correctly, and
    which adds a simple test that Regal::State::Depth::Set() invokes
    the right series of calls in the dispatch layer in order to set a new
    depth state.

  * Remove the demonstrative test I added to tests/test_main.cpp, as there
    are now many tests and this one was not valuable beyond the "Google
    Test works" stage.

  * Fix the null build. `make` and then `make` immediately afterwards
    was rebuilding libraries since the libraries depended on the lib/
    subdirectory, but that directory ended up with a modification time
    later than that of the library, causing make to think it needed to
    build the library again on the next round. Likewise there were
    dependencies on bin/ for things that were then built into bin/.
    Rather than having a rule `bin: mkdir -p bin`, I modified other
    rules to do a `mkdir -p $(dir $@)` to ensure the destination
    directory existed before running the linker or archiver.

  * Fix a few other dependency issues I uncovered when doing `make clean
    && make -j20`, where some libraries were being used before being
    built.

Caveats -- Please read!

  1. Google Mock does quite a bit of code generation through its macros
     and templated implementation. RegalDispatchGMock.cpp can take
     minutes to compile, due to the size of the API. On my machine,
     the output .o file is a huge 24 megabyte binary.

  2. The incremental compile time is also unfortunately a bit large.
     Touching testRegalState.cpp means reading and expanding the macros
     in RegalDispatchMock.h, which takes tens of seconds to do.

     Unfortunately with the way that Google Mock interfaces are defined,
     there is no seperation of the mock interface from its
     implementation. All tests that include RegalDispatchMock.h will
     incur overhead in expanding macros and setting up class data for the
     full API.

  3. Google Mock by default only supports functions with at most ten
     arguments. There were a handful of functions that are larger than
     this in the dispatch interface. I chose to set up the code
     generator to silently ignore these calls rather than forwarding
     them to the generated mock interface.

     Google Mock contains a number of .pump files which define a default
     call arity of 10, and it is perfectly possible to invoke
     googletest/scripts/pump.py to regenerate these files to allow for a
     larger arity, but I felt that keeping the default for now was fine.

     Regal looks like it needs an arity of 15 if all functions are to be
     mocked.
2013-01-14 14:35:44 -08:00
anatoly techtonik
61849537d6 scripts: Outdir should contain src and includes. 2012-12-24 22:21:04 +03:00
anatoly techtonik
180c0c69eb scripts: Rename genArgs.outdir to genArgs.srcdir
Because this is what it really is.
2012-12-24 22:12:34 +03:00
anatoly techtonik
f7114352c4 Export.py: outdir.strip() is unnecessary. 2012-12-24 22:04:35 +03:00
anatoly techtonik
ca59a0779e Export.py: Create output directory if it not exists.
This also adds error message when output dir is not set.
2012-12-24 19:20:50 +03:00
anatoly techtonik
eff7a58e36 Allow Export.py to be run from any directory.
Before this change Export.py only worked from project root.
2012-12-24 17:48:12 +03:00
Nigel Stewart
4320059302 Merge from git://github.com/adhoc-bobcat/regal.git gles2_texture_conversions - some conflicts resolved manually. 2012-12-20 12:00:10 -06:00
Lloyd Pique
f7793586a8 Implement a Texture Conversion Emulation recipe
A patch for issue #31.

Under an GLES2 API (and specifically Pepper implementation of GLES2),
calls to glTexSubImage2D may be required to use a type and format for
the new data that matches the underlying texture type/format, so that
the GLES2 implementation is a simple, straight copy of the data.

This means that in order for Regal to emulate the less strict OpenGL
interface, it must perform texture format conversions when calling a
GLES2 backend.

This patch adds such an emulation recipe, that:

1) Shadows the state of textures, so that Regal knows the underlying
formats, and
2) On a call to glTexSubImage2D, if the caller is passing something that
doesn't match the underlying texture format, Regal will handle the
conversion.

This patch makes a few assumptions that may need to be relaxed with
further changes:

* Only OpenGLES 2.0 compatible texture types and formats are supported.
  GL_BGRA and GL_UNSIGNED_BYTE_3_2_2 for example, while easy to add, are
  not. Other more general OpenGL formats could be added to, with a bit
  more work.
* As per the GLES2.x spec, only GL_UNPACK_ALIGNMENT is assumed to be
  relevant.
* To avoid a combinatorial explosion, all texture conversions are too
  and from a simple GL_RGBA, GL_UNSIGNED_BYTE intermedate format.
2012-12-19 13:34:36 -08:00
Nigel Stewart
23dfaeec15 RegalDispatchCode for direct C code output - initial implementation.
RegalSo optimizations.
Merged GLX/EGL and GL/GLES entry-point loading for Linux.  x86, x86_64 and ARM.
GLenum to string conversion refinements, prefer non-extension, ARB, KHR and so on.
GL spec database entries for maxSize of input parameters.  (vs output size)
2012-12-16 11:16:12 -06:00
Igor Chernyshev
2c1c9cf539 Rename NACL to PPAPI in GL-related contexts.
PPAPI is an API which contains GLES2 calls. The Chrome plugin,
on the other hand, could be NaCl-based or Trusted (for Windows,
Linux and perhaps Mac). So, the API name (PPAPI in our case)
is somewhat orthogonal to the target platform.

See https://github.com/p3/regal/pull/30
2012-12-06 16:50:49 -08:00
Nigel Stewart
0cd4183d29 Initial merge of Igor Chernyshev's OpenGL context sharing support.
Initially supporting single-threaded operation only.
Uses Regal::shared_map and Regal::shared_list alternatives to std::map and std::list.
RegalShareContext API added for grouping OpenGL contexts that share state.
RegalDestroyContext API added for releasing per GL context Regal resources.
Some consolidation of threading code into RegalThread.h
2012-11-05 21:11:59 -06:00
Nigel Stewart
c9d9fd976e Use lookup3 hashing library by Bob Jenkins for fixed-function state caching. 2012-10-29 18:25:58 -05:00
Nigel Stewart
f542d0b6ac Modularize Export.py into scrpts/regal/...
Refresh mongoose sources from github
Resolves MS compiler warnings by casting double to float for remapping.
Regal.h refinements
Initial GLX enum support for RegalToken.h
2012-08-28 07:38:34 -05:00
Nigel Stewart
acbbdbc920 Annotate gl.py with enableCap for ES 2.0 allowed glEnable caps.
Do checking in RegalDispatchEmu.cpp to avoid invalid glEnable/glDisable calls.
Tag ES 2.0 defines with .esVersions = [ 2.0 ]
Support per-function re-mapping to ES2.0 API - for example glClearDepth -> glClearDepthf
NaCL dreamtorus added.
2012-08-27 08:12:09 -05:00
Nigel Stewart
227bf34aa4 Improved REGAL_STATIC_EGL support.
Merged git://github.com/greggman/regal.git ifdef-stuff branch.
Add src/regal/RegalSystem.h to match REGAL_SYS_FOO for Regal.h.
2012-08-25 23:14:55 -05:00
Gregg Tavares
b568bfb1b1 ifdef to def 2012-08-24 14:23:02 -07:00
Nigel Stewart
1bd8eaea10 Add EGL static dispatch initialisation for ES2/EGL static linking purposes.
Re-do ES2 dispatch table initialization.
eglMakeCurrent calls RegalMakeCurrent.
Avoid crashing if Regal::GetProcAddress points to Regal entry point. (oops!)
README.rst updates - REGAL_NO_TLS, etc.
Rename GL_REGAL_enable GL_LOADER_REGAL to GL_DRIVER_REGAL

Compile-time support for REGAL_DRIVER.
Add support for compile-time REGAL_EMULATION=0 to compile-out emulation support.
Add support for REGAL_EMULATION environment variable - replaces REGAL_NO_EMULATION.
2012-08-24 13:49:40 -05:00
Nigel Stewart
2cee20d23f Initial implementation of GL_REGAL_enable.
GLUT dreamtorus keyboard hooks for toggling dispatch layers, one by one.
NaCL build fixups.
2012-08-22 10:55:21 -05:00
Nigel Stewart
6179f0a973 Replace DispatchState with Dispatcher
Further NaCL branch harmonization
Add initial static-linking ES2 dispatch support
2012-08-21 00:04:09 -05:00
Nigel Stewart
2ab57ed958 Initial Regal support for GL_REGAL_ES1_0_compatibility and GL_REGAL_ES1_1_compatibility.
Improved build support for NaCL.
GLEW refresh.
2012-08-19 19:36:32 -05:00
Nigel Stewart
049cc60b25 Merge NaCL branch: https://github.com/johnmccutchan/regal
Initial GL_REGAL_enable infrastructure for runtime glEnable/glDisable control of Regal features such as error and debug checking.
Add support for REGAL_NO_TLS compile flag.
GLEW refresh.
Public domain license for dreamtorus example code.
2012-08-15 23:46:33 -05:00
Nigel Stewart
d77c077a9f NaCL variant of RegalMakeCurrent.
Extend GL_REGAL_log extension to support callback function for output.
Consolidate glBegin/glEnd state tracking into RegalContext.
glBegin/glEnd indentation for logging.
GLEW refresh for GL_REGAL_log.
2012-08-13 12:48:06 -05:00
Nigel Stewart
14dba43de3 Added RegalDispatchMissing.cpp for NaCL dispatch table purposes.
Optionally reduce binary size by use of REGAL_LOG=0, REGAL_DEBUG=0 and REGAL_ERROR=0 at compile time.
Fix for GL_TRIANGLE_FAN emulation buffer restart.
Fixes for environment variable handling for REGAL_LOG, REGAL_DEBUG and REGAL_ERROR.
Resolve zero-size glBufferData/glDrawArrays calls.
2012-08-11 00:46:20 -05:00
Nigel Stewart
41530b01c7 Initial code generation for Google Native Client (NaCL) support. 2012-08-09 16:14:14 -05:00
Nigel Stewart
4a5959d3a0 Merge NaCL changes with modifications from git://github.com/johnmccutchan/regal.git
Cleanup minimal win32 dreamtorus example code.
GL_KTX_buffer_region functions do not have EXT suffix.
Workaround for gdi32 SetPixelFormat without opengl32.dll loaded.
2012-08-08 09:22:52 -05:00
Nigel Stewart
a08b97c9d2 Update GL, GLX and WGL API databases to GL 4.3 and related extensions. 2012-08-07 11:42:24 -05:00
Nigel Stewart
65a0efee06 Update to GLEW 1.9.0, including GL 4.3
Makefile build for RegalGLU
Add ccache support to Makefile build
2012-08-06 16:15:33 -05:00
Nigel Stewart
53c2c8f97e VC10 project update. 2012-08-03 08:27:32 -05:00
Nigel Stewart
30b994ac14 Add code generation scripts. (make export)
Add GL, GLX, WGL, CGL, EGL API databases for code generation purposes.
Reduce the order dependence of code generation.
Android build refinements.
2012-08-01 23:53:54 -05:00