From 2e040f41de18f4d46e649561b6efb043195fdfbe Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Tue, 18 Mar 2014 09:42:55 +0100 Subject: [PATCH] glamor: Drop feature dependent optimization on startup. We don't care that much about startup time to write different code paths... Signed-off-by: Eric Anholt Reviewed-by: Eric Anholt --- glamor/glamor_render.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 62236b985..cdf8effdc 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -412,27 +412,10 @@ glamor_init_composite_shaders(ScreenPtr screen) eb_size = GLAMOR_COMPOSITE_VBO_VERT_CNT * sizeof(short) * 2; - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { - glBufferData(GL_ELEMENT_ARRAY_BUFFER, eb_size, NULL, GL_STATIC_DRAW); - eb = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); - } - else { - eb = malloc(eb_size); - } - - if (eb == NULL) - FatalError - ("fatal error, fail to get element buffer. GL context may be not created correctly.\n"); + eb = XNFalloc(eb_size); glamor_init_eb(eb, GLAMOR_COMPOSITE_VBO_VERT_CNT); - - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { - glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); - } - else { - glBufferData(GL_ELEMENT_ARRAY_BUFFER, eb_size, eb, GL_STATIC_DRAW); - - free(eb); - } + glBufferData(GL_ELEMENT_ARRAY_BUFFER, eb_size, eb, GL_STATIC_DRAW); + free(eb); glamor_put_context(glamor_priv); }