OSDN Git Service

[Qt][Draw][GL][GLSL] Shader: Remove heavy? biye swapping , swap within emulator ...
authorK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 9 Nov 2015 16:42:58 +0000 (01:42 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Mon, 9 Nov 2015 16:42:58 +0000 (01:42 +0900)
source/src/common.h
source/src/qt/common/chromakey_fragment_shader.glsl
source/src/qt/common/fragment_shader.glsl

index 305bd06..7a8811a 100644 (file)
@@ -404,11 +404,8 @@ typedef uint16 scrntype;
 #  define RGB_COLOR(r, g, b) (((uint32)(r) << 24) | ((uint32)(g) << 16) | ((uint32)(b) << 8))
 typedef uint32 scrntype;
 # elif defined(_RGBA888)
-//#  if defined(USE_BITMAP)
-//#   define RGB_COLOR(r, g, b) (((uint32)(r) << 24) | ((uint32)(g) << 16) | ((uint32)(b) << 8)) | ((uint32)((r | g | b) == 0x00) ? 0x00 : 0xff)
-//#  else
-#   define RGB_COLOR(r, g, b) (((uint32)(r) << 24) | ((uint32)(g) << 16) | ((uint32)(b) << 8)) | ((uint32)0xff << 0)
-//#  endif
+//#   define RGB_COLOR(r, g, b) (((uint32)(r) << 24) | ((uint32)(g) << 16) | ((uint32)(b) << 8)) | ((uint32)0xff << 0)
+#   define RGB_COLOR(r, g, b) (((uint32)(b) << 24) | ((uint32)(g) << 16) | ((uint32)(r) << 8)) | ((uint32)0xff << 0)
 typedef uint32 scrntype;
 # endif
 
@@ -424,8 +421,8 @@ typedef uint16 scrntype;
 #  define RGB_COLOR(r, g, b) (((uint32)(r) << 16) | ((uint32)(g) << 8) | ((uint32)(b) << 0))
 typedef uint32 scrntype;
 # elif defined(_RGBA888)
-#   define RGB_COLOR(r, g, b) (((uint32)(r) << 16) | ((uint32)(g) << 8) | ((uint32)(b) << 0)) | ((uint32)0xff << 24)
-//#  endif
+//#   define RGB_COLOR(r, g, b) (((uint32)(r) << 16) | ((uint32)(g) << 8) | ((uint32)(b) << 0)) | ((uint32)0xff << 24)
+#   define RGB_COLOR(r, g, b) (((uint32)(b) << 16) | ((uint32)(g) << 8) | ((uint32)(r) << 0)) | ((uint32)0xff << 24)
 typedef uint32 scrntype;
 # endif
 
index 41b8358..cbaf4c9 100644 (file)
@@ -13,11 +13,8 @@ void main()
 {
        // Set fragment color from texture
        vec4 pixel_t = texture2D(a_texture, v_texcoord );
-       vec4 pixel_r;
+       vec4 pixel_r = pixel_t;
        vec4 c = vec4(chromakey, 1.0);
-       pixel_r.b = pixel_t.r;
-       pixel_r.r = pixel_t.b;
-       pixel_r.g = pixel_t.g;
        pixel_r.a = 1.0;
     
        if(pixel_r != c) { // Chromakey;
index d2f0773..e224919 100644 (file)
@@ -14,10 +14,5 @@ void main()
     vec4 pixel_t = texture2D(a_texture, v_texcoord );
     vec4 pixel_r;
     pixel_r = pixel_t * color;
-    pixel_r.b = pixel_t.r;
-    pixel_r.r = pixel_t.b;
-    pixel_r.g = pixel_t.g;
-    
     gl_FragColor = pixel_r;
-  //  gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
 }