mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
gfx-effect-source: Check for effect == nullptr in test_for_updates
This commit is contained in:
parent
49964e15be
commit
d8d60f7a21
1 changed files with 127 additions and 125 deletions
|
@ -62,13 +62,14 @@ void gfx::effect_source::video_tick_impl(float time) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx::effect_source::video_render_impl(gs_effect_t* parent_effect) {
|
void gfx::effect_source::video_render_impl(gs_effect_t* parent_effect) {
|
||||||
|
parent_effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::effect_source::effect_source(obs_data_t* data, obs_source_t* owner) {
|
gfx::effect_source::effect_source(obs_data_t* data, obs_source_t* owner) {
|
||||||
m_source = owner;
|
m_source = owner;
|
||||||
time_existing = 0;
|
time_existing = 0;
|
||||||
time_active = 0;
|
time_active = 0;
|
||||||
|
update(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::effect_source::~effect_source() {}
|
gfx::effect_source::~effect_source() {}
|
||||||
|
@ -205,11 +206,10 @@ bool gfx::effect_source::test_for_updates(const char* text, const char* path) {
|
||||||
|
|
||||||
// If the shader is different, rebuild the parameter list.
|
// If the shader is different, rebuild the parameter list.
|
||||||
if (is_shader_different) {
|
if (is_shader_different) {
|
||||||
std::map<paramident_t, std::shared_ptr<parameter>> new_params;
|
if (shader.effect) {
|
||||||
|
|
||||||
// ToDo: Figure out if a recycling approach would work.
|
// ToDo: Figure out if a recycling approach would work.
|
||||||
// Might improve stability in low memory situations.
|
// Might improve stability in low memory situations.
|
||||||
|
std::map<paramident_t, std::shared_ptr<parameter>> new_params;
|
||||||
auto effect_param_list = shader.effect->get_parameters();
|
auto effect_param_list = shader.effect->get_parameters();
|
||||||
for (auto effect_param : effect_param_list) {
|
for (auto effect_param : effect_param_list) {
|
||||||
paramident_t ident;
|
paramident_t ident;
|
||||||
|
@ -335,8 +335,10 @@ bool gfx::effect_source::test_for_updates(const char* text, const char* path) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parameters = std::move(new_params);
|
parameters = std::move(new_params);
|
||||||
|
} else {
|
||||||
|
parameters.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return is_shader_different;
|
return is_shader_different;
|
||||||
|
|
Loading…
Reference in a new issue