diff --git a/source/obs/gs/gs-effect-parameter.cpp b/source/obs/gs/gs-effect-parameter.cpp index 16e4a022..8556d93a 100644 --- a/source/obs/gs/gs-effect-parameter.cpp +++ b/source/obs/gs/gs-effect-parameter.cpp @@ -647,18 +647,20 @@ void streamfx::obs::gs::effect_parameter::get_default_matrix(matrix4& v) } } -void streamfx::obs::gs::effect_parameter::set_texture(std::shared_ptr v) +void streamfx::obs::gs::effect_parameter::set_texture(std::shared_ptr v, bool srgb) { - if (get_type() != type::Texture) - throw std::bad_cast(); - gs_effect_set_texture(get(), v->get_object()); + set_texture(v->get_object(), srgb); } -void streamfx::obs::gs::effect_parameter::set_texture(gs_texture_t* v) +void streamfx::obs::gs::effect_parameter::set_texture(gs_texture_t* v, bool srgb) { if (get_type() != type::Texture) throw std::bad_cast(); - gs_effect_set_texture(get(), v); + if (!srgb) { + gs_effect_set_texture(get(), v); + } else { + gs_effect_set_texture_srgb(get(), v); + } } void streamfx::obs::gs::effect_parameter::set_sampler(std::shared_ptr v) diff --git a/source/obs/gs/gs-effect-parameter.hpp b/source/obs/gs/gs-effect-parameter.hpp index c5686461..df956755 100644 --- a/source/obs/gs/gs-effect-parameter.hpp +++ b/source/obs/gs/gs-effect-parameter.hpp @@ -189,8 +189,8 @@ namespace streamfx::obs::gs { void get_matrix(matrix4& v); void get_default_matrix(matrix4& v); - void set_texture(std::shared_ptr v); - void set_texture(gs_texture_t* v); + void set_texture(std::shared_ptr v, bool srgb = false); + void set_texture(gs_texture_t* v, bool srgb = false); void set_sampler(std::shared_ptr v); void set_sampler(gs_sampler_state* v);