Age | Commit message (Collapse) | Author | Files | Lines |
|
This moves the waffle_test sources into a more canonical location.
Instead of keeping it jailed as a subdir of 'tests' as
'tests/waffle_test', its source is now in 'src/waffle_test' and its
public headers in 'include/waffle_test'.
Keeping things in canonical locations makes it easier to find things if
you don't yet know where they reside.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This continues the conversion of int32_t to `enum waffle_error` began in
commit a5cd4c7.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Using the enum type instead of int makes debugging a little easier.
It just seems like the right thing to do anyway.
v2[chadv]: Update type of waffle_error_info::code in manpage.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
|
|
That is, guard it with the feature macro WAFFLE_API_EXPERIMENTAL.
waffle_window_resize() is proving to dificult to implement because
Waffle lacks an event model.
It seems to work properly on Wayland. It works on CGL but the resize is
janky. It kinda works on composited X11 but interacts badly with GL
rendering; the client needs to stall after resize to provide the
compositor sufficient time to process the request before the client
begins to draw... ouch. I haven't tested it on Android.
So... until waffle_window_resize() actually works it needs to remain
experimental until we do one of:
1. Make it synchronous on all platforms. (I'm having difficulty
doing this on composited X11).
2. Waffle exposes API for an event model, into which window resizes
are integrated. (This is likely the wrong direction).
3. We kill waffle_window_resize().
CC: Juha-Pekka Heikkila <juha-pekka.heikkila@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This macro controls the API exposed by Waffle's headers. Use it to guard
the new API added in waffle 1.3.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This adds support only to core waffle. That is, this patch makes aware
only wcore_config_attrs_parse() and wcore_enum_to_string().
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This adds support only to core waffle. That is, this patch makes aware
only wcore_config_attrs_parse() and wcore_enum_to_string().
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Added waffle_window_resize(self, width, heigh) API call. Currently
implemented only on Android, other platforms return
WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM.
Signed-off-by: Juha-Pekka Heikkila <juha-pekka.heikkila@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Fixes build breakage on Piglit, which uses -std=c90 on Linux. The
'restrict' keyword was introduced in C99.
The #definition of restrict was present in the now deleted header
waffle_portability.h. I forgot to move the #definition during the header
shuffle.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Fold all headers into waffle.h except
- The native platform headers, because users need to be able to select
which to include and exclude.
- waffle_version.h, which is generate at configure time.
When Waffle's documentation consisted of Doxygen in the headers, it was
sensible to maintain a separate header for each class of functions. The
Doxygen was lengthy, thus having separate headers made the documentation
easier to navigate.
Now that the documentation resides in manpage xml, each individual header
is nearly empty. It's silly to have numerous headers that declare only
3 to 4 functions each.
Strictly speaking, removing header files breaks the API. But I'm aware of
no client that will miss the removed headers.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Add enums WAFFLE_CONTEXT_OPENGL_ES3 and WAFFLE_DL_OPENGL_ES3.
Waffle does not yet accept the new enums.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This reverts commit 52df64af6a57d7fabc87afc4685588a2875a83d0.
After more closely reading the EGL_KHR_create_context spec and discussing
its history with Iam Romanick <idr@freedesktop.org>, I decided that
Waffle's interface for creating an OpenGL ES3 context needs changing.
I wish to model it after how GLES3 contexts are created in Khronos' OpenGL
ES3 conformance testsuite.
Discussion of EGL_OPENGL_ES3_BIT_KHR
------------------------------------
In version 13 of the EGL_KHR_create_context spec, the only way to
explicitly request a GLES3 context was to (1) choose an EGLConfig whose
EGL_RENDERABLE_TYPE attribute had the EGL_OPENGL_ES2_BIT set and (2) then
call eglCreateContext with EGL_CONTEXT_MAJOR_VERSION_KHR = 3. In version
14 was added a new enum, EGL_OPENGL_ES2_BIT_KHR, and thus a second way to
explicitly request a GLES3 context.
From a close reading of the EGL_KHR_create_context spec and from
a discussion with Romanick, I discovered that the EGL working group's
preferred method for creating a GLES3 context is that from version 13.
This observation is corroborated by Khronos' OpenGL ES3 conformance
testsuite, which does not use EGL_OPENGL_ES3_BIT_KHR.
Change in Waffle's interface
----------------------------
The original interface, as added by the reverted patch, for creating
a GLES3 context looks like this:
int32_ attrib_list = {
WAFFLE_CONTEXT_API, WAFFLE_CONTEXT_OPENGL_ES3,
0,
};
config = waffle_config_choose(dpy, attrib_list);
ctx = waffle_context_create(config, NULL);
Instead, I wish to change it to follow the original intent of the
EGL_KHR_create_context spec and the precedent in Khronos' OpenGL ES3
conformance testsuite:
int32_ attrib_list = {
WAFFLE_CONTEXT_API, WAFFLE_CONTEXT_OPENGL_ES2,
WAFFLE_CONTEXT_MAJOR_VERSION, 3,
0,
};
config = waffle_config_choose(dpy, attrib_list);
ctx = waffle_context_create(config, NULL);
Issues
------
In reimplementing Waffle's OpenGL ES3 support, I will be careful to
accomodate EGL implementations that require EGL_OPENGL_ES3_BIT_KHR to be
set.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
- Add enum WAFFLE_CONTEXT_OPENGL_ES3.
- Extend wcore_config_attrs_parse() for ES3.
- GLX, CGL:
- Reject ES3 from display_supports_api().
- Reject ES3 configs and contexts.
- EGL:
- Extend display_supports_api() for ES3.
- Extend config and context creation for ES3.
Note: I have access to no driver that supports OpenGL ES3. Once Mesa's
Intel driver acquires ES3 support, I will test this patch against it.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The recently added man pages were based on this doxygen and are now the
canonical source of user documentation. Delete the doxygen so it doesn't
drift out-of-sync with with the man pages.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This error indicates that waffle was built without support for the
requested action.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This adds CMake options that are familiar to autoconf users, such as
CMAKE_INSTALL_LIBDIR. Portage's cmake.eclass expects these variables
to be supported.
This replaces the following CMake options. If the user specifies any of
the old options, then emit a fatal error.
waffle_install_includedir -> CMAKE_INSTALL_INCLUDEDIR
waffle_install_libdir -> CMAKE_INSTALL_LIBDIR
waffle_install_docdir -> CMAKE_INSTALL_DOCDIR
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
All routines in this skeleton will fail.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
waffle_glx.h included <X11/Xlib.h> but not <GL/glx.h>. This patch replaces
the former with the latter, since the latter includes the former.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This header defines WAFFLE_{MAJOR,MINOR,PATCH}_VERSION in order to allow
users to determine the version at configuration and compile time. This
also allows CMake to detect the Waffle's version on systems that don't
have pkgconfig, namely Windows.
Note: This prepares for the 1.0 release.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Install headers into include/waffle-MAJOR/. This will allow multiple major
versions of Waffle to be installed in parallel.
Note: This prepares for the 1.0 release.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
They were not getting installed at all. Oops.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Move headers in include/waffle/native/ to include/waffle/.
Note: This prepares for the 1.0 release.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Fix list of valid platform enums.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Document waffle_make_current and waffle_get_proc_address.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The new name is more clearly conveys the error meaning than the old name,
WAFFLE_ERROR_UNSUPPORTED.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
- Remove redundant comments in waffle_error_get_code().
- Remove references to non-existent function, waffle_finish().
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Remove the forward declarations of the native types for the CGL and
Android platforms. The types were nowhere defined.
If in the future the waffle_*_get_native functions become implemented for
these platforms, then we can easily revert this commit.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The error enums were renamed in 8e5431e. This patch fixes the following
names in the doxygen for waffle_init():
WAFFLE_ALREADY_INITIALIZED -> WAFFLE_ERROR_ALREADY_INITIALIZED
WAFFLE_BAD_ATTRIBUTE -> WAFFLE_ERROR_BAD_ATTRIBUTE
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Describe the actions and conditions that produce each error. Remove some
stale documentation.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
For consistency, rename each token in `enum waffle_error` with the prefix
WAFFLE_ERROR. The exception is WAFFLE_NO_ERROR, which is not renamed.
This changes follows the precedent of Wayland, and makes it much easier to
grep for error cases.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Remove WAFFLE_NOT_IMPLEMENTED. That error shouldn't be part of a public
API.
Remove WAFFLE_INCOMPATIBLE_ATTRIBUTES. This was never used.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Add the following headers:
waffle_glx.h
waffle_wayland.h
waffle_x11_egl.h
Each header defines the types returned by waffle_$x_get_native for the
respective platform. The types defined are:
struct waffle_$x_config
struct waffle_$x_context
struct waffle_$x_display
struct waffle_$x_window
This patch intentionally neglects waffle_cgl.h because I haven't yet
decided how to define the waffle_cgl types.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The following functions are declared:
waffle_config_get_native()
waffle_context_get_native()
waffle_display_get_native()
waffle_window_get_native()
These functions allow users to get the underlying native objects.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The original filename was dumb. The new filename makes more sense. As
a precedent, I have seen other projects that contain a header named
*_portability.h
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This rewrites the bulk of Waffle's code.
When I first began writing Waffle, I wanted to experiment with
a non-traditional object model that used tagged unions. Very soon I began
to abhor the "innovative" decision. This patch replaces the tagged-union
model with a more traditional object model (as found in the Linux kernel
[1], Google's NaCl, libdrm, and many other places) that uses vtables and
embedded structures.
[1] Neil Brown. LWN, 2011 June 1. Object-oriented design patterns in the kernel.
(Part 1: http://lwn.net/Articles/444910/).
(Part 2: http://lwn.net/Articles/446317/).
As an example of the new object model, below is an outline of how
waffle_window_swap_buffers() is now implemeneted.
// file: waffle_window.c
bool
waffle_window_swap_buffers(struct waffle_window *self)
{
struct wcore_window *wc_self = wcore_window(self); // safe cast
// Check preconditions ...
return wc_self->vtbl->swap_buffers(wc_self);
}
// file: wcore_window.h
struct wcore_window_vtbl {
bool
(*swap_buffers)(struct wcore_window *self);
// More member functions ...
};
struct wcore_window {
const struct wcore_window_vtbl *vtbl;
struct waffle_window {} wfl;
// More members ...
};
// file: glx_window.h
struct glx_window {
struct wcore_window wcore;
// More members ...
};
// file: glx_window.c
static bool
glx_window_swap_buffers(struct wcore_window *wc_self)
{
struct glx_window *self = glx_window(wc_self); // safe cast
// Call glXSwapBuffers ...
return true;
}
static const struct wcore_window_vtbl glx_window_wcore_vtbl = {
.swap_buffers = glx_window_swap_buffers,
// More members ...
};
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Now that waffle_finish() is no longer in Waffle's API, it is impossible to
produce this error.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Jordan Justen brought to my attention that, according to the Apache and
GNU websites, Apache 2.0 is incompatible with GPLv2 because GPLv2 lacks
a patent indemnification clause. (It is compatible with GPLv3, however).
See [1] [2] [3].
By the same logic, a lawyer could argue that Apache 2.0 is also
incompatible, in one direction only, with minimal gift licenses such as
BSD and MIT.
I do not want license incompatibility to prevent any project from using
Waffle's code, so I'm converting the project to use the most liberal
license possible, BSD 2-clause [4].
[1] http://www.apache.org/licenses/GPL-compatibility.html
[2] http://www.gnu.org/licenses/license-list.html#apache2
[3] http://en.wikipedia.org/wiki/Apache_License#GPL_compatibility
[4] http://www.opensource.org/licenses/bsd-license.php
CC: Jordan Justen <jljusten@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Cocoa is a general-purpose Objective-C framework, not Apple's GL
interface. The GL interface is named CGL.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This returns the WAFFLE_PLATFORM_* that was given to waffle_init().
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Using waffle_error_get_info() was awkward. It had three return parameters.
To use it, the user had to declare three temporary variables into which
the info was returned.
This patch changes the function to return a struct that contains all the
info formerly returned in the output parameters. This allows usage like:
printf("ouch! %s\n", waffle_error_get_info()->message);
Some documentation in waffle_error.h is fixed up and relocated, as
appropriate with this change.
Several tests are fixed in tandem with this change.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This is a boolean attribute for waffle_config.
If true on EGL, the WAFFLE_UNSUPPORTED_ON_PLATFORM on is emitted.
If true on GLX, then an accum buffer is requested.
This is required for Piglit test 'clear-accum'.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The 'restrict' keyword was introduced in C99. If the C version is less,
then remove occurences the keyword with a macro.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
This Microsoft-only macro was never used. If needed, it can be added back
when Windows support arrives.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The intent is that this header contain all macro cruft for cross-platform
portability.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
Declare waffle_window_show() in waffle_window.h and implement the api
entry point. If platform does yet implement this function, then
waffle_window_show() succeeds without warning.
Update doxygen for waffle_window to reflect the new, expected behavior---
waffle_window_create() will not display the window if the platform allows
it. One must call waffle_window_show().
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
I originally had high hopes for this function, but it failed to work as
expected, but by no fault of Waffle.
I had wanted to be able to initialize Waffle multiple times in one
process, each time with a different platform: GLX, Wayland, then X11/EGL.
However, Mesa's libEGL can only be initialized once per process.
Waffle shouldn't pretend to the user that it can do the impossible, so
just remove waffle_finish() and all documentation that referes to it and
re-initialization.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|
|
The enum no longer exists.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
|