From 306f197108d1a264bebea9f96ac22fa084d402fb Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Sat, 30 Nov 2019 20:52:40 +0100 Subject: [PATCH] fosphor/gl: Remove redundant initial clear of buffers The buffers will end up being initialized from the CL result anyway. (and CL has its own clear). Apparently the clear of the VBO was causing CL/GL share failur on recent NVidia driver so get rid of all of it. Thanks a lot to Aaron Giles for finding the root cause of the issue. Signed-off-by: Sylvain Munaut --- lib/fosphor/gl.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/fosphor/gl.c b/lib/fosphor/gl.c index 8b8fe4b..f02ed8f 100644 --- a/lib/fosphor/gl.c +++ b/lib/fosphor/gl.c @@ -91,6 +91,7 @@ gl_check_extension(const char *ext_name) return 0; } +#if 0 static void gl_tex2d_float_clear(GLuint tex_id, int width, int height) { @@ -109,6 +110,7 @@ gl_tex2d_float_clear(GLuint tex_id, int width, int height) } } } +#endif static void gl_tex2d_write(GLuint tex_id, float *src, int width, int height) @@ -123,6 +125,7 @@ gl_tex2d_write(GLuint tex_id, float *src, int width, int height) ); } +#if 0 static void gl_vbo_clear(GLuint vbo_id, int size) { @@ -139,7 +142,6 @@ gl_vbo_clear(GLuint vbo_id, int size) glUnmapBuffer(GL_ARRAY_BUFFER); } -#if 0 static void gl_vbo_read(GLuint vbo_id, void *dst, int size) { @@ -208,8 +210,6 @@ gl_deferred_init(struct fosphor *self) glTexImage2D(GL_TEXTURE_2D, 0, tex_fmt, FOSPHOR_FFT_LEN, 1024, 0, GL_RED, GL_FLOAT, NULL); - gl_tex2d_float_clear(gl->tex_waterfall, FOSPHOR_FFT_LEN, 1024); - /* Histogram texture (FFT_LEN * 128) */ glGenTextures(1, &gl->tex_histogram); @@ -222,8 +222,6 @@ gl_deferred_init(struct fosphor *self) glTexImage2D(GL_TEXTURE_2D, 0, tex_fmt, FOSPHOR_FFT_LEN, 128, 0, GL_RED, GL_FLOAT, NULL); - gl_tex2d_float_clear(gl->tex_histogram, FOSPHOR_FFT_LEN, 128); - /* Spectrum VBO (2 * FFT_LEN, half for live, half for 'hold') */ glGenBuffers(1, &gl->vbo_spectrum); @@ -231,8 +229,6 @@ gl_deferred_init(struct fosphor *self) len = 2 * sizeof(float) * 2 * FOSPHOR_FFT_LEN; glBufferData(GL_ARRAY_BUFFER, len, NULL, GL_DYNAMIC_DRAW); - - gl_vbo_clear(gl->vbo_spectrum, len); }