From c8dfce886b8437ec7804f12ed397a0893610a8c4 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 26 Nov 2014 23:29:36 -0800 Subject: [PATCH] libobs: Fix warnings assigning values to vec3 Because a vec3 structure can contain a __m128 variable and not the expected three floats x, y, and z, you must use vec3_set when setting a value for a vec3 structure to ensure that it uses the proper intrinsics internally if necessary. --- libobs/obs-source.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 7230ef48e..c45dd99fb 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -2120,8 +2120,12 @@ void obs_source_draw_set_color_matrix(const struct matrix4 *color_matrix, const struct vec3 *color_range_min, const struct vec3 *color_range_max) { - static const struct vec3 color_range_min_def = {0.0f, 0.0f, 0.0f}; - static const struct vec3 color_range_max_def = {1.0f, 1.0f, 1.0f}; + struct vec3 color_range_min_def; + struct vec3 color_range_max_def; + + vec3_set(&color_range_min_def, 0.0f, 0.0f, 0.0f); + vec3_set(&color_range_max_def, 1.0f, 1.0f, 1.0f); + gs_effect_t *effect = gs_get_effect(); gs_eparam_t *matrix; gs_eparam_t *range_min;