1
0
Fork 0
mutter-performance-source/cogl/Makefile.am
Neil Roberts 5288f6d88d Add a Cogl texture 3D backend
This adds a publicly exposed experimental API for a 3D texture
backend. There is a feature flag which can be checked for whether 3D
textures are supported. Although we require OpenGL 1.2 which has 3D
textures in core, GLES only provides them through an extension so the
feature can be used to detect that.

The textures can be created with one of two new API functions :-

cogl_texture_3d_new_with_size

 and

cogl_texture_3d_new_from_data

There is also internally a new_from_bitmap function. new_from_data is
implemented in terms of this function.

The two constructors are effectively the only way to upload data to a
3D texture. It does not work to call glTexImage2D with the
GL_TEXTURE_3D target so the virtual for cogl_texture_set_region does
nothing. It would be possible to make cogl_texture_get_data do
something sensible like returning all of the images as a single long
image but this is not currently implemented and instead the virtual
just always fails. We may want to add API specific to the 3D texture
backend to get and set a sub region of the texture.

All of those three functions can throw a GError. This will happen if
the GPU does not support 3D textures or it does not support NPOTs and
an NPOT size is requested. It will also fail if the FBO extension is
not supported and the COGL_TEXTURE_NO_AUTO_MIPMAP flag is not
given. This could be avoided by copying the code for the
GL_GENERATE_MIPMAP TexParameter fallback, but in the interests of
keeping the code simple this is not yet done.

This adds a couple of functions to cogl-texture-driver for uploading
3D data and querying the 3D proxy
texture. prep_gl_for_pixels_upload_full now also takes sets the
GL_UNPACK_IMAGE_HEIGHT parameter so that 3D textures can have padding
between the images. Whenever 3D texture is uploading, both the height
of the images and the height of all of the data is specified (either
explicitly or implicilty from the CoglBitmap) so that the image height
can be deduced by dividing by the depth.
2010-07-13 14:28:52 +01:00

247 lines
7.2 KiB
Makefile

include $(top_srcdir)/build/autotools/Makefile.am.silent
NULL =
SUBDIRS = driver tesselator
BUILT_SOURCES =
EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
# pkg-config ==================================================================
pc_files = \
cogl-$(COGL_DRIVER)-$(CLUTTER_API_VERSION).pc \
cogl-$(CLUTTER_API_VERSION).pc
cogl-$(CLUTTER_API_VERSION).pc: cogl.pc
$(QUIET_GEN)cp -f $< $(@F)
cogl-$(COGL_DRIVER)-$(CLUTTER_API_VERSION).pc: cogl.pc
$(QUIET_GEN)cp -f $< $(@F)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
EXTRA_DIST += cogl.pc.in
CLEANFILES += $(pc_files)
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter/cogl \
-I$(srcdir)/winsys \
-I$(srcdir)/driver/$(COGL_DRIVER) \
-I$(top_builddir)/clutter/cogl \
$(NULL)
AM_CPPFLAGS = \
-DG_DISABLE_SINGLE_INCLUDES \
-DG_DISABLE_DEPRECATED \
-DG_LOG_DOMAIN=\"Cogl-$(COGL_WINSYS)\" \
-DCLUTTER_COMPILATION \
-DCOGL_ENABLE_EXPERIMENTAL_API \
$(COGL_DEBUG_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS) \
$(NULL)
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
BUILT_SOURCES += cogl-defines.h
DISTCLEANFILES += cogl-defines.h
EXTRA_DIST += cogl-defines.h.in
# public headers
cogl_public_h = \
$(srcdir)/cogl-object.h \
$(srcdir)/cogl-bitmap.h \
$(srcdir)/cogl-buffer.h \
$(srcdir)/cogl-color.h \
$(srcdir)/cogl-debug.h \
$(srcdir)/cogl-fixed.h \
$(srcdir)/cogl-material.h \
$(srcdir)/cogl-vector.h \
$(srcdir)/cogl-matrix.h \
$(srcdir)/cogl-offscreen.h \
$(srcdir)/cogl-primitives.h \
$(srcdir)/cogl-path.h \
$(srcdir)/cogl-pixel-array.h \
$(srcdir)/cogl-shader.h \
$(srcdir)/cogl-texture.h \
$(srcdir)/cogl-texture-3d.h \
$(srcdir)/cogl-types.h \
$(srcdir)/cogl-vertex-buffer.h \
$(srcdir)/cogl.h \
$(NULL)
cogl_sources_c = \
$(srcdir)/winsys/cogl-winsys.h \
$(srcdir)/winsys/cogl-context-winsys.h \
$(srcdir)/winsys/cogl-context-winsys.c \
$(srcdir)/winsys/cogl-winsys-feature-functions.h \
$(srcdir)/cogl-handle.h \
$(srcdir)/cogl-context.h \
$(srcdir)/cogl-context.c \
$(srcdir)/cogl-internal.h \
$(srcdir)/cogl.c \
$(srcdir)/cogl-object-private.h \
$(srcdir)/cogl-object.h \
$(srcdir)/cogl-object.c \
$(srcdir)/cogl-util.h \
$(srcdir)/cogl-util.c \
$(srcdir)/cogl-bitmap-private.h \
$(srcdir)/cogl-bitmap.c \
$(srcdir)/cogl-bitmap-fallback.c \
$(srcdir)/cogl-primitives.h \
$(srcdir)/cogl-primitives.c \
$(srcdir)/cogl-path-private.h \
$(srcdir)/cogl-path.h \
$(srcdir)/cogl-path.c \
$(srcdir)/cogl-bitmap-pixbuf.c \
$(srcdir)/cogl-clip-stack.h \
$(srcdir)/cogl-clip-stack.c \
$(srcdir)/cogl-clip-state.h \
$(srcdir)/cogl-clip-state.c \
$(srcdir)/cogl-feature-private.h \
$(srcdir)/cogl-feature-private.c \
$(srcdir)/cogl-fixed.c \
$(srcdir)/cogl-color-private.h \
$(srcdir)/cogl-color.c \
$(srcdir)/cogl-buffer-private.h \
$(srcdir)/cogl-buffer.c \
$(srcdir)/cogl-pixel-array-private.h \
$(srcdir)/cogl-pixel-array.c \
$(srcdir)/cogl-vertex-buffer-private.h \
$(srcdir)/cogl-vertex-buffer.c \
$(srcdir)/cogl-matrix.c \
$(srcdir)/cogl-vector.c \
$(srcdir)/cogl-matrix-private.h \
$(srcdir)/cogl-matrix-stack.c \
$(srcdir)/cogl-matrix-stack.h \
$(srcdir)/cogl-material.c \
$(srcdir)/cogl-material-private.h \
$(srcdir)/cogl-material-glsl.c \
$(srcdir)/cogl-material-glsl-private.h \
$(srcdir)/cogl-material-arbfp.c \
$(srcdir)/cogl-material-arbfp-private.h \
$(srcdir)/cogl-material-fixed.c \
$(srcdir)/cogl-material-fixed-private.h \
$(srcdir)/cogl-blend-string.c \
$(srcdir)/cogl-blend-string.h \
$(srcdir)/cogl-debug.c \
$(srcdir)/cogl-sub-texture-private.h \
$(srcdir)/cogl-texture-private.h \
$(srcdir)/cogl-texture-2d-private.h \
$(srcdir)/cogl-texture-2d-sliced-private.h \
$(srcdir)/cogl-texture-3d-private.h \
$(srcdir)/cogl-texture-driver.h \
$(srcdir)/cogl-sub-texture.c \
$(srcdir)/cogl-texture.c \
$(srcdir)/cogl-texture-2d.c \
$(srcdir)/cogl-texture-2d-sliced.c \
$(srcdir)/cogl-texture-3d.c \
$(srcdir)/cogl-texture-rectangle-private.h \
$(srcdir)/cogl-texture-rectangle.c \
$(srcdir)/cogl-atlas.h \
$(srcdir)/cogl-atlas.c \
$(srcdir)/cogl-atlas-texture-private.h \
$(srcdir)/cogl-atlas-texture.c \
$(srcdir)/cogl-spans.h \
$(srcdir)/cogl-spans.c \
$(srcdir)/cogl-journal-private.h \
$(srcdir)/cogl-journal.c \
$(srcdir)/cogl-framebuffer-private.h \
$(srcdir)/cogl-framebuffer.c \
$(srcdir)/cogl-matrix-mesa.h \
$(srcdir)/cogl-matrix-mesa.c \
$(srcdir)/cogl-profile.h \
$(srcdir)/cogl-profile.c \
$(srcdir)/cogl-bitmask.h \
$(srcdir)/cogl-bitmask.c \
$(NULL)
# glib-mkenums rules
glib_enum_h = cogl-enum-types.h
glib_enum_c = cogl-enum-types.c
glib_enum_headers = $(cogl_public_h)
include $(top_srcdir)/build/autotools/Makefile.am.enums
noinst_LTLIBRARIES = libclutter-cogl.la
libclutter_cogl_la_LIBADD = \
-lm $(CLUTTER_LIBS) \
$(top_builddir)/clutter/cogl/cogl/driver/$(COGL_DRIVER)/libclutter-cogl-driver.la \
$(top_builddir)/clutter/cogl/cogl/tesselator/libtesselator.la
libclutter_cogl_la_SOURCES = $(cogl_sources_c)
nodist_libclutter_cogl_la_SOURCES = $(BUILT_SOURCES)
if SUPPORT_XLIB
cogl_public_h += \
$(srcdir)/winsys/cogl-texture-pixmap-x11.h
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-xlib.h \
$(srcdir)/winsys/cogl-xlib.c \
$(srcdir)/winsys/cogl-texture-pixmap-x11.c \
$(srcdir)/winsys/cogl-texture-pixmap-x11-private.h
endif
if SUPPORT_GLX
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-glx.c
endif
if SUPPORT_EGL_PLATFORM_POWERVR_X11
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-egl.c
endif
if SUPPORT_EGL_PLATFORM_POWERVR_NULL
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-egl.c
endif
if SUPPORT_EGL_PLATFORM_FRUITY
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-fruity.c
endif
if SUPPORT_WIN32
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-win32.c
endif
if SUPPORT_OSX
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-osx.c
endif
EXTRA_DIST += stb_image.c
# COGL installed headers
cogl_headers = \
$(cogl_public_h) \
$(srcdir)/cogl-deprecated.h \
$(NULL)
coglincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/cogl
coglinclude_HEADERS = $(cogl_headers)
nodist_coglinclude_HEADERS = cogl-defines.h cogl-enum-types.h
if HAVE_INTROSPECTION
Cogl-@CLUTTER_API_VERSION@.gir: Makefile $(INTROSPECTION_SCANNER) libclutter-cogl.la
$(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \
--namespace Cogl --nsversion=@CLUTTER_API_VERSION@ \
$(INCLUDES) \
$(AM_CPPFLAGS) \
--c-include='cogl/cogl.h' \
--include=GL-1.0 \
--include=GObject-2.0 \
--library=libclutter-cogl.la \
--libtool="$(top_builddir)/libtool" \
--pkg gobject-2.0 \
--output $@ \
$(cogl_headers) cogl-enum-types.h
BUILT_GIRSOURCES = Cogl-@CLUTTER_API_VERSION@.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(BUILT_GIRSOURCES)
CLEANFILES += $(BUILT_GIRSOURCES)
endif