gsdx: Add color component to OGL shaders

This commit is contained in:
Jason Brown 2016-09-18 20:32:44 +00:00 committed by Gregory Hainaut
parent 7ca9ca9465
commit d84d30fe87
7 changed files with 18 additions and 0 deletions

View File

@ -67,6 +67,8 @@ struct alignas(32) GSVertexPT1
{
GSVector4 p;
GSVector2 t;
char pad[4];
union {uint32 c; struct {uint8 r, g, b, a;};};
};
struct GSVertexPT2

View File

@ -17,6 +17,7 @@ in SHADER
{
vec4 p;
vec2 t;
vec4 c;
} PSin;
layout(location = 0) out vec4 SV_Target0;

View File

@ -5,6 +5,7 @@
layout(location = 0) in vec2 POSITION;
layout(location = 1) in vec2 TEXCOORD0;
layout(location = 7) in vec4 COLOR;
// FIXME set the interpolation (don't know what dx do)
// flat means that there is no interpolation. The value given to the fragment shader is based on the provoking vertex conventions.
@ -18,12 +19,14 @@ out SHADER
{
vec4 p;
vec2 t;
vec4 c;
} VSout;
void vs_main()
{
VSout.p = vec4(POSITION, 0.5f, 1.0f);
VSout.t = TEXCOORD0;
VSout.c = COLOR;
gl_Position = vec4(POSITION, 0.5f, 1.0f); // NOTE I don't know if it is possible to merge POSITION_OUT and gl_Position
}
@ -35,6 +38,7 @@ in SHADER
{
vec4 p;
vec2 t;
vec4 c;
} PSin;
// Give a different name so I remember there is a special case!

View File

@ -4,6 +4,7 @@ in SHADER
{
vec4 p;
vec2 t;
vec4 c;
} PSin;
#ifdef FRAGMENT_SHADER

View File

@ -4,6 +4,7 @@ in SHADER
{
vec4 p;
vec2 t;
vec4 c;
} PSin;
#ifdef FRAGMENT_SHADER

View File

@ -15,6 +15,7 @@ in SHADER
{
vec4 p;
vec2 t;
vec4 c;
} PSin;
layout(location = 0) out vec4 SV_Target0;

View File

@ -140,6 +140,7 @@ static const char* const convert_glsl =
"\n"
"layout(location = 0) in vec2 POSITION;\n"
"layout(location = 1) in vec2 TEXCOORD0;\n"
"layout(location = 7) in vec4 COLOR;\n"
"\n"
"// FIXME set the interpolation (don't know what dx do)\n"
"// flat means that there is no interpolation. The value given to the fragment shader is based on the provoking vertex conventions.\n"
@ -153,12 +154,14 @@ static const char* const convert_glsl =
"{\n"
" vec4 p;\n"
" vec2 t;\n"
" vec4 c;\n"
"} VSout;\n"
"\n"
"void vs_main()\n"
"{\n"
" VSout.p = vec4(POSITION, 0.5f, 1.0f);\n"
" VSout.t = TEXCOORD0;\n"
" VSout.c = COLOR;\n"
" gl_Position = vec4(POSITION, 0.5f, 1.0f); // NOTE I don't know if it is possible to merge POSITION_OUT and gl_Position\n"
"}\n"
"\n"
@ -170,6 +173,7 @@ static const char* const convert_glsl =
"{\n"
" vec4 p;\n"
" vec2 t;\n"
" vec4 c;\n"
"} PSin;\n"
"\n"
"// Give a different name so I remember there is a special case!\n"
@ -521,6 +525,7 @@ static const char* const interlace_glsl =
"{\n"
" vec4 p;\n"
" vec2 t;\n"
" vec4 c;\n"
"} PSin;\n"
"\n"
"#ifdef FRAGMENT_SHADER\n"
@ -580,6 +585,7 @@ static const char* const merge_glsl =
"{\n"
" vec4 p;\n"
" vec2 t;\n"
" vec4 c;\n"
"} PSin;\n"
"\n"
"#ifdef FRAGMENT_SHADER\n"
@ -627,6 +633,7 @@ static const char* const shadeboost_glsl =
"{\n"
" vec4 p;\n"
" vec2 t;\n"
" vec4 c;\n"
"} PSin;\n"
"\n"
"layout(location = 0) out vec4 SV_Target0;\n"
@ -1769,6 +1776,7 @@ static const char* const fxaa_fx =
"{\n"
" vec4 p;\n"
" vec2 t;\n"
" vec4 c;\n"
"} PSin;\n"
"\n"
"layout(location = 0) out vec4 SV_Target0;\n"