Read-only mirror of https://gitlab.gnome.org/GNOME/mutter
d38ae0284b
This adds two new public experimental functions for attaching CoglSnippets to two hook points on a CoglPipeline: void cogl_pipeline_add_vertex_hook (CoglPipeline *, CoglSnippet *) void cogl_pipeline_add_fragment_hook (CoglPipeline *, CoglSnippet *) The hooks are intended to be around the entire vertex or fragment processing. That means the pre string in the snippet will be inserted at the very top of the main function and the post function will be inserted at the very end. The declarations get inserted in the global scope. The snippets are stored in two separate linked lists with a structure containing an enum representing the hook point and a pointer to the snippet. The lists are meant to be for hooks that affect the vertex shader and fragment shader respectively. Although there are currently only two hooks and the names match these two lists, the intention is *not* that each new hook will be in a separate list. The separation of the lists is just to make it easier to determine which shader needs to be regenerated when a new snippet is added. When a pipeline becomes the authority for either the vertex or fragment snipper state, it simply copies the entire list from the previous authority (although of course the shader snippet objects are referenced instead of copied so it doesn't duplicate the source strings). Each string is inserted into its own block in the shader. This means that each string has its own scope so it doesn't need to worry about name collisions with variables in other snippets. However it does mean that the pre and post strings can't share variables. It could be possible to wrap both parts in one block and then wrap the actual inner hook code in another block, however this would mean that any further snippets within the outer snippet would be able to see those variables. Perhaps something to consider would be to put each snippet into its own function which calls another function between the pre and post strings to do further processing. The pipeline cache for generated programs was previously shared with the fragment shader cache because the state that affects vertex shaders was a subset of the state that affects fragment shaders. This is no longer the case because there is a separate state mask for vertex snippets so the program cache now has its own hash table. Reviewed-by: Robert Bragg <robert@linux.intel.com> |
||
---|---|---|
build | ||
cogl | ||
cogl-pango | ||
doc | ||
examples | ||
po | ||
tests | ||
.gitignore | ||
.vimrc | ||
autogen.sh | ||
ChangeLog | ||
cogl.doap | ||
config-custom.h | ||
config.h.win32.in | ||
configure.ac | ||
COPYING | ||
Makefile.am | ||
NEWS | ||
README.in |
README for Cogl @COGL_1_VERSION@ =============================================================================== Note: This file is delimited with -- markers so it is possible to split sections out for other purposes, such as for release notes. -- DESCRIPTION ------------------------------------------------------------------------------- Cogl is a small open source library for using 3D graphics hardware for rendering. The API departs from the flat state machine style of OpenGL and is designed to make it easy to write orthogonal components that can render without stepping on each others toes. As well as aiming for a nice API, we think having a single library as opposed to an API specification like OpenGL has a few advantages too; like being able to paper over the inconsistencies/bugs of different OpenGL implementations in a centralized place, not to mention the myriad of OpenGL extensions. It also means we are in a better position to provide utility APIs that help software developers since they only need to be implemented once and there is no risk of inconsistency between implementations. Having other backends, besides OpenGL, such as drm, Gallium or D3D are options we are interested in for the future. -- REQUIREMENTS ------------------------------------------------------------------------------- Cogl currently only requires: • GLib ≥ @GLIB_REQ_VERSION@ • OpenGL ≥ 1.3 (or 1.2 + multitexturing), or OpenGL ES 2.0 (or 1.1) • GLX, AGL, WGL or an EGL implementation Cogl also has optional dependencies: • GDK-Pixbuf ≥ @GDK_PIXBUF_REQ_VERSION@ - for image loading • Cairo ≥ @CAIRO_REQ_VERSION@ - for debugging texture atlasing (debug builds only) The optional Cogl Pango library requires: • Cairo ≥ @CAIRO_REQ_VERSION@ • PangoCairo ≥ @PANGOCAIRO_REQ_VERSION@ On X11, Cogl depends on the following extensions • XComposite ≥ @XCOMPOSITE_REQ_VERSION@ • XDamage • XExt • XFixes ≥ @XFIXES_REQ_VERSION@ When running with OpenGL, Cogl requires at least version 1.3 or 1.2 with the multitexturing extension. However to build Cogl you will need the latest GL headers which can be obtained from: http://www.khronos.org If you are building the API reference you will also need: • GTK-Doc ≥ @GTK_DOC_REQ_VERSION@ If you are building the additional documentation you will also need: • xsltproc • jw (optional, for generating PDFs) If you are building the Introspection data you will also need: • GObject-Introspection ≥ @GI_REQ_VERSION@ GObject-Introspection is available from: git://git.gnome.org/gobject-introspection If you want support for profiling Cogl you will also need: • UProf ≥ @UPROF_REQ_VERSION@ UProf is available from: git://github.com/rib/UProf.git -- DOCUMENTATION ------------------------------------------------------------------------------- The API references for the latest stable release are available at: http://docs.clutter-project.org/docs/cogl/stable/ The experimental 2.0 API can be found here: http://docs.clutter-project.org/docs/cogl-2.0-experimental/stable/ Note: The confusing "stable" at the end refers to the overall Cogl release status, not the documentation specifically. -- LICENSE ------------------------------------------------------------------------------- Most of Cogl is licensed under the terms of the GNU Lesser General Public License, version 2.1 or (at your option) later. Some files are licensed under more permissive licenses MIT or BSD style licenses though so please see individual files for details. -- BUILDING AND INSTALLATION ------------------------------------------------------------------------------- Please refer to the INSTALL document. -- BUGS ------------------------------------------------------------------------------- Please report bugs here: http://bugzilla.gnome.org/enter_bug.cgi?product=cogl You will need a Bugzilla account. Please include the following in bug reports: • what system you're running Cogl on; • which version of Cogl you are using; • which version of GLib and OpenGL (or OpenGL ES) you are using; • which video card and which drivers you are using, including output of glxinfo and xdpyinfo (if applicable); • how to reproduce the bug. If you cannot reproduce the bug with one of the tests that come with Cogl's source code, it can help a lot to include a small test case displaying the bad behaviour. If the bug exposes a crash, the exact text printed out and a stack trace obtained using gdb are greatly appreciated. -- CONTRIBUTING ------------------------------------------------------------------------------- The CODING_STYLE file describes the coding style we use throughout Cogl, please try your best to conform to this style because the consistency really helps keep the code maintainable. We can accept contributions in several ways: • Either as patches attached to bugs on bugzilla - For this you may be interested in using git-bz. See http://git.fishsoup.net/man/git-bz.html for details • You can email us patches - For this we recommend using git-send-email • You can create a remote branch and ask us to pull from that for more substantial changes. - For this we recommend using github. Ideally standalone patches should be created using git format-patch since that makes it easiest to import the patch with a commit message into a git repository.