瀏覽代碼

Revert OpenGL swizzle change

Was wrong to use the swizzle -- it was an incorrect assumption on my
part that this could work in the first place (despite working on
windows)
jp9000 11 年之前
父節點
當前提交
bc33b09ba9
共有 2 個文件被更改,包括 2 次插入22 次删除
  1. 2 15
      libobs-opengl/gl-subsystem.c
  2. 0 7
      libobs-opengl/gl-subsystem.h

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

@@ -322,21 +322,8 @@ static void strip_mipmap_filter(GLint *filter)
 
 static inline void apply_swizzle(struct gs_texture *tex)
 {
-	if (tex->format == GS_A8) {
-		gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R, GL_ALPHA);
-	} else {
-#ifdef USE_FORMAT_SWIZZLE
-		bool invert_format =
-			(tex->format == GS_BGRA || tex->format == GS_BGRX);
-
-		gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R,
-				invert_format ? GL_BLUE : GL_RED);
-		gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_B,
-				invert_format ? GL_RED  : GL_BLUE);
-#else
-		gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R, GL_RED);
-#endif
-	}
+	gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R,
+			(tex->format == GS_A8) ? GL_ALPHA : GL_RED);
 }
 
 static bool load_texture_sampler(texture_t tex, samplerstate_t ss)

+ 0 - 7
libobs-opengl/gl-subsystem.h

@@ -27,8 +27,6 @@
 
 #include "gl-helpers.h"
 
-#define USE_FORMAT_SWIZZLE
-
 struct gl_platform;
 struct gl_windowinfo;
 
@@ -44,13 +42,8 @@ static inline GLint convert_gs_format(enum gs_color_format format)
 	case GS_A8:          return GL_RGBA;
 	case GS_R8:          return GL_RED;
 	case GS_RGBA:        return GL_RGBA;
-#ifdef USE_FORMAT_SWIZZLE
-	case GS_BGRX:        return GL_RGB;
-	case GS_BGRA:        return GL_RGBA;
-#else
 	case GS_BGRX:        return GL_BGR;
 	case GS_BGRA:        return GL_BGRA;
-#endif
 	case GS_R10G10B10A2: return GL_RGBA;
 	case GS_RGBA16:      return GL_RGBA;
 	case GS_R16:         return GL_RED;