José Fonseca [Sat, 3 Dec 2011 10:04:14 +0000 (10:04 +0000)]
Merge branch 'glproc-cleanup'
Alexandros Frantzis [Fri, 2 Dec 2011 12:22:56 +0000 (14:22 +0200)]
Cast native types to EGL types when calling EGL functions.
This is needed to resolve build failures on some platforms that support
various EGL backends and, therefore, native types. Note that we can't
use reinterpret_cast<>() as the types involved are not necessarily
pointers or integers e.g. they can be typedef-ed types.
Alexandros Frantzis [Fri, 2 Dec 2011 12:14:47 +0000 (14:14 +0200)]
Use libGLESv2.so.2 as the OpenGL ES 2.0 library SONAME.
Although the spec doesn't propose a SONAME, this seems to be the most
widely adopted name in the Linux world.
José Fonseca [Fri, 2 Dec 2011 16:13:31 +0000 (16:13 +0000)]
Fix typo in previous commit.
José Fonseca [Fri, 2 Dec 2011 15:56:46 +0000 (15:56 +0000)]
Fix build on certain mingw versions.
José Fonseca [Wed, 30 Nov 2011 07:04:44 +0000 (07:04 +0000)]
Introduce call flags.
A central place for metainfo such as whether a call terminates a frame
or not, etc.
No trace format changes yet. Will introduce them later after more
careful thought.
José Fonseca [Thu, 1 Dec 2011 21:36:31 +0000 (21:36 +0000)]
Make the GLenum_int hack for MacOS robust against include order.
José Fonseca [Fri, 2 Dec 2011 07:56:54 +0000 (07:56 +0000)]
Try to do the right thing with EGL symbols.
José Fonseca [Thu, 1 Dec 2011 21:37:21 +0000 (21:37 +0000)]
Fix glretrace on MacOSX.
José Fonseca [Thu, 1 Dec 2011 21:36:31 +0000 (21:36 +0000)]
Make the GLenum_int hack for MacOS robust against include order.
José Fonseca [Thu, 1 Dec 2011 21:09:57 +0000 (21:09 +0000)]
Cleanup glproc.
Based on some of Alexandros Frantzis code/ideas.
Alexandros Frantzis [Thu, 1 Dec 2011 13:59:23 +0000 (15:59 +0200)]
Don't call GLX functions when compiling the EGL retracer.
This is a temporary fix, until we implement a dedicated EGL-based,
GL/GLES1/GLES2 state dumping mechanism.
Alexandros Frantzis [Thu, 1 Dec 2011 13:52:32 +0000 (15:52 +0200)]
Produce dispatchers for all functions, even in retrace mode.
José Fonseca [Thu, 1 Dec 2011 10:09:07 +0000 (10:09 +0000)]
Don't free fbconfig.
It doesn't belong to us.
Fixes segfault on exiting glretrace.
José Fonseca [Thu, 1 Dec 2011 10:03:14 +0000 (10:03 +0000)]
Replace dynamic casts with static on glws.
We know as a fact that the type matches.
José Fonseca [Thu, 1 Dec 2011 09:30:12 +0000 (09:30 +0000)]
Make gltxt.py obbey prefix option for types too.
José Fonseca [Thu, 1 Dec 2011 09:00:50 +0000 (09:00 +0000)]
Minor cleanups and better documentation for the spec generation scripts.
José Fonseca [Tue, 29 Nov 2011 23:25:13 +0000 (23:25 +0000)]
Update docs.
José Fonseca [Tue, 29 Nov 2011 11:01:05 +0000 (11:01 +0000)]
Support 'apitrace diff-images' on Windows.
José Fonseca [Tue, 29 Nov 2011 06:50:25 +0000 (06:50 +0000)]
Update glws Cocoa bindings too.
José Fonseca [Tue, 29 Nov 2011 00:25:12 +0000 (00:25 +0000)]
Refactor the code to find scripts.
Hopefully fixes scripts on Windows too, but untested yet.
José Fonseca [Tue, 29 Nov 2011 00:22:41 +0000 (00:22 +0000)]
Install snapdiff.py as well.
José Fonseca [Mon, 28 Nov 2011 21:48:58 +0000 (21:48 +0000)]
Cache context profile in glws::Context.
José Fonseca [Sun, 27 Nov 2011 15:16:34 +0000 (15:16 +0000)]
Allow to retrace with EGL too.
José Fonseca [Sun, 27 Nov 2011 15:15:33 +0000 (15:15 +0000)]
Allow to specify an initial call no in the qapitrace command line.
José Fonseca [Sun, 27 Nov 2011 12:32:00 +0000 (12:32 +0000)]
Add "apitrace repack" command.
José Fonseca [Sun, 27 Nov 2011 12:15:32 +0000 (12:15 +0000)]
Return read bytes in File::read().
José Fonseca [Sun, 27 Nov 2011 12:18:24 +0000 (12:18 +0000)]
Don't call overridden virtual methods from the base destructor.
It causes the program to terminate with "pure virtual method called"
error, as the derived class members are no longer accessible.
Kan-Ru Chen [Thu, 10 Nov 2011 02:57:04 +0000 (10:57 +0800)]
Always try dlsym before get eglGetProcAddress
Some implementation could return garbage from eglGetProcAddress
José Fonseca [Sun, 27 Nov 2011 12:04:13 +0000 (12:04 +0000)]
Add hyperlinks for non-ARB extensions too.
José Fonseca [Sat, 26 Nov 2011 10:50:39 +0000 (10:50 +0000)]
Require gles1 and gles2 modules for EGL support (fixes issue #58).
José Fonseca [Fri, 25 Nov 2011 13:37:37 +0000 (13:37 +0000)]
Fix GUI visualization of floating point values.
According to http://doc.qt.nokia.com/stable/qvariant.html#type ,
variant types are actually QMetaType::Type, which includes floats.
So handle the QMetaType::Float case everywhere.
José Fonseca [Fri, 25 Nov 2011 13:16:35 +0000 (13:16 +0000)]
Trace via "apitrace trace" command.
It could be done via the library directly, but this allows to use
QProcess as before, and therefore run asynchronously without extra effort.
Kan-Ru Chen [Fri, 25 Nov 2011 03:02:01 +0000 (11:02 +0800)]
Remove unused includes from trace_file.cpp
José Fonseca [Fri, 25 Nov 2011 11:26:08 +0000 (11:26 +0000)]
Add links to EXT_framebuffer_object spec.
José Fonseca [Fri, 25 Nov 2011 11:15:06 +0000 (11:15 +0000)]
Fix internalformat determination for renderbuffers.
glGetRenderbufferParameteriv takes a target.
José Fonseca [Thu, 24 Nov 2011 20:09:41 +0000 (20:09 +0000)]
Cleanup and generalize os string class.
José Fonseca [Thu, 24 Nov 2011 19:12:34 +0000 (19:12 +0000)]
Kill glsnapshot.
The ability of taking snaphshots while tracing was meant for test
automation of apitrace itself, but even so, it was not very robust
-- apps that used glXCreateWindow would not find be able to determine
window id --, so remove this now that a custom made test suite is
being developed.
Carl Worth [Thu, 17 Nov 2011 22:04:16 +0000 (14:04 -0800)]
Parse doubles to a new Double class rather than to the Float class.
This is simply a case of not discarding information. Without this, it would
not be possible to parse a trace and re-create the identical trace.
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
Carl Worth [Wed, 16 Nov 2011 04:54:01 +0000 (20:54 -0800)]
TODO: Fix typo in the description of the range specification.
The syntax example was updated from using '@' to '/' some time ago,
but the description still had the old '@' symbol.
José Fonseca [Thu, 24 Nov 2011 16:30:49 +0000 (16:30 +0000)]
Prevent segfault on glretrace crash (fixes issue #52).
On glretrace crash, both error and finished QProcess events are emitted, by
this order. Members were reset on error, causing null pointer dereference
on replayFinished.
Fix this by handling abnormal termination on replayFinished too.
replayError should probably removed/merged into replayFinished.
José Fonseca [Thu, 24 Nov 2011 15:09:47 +0000 (15:09 +0000)]
Abort on failure to open trace (fixes issue #50).
Carl Worth [Mon, 14 Nov 2011 19:05:11 +0000 (11:05 -0800)]
snapdiff: Drop the --version option
This isn't currently giving any actual information, and it doesn't fit
well with the new top-level apitrace command, (which should presumably
take care of any --version option itself).
Carl Worth [Sat, 12 Nov 2011 00:58:05 +0000 (16:58 -0800)]
Add "apitrace diff-images" command
Which simply calls out to the existing snapdiff.py script, (notably,
it also passes "apitrace diff-images --help" to snapdiff.py as well).
Zack Rusin [Thu, 17 Nov 2011 21:00:41 +0000 (16:00 -0500)]
Encode format as a member and not part of the label.
José Fonseca [Thu, 17 Nov 2011 15:47:17 +0000 (15:47 +0000)]
Fix MinGW-w64 build without DXSDK.
José Fonseca [Thu, 17 Nov 2011 15:45:10 +0000 (15:45 +0000)]
Allow to enable/disable EGL support.
As done with GUI, to avoid automagic dependencies.
José Fonseca [Tue, 15 Nov 2011 21:28:08 +0000 (21:28 +0000)]
Ignore generated files.
José Fonseca [Tue, 15 Nov 2011 18:47:20 +0000 (18:47 +0000)]
Fix whitespace in CMakeLists.txt.
José Fonseca [Tue, 15 Nov 2011 09:52:15 +0000 (09:52 +0000)]
Keep Copyright lines together.
José Fonseca [Tue, 15 Nov 2011 09:28:01 +0000 (09:28 +0000)]
Drop glPointSizePointerOES from eglimports.hpp.
MinGW doesn't like it for some reason and it doesn't seem to be needed.
Chia-I Wu [Tue, 8 Nov 2011 21:31:58 +0000 (14:31 -0700)]
gles: Fix retrace of eglCreateContext for GLES contexts
Check the current API and the attribute list to determine the profile of the
context.
Chia-I Wu [Tue, 8 Nov 2011 21:33:57 +0000 (14:33 -0700)]
gles: Add eglretrace
It works like glretrace, except that an EGL-based glws implementation is used.
Chia-I Wu [Mon, 7 Nov 2011 21:10:46 +0000 (14:10 -0700)]
gles: Add support for GLES retracing
GLES entrypoings are added to glretrace.py, as if GLES is just an extension to
GL.
Chia-I Wu [Mon, 7 Nov 2011 21:33:25 +0000 (14:33 -0700)]
glws: Add EGL/Xlib-based implementation
This is based on glws_glx, with GLX replaced by EGL. This is also the only
glws implementation that supports GLESv1 and GLESv2 profiles.
Chia-I Wu [Mon, 7 Nov 2011 23:12:29 +0000 (16:12 -0700)]
glws: Add support for profiles
The valid profiles are PROFILE_COMPAT, PROFILE_ES1, and PROFILE_ES2. They
stand for desktop GL with compatibility profile, GLESv1, and GLESv2
respectively. Update createContext to take profile as the last parameter.
Chia-I Wu [Mon, 7 Nov 2011 21:45:20 +0000 (14:45 -0700)]
glws: Allow the attribute terminator to be specified
This is needed to support EGL attribute lists. They have EGL_NONE, instead of
zero, as the list terminator.
Chia-I Wu [Wed, 2 Nov 2011 17:10:00 +0000 (01:10 +0800)]
gles: Add support for GLES tracing to egltrace
Override GLES entrypoints and set the tracer context's profile when
eglMakeCurrent is called. This allows egltrace to trace GLES apps.
Chia-I Wu [Wed, 2 Nov 2011 17:59:22 +0000 (01:59 +0800)]
gles: Prepare __gl_image_size for GLES
__gl_image_size queries several GL states that are not available in GLES
contexts. The defaults work for GLES so those queries can be safely skipped.
Chia-I Wu [Wed, 2 Nov 2011 17:37:36 +0000 (01:37 +0800)]
gles: Add ES1 and ES2 profiles to glretrace.py
Some of the internal GL calls we make generate GL_INVALID_ENUM or other errors
when tracing an GLES app. We need to know the profile of the current context
to adapt the calls made.
Chia-I Wu [Thu, 3 Nov 2011 04:45:00 +0000 (12:45 +0800)]
gles: Update glproc.py
Generate dispatch functions for GLES API.
Chia-I Wu [Wed, 2 Nov 2011 13:38:26 +0000 (21:38 +0800)]
gles: add GLES API spec
Only entrypoints found in OpenGL ES 1.1 and OpenGL ES 2.0 are added. No
extension support yet. This could limit the usefulness a lot.
Chia-I Wu [Wed, 2 Nov 2011 13:12:51 +0000 (21:12 +0800)]
gles: Include GLES headers in eglimports.hpp
They are always included to make sure we have GLES types and enums defined.
This allows us to treat GLES effectively as an extension to GL, without having
to put #ifdef's at multiple places.
Chia-I Wu [Wed, 2 Nov 2011 13:13:47 +0000 (21:13 +0800)]
gles: Add Khronos GLES headers
Chia-I Wu [Wed, 2 Nov 2011 17:32:35 +0000 (01:32 +0800)]
Add profile to tracer_context
The profile of the context, which is always PROFILE_COMPAT for now.
Chia-I Wu [Wed, 2 Nov 2011 17:19:46 +0000 (01:19 +0800)]
Add tracer_context as the tracer's context
For now, it is just a static struct replacing __user_arrays*. Later, we can
add more fields to cache more GL states (e.g. is there a PBO bound?), support
multiple contexts, and etc.
Chia-I Wu [Wed, 2 Nov 2011 13:45:47 +0000 (21:45 +0800)]
Add GL_FIXED to __gl_type_size
It is needed for GL_ARB_ES2_compatibility (and GLES).
Zack Rusin [Thu, 17 Nov 2011 04:52:15 +0000 (23:52 -0500)]
Make the details view a bit clearer.
most importantly show the frame number
Zack Rusin [Thu, 17 Nov 2011 03:44:05 +0000 (22:44 -0500)]
Return format info for both textures and framebuffers.
Incredibly useful, especially that we don't encode anything
but 32bpp rgba correctly.
Zack Rusin [Thu, 17 Nov 2011 03:43:34 +0000 (22:43 -0500)]
Add depth info to the surfaces.
Zack Rusin [Wed, 16 Nov 2011 02:33:31 +0000 (21:33 -0500)]
Fix fetching of the data for uniform arrays.
The initial array element is usually returned as arrayName[0] not
arrayName which means that we were usually creating two-dimensional
arrays for those elements which in turned always returned garbage.
José Fonseca [Fri, 11 Nov 2011 20:12:15 +0000 (20:12 +0000)]
Warn for QueryInterface with unknown IIDs.
José Fonseca [Fri, 11 Nov 2011 14:56:42 +0000 (14:56 +0000)]
Abstract execv().
José Fonseca [Wed, 9 Nov 2011 12:08:39 +0000 (12:08 +0000)]
Add missing terminator.
José Fonseca [Thu, 10 Nov 2011 06:37:13 +0000 (06:37 +0000)]
Add an "--api" option to "apitrace trace" allowing to choose egl.
José Fonseca [Thu, 10 Nov 2011 05:55:47 +0000 (05:55 +0000)]
Build egltrace.so into the wrapper dir.
Chia-I Wu [Wed, 2 Nov 2011 12:16:36 +0000 (20:16 +0800)]
egl: add retracing support for EGL
As the glws abstraction supports desktop GL, EGL retrace will abort with a
warning when the trace file tries to create a GLES context.
Chia-I Wu [Wed, 2 Nov 2011 10:11:53 +0000 (18:11 +0800)]
egl: add EGL tracer
This tracer supports EGL/OpenGL applications for now. Support for GLES is
missing, but can be added later. There are two new macros defined. HAVE_EGL
indicates that the system has EGL available. It will make eglimports.h
include EGL headers.
There is also TRACE_EGL. It indicates that EGL, instead of the OS-dependent
GLX/CGL/WGL, is the winsys API to trace,
José Fonseca [Sun, 6 Nov 2011 10:13:49 +0000 (10:13 +0000)]
cmake: include FindPkgConfig.
Chia-I Wu [Wed, 2 Nov 2011 10:30:28 +0000 (18:30 +0800)]
add support for (key, val) attribute list
A (key, val) attribute list has this format
{ key1, val1, ..., keyN, valN, terminator }
and the size is 2*N + 1
Chia-I Wu [Thu, 3 Nov 2011 04:24:53 +0000 (12:24 +0800)]
egl: Update glproc.py
Generate dispatch functions for EGL API.
Chia-I Wu [Thu, 3 Nov 2011 04:23:21 +0000 (12:23 +0800)]
egl: Add EGL API spec
Only those defined by EGL 1.4, no extensions yet. This limits the usefulness
a lot.
Chia-I Wu [Wed, 2 Nov 2011 10:47:23 +0000 (18:47 +0800)]
egl: Add eglimports.hpp
This header file is included by glimports.hpp. It is made a separate file
file so that we can add the (messy) GLES includes to it later without
complicating glimports.hpp.
Chia-I Wu [Wed, 2 Nov 2011 11:37:40 +0000 (19:37 +0800)]
egl: Add Khronos EGL headers
Use our own egl.h and eglext.h, but system's platform headers (eglplatform.h
and khrplatform.h).
Carl Worth [Sat, 5 Nov 2011 00:04:15 +0000 (17:04 -0700)]
Add new "apitrace diff-state" command
Which is simply a convenient way to invoke the existing jsondiff.py script,
(which is now installed by "make install" to support this command).
José Fonseca [Sun, 6 Nov 2011 09:01:12 +0000 (09:01 +0000)]
doc: Prefer `apitrace diff` over tracediff.sh.
José Fonseca [Sun, 6 Nov 2011 08:58:30 +0000 (08:58 +0000)]
cli: Pass apitrace path to tracediff.sh.
So that it works automatically from the build directory too.
Carl Worth [Fri, 4 Nov 2011 22:45:09 +0000 (15:45 -0700)]
cli: Add a new "apitrace diff" command.
This command simply provides a more consistent way of getting access
to the existing tracediff.sh command, (which is now installed to
<prefix>/lib/apitrace/scripts for the "apitrace diff" command to
invoke, but not necessarily for users to invoke directly).
Carl Worth [Fri, 4 Nov 2011 22:42:02 +0000 (15:42 -0700)]
Separate wrappers/ and scripts/ under <prefix>/lib/apitrace
We now define a new APITRACE_SCRIPTS_INSTALL_DIR:
<prefix>/lib/apitrace/scripts
where scripts will soon be installed (as needed).
Meanwhile, APITRACE_WRAPPER_INSTALL_DIR is updated to:
<prefix>/lib/apitrace/$arch/wrappers
(where before it didn't have the final "wrappers" directory).
Carl Worth [Fri, 4 Nov 2011 23:20:57 +0000 (16:20 -0700)]
Fix "apitrace trace" when running from installed location.
A missing path separator was causing the wrapper library to fail to be found.
José Fonseca [Sat, 5 Nov 2011 08:50:25 +0000 (08:50 +0000)]
gui: Handle incomplete calls.
Should fix issue 48.
José Fonseca [Thu, 3 Nov 2011 19:27:57 +0000 (19:27 +0000)]
Only re-allocate if the snappy cache buffer when it is not big enough.
José Fonseca [Thu, 3 Nov 2011 14:32:45 +0000 (14:32 +0000)]
Update glxtrace.so path in docs.
José Fonseca [Thu, 3 Nov 2011 14:24:01 +0000 (14:24 +0000)]
Fix typo.
José Fonseca [Thu, 3 Nov 2011 14:17:55 +0000 (14:17 +0000)]
Make findFile non-static, given it will be necessary for other commands.
José Fonseca [Thu, 3 Nov 2011 13:59:54 +0000 (13:59 +0000)]
Split common functionality out of cli.
José Fonseca [Thu, 3 Nov 2011 13:19:48 +0000 (13:19 +0000)]
Make file_exists as os::Path method.
José Fonseca [Thu, 3 Nov 2011 12:30:18 +0000 (12:30 +0000)]
Keep info on how to manually retrace in a separate section.
Carl Worth [Wed, 2 Nov 2011 00:54:19 +0000 (17:54 -0700)]
Add a new "apitrace trace" command to the command-line interface.
There is no code to support Windows yet, but there is specific code
for both Linux and Mac OS X. The documentation is also updated to
reflect the new command.
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
José Fonseca [Thu, 3 Nov 2011 11:54:05 +0000 (11:54 +0000)]
Put glxtrace.so also in the wrappers directory.
For consistency among all platforms, per Carl Worth's suggestion,
but the wrappers DLLs must remain in a directory of their own to
avoid interfering with other executables.