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)
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.
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
Merge and harmonize src/apitrace with upstream
Merging Emscripten changes from Vladimir Vukicevic, except Makefile
More entry points for RegalDispatchGMock
- Use BIN.SUFFIX instead of BIN_EXTENSION for consistency
- Don't build static/shared lib if the filename isn't specified
- Examples should depend on static lib if shared isn't built
- Allow overriding release-mode defines for LOG/TLS
- Add SYSTEM=emscripten config
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
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
Add regaltest test coverage for Regal::helper::size::get
Eliminate global/static data in RegalIff.cpp
GL_VERSION_1_2 enums that GLEW missed out on: GL_MAX_ELEMENTS_VERTICES, GL_MAX_ELEMENTS_INDICES
Add GL_SGIS_detail_texture enums to gl.py
Add GL_ARB_viewport_array enums to gl.py
Regal::Config string variables for code generation dispatch layers.
For RegalDispatchCode - name shader and program return variables, rather than generic o output.
Add extra cast through void* to avoid -Wcast-align warning
Fixups for glShaderSource support in RegalDispatchCode
Update NaCl build in accordance with recent Makefile changes.
NaCl binaryes all live in the same folder and have architecutre
in thier filename.
Automatically create nmf file.
Add LOG_CC to Makefile.
Move zlib, libpng, GLU and GLUT source lists into build/foo.inc for Makefile build.
Move NACL_SDK_ROOT logic into config/Makefile.nacl
Makefile revamp - put libs in lib/$(SYSTEM) and binaries in bin/$(SYSTEM)
Add clobber target for wiping out all temps, libs and binaries
Fixups for core and compat profiles.
DXT1 and DXT5 via squishlib, disabled by default.
Per emulation layer force flag REGAL_FORCE_EMU_FOO for Regal::Config.
build/regal.inc for GNU make list of sources and headers.
Updated VC projects.
Extend RegalUtil.h to ensure that REGAL_NO_ASSERT, REGAL_NO_PNG, REGAL_NO_SQUISH, REGAL_NO_TLS are always defined - 0 or 1.
Update boost (subset) to 1.53.0 release.
Add Push/PopClientAttribute emulation for Regal, allowing the full
OpenGL 4.3 compatability profile pixel and vertex array states to be
saved and restored.
These notes and the implementation are based on
glspec43.compatability.20120806.pdf, as well as
http://www.opengl.org/registry/specs/EXT/direct_state_access.txt
This is needed when running on top of a back-end which does not support it
(GLES2), when the caller is an more general OpenGL client.
Specifically, the state mentioned in Tables 23.4 - 23.8 identified as
"vertex array", and the state in Tables 23.34 and 23.35 identified as
"pixel-store" is what is saved and restored.
For the pixel store state, this was straightforward. For the vertex
array state, this was more involved than I initially expected, leading
to this rather large patch. Sorry.
I implemented this version with the following in mind:
* The client state tracking should not constrain itself to the client
state actually supported by the back-end. If the client for example
calls glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_TRUE), we record and
attempt to restore this change in state even if the back-end is
GLES2 which does not support it. If the client never makes this
call, then we never attempt to touch this state on restore.
It is assumed that for GLES2 and other similarly restrictive
back-ends that some other emulation layer will handle it as needed.
* Primarily this change is about implementing emulated versions of
glPushClientAttrib and glPopClientAttrib. All "global" client state
is tracked. Note that some calls would set state inside a Vertex
Array Object if one is bound, and this code ignores those calls
since that goes beyond what was needed. Also, while it implements
glGet for the purposes of constraining certain attribute count
limits and other maximums, it does not otherwise implement any
real functionality to get the shadowed client state.
* Beyond the compatability profile specification, I only handled the
Direct State Access extension, as there was already the RegalDsa
module present to emulate it. I pass the calls through after
shadowing the state, but in restoring state, I went and made the
more stateful calls without using that extension.
* I did my best to track the spec properly. There are a few corner
cases I did not properly handle.
1. This code does not know what buffers and vertex array objects,
etc. are properly allocated. The specification calls for the
interface to not allow an unallocated named object to be bound,
which should mean that this shadowing interface should ignore
the attempt.
2. Between the glBegin() / glEnd() call pair, calls other than
those to set single vertex attributes should fail. The
specification calls out a limited set of functions which might
not (10.8.5, after the errors box).
3. I was uncertain what to do if a state saved on the stack
contained a named object that was deleted. While I check the
current state, and effectively unbind, I did not do so for the
state stack. Some similar handling might need to be done for
bound objects stored inside a Vertex Array Object.
As I neared the end of the work on this patch, I strongly felt that the
following should really be done further down the line:
* With this change, Regal now has much redundancy in code that tracks
client state. I was really tempted to help clean this up, but I
don't feel like I have the time.
I feel like the emulation layer should implement one or more modules
to shadow OpenGL state, which should be all they do. I could see
making them configurable so that for example if vertex array state
was not needed, no attempt would be made to shadow it.
Other modules can then "require" this layer to work. RegalPpca would
then just implement the state stacks, and the Push/pop
functionality.
I'm hoping at least that you will find my implementation at least a
good starting point for this unification. I checked it numerous
times.
* In working through this patch, I looked briefly at the code in
RegalIff, RegalVao, and RegalPpc (the last of which is not
apparently used, and appeared to be the closest to what I wanted to
do in this patch). I used them to cross check my version, but I did
not directly use them as I felt each of them was incomplete (not
implementing all the interfaces, not consistently checking for bad
parameters, ...)
There are still some differences to call out, which should be
resolved at part of the unification:
1. RegalVao implements Vertex Array Objects assuming the back-end
does not. If vertex array state were unified, it would still
perform this function.
2. RegalIff includes some code to handle the having only
8 vertex attributes, and also maps the fixed-function
attributes into generic attribute entries. The mapping seemed
wrong, so I did not do it, but I'm sure the 8 vertex attribute
restriction is important for some platform. Integrating the
state tracking done by this module would also seem like the
most work involved in a unification effort.
3. RegalPpc implements state query functionality, which RegalPpca
does not.
Extend the existing RegalPPa/RegalState functionality to add support for
saving and restoring the server side transform state.
Unlike the other emulated functionlity in RegalState, the code I added
does minimize the state transitions, which is especially a good idea if
the backend does not support certain state (such as clip planes) that
may not be actually set by the Regal client.
Extends the testRegalState test to fully cover the new state code. Adds
a quick test for the PushAttrib/PopAttrib calls.
Half of the fix for Regal Issue #27.
* 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.
Move Regal::Thread dependency from RegalPrivate.h to RegalContext.h
Add jsonsl to src tree, for parsing JSON data.
Extend boost::print to support pad(width) operator for indentation.
Info logging for shader caching.
Logging enhancement for texture parameter.
shaderSourceStrings - to NUL-terminated string.
Build regaltest as part of all Makefile target.
make export - Export.py command-line has changed.
Makefile defaults to MODE=release
Texture parameter logging improvements.
boost::string_list support for splitting glShaderSource string arrays, with optional delimiter
Optional logging of pointers - REGAL_LOG_POINTERS=1 by default
Optional logging of thread, per line of log output - REGAL_LOG_THREAD=0 by default
In Init::context, avoid assertion if thread was previously associated with the context
Optional writing to shader cache - REGAL_CACHE_SHADER_WRITE=1 by default in debug mode
Initial test coverage added for boost::string_list
Add makePath utility function for joining a directory and filename.
Logging refinements
Per-toolchain debug and release flags for Makefile build.
Regal sampler object refinements.
Logging refinements - REGAL_LOG_MAX_BYTES=n for limiiting raw bytes, REGAL_LOG_MAX_BYTES=0 to omit pointers.
Extend boost::print to support optional output.
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.
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)
REGAL_SYS_FOO variables are always defined. (0 or 1)
Initialization refinement for EGL - EmuInit.py added.
Regal::Config support for EGL and GLX at runtime.
Complete list of extensions in Regal::ContextInfo
REGAL_LOG_ONCE for logging warnings and errors once only
Sampler object emulation refinements.
Add the head version of GoogleTest (using
https://git.chromium.org/git/external/googletest.git), with a version
equivalent to Subversion change #625. Note that I've trimmed out some
parts of the tree that aren't directly related to building a working
library (such as their self-tests), but I preserved the special files in
the root directory of the project (such as LICENSE).
Modifies the Makefile to build "lib/libgtest.a" from the Google Test sources.
Adds a tests/ subdirectory for Regal tests. Adds a test_main.cpp file,
which will run all the tests, and contains a trivial test for
verification.
Modifies the Makefile to build and run "bin/RegalTests" from the
tests/ source code if "make tests" is run. The tests however are not
built/run by the "make all"
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
Application-side shaders in Regal.cpp via EmuCache.py
Driver-side shaders via RegalDispatchCache.cpp
Regal::Config support for shader chaching and readback.
REGAL_CACHE=1 global enable/disable of caching in general.
REGAL_CACHE_SHADER=1 enable/disable of shader caching (GLSL only, so far).
REGAL_CACHE_SHADER_READ=1 enable/disable readback from disk cache.
REGAL_CACHE_DIRECTORY directory for caching shaders.
Additional documentation for Regal logging.
For glUseProgram also log glGetAttachedShaders, if applicable.
Fixup for driver logging dispatch - log contents of output parameters too.
Consolidate driver logging dispatch to one line per call, including return value.
Fixup: exit glFrameTerminatorGREMEDY appropriately whether Regal::Frame is in use, or not.
Use -O1 for linux-arm Makefile build, to workaround goofy assembler error.
Fixes for Regal extensions handling.
eglGetProcAddress fix.
Improved EGL logging.
Makefile support for CFLAGS on gmake command line.
Better handling of lib and bin dependencies.
GetProcAddress implementation for REGAL_SYS_GLX && REGAL_SYS_EGL - both GL ES and EGL.