diff --git a/cogl/cogl/cogl-framebuffer-private.h b/cogl/cogl/cogl-framebuffer-private.h
index e1a639411..30403e8a5 100644
--- a/cogl/cogl/cogl-framebuffer-private.h
+++ b/cogl/cogl/cogl-framebuffer-private.h
@@ -60,7 +60,6 @@ typedef struct
CoglSwapChain *swap_chain;
gboolean need_stencil;
int samples_per_pixel;
- gboolean depth_texture_enabled;
gboolean stereo_enabled;
} CoglFramebufferConfig;
diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c
index 31a04f229..8164e5760 100644
--- a/cogl/cogl/cogl-framebuffer.c
+++ b/cogl/cogl/cogl-framebuffer.c
@@ -705,15 +705,6 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
if (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN)
{
- if (framebuffer->config.depth_texture_enabled)
- {
- g_set_error_literal (error, COGL_FRAMEBUFFER_ERROR,
- COGL_FRAMEBUFFER_ERROR_ALLOCATE,
- "Can't allocate onscreen framebuffer with a "
- "texture based depth buffer");
- return FALSE;
- }
-
if (!winsys->onscreen_init (onscreen, error))
return FALSE;
@@ -1049,32 +1040,6 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
framebuffer->dither_enabled = dither_enabled;
}
-void
-cogl_framebuffer_set_depth_texture_enabled (CoglFramebuffer *framebuffer,
- gboolean enabled)
-{
- g_return_if_fail (!framebuffer->allocated);
-
- framebuffer->config.depth_texture_enabled = enabled;
-}
-
-gboolean
-cogl_framebuffer_get_depth_texture_enabled (CoglFramebuffer *framebuffer)
-{
- return framebuffer->config.depth_texture_enabled;
-}
-
-CoglTexture *
-cogl_framebuffer_get_depth_texture (CoglFramebuffer *framebuffer)
-{
- /* lazily allocate the framebuffer... */
- if (!cogl_framebuffer_allocate (framebuffer, NULL))
- return NULL;
-
- g_return_val_if_fail (cogl_is_offscreen (framebuffer), NULL);
- return COGL_OFFSCREEN(framebuffer)->depth_texture;
-}
-
int
cogl_framebuffer_get_samples_per_pixel (CoglFramebuffer *framebuffer)
{
diff --git a/cogl/cogl/cogl-framebuffer.h b/cogl/cogl/cogl-framebuffer.h
index 8fa313eea..b582dac71 100644
--- a/cogl/cogl/cogl-framebuffer.h
+++ b/cogl/cogl/cogl-framebuffer.h
@@ -837,62 +837,6 @@ void
cogl_framebuffer_set_stereo_mode (CoglFramebuffer *framebuffer,
CoglStereoMode stereo_mode);
-/**
- * cogl_framebuffer_set_depth_texture_enabled:
- * @framebuffer: A #CoglFramebuffer
- * @enabled: TRUE or FALSE
- *
- * If @enabled is #TRUE, the depth buffer used when rendering to @framebuffer
- * is available as a texture. You can retrieve the texture with
- * cogl_framebuffer_get_depth_texture().
- *
- * It's not valid to call this function after the framebuffer has been
- * allocated as the creation of the depth texture is done at allocation time.
- *
- *
- * Since: 1.14
- * Stability: unstable
- */
-void
-cogl_framebuffer_set_depth_texture_enabled (CoglFramebuffer *framebuffer,
- gboolean enabled);
-
-/**
- * cogl_framebuffer_get_depth_texture_enabled:
- * @framebuffer: A #CoglFramebuffer
- *
- * Queries whether texture based depth buffer has been enabled via
- * cogl_framebuffer_set_depth_texture_enabled().
- *
- * Return value: %TRUE if a depth texture has been enabled, else
- * %FALSE.
- *
- * Since: 1.14
- * Stability: unstable
- */
-gboolean
-cogl_framebuffer_get_depth_texture_enabled (CoglFramebuffer *framebuffer);
-
-/**
- * cogl_framebuffer_get_depth_texture:
- * @framebuffer: A #CoglFramebuffer
- *
- * Retrieves the depth buffer of @framebuffer as a #CoglTexture. You need to
- * call cogl_framebuffer_get_depth_texture(fb, TRUE); before using this
- * function.
- *
- * Calling this function implicitely allocates the framebuffer.
- * The texture returned stays valid as long as the framebuffer stays
- * valid.
- *
- * Returns: (transfer none): the depth texture
- *
- * Since: 1.14
- * Stability: unstable
- */
-CoglTexture *
-cogl_framebuffer_get_depth_texture (CoglFramebuffer *framebuffer);
-
/**
* cogl_framebuffer_set_samples_per_pixel:
* @framebuffer: A #CoglFramebuffer framebuffer
diff --git a/cogl/cogl/cogl.symbols b/cogl/cogl/cogl.symbols
index 0710d626e..3a8fae384 100644
--- a/cogl/cogl/cogl.symbols
+++ b/cogl/cogl/cogl.symbols
@@ -230,8 +230,6 @@ cogl_framebuffer_get_blue_bits
cogl_framebuffer_get_color_format
cogl_framebuffer_get_context
cogl_framebuffer_get_depth_bits
-cogl_framebuffer_get_depth_texture
-cogl_framebuffer_get_depth_texture_enabled
cogl_framebuffer_get_depth_write_enabled
cogl_framebuffer_get_dither_enabled
cogl_framebuffer_get_green_bits
@@ -269,7 +267,6 @@ cogl_framebuffer_rotate_euler
#endif
cogl_framebuffer_scale
-cogl_framebuffer_set_depth_texture_enabled
cogl_framebuffer_set_depth_write_enabled
cogl_framebuffer_set_dither_enabled
cogl_framebuffer_set_modelview_matrix
diff --git a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
index d9d9e5690..343793999 100644
--- a/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
+++ b/cogl/cogl/driver/gl/cogl-framebuffer-gl.c
@@ -438,20 +438,6 @@ _cogl_framebuffer_gl_flush_state (CoglFramebuffer *draw_buffer,
ctx->current_draw_buffer_changes &= ~state;
}
-static CoglTexture *
-create_depth_texture (CoglContext *ctx,
- int width,
- int height)
-{
- CoglTexture2D *depth_texture =
- cogl_texture_2d_new_with_size (ctx, width, height);
-
- cogl_texture_set_components (COGL_TEXTURE (depth_texture),
- COGL_TEXTURE_COMPONENTS_DEPTH);
-
- return COGL_TEXTURE (depth_texture);
-}
-
static CoglTexture *
attach_depth_texture (CoglContext *ctx,
CoglTexture *depth_texture,
@@ -784,24 +770,6 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
&level_height,
NULL);
- if (fb->config.depth_texture_enabled &&
- offscreen->depth_texture == NULL)
- {
- offscreen->depth_texture =
- create_depth_texture (ctx,
- level_width,
- level_height);
-
- if (!cogl_texture_allocate (offscreen->depth_texture, error))
- {
- cogl_object_unref (offscreen->depth_texture);
- offscreen->depth_texture = NULL;
- return FALSE;
- }
-
- _cogl_texture_associate_framebuffer (offscreen->depth_texture, fb);
- }
-
/* XXX: The framebuffer_object spec isn't clear in defining whether attaching
* a texture as a renderbuffer with mipmap filtering enabled while the
* mipmaps have not been uploaded should result in an incomplete framebuffer