Răsfoiți Sursa

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.
jp9000 11 ani în urmă
părinte
comite
c8dfce886b
1 a modificat fișierele cu 6 adăugiri și 2 ștergeri
  1. 6 2
      libobs/obs-source.c

+ 6 - 2
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;