mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
cogl: Remove unused depth texture API
https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
This commit is contained in:
parent
fb49e9def7
commit
0e4c23c985
@ -60,7 +60,6 @@ typedef struct
|
||||
CoglSwapChain *swap_chain;
|
||||
gboolean need_stencil;
|
||||
int samples_per_pixel;
|
||||
gboolean depth_texture_enabled;
|
||||
gboolean stereo_enabled;
|
||||
} CoglFramebufferConfig;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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().
|
||||
*
|
||||
* <note>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.
|
||||
* </note>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* <note>Calling this function implicitely allocates the framebuffer.</note>
|
||||
* <note>The texture returned stays valid as long as the framebuffer stays
|
||||
* valid.</note>
|
||||
*
|
||||
* 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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user