From 31dd11a7b820eb90f9b64c46487dcb06c666e5bc Mon Sep 17 00:00:00 2001 From: phandasm Date: Fri, 25 Feb 2022 20:54:26 -0800 Subject: [PATCH] actually fix crash --- src/source.cpp | 2 ++ src/source.hpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/source.cpp b/src/source.cpp index 71d3ece..158f8f5 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -740,6 +740,7 @@ void WAVSource::render_curve([[maybe_unused]] gs_effect_t *effect) gs_draw((m_render_mode != RenderMode::LINE) ? GS_TRISTRIP : GS_LINESTRIP, 0, (uint32_t)num_verts); } + gs_load_vertexbuffer(nullptr); gs_vertexbuffer_destroy(vbuf); gs_technique_end_pass(tech); gs_technique_end(tech); @@ -916,6 +917,7 @@ void WAVSource::render_bars([[maybe_unused]] gs_effect_t *effect) gs_draw(GS_TRIS, 0, vertpos); } + gs_load_vertexbuffer(nullptr); gs_vertexbuffer_destroy(vbuf); gs_technique_end_pass(tech); gs_technique_end(tech); diff --git a/src/source.hpp b/src/source.hpp index 85e89e8..7d12b96 100644 --- a/src/source.hpp +++ b/src/source.hpp @@ -160,6 +160,9 @@ class WAVSource void init_interp(unsigned int sz); + void render_curve(gs_effect_t *effect); + void render_bars(gs_effect_t *effect); + // constants static const float DB_MIN; static constexpr auto RETRY_DELAY = 2.0f; @@ -188,9 +191,6 @@ class WAVSource virtual void tick(float seconds) = 0; virtual void render(gs_effect_t *effect); - void render_curve(gs_effect_t *effect); - void render_bars(gs_effect_t *effect); - void show(); void hide();