Browse Source

Only do the alpha swizzle on alpha textures

Avoids problems if swizzles are used elsewhere (like in the newer X11
plugins)
jp9000 11 years ago
parent
commit
51d338430f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libobs-opengl/gl-subsystem.c

+ 2 - 2
libobs-opengl/gl-subsystem.c

@@ -322,8 +322,8 @@ static void strip_mipmap_filter(GLint *filter)
 
 static inline void apply_swizzle(struct gs_texture *tex)
 {
-	gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R,
-			(tex->format == GS_A8) ? GL_ALPHA : GL_RED);
+	if (tex->format == GS_A8)
+		gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R, GL_ALPHA);
 }
 
 static bool load_texture_sampler(texture_t tex, samplerstate_t ss)