From 493648c6d2615b7f4ab9a35d418eaa789f467de6 Mon Sep 17 00:00:00 2001 From: James Park Date: Sat, 18 May 2019 22:14:27 -0700 Subject: [PATCH] obs-filters: Remove unused key_rgb shader variable Variable was never used. Clean up both C++ and shader code. --- plugins/obs-filters/chroma-key-filter.c | 10 +++------- plugins/obs-filters/data/chroma_key_filter.effect | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/obs-filters/chroma-key-filter.c b/plugins/obs-filters/chroma-key-filter.c index 180c5ae9a..3fa9790ff 100644 --- a/plugins/obs-filters/chroma-key-filter.c +++ b/plugins/obs-filters/chroma-key-filter.c @@ -35,7 +35,6 @@ struct chroma_key_filter_data { gs_eparam_t *pixel_size_param; gs_eparam_t *chroma_param; - gs_eparam_t *key_rgb_param; gs_eparam_t *similarity_param; gs_eparam_t *smoothness_param; gs_eparam_t *spill_param; @@ -45,7 +44,6 @@ struct chroma_key_filter_data { float brightness; float gamma; - struct vec4 key_rgb; struct vec2 chroma; float similarity; float smoothness; @@ -97,6 +95,7 @@ static inline void chroma_settings_update( SETTING_KEY_COLOR); const char *key_type = obs_data_get_string(settings, SETTING_COLOR_TYPE); + struct vec4 key_rgb; struct vec4 key_color_v4; struct matrix4 yuv_mat_m4; @@ -107,10 +106,10 @@ static inline void chroma_settings_update( else if (strcmp(key_type, "magenta") == 0) key_color = 0xFF00FF; - vec4_from_rgba(&filter->key_rgb, key_color | 0xFF000000); + vec4_from_rgba(&key_rgb, key_color | 0xFF000000); memcpy(&yuv_mat_m4, yuv_mat, sizeof(yuv_mat)); - vec4_transform(&key_color_v4, &filter->key_rgb, &yuv_mat_m4); + vec4_transform(&key_color_v4, &key_rgb, &yuv_mat_m4); vec2_set(&filter->chroma, key_color_v4.y, key_color_v4.z); filter->similarity = (float)similarity / 1000.0f; @@ -161,8 +160,6 @@ static void *chroma_key_create(obs_data_t *settings, obs_source_t *context) filter->effect, "gamma"); filter->chroma_param = gs_effect_get_param_by_name( filter->effect, "chroma_key"); - filter->key_rgb_param = gs_effect_get_param_by_name( - filter->effect, "key_rgb"); filter->pixel_size_param = gs_effect_get_param_by_name( filter->effect, "pixel_size"); filter->similarity_param = gs_effect_get_param_by_name( @@ -205,7 +202,6 @@ static void chroma_key_render(void *data, gs_effect_t *effect) gs_effect_set_float(filter->brightness_param, filter->brightness); gs_effect_set_float(filter->gamma_param, filter->gamma); gs_effect_set_vec2(filter->chroma_param, &filter->chroma); - gs_effect_set_vec4(filter->key_rgb_param, &filter->key_rgb); gs_effect_set_vec2(filter->pixel_size_param, &pixel_size); gs_effect_set_float(filter->similarity_param, filter->similarity); gs_effect_set_float(filter->smoothness_param, filter->smoothness); diff --git a/plugins/obs-filters/data/chroma_key_filter.effect b/plugins/obs-filters/data/chroma_key_filter.effect index 86280702d..c7d41f3e4 100644 --- a/plugins/obs-filters/data/chroma_key_filter.effect +++ b/plugins/obs-filters/data/chroma_key_filter.effect @@ -12,7 +12,6 @@ uniform float brightness; uniform float gamma; uniform float2 chroma_key; -uniform float4 key_rgb; uniform float2 pixel_size; uniform float similarity; uniform float smoothness;