cogl: Remove Framebuffer:stereo-mode
Nothing was setting it Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3806>
This commit is contained in:
parent
9097deb69d
commit
aa0600bf27
8 changed files with 2 additions and 129 deletions
|
@ -74,8 +74,7 @@ typedef enum _CoglFramebufferStateIndex
|
|||
COGL_FRAMEBUFFER_STATE_INDEX_PROJECTION = 5,
|
||||
COGL_FRAMEBUFFER_STATE_INDEX_FRONT_FACE_WINDING = 6,
|
||||
COGL_FRAMEBUFFER_STATE_INDEX_DEPTH_WRITE = 7,
|
||||
COGL_FRAMEBUFFER_STATE_INDEX_STEREO_MODE = 8,
|
||||
COGL_FRAMEBUFFER_STATE_INDEX_MAX = 9
|
||||
COGL_FRAMEBUFFER_STATE_INDEX_MAX = 8
|
||||
} CoglFramebufferStateIndex;
|
||||
|
||||
typedef enum _CoglFramebufferState
|
||||
|
@ -88,7 +87,6 @@ typedef enum _CoglFramebufferState
|
|||
COGL_FRAMEBUFFER_STATE_PROJECTION = 1<<5,
|
||||
COGL_FRAMEBUFFER_STATE_FRONT_FACE_WINDING = 1<<6,
|
||||
COGL_FRAMEBUFFER_STATE_DEPTH_WRITE = 1<<7,
|
||||
COGL_FRAMEBUFFER_STATE_STEREO_MODE = 1<<8
|
||||
} CoglFramebufferState;
|
||||
|
||||
#define COGL_FRAMEBUFFER_STATE_ALL ((1<<COGL_FRAMEBUFFER_STATE_INDEX_MAX) - 1)
|
||||
|
|
|
@ -109,7 +109,6 @@ typedef struct _CoglFramebufferPrivate
|
|||
|
||||
gboolean dither_enabled;
|
||||
gboolean depth_writing_enabled;
|
||||
CoglStereoMode stereo_mode;
|
||||
|
||||
/* We journal the textured rectangles we want to submit to OpenGL so
|
||||
* we have an opportunity to batch them together into less draw
|
||||
|
@ -1023,17 +1022,6 @@ _cogl_framebuffer_compare_depth_write_state (CoglFramebuffer *a,
|
|||
COGL_FRAMEBUFFER_STATE_DEPTH_WRITE : 0;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
_cogl_framebuffer_compare_stereo_mode (CoglFramebuffer *a,
|
||||
CoglFramebuffer *b)
|
||||
{
|
||||
CoglFramebufferPrivate *priv_a = cogl_framebuffer_get_instance_private (a);
|
||||
CoglFramebufferPrivate *priv_b = cogl_framebuffer_get_instance_private (b);
|
||||
|
||||
return priv_a->stereo_mode != priv_b->stereo_mode ?
|
||||
COGL_FRAMEBUFFER_STATE_STEREO_MODE : 0;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
_cogl_framebuffer_compare (CoglFramebuffer *a,
|
||||
CoglFramebuffer *b,
|
||||
|
@ -1082,10 +1070,6 @@ _cogl_framebuffer_compare (CoglFramebuffer *a,
|
|||
differences |=
|
||||
_cogl_framebuffer_compare_depth_write_state (a, b);
|
||||
break;
|
||||
case COGL_FRAMEBUFFER_STATE_INDEX_STEREO_MODE:
|
||||
differences |=
|
||||
_cogl_framebuffer_compare_stereo_mode (a, b);
|
||||
break;
|
||||
default:
|
||||
g_warn_if_reached ();
|
||||
}
|
||||
|
@ -1159,15 +1143,6 @@ cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer)
|
|||
return bits.alpha;
|
||||
}
|
||||
|
||||
CoglStereoMode
|
||||
cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer)
|
||||
{
|
||||
CoglFramebufferPrivate *priv =
|
||||
cogl_framebuffer_get_instance_private (framebuffer);
|
||||
|
||||
return priv->stereo_mode;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_framebuffer_get_depth_write_enabled (CoglFramebuffer *framebuffer)
|
||||
{
|
||||
|
|
|
@ -603,18 +603,6 @@ COGL_EXPORT void
|
|||
cogl_framebuffer_set_depth_write_enabled (CoglFramebuffer *framebuffer,
|
||||
gboolean depth_write_enabled);
|
||||
|
||||
/**
|
||||
* cogl_framebuffer_get_stereo_mode:
|
||||
* @framebuffer: a pointer to a #CoglFramebuffer
|
||||
*
|
||||
* Gets the current #CoglStereoMode, which defines which stereo buffers
|
||||
* should be drawn to.
|
||||
*
|
||||
* Returns: A #CoglStereoMode
|
||||
*/
|
||||
COGL_EXPORT CoglStereoMode
|
||||
cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer);
|
||||
|
||||
/**
|
||||
* cogl_framebuffer_get_context:
|
||||
* @framebuffer: A #CoglFramebuffer
|
||||
|
|
|
@ -249,7 +249,7 @@ typedef enum
|
|||
* @COGL_VERTICES_MODE_TRIANGLES: FIXME, equivalent to `GL_TRIANGLES`
|
||||
* @COGL_VERTICES_MODE_TRIANGLE_STRIP: FIXME, equivalent to `GL_TRIANGLE_STRIP`
|
||||
* @COGL_VERTICES_MODE_TRIANGLE_FAN: FIXME, equivalent to `GL_TRIANGLE_FAN`
|
||||
*
|
||||
*
|
||||
* Different ways of interpreting vertices when drawing.
|
||||
*/
|
||||
typedef enum
|
||||
|
@ -407,22 +407,6 @@ typedef enum /*< prefix=COGL_READ_PIXELS >*/
|
|||
COGL_READ_PIXELS_COLOR_BUFFER = 1L << 0
|
||||
} CoglReadPixelsFlags;
|
||||
|
||||
/**
|
||||
* CoglStereoMode:
|
||||
* @COGL_STEREO_BOTH: draw to both stereo buffers
|
||||
* @COGL_STEREO_LEFT: draw only to the left stereo buffer
|
||||
* @COGL_STEREO_RIGHT: draw only to the left stereo buffer
|
||||
*
|
||||
* Represents how draw should affect the two buffers
|
||||
* of a stereo framebuffer.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
COGL_STEREO_BOTH,
|
||||
COGL_STEREO_LEFT,
|
||||
COGL_STEREO_RIGHT
|
||||
} CoglStereoMode;
|
||||
|
||||
typedef struct _CoglScanout CoglScanout;
|
||||
typedef struct _CoglScanoutBuffer CoglScanoutBuffer;
|
||||
|
||||
|
|
|
@ -48,8 +48,6 @@ struct _CoglGlFramebufferClass
|
|||
|
||||
void (* bind) (CoglGlFramebuffer *gl_framebuffer,
|
||||
GLenum target);
|
||||
|
||||
void (* flush_stereo_mode_state) (CoglGlFramebuffer *gl_framebuffer);
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
@ -190,15 +190,6 @@ cogl_gl_framebuffer_flush_front_face_winding_state (CoglGlFramebuffer *gl_frameb
|
|||
context->current_pipeline_age--;
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_gl_framebuffer_flush_stereo_mode_state (CoglGlFramebuffer *gl_framebuffer)
|
||||
{
|
||||
CoglGlFramebufferClass *klass =
|
||||
COGL_GL_FRAMEBUFFER_GET_CLASS (gl_framebuffer);
|
||||
|
||||
klass->flush_stereo_mode_state (gl_framebuffer);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_gl_framebuffer_flush_state_differences (CoglGlFramebuffer *gl_framebuffer,
|
||||
unsigned long differences)
|
||||
|
@ -235,9 +226,6 @@ cogl_gl_framebuffer_flush_state_differences (CoglGlFramebuffer *gl_framebuffer,
|
|||
/* Nothing to do for depth write state change; the state will always
|
||||
* be taken into account when flushing the pipeline's depth state. */
|
||||
break;
|
||||
case COGL_FRAMEBUFFER_STATE_INDEX_STEREO_MODE:
|
||||
cogl_gl_framebuffer_flush_stereo_mode_state (gl_framebuffer);
|
||||
break;
|
||||
default:
|
||||
g_warn_if_reached ();
|
||||
}
|
||||
|
|
|
@ -220,42 +220,6 @@ cogl_gl_framebuffer_back_bind (CoglGlFramebuffer *gl_framebuffer,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_gl_framebuffer_back_flush_stereo_mode_state (CoglGlFramebuffer *gl_framebuffer)
|
||||
{
|
||||
CoglFramebufferDriver *driver = COGL_FRAMEBUFFER_DRIVER (gl_framebuffer);
|
||||
CoglFramebuffer *framebuffer =
|
||||
cogl_framebuffer_driver_get_framebuffer (driver);
|
||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||
GLenum draw_buffer = GL_BACK;
|
||||
|
||||
if (!ctx->glDrawBuffer)
|
||||
return;
|
||||
|
||||
/* The one-shot default draw buffer setting in _cogl_framebuffer_gl_bind
|
||||
* must have already happened. If not it would override what we set here. */
|
||||
g_assert (ctx->was_bound_to_onscreen);
|
||||
|
||||
switch (cogl_framebuffer_get_stereo_mode (framebuffer))
|
||||
{
|
||||
case COGL_STEREO_BOTH:
|
||||
draw_buffer = GL_BACK;
|
||||
break;
|
||||
case COGL_STEREO_LEFT:
|
||||
draw_buffer = GL_BACK_LEFT;
|
||||
break;
|
||||
case COGL_STEREO_RIGHT:
|
||||
draw_buffer = GL_BACK_RIGHT;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ctx->current_gl_draw_buffer != draw_buffer)
|
||||
{
|
||||
GE (ctx, glDrawBuffer (draw_buffer));
|
||||
ctx->current_gl_draw_buffer = draw_buffer;
|
||||
}
|
||||
}
|
||||
|
||||
CoglGlFramebufferBack *
|
||||
cogl_gl_framebuffer_back_new (CoglFramebuffer *framebuffer,
|
||||
const CoglFramebufferDriverConfig *driver_config,
|
||||
|
@ -291,6 +255,4 @@ cogl_gl_framebuffer_back_class_init (CoglGlFramebufferBackClass *klass)
|
|||
driver_class->discard_buffers = cogl_gl_framebuffer_back_discard_buffers;
|
||||
|
||||
gl_framebuffer_class->bind = cogl_gl_framebuffer_back_bind;
|
||||
gl_framebuffer_class->flush_stereo_mode_state =
|
||||
cogl_gl_framebuffer_back_flush_stereo_mode_state;
|
||||
}
|
||||
|
|
|
@ -207,24 +207,6 @@ cogl_gl_framebuffer_fbo_bind (CoglGlFramebuffer *gl_framebuffer,
|
|||
GE (ctx, glBindFramebuffer (target, gl_framebuffer_fbo->gl_fbo.fbo_handle));
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_gl_framebuffer_fbo_flush_stereo_mode_state (CoglGlFramebuffer *gl_framebuffer)
|
||||
{
|
||||
CoglFramebufferDriver *driver = COGL_FRAMEBUFFER_DRIVER (gl_framebuffer);
|
||||
CoglFramebuffer *framebuffer =
|
||||
cogl_framebuffer_driver_get_framebuffer (driver);
|
||||
|
||||
switch (cogl_framebuffer_get_stereo_mode (framebuffer))
|
||||
{
|
||||
case COGL_STEREO_BOTH:
|
||||
break;
|
||||
case COGL_STEREO_LEFT:
|
||||
case COGL_STEREO_RIGHT:
|
||||
g_warn_if_reached ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static GList *
|
||||
try_creating_renderbuffers (CoglContext *ctx,
|
||||
int width,
|
||||
|
@ -647,6 +629,4 @@ cogl_gl_framebuffer_fbo_class_init (CoglGlFramebufferFboClass *klass)
|
|||
driver_class->discard_buffers = cogl_gl_framebuffer_fbo_discard_buffers;
|
||||
|
||||
gl_framebuffer_class->bind = cogl_gl_framebuffer_fbo_bind;
|
||||
gl_framebuffer_class->flush_stereo_mode_state =
|
||||
cogl_gl_framebuffer_fbo_flush_stereo_mode_state;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue