From 0ea392844a57f3ea5c52d055c939ccb5c737bd6c Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 7 Jan 2023 16:16:48 +0100 Subject: [PATCH 1/6] lv-tool: Switch default FPS limit from 30 to 60 --- libvisual/tools/lv-tool/lv-tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvisual/tools/lv-tool/lv-tool.cpp b/libvisual/tools/lv-tool/lv-tool.cpp index 39aaae4aa..e51827484 100644 --- a/libvisual/tools/lv-tool/lv-tool.cpp +++ b/libvisual/tools/lv-tool/lv-tool.cpp @@ -43,7 +43,7 @@ #define DEFAULT_MORPH "slide_left" #define DEFAULT_WIDTH 320 #define DEFAULT_HEIGHT 200 -#define DEFAULT_FPS 30 +#define DEFAULT_FPS 60 #define DEFAULT_COLOR_DEPTH 0 #if HAVE_SDL From 168c94ec99e06e379e58c7da534a4075bbed4ee1 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 7 Jan 2023 16:17:01 +0100 Subject: [PATCH 2/6] lv-tool: Switch default actor plugin to "lv_gltest" when available --- libvisual/tools/lv-tool/lv-tool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libvisual/tools/lv-tool/lv-tool.cpp b/libvisual/tools/lv-tool/lv-tool.cpp index e51827484..7e42331ab 100644 --- a/libvisual/tools/lv-tool/lv-tool.cpp +++ b/libvisual/tools/lv-tool/lv-tool.cpp @@ -38,7 +38,11 @@ #include // Defaults -#define DEFAULT_ACTOR "lv_analyzer" +#ifdef HAVE_GL +# define DEFAULT_ACTOR "lv_gltest" +#else +# define DEFAULT_ACTOR "lv_analyzer" +#endif #define DEFAULT_INPUT "debug" #define DEFAULT_MORPH "slide_left" #define DEFAULT_WIDTH 320 From 10314fc9a1fd8c1881c3572d81e0ca0954941fd5 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 7 Jan 2023 18:57:56 +0100 Subject: [PATCH 3/6] lv-tool: Exclude visual_cpu_initialize from AddressSanitizer --- libvisual/libvisual/lv_cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libvisual/libvisual/lv_cpu.c b/libvisual/libvisual/lv_cpu.c index 1876a838e..d5c670e8d 100644 --- a/libvisual/libvisual/lv_cpu.c +++ b/libvisual/libvisual/lv_cpu.c @@ -432,6 +432,7 @@ static void print_cpu_info (void) #endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */ } +__attribute__((no_sanitize("address"))) void visual_cpu_initialize () { visual_mem_set (&cpu_caps, 0, sizeof (VisCPU)); From a2ead5d4bec5600d55e599a3126a13cbbae5fa90 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 7 Jan 2023 19:05:25 +0100 Subject: [PATCH 4/6] lv-tool: Fix use of SDL_GL_DOUBLEBUFFER and SDL_SetVideoMode flags --- libvisual/tools/lv-tool/display/sdl_driver.cpp | 9 +++------ libvisual/tools/lv-tool/display/stdout_sdl_driver.cpp | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/libvisual/tools/lv-tool/display/sdl_driver.cpp b/libvisual/tools/lv-tool/display/sdl_driver.cpp index 73e193412..8dbb12401 100644 --- a/libvisual/tools/lv-tool/display/sdl_driver.cpp +++ b/libvisual/tools/lv-tool/display/sdl_driver.cpp @@ -108,15 +108,10 @@ namespace { return nullptr; } - videoflags |= SDL_OPENGL | SDL_GL_DOUBLEBUFFER; + videoflags |= SDL_OPENGL; if (videoinfo->hw_available) videoflags |= SDL_HWSURFACE; - else - videoflags |= SDL_SWSURFACE; - - if (videoinfo->blit_hw) - videoflags |= SDL_HWACCEL; if (vidoptions) { for (unsigned int i = VISUAL_GL_ATTRIBUTE_NONE; i < VISUAL_GL_ATTRIBUTE_LAST; i++) { @@ -130,6 +125,8 @@ namespace { } } + SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); + int bpp = videoinfo->vfmt->BitsPerPixel; m_screen = SDL_SetVideoMode (width, height, bpp, videoflags); diff --git a/libvisual/tools/lv-tool/display/stdout_sdl_driver.cpp b/libvisual/tools/lv-tool/display/stdout_sdl_driver.cpp index e4872a491..19a723ace 100644 --- a/libvisual/tools/lv-tool/display/stdout_sdl_driver.cpp +++ b/libvisual/tools/lv-tool/display/stdout_sdl_driver.cpp @@ -121,15 +121,10 @@ namespace { return nullptr; } - videoflags |= SDL_OPENGL | SDL_GL_DOUBLEBUFFER; + videoflags |= SDL_OPENGL; if (videoinfo->hw_available) videoflags |= SDL_HWSURFACE; - else - videoflags |= SDL_SWSURFACE; - - if (videoinfo->blit_hw) - videoflags |= SDL_HWACCEL; if (vidoptions) { for (unsigned int i = VISUAL_GL_ATTRIBUTE_NONE; i < VISUAL_GL_ATTRIBUTE_LAST; i++) { @@ -144,6 +139,8 @@ namespace { } } + SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); + bpp = videoinfo->vfmt->BitsPerPixel; unsigned int buffer_size = width * height * 3; From a3debf8783f04944d6267d89b190227fc2423a59 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 7 Jan 2023 19:12:23 +0100 Subject: [PATCH 5/6] lv-tool: Sync lv-tool.cpp attribution header --- libvisual/tools/lv-tool/lv-tool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libvisual/tools/lv-tool/lv-tool.cpp b/libvisual/tools/lv-tool/lv-tool.cpp index 7e42331ab..41f6897ce 100644 --- a/libvisual/tools/lv-tool/lv-tool.cpp +++ b/libvisual/tools/lv-tool/lv-tool.cpp @@ -6,6 +6,7 @@ // Authors: Daniel Hiepler // Chong Kai Xiong // Dennis Smit +// Scott Sibley // // This file is part of lv-tool. // From 46e25c9cd9cbd318840b5b4168422890b43d5c9b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 7 Jan 2023 19:18:54 +0100 Subject: [PATCH 6/6] examples (simple): Fix use of SDL_GL_DOUBLEBUFFER and SDL_SetVideoMode flags --- libvisual/examples/simple/simple_example.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvisual/examples/simple/simple_example.cpp b/libvisual/examples/simple/simple_example.cpp index 9a19a1ee5..45e0e23b5 100644 --- a/libvisual/examples/simple/simple_example.cpp +++ b/libvisual/examples/simple/simple_example.cpp @@ -97,7 +97,7 @@ LV::VideoPtr SimpleExample::create_display (int width, int height, VisVideoDepth m_sdl_screen = nullptr; if (depth == VISUAL_VIDEO_DEPTH_GL) { - int flags = SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_RESIZABLE; + int flags = SDL_OPENGL | SDL_RESIZABLE; SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 8);