Переглянути джерело

linux-capture: Revert GS_RGBX usage

Kurt Kartaltepe 6 роки тому
батько
коміт
1402a80583
1 змінених файлів з 7 додано та 3 видалено
  1. 7 3
      plugins/linux-capture/xcompcap-main.cpp

+ 7 - 3
plugins/linux-capture/xcompcap-main.cpp

@@ -303,13 +303,17 @@ static void xcc_cleanup(XCompcapMain_private *p)
 static gs_color_format gs_format_from_tex()
 static gs_color_format gs_format_from_tex()
 {
 {
 	GLint iformat = 0;
 	GLint iformat = 0;
-	// we can probably fix the intel swapped texture by querying via
-	// GL_ARB_internalformat_query
+	// consider GL_ARB_internalformat_query
 	glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT,
 	glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT,
 				 &iformat);
 				 &iformat);
+
+	// These formats are known to be wrong on Intel platforms. We intentionally
+	// use swapped internal formats here to preserve historic behavior which
+	// swapped colors accidentally and because D3D11 would not support a
+	// GS_RGBX format
 	switch (iformat) {
 	switch (iformat) {
 	case GL_RGB:
 	case GL_RGB:
-		return GS_RGBX;
+		return GS_BGRX;
 	case GL_RGBA:
 	case GL_RGBA:
 		return GS_RGBA;
 		return GS_RGBA;
 	default:
 	default: