Merge branch 'GLSL-master'

Merge an endless story. The branch name is a lie, it was started as glsl, but now it is a complete reworked opengl3 backend.

It just began with simple changes which aren't supported on osx.
They either support ogl2 OR ogl3 core, but mixing isn't allowed.
As the branch name says, the vicious circle starts with GLSL, but just implementing one wasn't possible either:
- OSX supports only GLSL100 which doesn't support our shaders.
- Vertex Array Objects are needed for ogl3, but not supported on ogl2
- immediate mode isn't supported any more, so we must implement vertex buffers
- uniform buffers are recommended as else we would need tons glUniform
- postprocessing shaders have to be converted to glsl
- lots of smaller outdated issues and bug fixes :-)

Thanks at all for testing and at Sonic for converting all of our shaders to glsl130

And sorry for all upcoming bugs...
This commit is contained in:
degasus 2013-03-15 22:49:26 +01:00
commit e1a081ad2d
152 changed files with 53010 additions and 48645 deletions

1
.gitignore vendored
View File

@ -36,5 +36,6 @@ Source/Core/Common/Src/scmrev.h
.sconsign.dblite
Externals/scons-local/*
.DS_Store
*~
#Ignore transifix configuration directory
.tx

View File

@ -655,6 +655,7 @@ file(WRITE ${PROJECT_BINARY_DIR}/Source/Core/Common/Src/scmrev.h
)
include_directories("${PROJECT_BINARY_DIR}/Source/Core/Common/Src")
########################################
# Start compiling our code
#

View File

@ -1,109 +1,61 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
//Change this number to increase the pixel size.
int pixelSize = 3;
float pixelSize = 3;
float red = 0.0;
float green = 0.0;
float blue = 0.0;
int val = uv0[0];
int val2 = uv0[1];
val = val % pixelSize;
val2 = val2 % pixelSize;
vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw;
if(val == 0 && val2 == 0 ){
if (c0.r < 0.1 && c0.r >= 0)
vec4 c0 = texture(samp9, pos);
if (c0.r < 0.1)
red = 0.1;
if (c0.r < 0.20 && c0.r >= 0.1)
else if (c0.r < 0.20)
red = 0.20;
if (c0.r <0.40 && c0.r >= 0.20)
else if (c0.r < 0.40)
red = 0.40;
if (c0.r <0.60 && c0.r >= 0.40)
else if (c0.r < 0.60)
red = 0.60;
if (c0.r <0.80 && c0.r >= 0.60)
else if (c0.r < 0.80)
red = 0.80;
if (c0.r >= 0.80)
red = 1;
else
red = 1.0;
if (c0.b < 0.1 && c0.b >= 0)
if (c0.b < 0.1)
blue = 0.1;
if (c0.b < 0.20 && c0.b >= 0.1)
else if (c0.b < 0.20)
blue = 0.20;
if (c0.b <0.40 && c0.b >= 0.20)
else if (c0.b < 0.40)
blue = 0.40;
if (c0.b <0.60 && c0.b >= 0.40)
else if (c0.b < 0.60)
blue = 0.60;
if (c0.b <0.80 && c0.b >= 0.60)
else if (c0.b < 0.80)
blue = 0.80;
if (c0.b >= 0.80)
blue = 1;
else
blue = 1.0;
if (c0.g < 0.1 && c0.g >= 0)
if (c0.g < 0.1)
green = 0.1;
if (c0.g < 0.20 && c0.g >= 0.1)
else if (c0.g < 0.20)
green = 0.20;
if (c0.g <0.40 && c0.g >= 0.20)
else if (c0.g < 0.40)
green = 0.40;
if (c0.g <0.60 && c0.g >= 0.40)
else if (c0.g < 0.60)
green = 0.60;
if (c0.g <0.80 && c0.g >= 0.60)
else if (c0.g < 0.80)
green = 0.80;
if (c0.g >= 0.80)
green = 1;
else
green = 1.0;
}
else{
float4 c1 = texRECT(samp0, uv0-float2(val, val2)).rgba;
if (c1.r < 0.1 && c1.r >= 0)
red = 0.1;
if (c1.r < 0.20 && c1.r >= 0.1)
red = 0.20;
if (c1.r <0.40 && c1.r >= 0.20)
red = 0.40;
if (c1.r <0.60 && c1.r >= 0.40)
red = 0.60;
if (c1.r <0.80 && c1.r >= 0.60)
red = 0.80;
if (c1.r >= 0.80)
red = 1;
if (c1.b < 0.1 && c1.b >= 0)
blue = 0.1;
if (c1.b < 0.20 && c1.b >= 0.1)
blue = 0.20;
if (c1.b <0.40 && c1.b >= 0.20)
blue = 0.40;
if (c1.b <0.60 && c1.b >= 0.40)
blue = 0.60;
if (c1.b <0.80 && c1.b >= 0.60)
blue = 0.80;
if (c1.b >= 0.80)
blue = 1;
if (c1.g < 0.1 && c1.g >= 0)
green = 0.1;
if (c1.g < 0.20 && c1.g >= 0.1)
green = 0.20;
if (c1.g <0.40 && c1.g >= 0.20)
green = 0.40;
if (c1.g <0.60 && c1.g >= 0.40)
green = 0.60;
if (c1.g <0.80 && c1.g >= 0.60)
green = 0.80;
if (c1.g >= 0.80)
green = 1;
}
ocol0 = float4(red, green, blue, c0.a);
ocol0 = vec4(red, green, blue, c0.a);
}

View File

@ -1,157 +1,86 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
//Change this number to increase the pixel size.
int pixelSize = 2;
float pixelSize = 2;
float red = 0.0;
float green = 0.0;
float blue = 0.0;
int val = uv0[0];
int val2 = uv0[1];
val = val % pixelSize;
val2 = val2 % pixelSize;
vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw;
if(val == 0 && val2 == 0 ){
if (c0.r < 0.06 && c0.r >= 0)
vec4 c0 = texture(samp9, pos);
if (c0.r < 0.06)
red = 0.06;
if (c0.r < 0.13 && c0.r >= 0.06)
else if (c0.r < 0.13)
red = 0.13;
if (c0.r < 0.26 && c0.r >= 0.13)
else if (c0.r < 0.26)
red = 0.26;
if (c0.r < 0.33 && c0.r >= 0.26)
else if (c0.r < 0.33)
red = 0.33;
if (c0.r <0.46 && c0.r >= 0.33)
else if (c0.r < 0.46)
red = 0.46;
if (c0.r <0.60 && c0.r >= 0.46)
else if (c0.r < 0.60)
red = 0.60;
if (c0.r <0.73 && c0.r >= 0.60)
else if (c0.r < 0.73)
red = 0.73;
if (c0.r <0.80 && c0.r >= 0.73)
else if (c0.r < 0.80)
red = 0.80;
if (c0.r <0.93 && c0.r >= 0.80)
else if (c0.r < 0.93)
red = 0.93;
if (c0.r <=1 && c0.r >= 0.93)
red = 1;
else
red = 1.0;
if (c0.b < 0.06 && c0.b >= 0)
if (c0.b < 0.06)
blue = 0.06;
if (c0.b < 0.13 && c0.b >= 0.06)
else if (c0.b < 0.13)
blue = 0.13;
if (c0.b < 0.26 && c0.b >= 0.13)
else if (c0.b < 0.26)
blue = 0.26;
if (c0.b < 0.33 && c0.b >= 0.26)
else if (c0.b < 0.33)
blue = 0.33;
if (c0.b <0.46 && c0.b >= 0.33)
else if (c0.b < 0.46)
blue = 0.46;
if (c0.b <0.60 && c0.b >= 0.46)
else if (c0.b < 0.60)
blue = 0.60;
if (c0.b <0.73 && c0.b >= 0.60)
else if (c0.b < 0.73)
blue = 0.73;
if (c0.b <0.80 && c0.b >= 0.73)
else if (c0.b < 0.80)
blue = 0.80;
if( c0.b <0.93 && c0.b >= 0.80)
else if( c0.b < 0.93)
blue = 0.93;
if (c0.b <=1 && c0.b >= 0.93)
blue = 1;
else
blue = 1.0;
if (c0.g < 0.06 && c0.g >= 0)
if (c0.g < 0.06)
green = 0.06;
if (c0.g < 0.13 && c0.g >= 0.06)
else if (c0.g < 0.13)
green = 0.13;
if (c0.g < 0.26 && c0.g >= 0.13)
else if (c0.g < 0.26)
green = 0.26;
if (c0.g < 0.33 && c0.g >= 0.26)
else if (c0.g < 0.33)
green = 0.33;
if (c0.g <0.46 && c0.g >= 0.33)
else if (c0.g < 0.46)
green = 0.46;
if (c0.g <0.60 && c0.g >= 0.46)
else if (c0.g < 0.60)
green = 0.60;
if (c0.g <0.73 && c0.g >= 0.60)
else if (c0.g < 0.73)
green = 0.73;
if (c0.g <0.80 && c0.g >= 0.73)
else if (c0.g < 0.80)
green = 0.80;
if( c0.g <0.93 && c0.g >= 0.80)
else if( c0.g < 0.93)
green = 0.93;
if (c0.g <=1 && c0.g >= 0.93)
green = 1;
else
green = 1.0;
}
else{
float4 c1 = texRECT(samp0, uv0-float2(val, val2)).rgba;
if (c1.r < 0.06 && c1.r >= 0)
red = 0.06;
if (c1.r < 0.13 && c1.r >= 0.06)
red = 0.13;
if (c1.r < 0.26 && c1.r >= 0.13)
red = 0.26;
if (c1.r < 0.33 && c1.r >= 0.26)
red = 0.33;
if (c1.r <0.46 && c1.r >= 0.33)
red = 0.46;
if (c1.r <0.60 && c1.r >= 0.46)
red = 0.60;
if (c1.r <0.73 && c1.r >= 0.60)
red = 0.73;
if (c1.r <0.80 && c1.r >= 0.73)
red = 0.80;
if (c1.r <0.93 && c1.r >= 0.80)
red = 0.93;
if (c1.r <=1 && c1.r >= 0.93)
red = 1;
if (c1.b < 0.06 && c1.b >= 0)
blue = 0.06;
if (c1.b < 0.13 && c1.b >= 0.06)
blue = 0.13;
if (c1.b < 0.26 && c1.b >= 0.13)
blue = 0.26;
if (c1.b < 0.33 && c1.b >= 0.26)
blue = 0.33;
if (c1.b <0.46 && c1.b >= 0.33)
blue = 0.46;
if (c1.b <0.60 && c1.b >= 0.46)
blue = 0.60;
if (c1.b <0.73 && c1.b >= 0.60)
blue = 0.73;
if (c1.b <0.80 && c1.b >= 0.73)
blue = 0.80;
if( c1.b <0.93 && c1.b >= 0.80)
blue = 0.93;
if (c1.b <=1 && c1.b >= 0.93)
blue = 1;
if (c1.g < 0.06 && c1.g >= 0)
green = 0.06;
if (c1.g < 0.13 && c1.g >= 0.06)
green = 0.13;
if (c1.g < 0.26 && c1.g >= 0.13)
green = 0.26;
if (c1.g < 0.33 && c1.g >= 0.26)
green = 0.33;
if (c1.g <0.46 && c1.g >= 0.33)
green = 0.46;
if (c1.g <0.60 && c1.g >= 0.46)
green = 0.60;
if (c1.g <0.73 && c1.g >= 0.60)
green = 0.73;
if (c1.g <0.80 && c1.g >= 0.73)
green = 0.80;
if( c1.g <0.93 && c1.g >= 0.80)
green = 0.93;
if ( c1.g >= 0.93)
green = 1;
}
ocol0 = float4(red, green, blue, c0.a);
ocol0 = vec4(red, green, blue, c0.a);
}

View File

@ -1,11 +1,14 @@
//dummy shader:
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(c0.r, c0.g, c0.b, c0.a);
ocol0 = texture(samp9, uv0);
}
/*
And now that's over with, the contents of this readme file!
For best results, turn Wordwrap formatting on...

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float blue = 0.0;
@ -14,5 +17,5 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
float green = max(c0.r + c0.b, c0.g);
ocol0 = float4(red, green, blue, 1.0);
ocol0 = vec4(red, green, blue, 1.0);
}

View File

@ -1,6 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
ocol0 = (texRECT(samp0, uv0+1).rgba - texRECT(samp0, uv0-1).rgba)*8;
ocol0 = (texture(samp9, uv0+resolution.zw) - texture(samp9, uv0-resolution.zw))*8;
}

View File

@ -1,6 +1,13 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
ocol0 = texRECT(samp0, uv0+1).rgba * 1.3 * abs(texRECT(samp0, uv0+1).rgba - texRECT(samp0, uv0-1).rgba)*8;
vec4 a = texture(samp9, uv0+resolution.zw);
vec4 b = texture(samp9, uv0-resolution.zw);
ocol0 = ( a*a*1.3 - b )*8;
}

View File

@ -0,0 +1,95 @@
uniform sampler2D samp8; // textures
uniform sampler2D samp9;
const int char_width = 8;
const int char_height = 13;
const int char_count = 95;
const int char_pixels = char_width*char_height;
const vec2 char_dim = vec2(char_width, char_height);
const vec2 font_scale = vec2(1.0/char_width/char_count, 1.0/char_height);
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
vec2 char_pos = floor(uv0*resolution.xy/char_dim);
vec2 pixel_offset = floor(uv0*resolution.xy) - char_pos*char_dim;
float mindiff = char_width*char_height*100; // just a big number
float minc = 0.0;
vec4 mina = vec4(0.0, 0.0, 0.0, 0.0);
vec4 minb = vec4(0.0, 0.0, 0.0, 0.0);
for(int i=0; i<char_count; i++) {
vec4 ff = vec4(0.0, 0.0, 0.0, 0.0);
vec4 f = vec4(0.0, 0.0, 0.0, 0.0);
vec4 ft = vec4(0.0, 0.0, 0.0, 0.0);
vec4 t = vec4(0.0, 0.0, 0.0, 0.0);
vec4 tt = vec4(0.0, 0.0, 0.0, 0.0);
for(int x=0; x<char_width; x++) {
for(int y=0; y<char_height; y++) {
vec2 tex_pos = char_pos*char_dim + vec2(x,y) + 0.5;
vec4 tex = texture(samp9, tex_pos * resolution.zw);
vec2 font_pos = vec2(x+i*char_width, y) + 0.5;
vec4 font = texture(samp8, font_pos * font_scale);
// generates sum of texture and font and their squares
ff += font*font;
f += font;
ft += font*tex;
t += tex;
tt += tex*tex;
}
}
/*
The next lines are a bit harder, hf :-)
The idea is to find the perfect char with the perfect background color and the perfect font color.
As this is an equation with three unknowns, we can't just try all chars and color combinations.
As criterion how "perfect" the selection is, we compare the "mean squared error" of the resulted colors of all chars.
So, now the big issue: how to calculate the MSE without knowing the two colors ...
In the next steps, "a" is the font color, "b" is the background color, "f" is the font value at this pixel, "t" is the texture value
So the square error of one pixel is:
e = ( t - a⋅f - b⋅(1-f) ) ^ 2
In longer:
e = a^2⋅f^2 - 2⋅a⋅b⋅f^2 + 2⋅a⋅b⋅f - 2⋅a⋅f⋅t + b^2⋅f^2 - 2⋅b^2⋅f + b^2 + 2⋅b⋅f⋅t - 2⋅b⋅t + t^2
The sum of all errors is: (as shortcut, ff,f,ft,t,tt are now the sums like declared above, sum(1) is the count of pixels)
sum(e) = a^2⋅ff - 2⋅a^2⋅ff + 2⋅a⋅b⋅f - 2⋅a⋅ft + b^2⋅ff - 2⋅b^2⋅f + b^2⋅sum(1) + 2⋅b⋅ft - 2⋅b⋅t + tt
To find the minimum, we have to derive this by "a" and "b":
d/da sum(e) = 2⋅a⋅ff + 2⋅b⋅f - 2⋅b⋅ff - 2⋅ft
d/db sum(e) = 2⋅a⋅f - 2⋅a⋅ff - 4⋅b⋅f + 2⋅b⋅ff + 2⋅b⋅sum(1) + 2⋅ft - 2⋅t
So, both equations must be zero at minimum and there is only one solution.
*/
vec4 a = (f*ft - ff*t + f*t - ft*char_pixels) / (f*f - ff*char_pixels);
vec4 b = (f*ft - ff*t) / (f*f - ff*char_pixels);
vec4 diff = a*a*ff + 2.0*a*b*f - 2.0*a*b*ff - 2.0*a*ft + b*b *(-2.0*f + ff + char_pixels) + 2.0*b*ft - 2.0*b*t + tt;
float diff_f = dot(diff, vec4(1.0, 1.0, 1.0, 1.0));
if(diff_f < mindiff) {
mindiff = diff_f;
minc = i;
mina = a;
minb = b;
}
}
vec2 font_pos_res = vec2(minc*char_width, 0) + pixel_offset + 0.5;
vec4 col = texture(samp8, font_pos_res * font_scale);
ocol0 = mina * col + minb * (vec4(1.0,1.0,1.0,1.0) - col);
}

View File

@ -1,16 +1,22 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 to_gray = float4(0.3,0.59,0.11,0);
float x1 = dot(to_gray, texRECT(samp0, uv0+float2(1,1)));
float x0 = dot(to_gray, texRECT(samp0, uv0+float2(-1,-1)));
float x3 = dot(to_gray, texRECT(samp0, uv0+float2(1,-1)));
float x2 = dot(to_gray, texRECT(samp0, uv0+float2(-1,1)));
float edge = (x1 - x0) * (x1 - x0);
float edge2 = (x3 - x2) * (x3 - x2);
edge += edge2;
float4 color = texRECT(samp0, uv0).rgba;
vec4 to_gray = vec4(0.3,0.59,0.11,0);
ocol0 = max(color - float4(edge, edge, edge, edge) * 12, float4(0,0,0,0));
float x1 = dot(to_gray, texture(samp9, uv0+vec2(1,1)*resolution.zw));
float x0 = dot(to_gray, texture(samp9, uv0+vec2(-1,-1)*resolution.zw));
float x3 = dot(to_gray, texture(samp9, uv0+vec2(1,-1)*resolution.zw));
float x2 = dot(to_gray, texture(samp9, uv0+vec2(-1,1)*resolution.zw));
float edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2);
float4 color = texture(samp9, uv0).rgba;
ocol0 = color - vec4(edge, edge, edge, edge) * 12.0;
}

View File

@ -1,24 +1,25 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//Changethis to increase the number of colors.
float numColors =8;
int numColors =8;
float4 to_gray = float4(0.3,0.59,0.11,0);
float x1 = dot(to_gray, texRECT(samp0, uv0+float2(1,1)));
float x0 = dot(to_gray, texRECT(samp0, uv0+float2(-1,-1)));
float x3 = dot(to_gray, texRECT(samp0, uv0+float2(1,-1)));
float x2 = dot(to_gray, texRECT(samp0, uv0+float2(-1,1)));
float edge = (x1 - x0) * (x1 - x0);
float edge2 = (x3 - x2) * (x3 - x2);
edge += edge2;
float4 color = texRECT(samp0, uv0).rgba;
float x1 = dot(to_gray, texture(samp9, uv0+vec2(1,1)*resolution.zw));
float x0 = dot(to_gray, texture(samp9, uv0+vec2(-1,-1)*resolution.zw));
float x3 = dot(to_gray, texture(samp9, uv0+vec2(1,-1)*resolution.zw));
float x2 = dot(to_gray, texture(samp9, uv0+vec2(-1,1)*resolution.zw));
float edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2);
float4 color = texture(samp9, uv0).rgba;
float4 c0 = max(color - float4(edge, edge, edge, edge) * 12, float4(0,0,0,0));
float4 c0 = color - float4(edge, edge, edge, edge) * 12;
//Change this number to increase the pixel size.
int pixelSize = 1;
float red = 0.0;
@ -27,19 +28,11 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
bool rr = false;
bool bb = false;
bool gg = false;
int val = uv0[0];
int val2 = uv0[1];
int count = 1;
double colorN = 0.0;
double colorB = 0.0;
val = val % pixelSize;
val2 = val2 % pixelSize;
float colorN = 0.0;
float colorB = 0.0;
//if(val == 0 && val2 == 0 )
// c0 = texRECT(samp0, uv0).rgba;
//else
// c0 = texRECT(samp0, uv0-float2(val, val2)).rgba;
for(count = 1; count <= numColors ; count++){
colorN = count / numColors;

View File

@ -1,36 +1,41 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0, in float2 uv1 : TEXCOORD1)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c_center = texRECT(samp0, uv0.xy).rgba;
float4 c_center = texture(samp9, uv0);
float4 bloom_sum = float4(0.0, 0.0, 0.0, 0.0);
uv0 += float2(0.3, 0.3);
float radius1 = 1.3;
bloom_sum += texRECT(samp0, uv0 + float2(-1.5, -1.5) * radius1);
bloom_sum += texRECT(samp0, uv0 + float2(-2.5, 0) * radius1);
bloom_sum += texRECT(samp0, uv0 + float2(-1.5, 1.5) * radius1);
bloom_sum += texRECT(samp0, uv0 + float2(0, 2.5) * radius1);
bloom_sum += texRECT(samp0, uv0 + float2(1.5, 1.5) * radius1);
bloom_sum += texRECT(samp0, uv0 + float2(2.5, 0) * radius1);
bloom_sum += texRECT(samp0, uv0 + float2(1.5, -1.5) * radius1);
bloom_sum += texRECT(samp0, uv0 + float2(0, -2.5) * radius1);
vec2 pos = uv0 + float2(0.3, 0.3) * resolution.zw;
float2 radius1 = 1.3 * resolution.zw;
bloom_sum += texture(samp9, pos + float2(-1.5, -1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(-2.5, 0) * radius1);
bloom_sum += texture(samp9, pos + float2(-1.5, 1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(0, 2.5) * radius1);
bloom_sum += texture(samp9, pos + float2(1.5, 1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(2.5, 0) * radius1);
bloom_sum += texture(samp9, pos + float2(1.5, -1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(0, -2.5) * radius1);
float radius2 = 4.6;
bloom_sum += texRECT(samp0, uv0 + float2(-1.5, -1.5) * radius2);
bloom_sum += texRECT(samp0, uv0 + float2(-2.5, 0) * radius2);
bloom_sum += texRECT(samp0, uv0 + float2(-1.5, 1.5) * radius2);
bloom_sum += texRECT(samp0, uv0 + float2(0, 2.5) * radius2);
bloom_sum += texRECT(samp0, uv0 + float2(1.5, 1.5) * radius2);
bloom_sum += texRECT(samp0, uv0 + float2(2.5, 0) * radius2);
bloom_sum += texRECT(samp0, uv0 + float2(1.5, -1.5) * radius2);
bloom_sum += texRECT(samp0, uv0 + float2(0, -2.5) * radius2);
float2 radius2 = 4.6 * resolution.zw;
bloom_sum += texture(samp9, pos + float2(-1.5, -1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(-2.5, 0) * radius2);
bloom_sum += texture(samp9, pos + float2(-1.5, 1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(0, 2.5) * radius2);
bloom_sum += texture(samp9, pos + float2(1.5, 1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(2.5, 0) * radius2);
bloom_sum += texture(samp9, pos + float2(1.5, -1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(0, -2.5) * radius2);
bloom_sum *= 0.07;
bloom_sum -= float4(0.3, 0.3, 0.3, 0.3);
bloom_sum = max(bloom_sum, float4(0,0,0,0));
float2 vpos = (uv1 - float2(.5, .5)) * 2;
float2 vpos = (uv0 - float2(.5, .5)) * 2;
float dist = (dot(vpos, vpos));
dist = 1 - 0.4*dist;

View File

@ -1,8 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
c0 += c0 * 2;
ocol0 = float4(c0.r, c0.g, c0.b, c0.a);
ocol0 = texture(samp9, uv0) * 3;
}

View File

@ -1,20 +1,17 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float green = 0.0;
if (c0.r < 0.35 || c0.b > 0.35)
{
green = c0.g + (c0.b / 2);
}
else
{
//red = 1 - c0.r + (c0.b / 2);
red = c0.r + 0.4;
}
ocol0 = float4(red, green, 0.0, 1.0);
ocol0 = vec4(red, green, 0.0, 1.0);
}

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -17,6 +20,5 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
blue = c0.r;
green = c0.r;
}
ocol0 = float4(red, green, blue, 1.0);
ocol0 = vec4(red, green, blue, 1.0);
}

View File

@ -1,12 +1,17 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c1 = texRECT(samp0, uv0 - float2(1, 0)).rgba;
float4 c2 = texRECT(samp0, uv0 - float2(0, 1)).rgba;
float4 c3 = texRECT(samp0, uv0 + float2(1, 0)).rgba;
float4 c4 = texRECT(samp0, uv0 + float2(0, 1)).rgba;
float4 c0 = texture(samp9, uv0);
float4 c1 = texture(samp9, uv0 - float2(1, 0)*resolution.zw);
float4 c2 = texture(samp9, uv0 - float2(0, 1)*resolution.zw);
float4 c3 = texture(samp9, uv0 + float2(1, 0)*resolution.zw);
float4 c4 = texture(samp9, uv0 + float2(0, 1)*resolution.zw);
float red = c0.r;
float blue = c0.b;

View File

@ -1,9 +1,14 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c1 = texRECT(samp0, uv0 + float2(5,5)).rgba;
float4 c0 = texture(samp9, uv0).rgba;
float4 c1 = texture(samp9, uv0 + float2(5,5)*resolution.zw).rgba;
float y = (0.222 * c1.r) + (0.707 * c1.g) + (0.071 * c1.b);
float y2 = ((0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b)) / 3;
float red = c0.r;

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -11,12 +14,8 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
if (c0.r > 0.0)
{
if (c0.g > c0.r)
{
green = (c0.g - (c0.g - c0.r)) / 3;
}
}
if (c0.b > 0.0 && c0.r < 0.25)
{
@ -31,9 +30,7 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
}
if (((c0.r + c0.g + c0.b) / 3) > 0.9)
{
green = c0.r / 3;
}
ocol0 = float4(red, green, blue, 1.0);
ocol0 = vec4(red, green, blue, 1.0);
}

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -11,5 +14,5 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
red = c0.r + (c0.g / 2) + (c0.b / 3);
green = c0.r / 3;
ocol0 = float4(red, green, blue, 1.0);
ocol0 = vec4(red, green, blue, 1.0);
}

View File

@ -1,10 +1,15 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c1 = texRECT(samp0, uv0 + float2(1,1)).rgba;
float4 c2 = texRECT(samp0, uv0 + float2(-1,-1)).rgba;
float4 c0 = texture(samp9, uv0);
float4 c1 = texture(samp9, uv0 + float2(1,1)*resolution.zw);
float4 c2 = texture(samp9, uv0 + float2(-1,-1)*resolution.zw);
float red = c0.r;
float green = c0.g;
float blue = c0.b;

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float avg = (c0.r + c0.g + c0.b) / 3.0;
ocol0 = float4(avg, avg, avg, c0.a);
ocol0 = vec4(avg, avg, avg, c0.a);
}

View File

@ -1,9 +1,12 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
// Info: http://www.oreillynet.com/cs/user/view/cs_msg/8691
float avg = (0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b);
ocol0 = float4(avg, avg, avg, c0.a);
ocol0 = vec4(avg, avg, avg, c0.a);
}

View File

@ -1,7 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(1.0, 1.0, 1.0, 1.0) - c0;
ocol0 = vec4(1.0, 1.0, 1.0, 1.0) - texture(samp9, uv0);
}

View File

@ -1,7 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(0.0, 0.0, 0.7, 1.0) - c0;
ocol0 = vec4(0.0, 0.0, 0.7, 1.0) - texture(samp9, uv0);
}

View File

@ -1,9 +1,14 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c1 = texRECT(samp0, uv0 + float2(5,5)).rgba;
float4 c0 = texture(samp9, uv0);
float4 c1 = texture(samp9, uv0 + float2(5,5)*resolution.zw);
ocol0 = c0 - c1;
}

View File

@ -1,10 +1,15 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 emboss = (texRECT(samp0, uv0+1).rgba - texRECT(samp0, uv0-1).rgba)*2.0f;
emboss -= (texRECT(samp0, uv0+float2(1,-1)).rgba - texRECT(samp0, uv0+float2(-1,1)).rgba);
float4 color = texRECT(samp0, uv0).rgba;
float4 emboss = (texture(samp9, uv0+resolution.zw) - texture(samp9, uv0-resolution.zw))*2.0;
emboss -= (texture(samp9, uv0+float2(1,-1)*resolution.zw).rgba - texture(samp9, uv0+float2(-1,1)*resolution.zw).rgba);
float4 color = texture(samp9, uv0).rgba;
if (color.r > 0.8 && color.b + color.b < 0.2)
ocol0 = float4(1,0,0,0);
else {

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c0 = texture(samp9, uv0).rgba;
float green = c0.g;
if (c0.g < 0.50)

View File

@ -1,21 +1,26 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//variables
int internalresolution = 1278;
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c0 = texture(samp9, uv0).rgba;
//blur
float4 blurtotal = float4(0, 0, 0, 0);
float blursize = 1.5;
blurtotal += texRECT(samp0, uv0 + float2(-blursize, -blursize));
blurtotal += texRECT(samp0, uv0 + float2(-blursize, blursize));
blurtotal += texRECT(samp0, uv0 + float2( blursize, -blursize));
blurtotal += texRECT(samp0, uv0 + float2( blursize, blursize));
blurtotal += texRECT(samp0, uv0 + float2(-blursize, 0));
blurtotal += texRECT(samp0, uv0 + float2( blursize, 0));
blurtotal += texRECT(samp0, uv0 + float2( 0, -blursize));
blurtotal += texRECT(samp0, uv0 + float2( 0, blursize));
blurtotal += texture(samp9, uv0 + float2(-blursize, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, 0)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, 0)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0, blursize)*resolution.zw);
blurtotal *= 0.125;
c0 = blurtotal;
//greyscale
@ -23,8 +28,8 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
// brighten
grey = grey * 0.5 + 0.7;
// darken edges
float x = uv0[0];
float y = uv0[1];
float x = uv0.x * resolution.x;
float y = uv0.y * resolution.y;
if (x > internalresolution/2) x = internalresolution-x;
if (y > internalresolution/2) y = internalresolution-y;
if (x > internalresolution/2*0.95) x = internalresolution/2*0.95;

View File

@ -1,21 +1,26 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//variables
int internalresolution = 1278;
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c0 = texture(samp9, uv0).rgba;
//blur
float4 blurtotal = float4(0, 0, 0, 0);
float blursize = 1.5;
blurtotal += texRECT(samp0, uv0 + float2(-blursize, -blursize));
blurtotal += texRECT(samp0, uv0 + float2(-blursize, blursize));
blurtotal += texRECT(samp0, uv0 + float2( blursize, -blursize));
blurtotal += texRECT(samp0, uv0 + float2( blursize, blursize));
blurtotal += texRECT(samp0, uv0 + float2(-blursize, 0));
blurtotal += texRECT(samp0, uv0 + float2( blursize, 0));
blurtotal += texRECT(samp0, uv0 + float2( 0, -blursize));
blurtotal += texRECT(samp0, uv0 + float2( 0, blursize));
blurtotal += texture(samp9, uv0 + float2(-blursize, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, 0)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, 0)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0, blursize)*resolution.zw);
blurtotal *= 0.125;
c0 = blurtotal;
//greyscale
@ -24,12 +29,12 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
// This would have been much simpler if I could get the stupid modulo (%) to work
// If anyone who is more well versed in Cg knows how to do this it'd be slightly more efficient
// float lineIntensity = ((uv0[1] % 9) - 4) / 40;
float vPos = uv0[1] / 9;
float lineIntensity = (((vPos - (int)vPos) * 9) - 4) / 40;
float vPos = uv0.y*resolution.y / 9;
float lineIntensity = (((vPos - floor(vPos)) * 9) - 4) / 40;
grey = grey * 0.5 + 0.7 + lineIntensity;
// darken edges
float x = uv0[0];
float y = uv0[1];
float x = uv0.x * resolution.x;
float y = uv0.y * resolution.y;
if (x > internalresolution/2) x = internalresolution-x;
if (y > internalresolution/2) y = internalresolution-y;
if (x > internalresolution/2*0.95) x = internalresolution/2*0.95;

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c0 = texture(samp9, uv0).rgba;
float red = 0.0;
float green = 0.0;
float blue = 0.0;

View File

@ -1,6 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
inline float bound(float color)
out vec4 ocol0;
in vec2 uv0;
float bound(float color)
{
if (color < 0.35)
{
@ -13,9 +16,9 @@ inline float bound(float color)
return 1.0;
}
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
void main()
{
float4 c0 = texRECT(samp0, uv0 + float2(0,0)).rgba;
float4 c0 = texture(samp9, uv0);
ocol0 = float4(bound(c0.r), bound(c0.g), bound(c0.b), c0.a);
}

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = c0.r;
float blue = c0.b;
float green = c0.g;
@ -63,7 +66,5 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
green = 0.05;
}
}
ocol0 = float4(red, green, blue, c0.a);
ocol0 = vec4(red, green, blue, c0.a);
}

View File

@ -1,13 +1,16 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
// Same coefficients as grayscale2 at this point
float avg = (0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b);
float red=avg;
// Not sure about these coefficients, they just seem to produce the proper yellow
float green=avg*.75;
float blue=avg*.5;
ocol0 = float4(red, green, blue, c0.a);
ocol0 = vec4(red, green, blue, c0.a);
}

View File

@ -1,17 +1,22 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
float4 c0 = texture(samp9, uv0).rgba;
float4 tmp = float4(0, 0, 0, 0);
tmp += c0 - texRECT(samp0, uv0 + float2(2, 2)).rgba;
tmp += c0 - texRECT(samp0, uv0 - float2(2, 2)).rgba;
tmp += c0 - texRECT(samp0, uv0 + float2(2, -2)).rgba;
tmp += c0 - texRECT(samp0, uv0 - float2(2, -2)).rgba;
tmp += c0 - texture(samp9, uv0 + float2(2, 2)*resolution.zw).rgba;
tmp += c0 - texture(samp9, uv0 - float2(2, 2)*resolution.zw).rgba;
tmp += c0 - texture(samp9, uv0 + float2(2, -2)*resolution.zw).rgba;
tmp += c0 - texture(samp9, uv0 - float2(2, -2)*resolution.zw).rgba;
float grey = ((0.222 * tmp.r) + (0.707 * tmp.g) + (0.071 * tmp.b));
// get rid of the bottom line, as it is incorrect.
if (uv0[1] < 163)
tmp = 1;
c0 = c0+1-grey*7;
if (uv0.y*resolution.y < 163)
tmp = float4(1.0, 1.0, 1.0, 1.0);
c0 = c0+1-grey*7.0;
ocol0 = float4(c0.r, c0.g, c0.b, 1);
}

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float blue = 0.0;
@ -16,5 +19,5 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
blue = c0.r + c0.b;
}
ocol0 = float4(red, 0.0, blue, 1.0);
ocol0 = vec4(red, 0.0, blue, 1.0);
}

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -18,5 +21,5 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
green = c0.r + c0.b;
}
ocol0 = float4(red, green, blue, 1.0);
ocol0 = vec4(red, green, blue, 1.0);
}

View File

@ -1,11 +1,16 @@
// Omega's 3D Stereoscopic filtering
// TODO: Need depth info!
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba; // Source Color
float4 c0 = texture(samp9, uv0).rgba; // Source Color
float sep = 5;
float red = c0.r;
float green = c0.g;
@ -13,11 +18,11 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
// Left Eye (Red)
float4 c1 = texRECT(samp0, uv0 + float2(sep,0)).rgba;
float4 c1 = texture(samp9, uv0 + float2(sep,0)*resolution.zw).rgba;
red = max(c0.r, c1.r);
// Right Eye (Cyan)
float4 c2 = texRECT(samp0, uv0 + float2(-sep,0)).rgba;
float4 c2 = texture(samp9, uv0 + float2(-sep,0)*resolution.zw).rgba;
float cyan = (c2.g + c2.b) / 2;
green = max(c0.g, cyan);
blue = max(c0.b, cyan);

View File

@ -1,24 +1,30 @@
// Omega's 3D Stereoscopic filtering (Amber/Blue)
// TODO: Need depth info!
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba; // Source Color
float4 c0 = texture(samp9, uv0).rgba; // Source Color
float sep = 5;
float red = c0.r;
float green = c0.g;
float blue = c0.b;
// Left Eye (Amber)
float4 c2 = texRECT(samp0, uv0 + float2(sep,0)).rgba;
float4 c2 = texture(samp9, uv0 + float2(sep,0)*resolution.zw).rgba;
float amber = (c2.r + c2.g) / 2;
red = max(c0.r, amber);
green = max(c0.g, amber);
// Right Eye (Blue)
float4 c1 = texRECT(samp0, uv0 + float2(-sep,0)).rgba;
float4 c1 = texture(samp9, uv0 + float2(-sep,0)*resolution.zw).rgba;
blue = max(c0.b, c1.b);

View File

@ -1,7 +1,10 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(c0.r*1.5, c0.g*1, c0.b*0.5, c0.a);
vec4 c0 = texture(samp9, uv0);
ocol0 = vec4(c0.r * 1.5, c0.g * 1, c0.b * 0.5, c0.a);
}

View File

@ -1,7 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(c0.b, c0.g, c0.r, c0.a);
ocol0 = texture(samp9, uv0).bgra;
}

View File

@ -1,7 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(c0.b, c0.r, c0.g, c0.a);
ocol0 = texture(samp9, uv0).brga;
}

View File

@ -1,7 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(c0.g, c0.b, c0.r, c0.a);
ocol0 = texture(samp9, uv0).gbra;
}

View File

@ -1,7 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(c0.g, c0.r, c0.b, c0.a);
ocol0 = texture(samp9, uv0).grba;
}

View File

@ -1,7 +1,9 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
ocol0 = float4(c0.r, c0.b, c0.g, c0.a);
ocol0 = texture(samp9, uv0).rbga;
}

View File

@ -1,8 +1,11 @@
uniform samplerRECT samp0 : register(s0);
uniform sampler2D samp9;
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texRECT(samp0, uv0).rgba;
vec4 c0 = texture(samp9, uv0);
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -18,5 +21,5 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
green = c0.r + c0.b;
}
ocol0 = float4(red, green, blue, 1.0);
ocol0 = vec4(red, green, blue, 1.0);
}

Binary file not shown.

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="2.1">
<dict>
<key>CFBundleGetInfoString</key>
<string>NVIDIA Cg version 3.0.0007</string>
<key>CFBundleIdentifier</key>
<string>com.nvidia.cg</string>
<key>CFBundleName</key>
<string>NVIDIA Cg</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0007</string>
<key>IFMajorVersion</key>
<integer>3</integer>
<key>IFMinorVersion</key>
<integer>0</integer>
<key>IFPkgFlagAllowBackRev</key>
<false/>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagDefaultLocation</key>
<string>/</string>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFlagOverwritePermissions</key>
<false/>
<key>IFPkgFlagRelocatable</key>
<false/>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
<key>IFPkgFlagUpdateInstalledLanguages</key>
<false/>
<key>IFPkgFlagUseUserMask</key>
<false/>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>

BIN
Externals/Cg/cg.dll vendored

Binary file not shown.

1354
Externals/Cg/cg.h vendored

File diff suppressed because it is too large Load Diff

BIN
Externals/Cg/cg.lib vendored

Binary file not shown.

BIN
Externals/Cg/cgGL.dll vendored

Binary file not shown.

243
Externals/Cg/cgGL.h vendored
View File

@ -1,243 +0,0 @@
/*
*
* Copyright (c) 2002-2010, NVIDIA Corporation.
*
*
*
* NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
* of your agreement to the following terms, and your use, installation,
* modification or redistribution of this NVIDIA software constitutes
* acceptance of these terms. If you do not agree with these terms, please do
* not use, install, modify or redistribute this NVIDIA software.
*
*
*
* In consideration of your agreement to abide by the following terms, and
* subject to these terms, NVIDIA grants you a personal, non-exclusive license,
* under NVIDIA's copyrights in this original NVIDIA software (the "NVIDIA
* Software"), to use, reproduce, modify and redistribute the NVIDIA
* Software, with or without modifications, in source and/or binary forms;
* provided that if you redistribute the NVIDIA Software, you must retain the
* copyright notice of NVIDIA, this notice and the following text and
* disclaimers in all such redistributions of the NVIDIA Software. Neither the
* name, trademarks, service marks nor logos of NVIDIA Corporation may be used
* to endorse or promote products derived from the NVIDIA Software without
* specific prior written permission from NVIDIA. Except as expressly stated
* in this notice, no other rights or licenses express or implied, are granted
* by NVIDIA herein, including but not limited to any patent rights that may be
* infringed by your derivative works or by other works in which the NVIDIA
* Software may be incorporated. No hardware is licensed hereunder.
*
*
*
* THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
* WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
* EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
*
*
*
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
* EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
* PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
* HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
* NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _cggl_h
#define _cggl_h
/*************************************************************************/
/*** CGGL Run-Time Library API ***/
/*************************************************************************/
#include <Cg/cg.h>
#ifdef _WIN32
# ifndef APIENTRY /* From Win32's <windef.h> */
# define CGGL_APIENTRY_DEFINED
# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__)
# define APIENTRY __stdcall
# else
# define APIENTRY
# endif
# endif
# ifndef WINGDIAPI /* From Win32's <wingdi.h> and <winnt.h> */
# define CGGL_WINGDIAPI_DEFINED
# define WINGDIAPI __declspec(dllimport)
# endif
#endif /* _WIN32 */
/* Set up CGGL_API for Win32 dllexport or gcc visibility. */
#ifndef CGGL_API
# ifdef CGGL_EXPORTS
# ifdef _WIN32
# define CGGL_API __declspec(dllexport)
# elif defined(__GNUC__) && __GNUC__>=4
# define CGGL_API __attribute__ ((visibility("default")))
# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# define CGGL_API __global
# else
# define CGGL_API
# endif
# else
# define CGGL_API
# endif
#endif
#ifndef CGGLENTRY
# ifdef _WIN32
# define CGGLENTRY __cdecl
# else
# define CGGLENTRY
# endif
#endif
#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
/*************************************************************************/
/*** Data types and enumerants ***/
/*************************************************************************/
typedef enum
{
CG_GL_MATRIX_IDENTITY = 0,
CG_GL_MATRIX_TRANSPOSE = 1,
CG_GL_MATRIX_INVERSE = 2,
CG_GL_MATRIX_INVERSE_TRANSPOSE = 3,
CG_GL_MODELVIEW_MATRIX = 4,
CG_GL_PROJECTION_MATRIX = 5,
CG_GL_TEXTURE_MATRIX = 6,
CG_GL_MODELVIEW_PROJECTION_MATRIX = 7,
CG_GL_VERTEX = 8,
CG_GL_FRAGMENT = 9,
CG_GL_GEOMETRY = 10,
CG_GL_TESSELLATION_CONTROL = 11,
CG_GL_TESSELLATION_EVALUATION = 12
} CGGLenum;
#ifdef __cplusplus
extern "C"
{
#endif
/*************************************************************************/
/*** Functions ***/
/*************************************************************************/
#ifndef CGGL_EXPLICIT
CGGL_API CGbool CGGLENTRY cgGLIsProfileSupported(CGprofile profile);
CGGL_API void CGGLENTRY cgGLEnableProfile(CGprofile profile);
CGGL_API void CGGLENTRY cgGLDisableProfile(CGprofile profile);
CGGL_API CGprofile CGGLENTRY cgGLGetLatestProfile(CGGLenum profile_type);
CGGL_API void CGGLENTRY cgGLSetOptimalOptions(CGprofile profile);
CGGL_API char const ** CGGLENTRY cgGLGetOptimalOptions(CGprofile profile);
CGGL_API void CGGLENTRY cgGLLoadProgram(CGprogram program);
CGGL_API void CGGLENTRY cgGLUnloadProgram(CGprogram program);
CGGL_API CGbool CGGLENTRY cgGLIsProgramLoaded(CGprogram program);
CGGL_API void CGGLENTRY cgGLBindProgram(CGprogram program);
CGGL_API void CGGLENTRY cgGLUnbindProgram(CGprofile profile);
CGGL_API GLuint CGGLENTRY cgGLGetProgramID(CGprogram program);
CGGL_API void CGGLENTRY cgGLSetParameter1f(CGparameter param, float x);
CGGL_API void CGGLENTRY cgGLSetParameter2f(CGparameter param, float x, float y);
CGGL_API void CGGLENTRY cgGLSetParameter3f(CGparameter param, float x, float y, float z);
CGGL_API void CGGLENTRY cgGLSetParameter4f(CGparameter param, float x, float y, float z, float w);
CGGL_API void CGGLENTRY cgGLSetParameter1fv(CGparameter param, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameter2fv(CGparameter param, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameter3fv(CGparameter param, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameter4fv(CGparameter param, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameter1d(CGparameter param, double x);
CGGL_API void CGGLENTRY cgGLSetParameter2d(CGparameter param, double x, double y);
CGGL_API void CGGLENTRY cgGLSetParameter3d(CGparameter param, double x, double y, double z);
CGGL_API void CGGLENTRY cgGLSetParameter4d(CGparameter param, double x, double y, double z, double w);
CGGL_API void CGGLENTRY cgGLSetParameter1dv(CGparameter param, const double *v);
CGGL_API void CGGLENTRY cgGLSetParameter2dv(CGparameter param, const double *v);
CGGL_API void CGGLENTRY cgGLSetParameter3dv(CGparameter param, const double *v);
CGGL_API void CGGLENTRY cgGLSetParameter4dv(CGparameter param, const double *v);
CGGL_API void CGGLENTRY cgGLGetParameter1f(CGparameter param, float *v);
CGGL_API void CGGLENTRY cgGLGetParameter2f(CGparameter param, float *v);
CGGL_API void CGGLENTRY cgGLGetParameter3f(CGparameter param, float *v);
CGGL_API void CGGLENTRY cgGLGetParameter4f(CGparameter param, float *v);
CGGL_API void CGGLENTRY cgGLGetParameter1d(CGparameter param, double *v);
CGGL_API void CGGLENTRY cgGLGetParameter2d(CGparameter param, double *v);
CGGL_API void CGGLENTRY cgGLGetParameter3d(CGparameter param, double *v);
CGGL_API void CGGLENTRY cgGLGetParameter4d(CGparameter param, double *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray1f(CGparameter param, long offset, long nelements, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray2f(CGparameter param, long offset, long nelements, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray3f(CGparameter param, long offset, long nelements, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray4f(CGparameter param, long offset, long nelements, const float *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray1d(CGparameter param, long offset, long nelements, const double *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray2d(CGparameter param, long offset, long nelements, const double *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray3d(CGparameter param, long offset, long nelements, const double *v);
CGGL_API void CGGLENTRY cgGLSetParameterArray4d(CGparameter param, long offset, long nelements, const double *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray1f(CGparameter param, long offset, long nelements, float *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray2f(CGparameter param, long offset, long nelements, float *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray3f(CGparameter param, long offset, long nelements, float *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray4f(CGparameter param, long offset, long nelements, float *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray1d(CGparameter param, long offset, long nelements, double *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray2d(CGparameter param, long offset, long nelements, double *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray3d(CGparameter param, long offset, long nelements, double *v);
CGGL_API void CGGLENTRY cgGLGetParameterArray4d(CGparameter param, long offset, long nelements, double *v);
CGGL_API void CGGLENTRY cgGLSetParameterPointer(CGparameter param, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
CGGL_API void CGGLENTRY cgGLEnableClientState(CGparameter param);
CGGL_API void CGGLENTRY cgGLDisableClientState(CGparameter param);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterdr(CGparameter param, const double *matrix);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterfr(CGparameter param, const float *matrix);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterdc(CGparameter param, const double *matrix);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterfc(CGparameter param, const float *matrix);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterdr(CGparameter param, double *matrix);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterfr(CGparameter param, float *matrix);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterdc(CGparameter param, double *matrix);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterfc(CGparameter param, float *matrix);
CGGL_API void CGGLENTRY cgGLSetStateMatrixParameter(CGparameter param, CGGLenum matrix, CGGLenum transform);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterArrayfc(CGparameter param, long offset, long nelements, const float *matrices);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterArrayfr(CGparameter param, long offset, long nelements, const float *matrices);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterArraydc(CGparameter param, long offset, long nelements, const double *matrices);
CGGL_API void CGGLENTRY cgGLSetMatrixParameterArraydr(CGparameter param, long offset, long nelements, const double *matrices);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterArrayfc(CGparameter param, long offset, long nelements, float *matrices);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterArrayfr(CGparameter param, long offset, long nelements, float *matrices);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterArraydc(CGparameter param, long offset, long nelements, double *matrices);
CGGL_API void CGGLENTRY cgGLGetMatrixParameterArraydr(CGparameter param, long offset, long nelements, double *matrices);
CGGL_API void CGGLENTRY cgGLSetTextureParameter(CGparameter param, GLuint texobj);
CGGL_API GLuint CGGLENTRY cgGLGetTextureParameter(CGparameter param);
CGGL_API void CGGLENTRY cgGLEnableTextureParameter(CGparameter param);
CGGL_API void CGGLENTRY cgGLDisableTextureParameter(CGparameter param);
CGGL_API GLenum CGGLENTRY cgGLGetTextureEnum(CGparameter param);
CGGL_API void CGGLENTRY cgGLSetManageTextureParameters(CGcontext ctx, CGbool flag);
CGGL_API CGbool CGGLENTRY cgGLGetManageTextureParameters(CGcontext ctx);
CGGL_API void CGGLENTRY cgGLSetupSampler(CGparameter param, GLuint texobj);
CGGL_API void CGGLENTRY cgGLRegisterStates(CGcontext ctx);
CGGL_API void CGGLENTRY cgGLEnableProgramProfiles(CGprogram program);
CGGL_API void CGGLENTRY cgGLDisableProgramProfiles(CGprogram program);
CGGL_API void CGGLENTRY cgGLSetDebugMode(CGbool debug);
CGGL_API CGbuffer CGGLENTRY cgGLCreateBuffer(CGcontext context, int size, const void *data, GLenum bufferUsage);
CGGL_API GLuint CGGLENTRY cgGLGetBufferObject(CGbuffer buffer);
#endif
#ifdef __cplusplus
}
#endif
#ifdef CGGL_APIENTRY_DEFINED
# undef CGGL_APIENTRY_DEFINED
# undef APIENTRY
#endif
#ifdef CGGL_WINGDIAPI_DEFINED
# undef CGGL_WINGDIAPI_DEFINED
# undef WINGDIAPI
#endif
#endif

BIN
Externals/Cg/cgGL.lib vendored

Binary file not shown.

BIN
Externals/Cg64/cg.dll vendored

Binary file not shown.

BIN
Externals/Cg64/cg.lib vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Externals/GLew/glew32s.lib vendored Normal file → Executable file

Binary file not shown.

BIN
Externals/GLew/glew64s.lib vendored Normal file → Executable file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -458,6 +458,28 @@ extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);
#endif /* GLX_ARB_multisample */
/* ---------------- GLX_ARB_robustness_application_isolation --------------- */
#ifndef GLX_ARB_robustness_application_isolation
#define GLX_ARB_robustness_application_isolation 1
#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation)
#endif /* GLX_ARB_robustness_application_isolation */
/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */
#ifndef GLX_ARB_robustness_share_group_isolation
#define GLX_ARB_robustness_share_group_isolation 1
#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation)
#endif /* GLX_ARB_robustness_share_group_isolation */
/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */
#ifndef GLX_ARB_vertex_buffer_object
@ -544,6 +566,17 @@ typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, i
#endif /* GLX_EXT_create_context_es2_profile */
/* ------------------- GLX_EXT_create_context_es_profile ------------------- */
#ifndef GLX_EXT_create_context_es_profile
#define GLX_EXT_create_context_es_profile 1
#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile)
#endif /* GLX_EXT_create_context_es_profile */
/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */
#ifndef GLX_EXT_fbconfig_packed_float
@ -617,6 +650,17 @@ typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable,
#endif /* GLX_EXT_swap_control */
/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */
#ifndef GLX_EXT_swap_control_tear
#define GLX_EXT_swap_control_tear 1
#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear)
#endif /* GLX_EXT_swap_control_tear */
/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */
#ifndef GLX_EXT_texture_from_pixmap
@ -785,6 +829,21 @@ typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode);
#endif /* GLX_MESA_set_3dfx_mode */
/* ------------------------- GLX_MESA_swap_control ------------------------- */
#ifndef GLX_MESA_swap_control
#define GLX_MESA_swap_control 1
typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void);
typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);
#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA)
#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA)
#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control)
#endif /* GLX_MESA_swap_control */
/* --------------------------- GLX_NV_copy_image --------------------------- */
#ifndef GLX_NV_copy_image
@ -876,10 +935,37 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);
#endif /* GLX_NV_vertex_array_range */
/* -------------------------- GLX_NV_video_output -------------------------- */
/* -------------------------- GLX_NV_video_capture ------------------------- */
#ifndef GLX_NV_video_output
#define GLX_NV_video_output 1
#ifndef GLX_NV_video_capture
#define GLX_NV_video_capture 1
#define GLX_DEVICE_ID_NV 0x20CD
#define GLX_UNIQUE_ID_NV 0x20CE
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
typedef XID GLXVideoCaptureDeviceNV;
typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements);
typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV)
#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV)
#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV)
#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV)
#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV)
#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture)
#endif /* GLX_NV_video_capture */
/* ---------------------------- GLX_NV_video_out --------------------------- */
#ifndef GLX_NV_video_out
#define GLX_NV_video_out 1
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
@ -906,9 +992,9 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf,
#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)
#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)
#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)
#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out)
#endif /* GLX_NV_video_output */
#endif /* GLX_NV_video_out */
/* -------------------------- GLX_OML_swap_method -------------------------- */
@ -926,8 +1012,7 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf,
/* -------------------------- GLX_OML_sync_control ------------------------- */
#if !defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#include <inttypes.h>
#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
@ -1308,198 +1393,213 @@ typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window,
/* ------------------------------------------------------------------------- */
#ifdef GLEW_MX
#define GLXEW_EXPORT
#define GLXEW_FUN_EXPORT
#define GLXEW_VAR_EXPORT
#else
#define GLXEW_EXPORT extern
#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT
#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT
#endif /* GLEW_MX */
extern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;
GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;
extern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;
extern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;
extern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;
extern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;
extern PFNGLXCREATEWINDOWPROC __glewXCreateWindow;
extern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;
extern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;
extern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;
extern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;
extern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;
extern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;
extern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;
extern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;
extern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;
extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
extern PFNGLXSELECTEVENTPROC __glewXSelectEvent;
GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;
GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;
GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;
GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;
GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow;
GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;
GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;
GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;
GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;
GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;
GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;
GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;
GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;
GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;
GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent;
extern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
extern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;
extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;
GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
extern PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;
GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;
extern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
extern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
extern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
extern PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA;
GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA;
extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
extern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
extern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
extern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
extern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
extern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
extern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
#ifdef GLX_OML_sync_control
extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
#endif
GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV;
GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV;
GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV;
GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV;
GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV;
extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
extern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;
extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
extern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
extern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
extern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
extern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
extern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
extern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
extern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
extern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
extern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;
extern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;
GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;
GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
extern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;
extern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;
GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
extern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;
GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;
GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;
extern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;
extern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;
extern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;
extern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;
extern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;
GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;
extern PFNGLXCUSHIONSGIPROC __glewXCushionSGI;
GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;
extern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;
extern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;
GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;
GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;
GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;
GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;
extern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;
GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI;
extern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;
extern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;
GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;
GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;
extern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;
GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;
extern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;
extern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;
GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;
GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;
GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;
GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;
GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;
#if defined(GLEW_MX)
struct GLXEWContextStruct
{
#endif /* GLEW_MX */
GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;
GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;
GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;
GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3;
GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4;
GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample;
GLXEW_EXPORT GLboolean __GLXEW_AMD_gpu_association;
GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context;
GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;
GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
GLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample;
GLXEW_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;
GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture;
GLXEW_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile;
GLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
GLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context;
GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker;
GLXEW_EXPORT GLboolean __GLXEW_EXT_swap_control;
GLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info;
GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating;
GLXEW_EXPORT GLboolean __GLXEW_INTEL_swap_event;
GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset;
GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers;
GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
GLXEW_EXPORT GLboolean __GLXEW_NV_copy_image;
GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer;
GLXEW_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
GLXEW_EXPORT GLboolean __GLXEW_NV_present_video;
GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group;
GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
GLXEW_EXPORT GLboolean __GLXEW_NV_video_output;
GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method;
GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;
GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range;
GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample;
GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;
GLXEW_EXPORT GLboolean __GLXEW_SGI_cushion;
GLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read;
GLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control;
GLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync;
GLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;
GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;
GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;
GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;
GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;
GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3;
GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4;
GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample;
GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info;
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating;
GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event;
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset;
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers;
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture;
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out;
GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method;
GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;
GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize;
#ifdef GLEW_MX
}; /* GLXEWContextStruct */
@ -1510,8 +1610,8 @@ GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;
#ifdef GLEW_MX
typedef struct GLXEWContextStruct GLXEWContext;
extern GLenum glxewContextInit (GLXEWContext* ctx);
extern GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name);
GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx);
GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name);
#define glxewInit() glxewContextInit(glxewGetContext())
#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
@ -1524,11 +1624,11 @@ extern GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* n
#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
#define GLXEW_GET_FUN(x) x
extern GLboolean glxewIsSupported (const char* name);
GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
#endif /* GLEW_MX */
extern GLboolean glxewGetExtension (const char* name);
GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name);
#ifdef __cplusplus
}

View File

@ -193,6 +193,8 @@ typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, in
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
#define WGL_CONTEXT_FLAGS_ARB 0x2094
#define ERROR_INVALID_VERSION_ARB 0x2095
#define ERROR_INVALID_PROFILE_ARB 0x2096
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);
@ -479,6 +481,17 @@ typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, con
#endif /* WGL_EXT_create_context_es2_profile */
/* ------------------- WGL_EXT_create_context_es_profile ------------------- */
#ifndef WGL_EXT_create_context_es_profile
#define WGL_EXT_create_context_es_profile 1
#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile)
#endif /* WGL_EXT_create_context_es_profile */
/* -------------------------- WGL_EXT_depth_float -------------------------- */
#ifndef WGL_EXT_depth_float
@ -684,6 +697,15 @@ typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
#endif /* WGL_EXT_swap_control */
/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */
#ifndef WGL_EXT_swap_control_tear
#define WGL_EXT_swap_control_tear 1
#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear)
#endif /* WGL_EXT_swap_control_tear */
/* --------------------- WGL_I3D_digital_video_control --------------------- */
#ifndef WGL_I3D_digital_video_control
@ -831,6 +853,46 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWO
#endif /* WGL_I3D_swap_frame_usage */
/* --------------------------- WGL_NV_DX_interop --------------------------- */
#ifndef WGL_NV_DX_interop
#define WGL_NV_DX_interop 1
#define WGL_ACCESS_READ_ONLY_NV 0x0000
#define WGL_ACCESS_READ_WRITE_NV 0x0001
#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice);
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle);
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV)
#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV)
#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV)
#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV)
#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV)
#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV)
#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV)
#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV)
#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop)
#endif /* WGL_NV_DX_interop */
/* --------------------------- WGL_NV_DX_interop2 -------------------------- */
#ifndef WGL_NV_DX_interop2
#define WGL_NV_DX_interop2 1
#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2)
#endif /* WGL_NV_DX_interop2 */
/* --------------------------- WGL_NV_copy_image --------------------------- */
#ifndef WGL_NV_copy_image
@ -996,6 +1058,32 @@ typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#endif /* WGL_NV_vertex_array_range */
/* -------------------------- WGL_NV_video_capture ------------------------- */
#ifndef WGL_NV_video_capture
#define WGL_NV_video_capture 1
#define WGL_UNIQUE_ID_NV 0x20CE
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList);
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV)
#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV)
#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV)
#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV)
#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV)
#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture)
#endif /* WGL_NV_video_capture */
/* -------------------------- WGL_NV_video_output -------------------------- */
#ifndef WGL_NV_video_output
@ -1061,9 +1149,11 @@ typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT6
/* ------------------------------------------------------------------------- */
#ifdef GLEW_MX
#define WGLEW_EXPORT
#define WGLEW_FUN_EXPORT
#define WGLEW_VAR_EXPORT
#else
#define WGLEW_EXPORT GLEWAPI
#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT
#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT
#endif /* GLEW_MX */
#ifdef GLEW_MX
@ -1071,183 +1161,203 @@ struct WGLEWContextStruct
{
#endif /* GLEW_MX */
WGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL;
WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL;
WGLEW_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD;
WGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD;
WGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD;
WGLEW_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD;
WGLEW_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD;
WGLEW_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD;
WGLEW_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD;
WGLEW_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;
WGLEW_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD;
WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD;
WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD;
WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD;
WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD;
WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD;
WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD;
WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD;
WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;
WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD;
WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
WGLEW_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB;
WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB;
WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;
WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;
WGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;
WGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;
WGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;
WGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;
WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;
WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;
WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;
WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;
WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;
WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;
WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;
WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;
WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;
WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;
WGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;
WGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;
WGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;
WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;
WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;
WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;
WGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;
WGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;
WGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;
WGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;
WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;
WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;
WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;
WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;
WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;
WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;
WGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;
WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;
WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;
WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;
WGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;
WGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;
WGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;
WGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;
WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;
WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;
WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;
WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;
WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;
WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;
WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;
WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;
WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;
WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;
WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;
WGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;
WGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;
WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;
WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;
WGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;
WGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;
WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;
WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;
WGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;
WGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;
WGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;
WGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;
WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;
WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;
WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;
WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;
WGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;
WGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;
WGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;
WGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;
WGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;
WGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;
WGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;
WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;
WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;
WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;
WGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;
WGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;
WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;
WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;
WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;
WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;
WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;
WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;
WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;
WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;
WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;
WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;
WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;
WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;
WGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;
WGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;
WGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;
WGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;
WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;
WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;
WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;
WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;
WGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;
WGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;
WGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;
WGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;
WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;
WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;
WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;
WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;
WGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;
WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;
WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
WGLEW_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;
WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV;
WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV;
WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV;
WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV;
WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV;
WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV;
WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV;
WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV;
WGLEW_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
WGLEW_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;
WGLEW_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;
WGLEW_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV;
WGLEW_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV;
WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;
WGLEW_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV;
WGLEW_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV;
WGLEW_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV;
WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;
WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;
WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV;
WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV;
WGLEW_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV;
WGLEW_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV;
WGLEW_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV;
WGLEW_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV;
WGLEW_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV;
WGLEW_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;
WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV;
WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV;
WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV;
WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV;
WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV;
WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV;
WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV;
WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV;
WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;
WGLEW_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;
WGLEW_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;
WGLEW_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;
WGLEW_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV;
WGLEW_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV;
WGLEW_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV;
WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
WGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;
WGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;
WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample;
WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control;
WGLEW_EXPORT GLboolean __WGLEW_AMD_gpu_association;
WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region;
WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context;
WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_profile;
WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_robustness;
WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string;
WGLEW_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB;
WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read;
WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample;
WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer;
WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format;
WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;
WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture;
WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;
WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
WGLEW_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile;
WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float;
WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table;
WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string;
WGLEW_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB;
WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read;
WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample;
WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer;
WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format;
WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float;
WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control;
WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma;
WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock;
WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer;
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
WGLEW_EXPORT GLboolean __WGLEW_NV_copy_image;
WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer;
WGLEW_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
WGLEW_EXPORT GLboolean __WGLEW_NV_multisample_coverage;
WGLEW_EXPORT GLboolean __WGLEW_NV_present_video;
WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
WGLEW_EXPORT GLboolean __WGLEW_NV_swap_group;
WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
WGLEW_EXPORT GLboolean __WGLEW_NV_video_output;
WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV;
WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV;
WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV;
WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV;
WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV;
WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;
WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;
WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;
WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV;
WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV;
WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV;
WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;
WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;
WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample;
WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control;
WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;
WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control;
WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear;
WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma;
WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock;
WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer;
WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture;
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output;
WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control;
#ifdef GLEW_MX
}; /* WGLEWContextStruct */
@ -1258,8 +1368,8 @@ WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
#ifdef GLEW_MX
typedef struct WGLEWContextStruct WGLEWContext;
GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx);
GLEWAPI GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char* name);
GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx);
GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name);
#define wglewInit() wglewContextInit(wglewGetContext())
#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
@ -1272,11 +1382,11 @@ GLEWAPI GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char*
#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
#define WGLEW_GET_FUN(x) x
GLEWAPI GLboolean wglewIsSupported (const char* name);
GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
#endif /* GLEW_MX */
GLEWAPI GLboolean wglewGetExtension (const char* name);
GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name);
#ifdef __cplusplus
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -161,10 +161,13 @@ main (int argc, char** argv)
fprintf(file, "OpenGL version string: %s\n", glGetString(GL_VERSION));
fprintf(file, "OpenGL extensions (GL_): \n");
PrintExtensions((char*)glGetString(GL_EXTENSIONS));
#ifndef GLEW_NO_GLU
/* GLU extensions */
fprintf(file, "GLU version string: %s\n", gluGetString(GLU_VERSION));
fprintf(file, "GLU extensions (GLU_): \n");
PrintExtensions((char*)gluGetString(GLU_EXTENSIONS));
#endif
/* ---------------------------------------------------------------------- */
/* extensions string */
@ -350,6 +353,8 @@ VisualInfoARB (GLContext* ctx)
else if (WGLEW_ATI_pixel_format_float && value[7] == WGL_TYPE_RGBA_FLOAT_ATI) fprintf(file, " f ");
else if (value[7] == WGL_TYPE_RGBA_ARB) fprintf(file, " i ");
else if (value[7] == WGL_TYPE_COLORINDEX_ARB) fprintf(file, " c ");
else if (value[7] == WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT) fprintf(file," p ");
else fprintf(file," ? ");
/* double buffer */
fprintf(file, " %c ", value[5] ? 'y' : '.');
/* swap method */

View File

@ -122,14 +122,10 @@ FunctionEnd
Section "Base" SEC01
SetShellVarContext all
; Dolphin exe and dlls
; TODO: cg is only for OGL, SDL is only for nJoy
; TODO: Make a nice subsection-ized display
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "${BASE_DIR}\Dolphin.exe"
File "..\Externals\Cg\cg.dll"
File "..\Externals\Cg\cgGL.dll"
; File "..\Externals\Cg\cgD3D9.dll"
File "..\Externals\WiiUse\Win32\wiiuse.dll"
File "..\Externals\SDL\win32\SDL.dll"
File "..\Externals\OpenAL\win32\OpenAL32.dll"

View File

@ -132,14 +132,10 @@ FunctionEnd
Section "Complete" SEC01
SetShellVarContext all
; Dolphin exe and dlls
; TODO: cg is only for OGL, SDL is only for nJoy
; TODO: Make a nice subsection-ized display
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "${BASE_DIR}\Dolphin.exe"
File "..\Externals\Cg64\cg.dll"
File "..\Externals\Cg64\cgGL.dll"
; File "..\Externals\Cg64\cgD3D9.dll"
File "..\Externals\WiiUse\X64\wiiuse.dll"
File "..\Externals\SDL\x64\SDL.dll"
File "..\Externals\OpenAL\win64\OpenAL32.dll"

View File

@ -21,11 +21,8 @@
#include "Common.h"
#include <fstream>
// Increment this every time you change shader generation code.
enum
{
LINEAR_DISKCACHE_VER = 6979
};
// defined in Version.cpp
extern const char *scm_rev_git_str;
// On disk format:
//header{
@ -187,13 +184,15 @@ private:
{
Header()
: id(*(u32*)"DCAC")
, ver(LINEAR_DISKCACHE_VER)
, key_t_size(sizeof(K))
, value_t_size(sizeof(V))
{}
{
memcpy(ver, scm_rev_git_str, 40);
}
const u32 id, ver;
const u32 id;
const u16 key_t_size, value_t_size;
char ver[40];
} m_header;

View File

@ -118,6 +118,8 @@ struct Rectangle
: left(theLeft), top(theTop), right(theRight), bottom(theBottom)
{ }
bool operator==(const Rectangle& r) { return left==r.left && top==r.top && right==r.right && bottom==r.bottom; }
T GetWidth() const { return abs(right - left); }
T GetHeight() const { return abs(bottom - top); }

View File

@ -50,3 +50,5 @@ const char *netplay_dolphin_ver = SCM_DESC_STR " M" NP_ARCH;
#else
const char *netplay_dolphin_ver = SCM_DESC_STR " L" NP_ARCH;
#endif
const char *scm_rev_git_str = SCM_REV_STR;

View File

@ -103,6 +103,7 @@ public:
virtual void Video_Prepare() = 0;
virtual void Video_EnterLoop() = 0;
virtual void Video_ExitLoop() = 0;
virtual void Video_Cleanup() = 0; // called from gl/d3d thread
virtual void Video_BeginField(u32, FieldType, u32, u32) = 0;
virtual void Video_EndField() = 0;

View File

@ -323,6 +323,9 @@ void CpuThread()
g_bStarted = false;
if (!_CoreParameter.bCPUThread)
g_video_backend->Video_Cleanup();
return;
}
@ -351,6 +354,9 @@ void FifoPlayerThread()
g_bStarted = false;
if(!_CoreParameter.bCPUThread)
g_video_backend->Video_Cleanup();
return;
}
@ -477,6 +483,9 @@ void EmuThread()
INFO_LOG(CONSOLE, "%s", StopMessage(true, "CPU thread stopped.").c_str());
if(_CoreParameter.bCPUThread)
g_video_backend->Video_Cleanup();
VolumeHandler::EjectVolume();
FileMon::Close();

View File

@ -95,11 +95,7 @@ else()
if(WIN32)
set(SRCS ${SRCS} Src/GLInterface/GLW.cpp)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(USE_WX)
set(SRCS ${SRCS} Src/GLInterface/WX.cpp)
else()
set(SRCS ${SRCS} Src/GLInterface/AGL.cpp)
endif()
else()
set(SRCS ${SRCS} Src/GLInterface/GLX.cpp
Src/GLInterface/X11_Util.cpp)

View File

@ -136,7 +136,6 @@
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)..\Data" "$(TargetDir)" /e /s /y /d
echo Copying External .dlls
xcopy "$(SolutionDir)..\Externals\Cg\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\OpenAL\Win32\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /s /y /q /d
</Command>
@ -151,7 +150,6 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)..\Data" "$(TargetDir)" /e /s /y /d
echo Copying External .dlls
xcopy "$(SolutionDir)..\Externals\Cg64\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\OpenAL\Win64\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /s /y /q /d
</Command>
@ -168,7 +166,6 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)..\Data" "$(TargetDir)" /e /s /y /d
echo Copying External .dlls
xcopy "$(SolutionDir)..\Externals\Cg\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\OpenAL\Win32\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /s /y /q /d
</Command>
@ -183,7 +180,6 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)..\Data" "$(TargetDir)" /e /s /y /d
echo Copying External .dlls
xcopy "$(SolutionDir)..\Externals\Cg\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\OpenAL\Win32\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /s /y /q /d
</Command>
@ -200,7 +196,6 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)..\Data" "$(TargetDir)" /e /s /y /d
echo Copying External .dlls
xcopy "$(SolutionDir)..\Externals\Cg64\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\OpenAL\Win64\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /s /y /q /d
</Command>
@ -217,7 +212,6 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)..\Data" "$(TargetDir)" /e /s /y /d
echo Copying External .dlls
xcopy "$(SolutionDir)..\Externals\Cg64\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\OpenAL\Win64\*.dll" "$(TargetDir)" /e /s /y /q /d
xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /s /y /q /d
</Command>

View File

@ -23,8 +23,6 @@
#include <GLInterface/InterfaceBase.h>
#elif defined(USE_EGL) && USE_EGL
#include "GLInterface/EGL_X11.h"
#elif defined(USE_WX) && USE_WX
#include "GLInterface/WX.h"
#elif defined(__APPLE__)
#include "GLInterface/AGL.h"
#elif defined(_WIN32)
@ -51,12 +49,8 @@ typedef struct {
std::thread xEventThread;
int x, y;
unsigned int width, height;
#elif defined(USE_WX) && USE_WX
wxGLCanvas *glCanvas;
wxGLContext *glCtxt;
wxPanel *panel;
#elif defined(__APPLE__)
NSWindow *cocoaWin;
NSView *cocoaWin;
NSOpenGLContext *cocoaCtx;
#elif defined(HAVE_X11) && HAVE_X11
int screen;

View File

@ -20,6 +20,8 @@
#include "RenderBase.h"
#include "ConfigManager.h"
#include <wx/panel.h>
#include "VertexShaderManager.h"
#include "../GLInterface.h"
#include "AGL.h"
@ -32,7 +34,7 @@ void cInterfaceAGL::Swap()
// Show the current FPS
void cInterfaceAGL::UpdateFPSDisplay(const char *text)
{
[GLWin.cocoaWin setTitle: [NSString stringWithUTF8String: text]];
[[GLWin.cocoaWin window] setTitle: [NSString stringWithUTF8String: text]];
}
// Create rendering window.
@ -48,7 +50,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
NSRect size;
NSUInteger style = NSMiniaturizableWindowMask;
NSOpenGLPixelFormatAttribute attr[2] = { NSOpenGLPFADoubleBuffer, 0 };
NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAAccelerated, 0 };
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc]
initWithAttributes: attr];
if (fmt == nil) {
@ -72,8 +74,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
style |= NSResizableWindowMask | NSTitledWindowMask;
}
GLWin.cocoaWin = [[NSWindow alloc] initWithContentRect: size
styleMask: style backing: NSBackingStoreBuffered defer: NO];
GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle());;
if (GLWin.cocoaWin == nil) {
ERROR_LOG(VIDEO, "failed to create window");
return NULL;
@ -84,8 +85,8 @@ bool cInterfaceAGL::Create(void *&window_handle)
[GLWin.cocoaWin setLevel: CGShieldingWindowLevel()];
}
[GLWin.cocoaCtx setView: [GLWin.cocoaWin contentView]];
[GLWin.cocoaWin makeKeyAndOrderFront: nil];
[GLWin.cocoaCtx setView: GLWin.cocoaWin];
[[GLWin.cocoaWin window] makeKeyAndOrderFront: nil];
return true;
}
@ -94,12 +95,12 @@ bool cInterfaceAGL::MakeCurrent()
{
int width, height;
width = [[GLWin.cocoaWin contentView] frame].size.width;
height = [[GLWin.cocoaWin contentView] frame].size.height;
if (width == s_backbuffer_width && height == s_backbuffer_height)
return;
width = [GLWin.cocoaWin frame].size.width;
height = [GLWin.cocoaWin frame].size.height;
//if (width == s_backbuffer_width && height == s_backbuffer_height)
// return true;
[GLWin.cocoaCtx setView: [GLWin.cocoaWin contentView]];
[GLWin.cocoaCtx setView: GLWin.cocoaWin];
[GLWin.cocoaCtx update];
[GLWin.cocoaCtx makeCurrentContext];
s_backbuffer_width = width;
@ -110,7 +111,6 @@ bool cInterfaceAGL::MakeCurrent()
// Close backend
void cInterfaceAGL::Shutdown()
{
[GLWin.cocoaWin close];
[GLWin.cocoaCtx clearDrawable];
[GLWin.cocoaCtx release];
}

View File

@ -69,8 +69,6 @@ bool cInterfaceGLX::Create(void *&window_handle)
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_DEPTH_SIZE, 24,
GLX_SAMPLE_BUFFERS_ARB, g_Config.iMultisampleMode != MULTISAMPLE_OFF?1:0,
GLX_SAMPLES_ARB, g_Config.iMultisampleMode != MULTISAMPLE_OFF?1:0,
None };
int attrListDefault[] = {

View File

@ -1,96 +0,0 @@
// Copyright (C) 2003 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "VideoConfig.h"
#include "Host.h"
#include "RenderBase.h"
#include "VertexShaderManager.h"
#include "../GLInterface.h"
#include "WX.h"
void cInterfaceWX::SwapInterval(int Interval)
{
// WX interface only used on Apple
#ifdef __APPLE__
#if defined USE_WX && USE_WX
NSOpenGLContext *ctx = GLWin.glCtxt->GetWXGLContext();
#else
NSOpenGLContext *ctx = GLWin.cocoaCtx;
#endif
[ctx setValues: &Interval forParameter: NSOpenGLCPSwapInterval];
#endif
}
void cInterfaceWX::Swap()
{
GLWin.glCanvas->SwapBuffers();
}
void cInterfaceWX::UpdateFPSDisplay(const char *text)
{
// Handled by Host_UpdateTitle()
}
// Create rendering window.
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
bool cInterfaceWX::Create(void *&window_handle)
{
int _tx, _ty, _twidth, _theight;
Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight);
// Control window size and picture scaling
s_backbuffer_width = _twidth;
s_backbuffer_height = _theight;
GLWin.panel = (wxPanel *)window_handle;
GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, NULL,
wxPoint(0, 0), wxSize(_twidth, _theight));
GLWin.glCanvas->Show(true);
if (GLWin.glCtxt == NULL) // XXX dirty hack
GLWin.glCtxt = new wxGLContext(GLWin.glCanvas);
return true;
}
bool cInterfaceWX::MakeCurrent()
{
return GLWin.glCanvas->SetCurrent(*GLWin.glCtxt);
}
// Update window width, size and etc. Called from Render.cpp
void cInterfaceWX::Update()
{
int width, height;
GLWin.panel->GetSize(&width, &height);
if (width == s_backbuffer_width && height == s_backbuffer_height)
return;
GLWin.glCanvas->SetFocus();
GLWin.glCanvas->SetSize(0, 0, width, height);
GLWin.glCtxt->SetCurrent(*GLWin.glCanvas);
s_backbuffer_width = width;
s_backbuffer_height = height;
}
// Close backend
void cInterfaceWX::Shutdown()
{
GLWin.glCanvas->Hide();
}

View File

@ -1,48 +0,0 @@
// Copyright (C) 2003 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _INTERFACEWX_H_
#define _INTERFACEWX_H_
#if defined HAVE_X11 && HAVE_X11
#include <GL/glxew.h>
#include <GL/gl.h>
#elif defined __APPLE__
#include <GL/glew.h>
#import <AppKit/AppKit.h>
#endif
#if defined USE_WX && USE_WX
#include "wx/wx.h"
#include "wx/glcanvas.h"
#endif
#include "InterfaceBase.h"
class cInterfaceWX : public cInterfaceBase
{
public:
void SwapInterval(int Interval);
void Swap();
void UpdateFPSDisplay(const char *Text);
bool Create(void *&window_handle);
bool MakeCurrent();
void Shutdown();
void Update();
};
#endif

View File

@ -64,6 +64,10 @@
#endif
#ifdef __APPLE__
#import <AppKit/AppKit.h>
#endif
// Nvidia drivers >= v302 will check if the application exports a global
// variable named NvOptimusEnablement to know if it should run the app in high
// performance graphics mode or using the IGP.
@ -232,6 +236,17 @@ bool DolphinApp::OnInit()
return false;
}
#endif
#ifdef __APPLE__
if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_7)
{
PanicAlertT("Hi,\n\nDolphin requires OS X 10.7 or greater.\n"
"Unfortunately you're running an old version of OS X.\n"
"The last Dolphin version to support OS X 10.6 is Dolphin 3.5\n"
"Please upgrade to 10.7 or greater to use the newest Dolphin version.\n\n"
"Sayonara!\n");
return false;
}
#endif
#ifdef _WIN32
if (!wxSetWorkingDirectory(StrToWxStr(File::GetExeDirectory())))

View File

@ -82,6 +82,7 @@ wxString af_desc = wxTRANSLATE("Enable anisotropic filtering.\nEnhances visual q
wxString aa_desc = wxTRANSLATE("Reduces the amount of aliasing caused by rasterizing 3D graphics.\nThis makes the rendered picture look less blocky.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select None.");
wxString scaled_efb_copy_desc = wxTRANSLATE("Greatly increases quality of textures generated using render to texture effects.\nRaising the internal resolution will improve the effect of this setting.\nSlightly decreases performance and possibly causes issues (although unlikely).\n\nIf unsure, leave this checked.");
wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D graphics per-pixel rather than per vertex.\nDecreases emulation speed by some percent (depending on your GPU).\nThis usually is a safe enhancement, but might cause issues sometimes.\n\nIf unsure, leave this unchecked.");
wxString hacked_buffer_upload_desc = wxTRANSLATE("Use a hacked upload strategy to stream vertices.\nThis usually speed up, but is forbidden by OpenGL specification and may causes heavy glitches.\n\nIf unsure, leave this unchecked.");
wxString force_filtering_desc = wxTRANSLATE("Force texture filtering even if the emulated game explicitly disabled it.\nImproves texture quality slightly but causes glitches in some games.\n\nIf unsure, leave this unchecked.");
wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked.");
wxString internal_res_desc = wxTRANSLATE("Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.\n\"Multiple of 640x528\" is a bit slower than \"Window Size\" but yields less issues. Generally speaking, the lower the internal resolution is, the better your performance will be.\n\nIf unsure, select 640x528.");
@ -486,12 +487,16 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
// - other hacks
{
wxGridSizer* const szr_other = new wxGridSizer(2, 5, 5);
SettingCheckBox* hacked_buffer_upload_cb;
szr_other->Add(CreateCheckBox(page_hacks, _("Cache Display Lists"), wxGetTranslation(dlc_desc), vconfig.bDlistCachingEnable));
szr_other->Add(CreateCheckBox(page_hacks, _("Disable Fog"), wxGetTranslation(disable_fog_desc), vconfig.bDisableFog));
szr_other->Add(CreateCheckBox(page_hacks, _("Skip Dest. Alpha Pass"), wxGetTranslation(disable_alphapass_desc), vconfig.bDstAlphaPass));
szr_other->Add(CreateCheckBox(page_hacks, _("OpenCL Texture Decoder"), wxGetTranslation(opencl_desc), vconfig.bEnableOpenCL));
szr_other->Add(CreateCheckBox(page_hacks, _("OpenMP Texture Decoder"), wxGetTranslation(omp_desc), vconfig.bOMPDecoder));
szr_other->Add(hacked_buffer_upload_cb = CreateCheckBox(page_hacks, _("Hacked Buffer Upload"), wxGetTranslation(hacked_buffer_upload_desc), vconfig.bHackedBufferUpload));
if (Core::GetState() != Core::CORE_UNINITIALIZED)
hacked_buffer_upload_cb->Disable();
wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Other"));
group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
@ -564,7 +569,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
szr_misc->Add(cb_prog_scan);
}
wxStaticBoxSizer* const group_misc = new wxStaticBoxSizer(wxVERTICAL, page_advanced, _("Misc"));
szr_advanced->Add(group_misc, 0, wxEXPAND | wxALL, 5);
group_misc->Add(szr_misc, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);

View File

@ -236,7 +236,7 @@ bool GetConfig(const int &type)
case CONFIG_DISABLEFOG:
return g_ActiveConfig.bDisableFog;
case CONFIG_SHOWEFBREGIONS:
return false;
return g_ActiveConfig.bShowEFBCopyRegions;
default:
PanicAlert("GetConfig Error: Unknown Config Type!");
return false;
@ -248,6 +248,7 @@ u8 *GetPointer(const u32 &address)
return Memory::GetPointer(address);
}
// Never used. All backends call SetSamplerState in VertexManager::Flush
void SetTextureMode(const BPCmd &bp)
{
g_renderer->SetSamplerState(bp.address & 3, (bp.address & 0xE0) == 0xA0);

View File

@ -225,6 +225,8 @@ void BPWritten(const BPCmd& bp)
{
PRIM_LOG("constalpha: alp=%d, en=%d", bpmem.dstalpha.alpha, bpmem.dstalpha.enable);
PixelShaderManager::SetDestAlpha(bpmem.dstalpha);
if(bp.changes & 0x100)
SetBlendMode();
break;
}
// This is called when the game is done drawing the new frame (eg: like in DX: Begin(); Draw(); End();)
@ -459,6 +461,8 @@ void BPWritten(const BPCmd& bp)
g_renderer->SetColorMask(); // alpha writing needs to be disabled if the new pixel format doesn't have an alpha channel
g_renderer->SetBlendMode(true);
OnPixelFormatChange();
if(bp.changes & 3)
SetBlendMode(); // dual source could be activated by changing to PIXELFMT_RGBA6_Z24
break;
case BPMEM_MIPMAP_STRIDE: // MipMap Stride Channel
@ -576,8 +580,6 @@ void BPWritten(const BPCmd& bp)
// ------------------------
case BPMEM_TX_SETMODE0: // (0x90 for linear)
case BPMEM_TX_SETMODE0_4:
// Shouldn't need to call this here, we call it for each active texture right before rendering
SetTextureMode(bp);
break;
case BPMEM_TX_SETMODE1:
@ -719,14 +721,6 @@ void BPReload()
SetBlendMode();
SetColorMask();
OnPixelFormatChange();
{
BPCmd bp = {BPMEM_TX_SETMODE0, 0xFFFFFF, static_cast<int>(((u32*)&bpmem)[BPMEM_TX_SETMODE0])};
SetTextureMode(bp);
}
{
BPCmd bp = {BPMEM_TX_SETMODE0_4, 0xFFFFFF, static_cast<int>(((u32*)&bpmem)[BPMEM_TX_SETMODE0_4])};
SetTextureMode(bp);
}
{
BPCmd bp = {BPMEM_FIELDMASK, 0xFFFFFF, static_cast<int>(((u32*)&bpmem)[BPMEM_FIELDMASK])};
SetInterlacingMode(bp);

View File

@ -164,12 +164,8 @@ void FramebufferManagerBase::CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHe
// keep stale XFB data from being used
ReplaceVirtualXFB();
g_renderer->ResetAPIState(); // reset any game specific settings
// Copy EFB data to XFB and restore render target again
vxfb->xfbSource->CopyEFB(Gamma);
g_renderer->RestoreAPIState();
}
FramebufferManagerBase::VirtualXFBListType::iterator FramebufferManagerBase::FindVirtualXFB(u32 xfbAddr, u32 width, u32 height)

View File

@ -47,13 +47,13 @@ char *GenerateLightShader(char *p, int index, const LitChannel& chan, const char
// atten disabled
switch (chan.diffusefunc) {
case LIGHTDIF_NONE:
WRITE(p, "lacc.%s += %s.lights[%d].col.%s;\n", swizzle, lightsName, index, swizzle);
WRITE(p, "lacc.%s += %s[%d].%s;\n", swizzle, lightsName, index * 5, swizzle);
break;
case LIGHTDIF_SIGN:
case LIGHTDIF_CLAMP:
WRITE(p, "ldir = normalize(%s.lights[%d].pos.xyz - pos.xyz);\n", lightsName, index);
WRITE(p, "lacc.%s += %sdot(ldir, _norm0)) * %s.lights[%d].col.%s;\n",
swizzle, chan.diffusefunc != LIGHTDIF_SIGN ? "max(0.0f," :"(", lightsName, index, swizzle);
WRITE(p, "ldir = normalize(%s[%d + 3].xyz - pos.xyz);\n", lightsName, index * 5);
WRITE(p, "lacc.%s += %sdot(ldir, _norm0)) * %s[%d].%s;\n",
swizzle, chan.diffusefunc != LIGHTDIF_SIGN ? "max(0.0f," :"(", lightsName, index * 5, swizzle);
break;
default: _assert_(0);
}
@ -62,32 +62,32 @@ char *GenerateLightShader(char *p, int index, const LitChannel& chan, const char
if (chan.attnfunc == 3)
{ // spot
WRITE(p, "ldir = %s.lights[%d].pos.xyz - pos.xyz;\n", lightsName, index);
WRITE(p, "ldir = %s[%d + 3].xyz - pos.xyz;\n", lightsName, index * 5);
WRITE(p, "dist2 = dot(ldir, ldir);\n"
"dist = sqrt(dist2);\n"
"ldir = ldir / dist;\n"
"attn = max(0.0f, dot(ldir, %s.lights[%d].dir.xyz));\n", lightsName, index);
WRITE(p, "attn = max(0.0f, dot(%s.lights[%d].cosatt.xyz, float3(1.0f, attn, attn*attn))) / dot(%s.lights[%d].distatt.xyz, float3(1.0f,dist,dist2));\n", lightsName, index, lightsName, index);
"attn = max(0.0f, dot(ldir, %s[%d + 4].xyz));\n", lightsName, index * 5);
WRITE(p, "attn = max(0.0f, dot(%s[%d + 1].xyz, float3(1.0f, attn, attn*attn))) / dot(%s[%d + 2].xyz, float3(1.0f,dist,dist2));\n", lightsName, index * 5, lightsName, index * 5);
}
else if (chan.attnfunc == 1)
{ // specular
WRITE(p, "ldir = normalize(%s.lights[%d].pos.xyz);\n", lightsName, index);
WRITE(p, "attn = (dot(_norm0,ldir) >= 0.0f) ? max(0.0f, dot(_norm0, %s.lights[%d].dir.xyz)) : 0.0f;\n", lightsName, index);
WRITE(p, "attn = max(0.0f, dot(%s.lights[%d].cosatt.xyz, float3(1,attn,attn*attn))) / dot(%s.lights[%d].distatt.xyz, float3(1,attn,attn*attn));\n", lightsName, index, lightsName, index);
WRITE(p, "ldir = normalize(%s[%d + 3].xyz);\n", lightsName, index * 5);
WRITE(p, "attn = (dot(_norm0,ldir) >= 0.0f) ? max(0.0f, dot(_norm0, %s[%d + 4].xyz)) : 0.0f;\n", lightsName, index * 5);
WRITE(p, "attn = max(0.0f, dot(%s[%d + 1].xyz, float3(1,attn,attn*attn))) / dot(%s[%d + 2].xyz, float3(1,attn,attn*attn));\n", lightsName, index * 5, lightsName, index * 5);
}
switch (chan.diffusefunc)
{
case LIGHTDIF_NONE:
WRITE(p, "lacc.%s += attn * %s.lights[%d].col.%s;\n", swizzle, lightsName, index, swizzle);
WRITE(p, "lacc.%s += attn * %s[%d].%s;\n", swizzle, lightsName, index * 5, swizzle);
break;
case LIGHTDIF_SIGN:
case LIGHTDIF_CLAMP:
WRITE(p, "lacc.%s += attn * %sdot(ldir, _norm0)) * %s.lights[%d].col.%s;\n",
WRITE(p, "lacc.%s += attn * %sdot(ldir, _norm0)) * %s[%d].%s;\n",
swizzle,
chan.diffusefunc != LIGHTDIF_SIGN ? "max(0.0f," :"(",
lightsName,
index,
index * 5,
swizzle);
break;
default: _assert_(0);
@ -120,7 +120,7 @@ char *GenerateLightingShader(char *p, int components, const char* materialsName,
WRITE(p, "mat = float4(1.0f, 1.0f, 1.0f, 1.0f);\n");
}
else // from color
WRITE(p, "mat = %s.C%d;\n", materialsName, j+2);
WRITE(p, "mat = %s[%d];\n", materialsName, j+2);
if (color.enablelighting) {
if (color.ambsource) { // from vertex
@ -132,7 +132,7 @@ char *GenerateLightingShader(char *p, int components, const char* materialsName,
WRITE(p, "lacc = float4(0.0f, 0.0f, 0.0f, 0.0f);\n");
}
else // from color
WRITE(p, "lacc = %s.C%d;\n", materialsName, j);
WRITE(p, "lacc = %s[%d];\n", materialsName, j);
}
else
{
@ -149,7 +149,7 @@ char *GenerateLightingShader(char *p, int components, const char* materialsName,
else WRITE(p, "mat.w = 1.0f;\n");
}
else // from color
WRITE(p, "mat.w = %s.C%d.w;\n", materialsName, j+2);
WRITE(p, "mat.w = %s[%d].w;\n", materialsName, j+2);
}
if (alpha.enablelighting)
@ -163,7 +163,7 @@ char *GenerateLightingShader(char *p, int components, const char* materialsName,
WRITE(p, "lacc.w = 0.0f;\n");
}
else // from color
WRITE(p, "lacc.w = %s.C%d.w;\n", materialsName, j);
WRITE(p, "lacc.w = %s[%d].w;\n", materialsName, j);
}
else
{

View File

@ -102,7 +102,7 @@ public:
virtual void SetupVertexPointers() = 0;
virtual void EnableComponents(u32 components) {}
int GetVertexStride() const { return vertex_stride; }
u32 GetVertexStride() const { return vertex_stride; }
// TODO: move this under private:
u32 m_components; // VB_HAS_X. Bitmask telling what vertex components are present.

View File

@ -394,7 +394,7 @@ static void Decode()
// Display lists get added directly into the FIFO stream
if (g_bRecordFifoData && cmd_byte != GX_CMD_CALL_DL)
FifoRecorder::GetInstance().WriteGPCommand(opcodeStart, g_pVideoData - opcodeStart);
FifoRecorder::GetInstance().WriteGPCommand(opcodeStart, u32(g_pVideoData - opcodeStart));
}
static void DecodeSemiNop()
@ -477,7 +477,7 @@ static void DecodeSemiNop()
}
if (g_bRecordFifoData && cmd_byte != GX_CMD_CALL_DL)
FifoRecorder::GetInstance().WriteGPCommand(opcodeStart, g_pVideoData - opcodeStart);
FifoRecorder::GetInstance().WriteGPCommand(opcodeStart, u32(g_pVideoData - opcodeStart));
}
void OpcodeDecoder_Init()

View File

@ -173,7 +173,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo
*ptr++ = components;
}
uid->num_values = ptr - uid->values;
uid->num_values = int(ptr - uid->values);
}
void GetSafePixelShaderId(PIXELSHADERUIDSAFE *uid, DSTALPHA_MODE dstAlphaMode, u32 components)
@ -205,7 +205,7 @@ void GetSafePixelShaderId(PIXELSHADERUIDSAFE *uid, DSTALPHA_MODE dstAlphaMode, u
*ptr++ = bpmem.tevindref.hex; // 31
for (unsigned int i = 0; i < bpmem.genMode.numtevstages+1u; ++i) // up to 16 times
for (u32 i = 0; i < bpmem.genMode.numtevstages+1u; ++i) // up to 16 times
{
*ptr++ = bpmem.combiners[i].colorC.hex; // 32+5*i
*ptr++ = bpmem.combiners[i].alphaC.hex; // 33+5*i
@ -440,8 +440,8 @@ static const char *tevRasTable[] =
"ERROR13", //2
"ERROR14", //3
"ERROR15", //4
"alphabump", // use bump alpha
"(alphabump*(255.0f/248.0f))", //normalized
"float4(alphabump,alphabump,alphabump,alphabump)", // use bump alpha
"(float4(alphabump,alphabump,alphabump,alphabump)*(255.0f/248.0f))", //normalized
"float4(0.0f, 0.0f, 0.0f, 0.0f)", // zero
};
@ -485,6 +485,24 @@ static void BuildSwapModeTable()
}
}
const char* WriteRegister(API_TYPE ApiType, const char *prefix, const u32 num)
{
if (ApiType == API_OPENGL)
return ""; // Nothing to do here
static char result[64];
sprintf(result, " : register(%s%d)", prefix, num);
return result;
}
const char *WriteLocation(API_TYPE ApiType)
{
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
return "";
static char result[64];
sprintf(result, "uniform ");
return result;
}
const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType, u32 components)
{
setlocale(LC_NUMERIC, "C"); // Reset locale for compilation
@ -510,8 +528,25 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
nIndirectStagesUsed |= 1 << bpmem.tevind[i].bt;
}
}
// Declare samplers
if (ApiType == API_OPENGL)
{
// A function here
// Fmod implementation gleaned from Nvidia
// At http://http.developer.nvidia.com/Cg/fmod.html
WRITE(p, "float fmod( float x, float y )\n");
WRITE(p, "{\n");
WRITE(p, "\tfloat z = fract( abs( x / y) ) * abs( y );\n");
WRITE(p, "\treturn (x < 0) ? -z : z;\n");
WRITE(p, "}\n");
for (int i = 0; i < 8; ++i)
WRITE(p, "uniform sampler2D samp%d;\n", i);
}
else
{
// Declare samplers
if (ApiType != API_D3D11)
{
WRITE(p, "uniform sampler2D ");
@ -524,7 +559,7 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
bool bfirst = true;
for (int i = 0; i < 8; ++i)
{
WRITE(p, "%s samp%d : register(s%d)", bfirst?"":",", i, i);
WRITE(p, "%s samp%d %s", bfirst?"":",", i, WriteRegister(ApiType, "s", i));
bfirst = false;
}
WRITE(p, ";\n");
@ -539,34 +574,92 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
}
WRITE(p, ";\n");
}
WRITE(p, "\n");
WRITE(p, "uniform float4 " I_COLORS"[4] : register(c%d);\n", C_COLORS);
WRITE(p, "uniform float4 " I_KCOLORS"[4] : register(c%d);\n", C_KCOLORS);
WRITE(p, "uniform float4 " I_ALPHA"[1] : register(c%d);\n", C_ALPHA);
WRITE(p, "uniform float4 " I_TEXDIMS"[8] : register(c%d);\n", C_TEXDIMS);
WRITE(p, "uniform float4 " I_ZBIAS"[2] : register(c%d);\n", C_ZBIAS);
WRITE(p, "uniform float4 " I_INDTEXSCALE"[2] : register(c%d);\n", C_INDTEXSCALE);
WRITE(p, "uniform float4 " I_INDTEXMTX"[6] : register(c%d);\n", C_INDTEXMTX);
WRITE(p, "uniform float4 " I_FOG"[3] : register(c%d);\n", C_FOG);
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
WRITE(p,"typedef struct { float4 col; float4 cosatt; float4 distatt; float4 pos; float4 dir; } Light;\n");
WRITE(p,"typedef struct { Light lights[8]; } s_" I_PLIGHTS";\n");
WRITE(p, "uniform s_" I_PLIGHTS" " I_PLIGHTS" : register(c%d);\n", C_PLIGHTS);
WRITE(p, "typedef struct { float4 C0, C1, C2, C3; } s_" I_PMATERIALS";\n");
WRITE(p, "uniform s_" I_PMATERIALS" " I_PMATERIALS" : register(c%d);\n", C_PMATERIALS);
}
WRITE(p, "\n");
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "layout(std140) uniform PSBlock {\n");
WRITE(p, "\t%sfloat4 " I_COLORS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_COLORS));
WRITE(p, "\t%sfloat4 " I_KCOLORS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_KCOLORS));
WRITE(p, "\t%sfloat4 " I_ALPHA"[1] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_ALPHA));
WRITE(p, "\t%sfloat4 " I_TEXDIMS"[8] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_TEXDIMS));
WRITE(p, "\t%sfloat4 " I_ZBIAS"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_ZBIAS));
WRITE(p, "\t%sfloat4 " I_INDTEXSCALE"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_INDTEXSCALE));
WRITE(p, "\t%sfloat4 " I_INDTEXMTX"[6] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_INDTEXMTX));
WRITE(p, "\t%sfloat4 " I_FOG"[3] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_FOG));
// For pixel lighting
WRITE(p, "\t%sfloat4 " I_PLIGHTS"[40] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PLIGHTS));
WRITE(p, "\t%sfloat4 " I_PMATERIALS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PMATERIALS));
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n");
if (ApiType == API_OPENGL)
{
WRITE(p, "out float4 ocol0;\n");
if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)
WRITE(p, "out float4 ocol1;\n");
if (per_pixel_depth)
WRITE(p, "#define depth gl_FragDepth\n");
WRITE(p, "float4 rawpos = gl_FragCoord;\n");
WRITE(p, "VARYIN float4 colors_02;\n");
WRITE(p, "VARYIN float4 colors_12;\n");
WRITE(p, "float4 colors_0 = colors_02;\n");
WRITE(p, "float4 colors_1 = colors_12;\n");
// compute window position if needed because binding semantic WPOS is not widely supported
// Let's set up attributes
if (xfregs.numTexGen.numTexGens < 7)
{
for (int i = 0; i < 8; ++i)
{
WRITE(p, "VARYIN float3 uv%d_2;\n", i);
WRITE(p, "float3 uv%d = uv%d_2;\n", i, i);
}
WRITE(p, "VARYIN float4 clipPos_2;\n");
WRITE(p, "float4 clipPos = clipPos_2;\n");
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
WRITE(p, "VARYIN float4 Normal_2;\n");
WRITE(p, "float4 Normal = Normal_2;\n");
}
}
else
{
// wpos is in w of first 4 texcoords
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
for (int i = 0; i < 8; ++i)
{
WRITE(p, "VARYIN float4 uv%d_2;\n", i);
WRITE(p, "float4 uv%d = uv%d_2;\n", i, i);
}
}
else
{
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
{
WRITE(p, "VARYIN float%d uv%d_2;\n", i < 4 ? 4 : 3 , i);
WRITE(p, "float%d uv%d = uv%d_2;\n", i < 4 ? 4 : 3 , i, i);
}
}
WRITE(p, "float4 clipPos;\n");
}
WRITE(p, "void main()\n{\n");
}
else
{
WRITE(p, "void main(\n");
if (ApiType != API_D3D11)
{
WRITE(p, " out float4 ocol0 : COLOR0,%s%s\n in float4 rawpos : %s,\n",
dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND ? "\n out float4 ocol1 : COLOR1," : "",
per_pixel_depth ? "\n out float depth : DEPTH," : "",
ApiType & API_OPENGL ? "WPOS" : ApiType & API_D3D9_SM20 ? "POSITION" : "VPOS");
ApiType & API_D3D9_SM20 ? "POSITION" : "VPOS");
}
else
{
@ -586,6 +679,7 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
WRITE(p, ",\n in float4 clipPos : TEXCOORD%d", numTexgen);
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
WRITE(p, ",\n in float4 Normal : TEXCOORD%d", numTexgen + 1);
WRITE(p, " ) {\n");
}
else
{
@ -600,12 +694,14 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
WRITE(p, ",\n in float%d uv%d : TEXCOORD%d", i < 4 ? 4 : 3 , i, i);
}
}
WRITE(p, " ) {\n");
WRITE(p, "\tfloat4 clipPos = float4(0.0f, 0.0f, 0.0f, 0.0f);");
}
}
WRITE(p, " float4 c0 = " I_COLORS"[1], c1 = " I_COLORS"[2], c2 = " I_COLORS"[3], prev = float4(0.0f, 0.0f, 0.0f, 0.0f), textemp = float4(0.0f, 0.0f, 0.0f, 0.0f), rastemp = float4(0.0f, 0.0f, 0.0f, 0.0f), konsttemp = float4(0.0f, 0.0f, 0.0f, 0.0f);\n"
" float3 comp16 = float3(1.0f, 255.0f, 0.0f), comp24 = float3(1.0f, 255.0f, 255.0f*255.0f);\n"
" float4 alphabump=float4(0.0f,0.0f,0.0f,0.0f);\n"
" float alphabump=0.0f;\n"
" float3 tevcoord=float3(0.0f, 0.0f, 0.0f);\n"
" float2 wrappedcoord=float2(0.0f,0.0f), tempcoord=float2(0.0f,0.0f);\n"
" float4 cc0=float4(0.0f,0.0f,0.0f,0.0f), cc1=float4(0.0f,0.0f,0.0f,0.0f);\n"
@ -616,32 +712,32 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
{
if (xfregs.numTexGen.numTexGens < 7)
{
WRITE(p,"float3 _norm0 = normalize(Normal.xyz);\n\n");
WRITE(p,"float3 pos = float3(clipPos.x,clipPos.y,Normal.w);\n");
WRITE(p,"\tfloat3 _norm0 = normalize(Normal.xyz);\n\n");
WRITE(p,"\tfloat3 pos = float3(clipPos.x,clipPos.y,Normal.w);\n");
}
else
{
WRITE(p," float3 _norm0 = normalize(float3(uv4.w,uv5.w,uv6.w));\n\n");
WRITE(p,"float3 pos = float3(uv0.w,uv1.w,uv7.w);\n");
WRITE(p,"\tfloat3 _norm0 = normalize(float3(uv4.w,uv5.w,uv6.w));\n\n");
WRITE(p,"\tfloat3 pos = float3(uv0.w,uv1.w,uv7.w);\n");
}
WRITE(p, "float4 mat, lacc;\n"
"float3 ldir, h;\n"
"float dist, dist2, attn;\n");
WRITE(p, "\tfloat4 mat, lacc;\n"
"\tfloat3 ldir, h;\n"
"\tfloat dist, dist2, attn;\n");
p = GenerateLightingShader(p, components, I_PMATERIALS, I_PLIGHTS, "colors_", "colors_");
}
if (numTexgen < 7)
WRITE(p, "clipPos = float4(rawpos.x, rawpos.y, clipPos.z, clipPos.w);\n");
WRITE(p, "\tclipPos = float4(rawpos.x, rawpos.y, clipPos.z, clipPos.w);\n");
else
WRITE(p, "float4 clipPos = float4(rawpos.x, rawpos.y, uv2.w, uv3.w);\n");
WRITE(p, "\tclipPos = float4(rawpos.x, rawpos.y, uv2.w, uv3.w);\n");
// HACK to handle cases where the tex gen is not enabled
if (numTexgen == 0)
{
WRITE(p, "float3 uv0 = float3(0.0f, 0.0f, 0.0f);\n");
WRITE(p, "\tfloat3 uv0 = float3(0.0f, 0.0f, 0.0f);\n");
}
else
{
@ -650,8 +746,8 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
// optional perspective divides
if (xfregs.texMtxInfo[i].projection == XF_TEXPROJ_STQ)
{
WRITE(p, "if (uv%d.z)", i);
WRITE(p, " uv%d.xy = uv%d.xy / uv%d.z;\n", i, i, i);
WRITE(p, "\tif (uv%d.z != 0.0f)", i);
WRITE(p, "\t\tuv%d.xy = uv%d.xy / uv%d.z;\n", i, i, i);
}
WRITE(p, "uv%d.xy = uv%d.xy * " I_TEXDIMS"[%d].zw;\n", i, i, i);
@ -666,9 +762,9 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
int texcoord = bpmem.tevindref.getTexCoord(i);
if (texcoord < numTexgen)
WRITE(p, "tempcoord = uv%d.xy * " I_INDTEXSCALE"[%d].%s;\n", texcoord, i/2, (i&1)?"zw":"xy");
WRITE(p, "\ttempcoord = uv%d.xy * " I_INDTEXSCALE"[%d].%s;\n", texcoord, i/2, (i&1)?"zw":"xy");
else
WRITE(p, "tempcoord = float2(0.0f, 0.0f);\n");
WRITE(p, "\ttempcoord = float2(0.0f, 0.0f);\n");
char buffer[32];
sprintf(buffer, "float3 indtex%d", i);
@ -696,19 +792,19 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
if(bpmem.combiners[numStages - 1].colorC.dest != 0)
{
bool retrieveFromAuxRegister = !RegisterStates[bpmem.combiners[numStages - 1].colorC.dest].ColorNeedOverflowControl && RegisterStates[bpmem.combiners[numStages - 1].colorC.dest].AuxStored;
WRITE(p, "prev.rgb = %s%s;\n", retrieveFromAuxRegister ? "c" : "" , tevCOutputTable[bpmem.combiners[numStages - 1].colorC.dest]);
WRITE(p, "\tprev.rgb = %s%s;\n", retrieveFromAuxRegister ? "c" : "" , tevCOutputTable[bpmem.combiners[numStages - 1].colorC.dest]);
RegisterStates[0].ColorNeedOverflowControl = RegisterStates[bpmem.combiners[numStages - 1].colorC.dest].ColorNeedOverflowControl;
}
if(bpmem.combiners[numStages - 1].alphaC.dest != 0)
{
bool retrieveFromAuxRegister = !RegisterStates[bpmem.combiners[numStages - 1].alphaC.dest].AlphaNeedOverflowControl && RegisterStates[bpmem.combiners[numStages - 1].alphaC.dest].AuxStored;
WRITE(p, "prev.a = %s%s;\n", retrieveFromAuxRegister ? "c" : "" , tevAOutputTable[bpmem.combiners[numStages - 1].alphaC.dest]);
WRITE(p, "\tprev.a = %s%s;\n", retrieveFromAuxRegister ? "c" : "" , tevAOutputTable[bpmem.combiners[numStages - 1].alphaC.dest]);
RegisterStates[0].AlphaNeedOverflowControl = RegisterStates[bpmem.combiners[numStages - 1].alphaC.dest].AlphaNeedOverflowControl;
}
}
// emulation of unsigned 8 overflow when casting if needed
if(RegisterStates[0].AlphaNeedOverflowControl || RegisterStates[0].ColorNeedOverflowControl)
WRITE(p, "prev = frac(prev * (255.0f/256.0f)) * (256.0f/255.0f);\n");
WRITE(p, "\tprev = frac(prev * (255.0f/256.0f)) * (256.0f/255.0f);\n");
AlphaTest::TEST_RESULT Pretest = bpmem.alpha_test.TestResult();
if (Pretest == AlphaTest::UNDETERMINED)
@ -741,11 +837,11 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
}
if (dstAlphaMode == DSTALPHA_ALPHA_PASS)
WRITE(p, " ocol0 = float4(prev.rgb, " I_ALPHA"[0].a);\n");
WRITE(p, "\tocol0 = float4(prev.rgb, " I_ALPHA"[0].a);\n");
else
{
WriteFog(p);
WRITE(p, " ocol0 = prev;\n");
WRITE(p, "\tocol0 = prev;\n");
}
// On D3D11, use dual-source color blending to perform dst alpha in a
@ -753,9 +849,9 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)
{
// Colors will be blended against the alpha from ocol1...
WRITE(p, " ocol1 = ocol0;\n");
WRITE(p, "\tocol1 = prev;\n");
// ...and the alpha from ocol0 will be written to the framebuffer.
WRITE(p, " ocol0.a = " I_ALPHA"[0].a;\n");
WRITE(p, "\tocol0.a = " I_ALPHA"[0].a;\n");
}
WRITE(p, "}\n");
@ -864,10 +960,10 @@ static void WriteStage(char *&p, int n, API_TYPE ApiType)
WRITE(p, "float2 indtevtrans%d = " I_INDTEXMTX"[%d].ww * uv%d.xy * indtevcrd%d.yy;\n", n, mtxidx, texcoord, n);
}
else
WRITE(p, "float2 indtevtrans%d = 0;\n", n);
WRITE(p, "float2 indtevtrans%d = float2(0.0f);\n", n);
}
else
WRITE(p, "float2 indtevtrans%d = 0;\n", n);
WRITE(p, "float2 indtevtrans%d = float2(0.0f);\n", n);
// ---------
// Wrapping
@ -1126,7 +1222,7 @@ void SampleTexture(char *&p, const char *destination, const char *texcoords, con
if (ApiType == API_D3D11)
WRITE(p, "%s=Tex%d.Sample(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, texmap,texmap, texcoords, texmap, texswap);
else
WRITE(p, "%s=tex2D(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, texmap, texcoords, texmap, texswap);
WRITE(p, "%s=%s(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, ApiType == API_OPENGL ? "texture" : "tex2D", texmap, texcoords, texmap, texswap);
}
static const char *tevAlphaFuncsTable[] =
@ -1157,8 +1253,9 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode
I_ALPHA"[0].g"
};
// using discard then return works the same in cg and dx9 but not in dx11
WRITE(p, "if(!( ");
WRITE(p, "\tif(!( ");
int compindex = bpmem.alpha_test.comp0;
WRITE(p, tevAlphaFuncsTable[compindex],alphaRef[0]);//lookup the first component from the alpha function table
@ -1169,9 +1266,9 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode
WRITE(p, tevAlphaFuncsTable[compindex],alphaRef[1]);//lookup the second component from the alpha function table
WRITE(p, ")) {\n");
WRITE(p, "ocol0 = 0;\n");
WRITE(p, "\t\tocol0 = float4(0.0f, 0.0f, 0.0f, 0.0f);\n");
if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)
WRITE(p, "ocol1 = 0;\n");
WRITE(p, "\t\tocol1 = float4(0.0f, 0.0f, 0.0f, 0.0f);\n");
if(per_pixel_depth)
WRITE(p, "depth = 1.f;\n");
@ -1187,9 +1284,9 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode
// we don't have a choice.
if (!(bpmem.zcontrol.early_ztest && bpmem.zmode.updateenable))
{
WRITE(p, "discard;\n");
WRITE(p, "\t\tdiscard;\n");
if (ApiType != API_D3D11)
WRITE(p, "return;\n");
WRITE(p, "\t\treturn;\n");
}
WRITE(p, "}\n");
@ -1201,27 +1298,28 @@ static const char *tevFogFuncsTable[] =
"", //?
"", //Linear
"", //?
" fog = 1.0f - pow(2.0f, -8.0f * fog);\n", //exp
" fog = 1.0f - pow(2.0f, -8.0f * fog * fog);\n", //exp2
" fog = pow(2.0f, -8.0f * (1.0f - fog));\n", //backward exp
" fog = 1.0f - fog;\n fog = pow(2.0f, -8.0f * fog * fog);\n" //backward exp2
"\tfog = 1.0f - pow(2.0f, -8.0f * fog);\n", //exp
"\tfog = 1.0f - pow(2.0f, -8.0f * fog * fog);\n", //exp2
"\tfog = pow(2.0f, -8.0f * (1.0f - fog));\n", //backward exp
"\tfog = 1.0f - fog;\n fog = pow(2.0f, -8.0f * fog * fog);\n" //backward exp2
};
static void WriteFog(char *&p)
{
if(bpmem.fog.c_proj_fsel.fsel == 0)return;//no Fog
if (bpmem.fog.c_proj_fsel.fsel == 0)
return; // no Fog
if (bpmem.fog.c_proj_fsel.proj == 0)
{
// perspective
// ze = A/(B - (Zs >> B_SHF)
WRITE (p, " float ze = " I_FOG"[1].x / (" I_FOG"[1].y - (zCoord / " I_FOG"[1].w));\n");
WRITE (p, "\tfloat ze = " I_FOG"[1].x / (" I_FOG"[1].y - (zCoord / " I_FOG"[1].w));\n");
}
else
{
// orthographic
// ze = a*Zs (here, no B_SHF)
WRITE (p, " float ze = " I_FOG"[1].x * zCoord;\n");
WRITE (p, "\tfloat ze = " I_FOG"[1].x * zCoord;\n");
}
// x_adjust = sqrt((x-center)^2 + k^2)/k
@ -1229,12 +1327,12 @@ static void WriteFog(char *&p)
//this is complitly teorical as the real hard seems to use a table intead of calculate the values.
if (bpmem.fogRange.Base.Enabled)
{
WRITE (p, " float x_adjust = (2.0f * (clipPos.x / " I_FOG"[2].y)) - 1.0f - " I_FOG"[2].x;\n");
WRITE (p, " x_adjust = sqrt(x_adjust * x_adjust + " I_FOG"[2].z * " I_FOG"[2].z) / " I_FOG"[2].z;\n");
WRITE (p, " ze *= x_adjust;\n");
WRITE (p, "\tfloat x_adjust = (2.0f * (clipPos.x / " I_FOG"[2].y)) - 1.0f - " I_FOG"[2].x;\n");
WRITE (p, "\tx_adjust = sqrt(x_adjust * x_adjust + " I_FOG"[2].z * " I_FOG"[2].z) / " I_FOG"[2].z;\n");
WRITE (p, "\tze *= x_adjust;\n");
}
WRITE (p, " float fog = saturate(ze - " I_FOG"[1].z);\n");
WRITE (p, "\tfloat fog = saturate(ze - " I_FOG"[1].z);\n");
if (bpmem.fog.c_proj_fsel.fsel > 3)
{
@ -1246,7 +1344,5 @@ static void WriteFog(char *&p)
WARN_LOG(VIDEO, "Unknown Fog Type! %08x", bpmem.fog.c_proj_fsel.fsel);
}
WRITE(p, " prev.rgb = lerp(prev.rgb," I_FOG"[0].rgb,fog);\n");
WRITE(p, "\tprev.rgb = lerp(prev.rgb, " I_FOG"[0].rgb, fog);\n");
}

View File

@ -28,8 +28,8 @@
#define I_INDTEXSCALE "cindscale"
#define I_INDTEXMTX "cindmtx"
#define I_FOG "cfog"
#define I_PLIGHTS "cLights"
#define I_PMATERIALS "cmtrl"
#define I_PLIGHTS "cPLights"
#define I_PMATERIALS "cPmtrl"
#define C_COLORMATRIX 0 // 0
#define C_COLORS 0 // 0
@ -47,6 +47,19 @@
#define PIXELSHADERUID_MAX_VALUES 70
#define PIXELSHADERUID_MAX_VALUES_SAFE 115
// Annoying sure, can be removed once we get up to GLSL ~1.3
const s_svar PSVar_Loc[] = { {I_COLORS, C_COLORS, 4 },
{I_KCOLORS, C_KCOLORS, 4 },
{I_ALPHA, C_ALPHA, 1 },
{I_TEXDIMS, C_TEXDIMS, 8 },
{I_ZBIAS , C_ZBIAS, 2 },
{I_INDTEXSCALE , C_INDTEXSCALE, 2 },
{I_INDTEXMTX, C_INDTEXMTX, 6 },
{I_FOG, C_FOG, 3 },
{I_PLIGHTS, C_PLIGHTS, 40 },
{I_PMATERIALS, C_PMATERIALS, 4 },
};
// DO NOT make anything in this class virtual.
template<bool safe>
class _PIXELSHADERUID

View File

@ -85,6 +85,8 @@ void PixelShaderManager::Shutdown()
void PixelShaderManager::SetConstants()
{
if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO)
Dirty();
for (int i = 0; i < 2; ++i)
{
if (s_nColorsChanged[i])

View File

@ -831,9 +831,5 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
entry->frameCount = frameCount;
g_renderer->ResetAPIState(); // reset any game specific settings
entry->FromRenderTarget(dstAddr, dstFormat, srcFormat, srcRect, isIntensity, scaleByHalf, cbufid, colmat);
g_renderer->RestoreAPIState();
}

View File

@ -26,6 +26,7 @@
#include "PixelShaderGen.h"
#include "BPMemory.h"
#include "RenderBase.h"
#include "VideoConfig.h"
#define WRITE p+=sprintf
@ -66,19 +67,31 @@ u16 GetEncodedSampleCount(u32 format)
}
}
const char* WriteRegister(API_TYPE ApiType, const char *prefix, const u32 num)
{
if (ApiType == API_OPENGL)
return ""; // Once we switch to GLSL 1.3 we can do something here
static char result[64];
sprintf(result, " : register(%s%d)", prefix, num);
return result;
}
// block dimensions : widthStride, heightStride
// texture dims : width, height, x offset, y offset
void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
{
WRITE(p, "uniform float4 blkDims : register(c%d);\n", C_COLORMATRIX);
WRITE(p, "uniform float4 textureDims : register(c%d);\n", C_COLORMATRIX + 1);
// [0] left, top, right, bottom of source rectangle within source texture
// [1] width and height of destination texture in pixels
// Two were merged for GLSL
WRITE(p, "uniform float4 " I_COLORS"[2] %s;\n", WriteRegister(ApiType, "c", C_COLORS));
float blkW = (float)TexDecoder_GetBlockWidthInTexels(format);
float blkH = (float)TexDecoder_GetBlockHeightInTexels(format);
float samples = (float)GetEncodedSampleCount(format);
if (ApiType == API_OPENGL)
{
WRITE(p,"uniform samplerRECT samp0 : register(s0);\n");
WRITE(p, "#define samp0 samp9\n");
WRITE(p, "uniform sampler2DRect samp0;\n");
}
else if (ApiType & API_D3D9)
{
@ -91,6 +104,14 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
}
if (ApiType == API_OPENGL)
{
WRITE(p, " out float4 ocol0;\n");
WRITE(p, " in float2 uv0;\n");
WRITE(p, "void main()\n");
}
else
{
WRITE(p,"void main(\n");
if (ApiType != API_D3D11)
{
@ -100,9 +121,10 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
{
WRITE(p," out float4 ocol0 : SV_Target,\n");
}
WRITE(p," in float2 uv0 : TEXCOORD0)\n");
}
WRITE(p," in float2 uv0 : TEXCOORD0)\n"
"{\n"
WRITE(p, "{\n"
" float2 sampleUv;\n"
" float2 uv1 = floor(uv0);\n");
@ -113,7 +135,7 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " float yl = floor(uv1.y / %f);\n", blkH);
WRITE(p, " float yb = yl * %f;\n", blkH);
WRITE(p, " float yoff = uv1.y - yb;\n");
WRITE(p, " float xp = uv1.x + (yoff * textureDims.x);\n");
WRITE(p, " float xp = uv1.x + (yoff * " I_COLORS"[1].x);\n");
WRITE(p, " float xel = floor(xp / %f);\n", blkW);
WRITE(p, " float xb = floor(xel / %f);\n", blkH);
WRITE(p, " float xoff = xel - (xb * %f);\n", blkH);
@ -121,17 +143,17 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " sampleUv.x = xib + (xb * %f);\n", blkW);
WRITE(p, " sampleUv.y = yb + xoff;\n");
WRITE(p, " sampleUv = sampleUv * blkDims.xy;\n");
WRITE(p, " sampleUv = sampleUv * " I_COLORS"[0].xy;\n");
if (ApiType == API_OPENGL)
WRITE(p," sampleUv.y = textureDims.y - sampleUv.y;\n");
WRITE(p," sampleUv.y = " I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p, " sampleUv = sampleUv + textureDims.zw;\n");
WRITE(p, " sampleUv = sampleUv + " I_COLORS"[1].zw;\n");
if (ApiType != API_OPENGL)
{
WRITE(p, " sampleUv = sampleUv + float2(0.0f,1.0f);\n");// still to determine the reason for this
WRITE(p, " sampleUv = sampleUv / blkDims.zw;\n");
WRITE(p, " sampleUv = sampleUv / " I_COLORS"[0].zw;\n");
}
}
@ -139,8 +161,10 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
// texture dims : width, height, x offset, y offset
void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
{
WRITE(p, "uniform float4 blkDims : register(c%d);\n", C_COLORMATRIX);
WRITE(p, "uniform float4 textureDims : register(c%d);\n", C_COLORMATRIX + 1);
// [0] left, top, right, bottom of source rectangle within source texture
// [1] width and height of destination texture in pixels
// Two were merged for GLSL
WRITE(p, "uniform float4 " I_COLORS"[2] %s;\n", WriteRegister(ApiType, "c", C_COLORS));
float blkW = (float)TexDecoder_GetBlockWidthInTexels(format);
float blkH = (float)TexDecoder_GetBlockHeightInTexels(format);
@ -148,7 +172,8 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
// 32 bit textures (RGBA8 and Z24) are store in 2 cache line increments
if (ApiType == API_OPENGL)
{
WRITE(p,"uniform samplerRECT samp0 : register(s0);\n");
WRITE(p, "#define samp0 samp9\n");
WRITE(p, "uniform sampler2DRect samp0;\n");
}
else if (ApiType & API_D3D9)
{
@ -160,7 +185,14 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, "Texture2D Tex0 : register(t0);\n");
}
if (ApiType == API_OPENGL)
{
WRITE(p, " out float4 ocol0;\n");
WRITE(p, " in float2 uv0;\n");
WRITE(p, "void main()\n");
}
else
{
WRITE(p,"void main(\n");
if(ApiType != API_D3D11)
{
@ -170,16 +202,18 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
{
WRITE(p," out float4 ocol0 : SV_Target,\n");
}
WRITE(p," in float2 uv0 : TEXCOORD0)\n");
}
WRITE(p," in float2 uv0 : TEXCOORD0)\n"
"{\n"
WRITE(p, "{\n"
" float2 sampleUv;\n"
" float2 uv1 = floor(uv0);\n");
WRITE(p, " float yl = floor(uv1.y / %f);\n", blkH);
WRITE(p, " float yb = yl * %f;\n", blkH);
WRITE(p, " float yoff = uv1.y - yb;\n");
WRITE(p, " float xp = uv1.x + (yoff * textureDims.x);\n");
WRITE(p, " float xp = uv1.x + (yoff * " I_COLORS"[1].x);\n");
WRITE(p, " float xel = floor(xp / 2);\n");
WRITE(p, " float xb = floor(xel / %f);\n", blkH);
WRITE(p, " float xoff = xel - (xb * %f);\n", blkH);
@ -189,20 +223,19 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " float xib = x2 - (xl * %f);\n", blkW);
WRITE(p, " float halfxb = floor(xb / 2);\n");
WRITE(p, " sampleUv.x = xib + (halfxb * %f);\n", blkW);
WRITE(p, " sampleUv.y = yb + xoff;\n");
WRITE(p, " sampleUv = sampleUv * blkDims.xy;\n");
WRITE(p, " sampleUv = sampleUv * " I_COLORS"[0].xy;\n");
if (ApiType == API_OPENGL)
WRITE(p," sampleUv.y = textureDims.y - sampleUv.y;\n");
WRITE(p," sampleUv.y = " I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p, " sampleUv = sampleUv + textureDims.zw;\n");
WRITE(p, " sampleUv = sampleUv + " I_COLORS"[1].zw;\n");
if (ApiType != API_OPENGL)
{
WRITE(p, " sampleUv = sampleUv + float2(0.0f,1.0f);\n");// still to determine the reason for this
WRITE(p, " sampleUv = sampleUv / blkDims.zw;\n");
WRITE(p, " sampleUv = sampleUv / " I_COLORS"[0].zw;\n");
}
}
@ -214,14 +247,14 @@ void WriteSampleColor(char*& p, const char* colorComp, const char* dest, API_TYP
else if (ApiType == API_D3D11)
texSampleOpName = "tex0.Sample";
else
texSampleOpName = "texRECT";
texSampleOpName = "texture2DRect";
// the increment of sampleUv.x is delayed, so we perform it here. see WriteIncrementSampleX.
const char* texSampleIncrementUnit;
if (ApiType != API_OPENGL)
texSampleIncrementUnit = "blkDims.x / blkDims.z";
texSampleIncrementUnit = I_COLORS"[0].x / " I_COLORS"[0].z";
else
texSampleIncrementUnit = "blkDims.x";
texSampleIncrementUnit = I_COLORS"[0].x";
WRITE(p, " %s = %s(samp0, sampleUv + float2(%d * (%s), 0)).%s;\n",
dest, texSampleOpName, s_incrementSampleXCount, texSampleIncrementUnit, colorComp);
@ -263,7 +296,7 @@ void WriteToBitDepth(char*& p, u8 depth, const char* src, const char* dest)
WRITE(p, " %s = floor(%s * %ff);\n", dest, src, result);
}
void WriteEncoderEnd(char* p)
void WriteEncoderEnd(char* p, API_TYPE ApiType)
{
WRITE(p, "}\n");
IntensityConstantAdded = false;
@ -292,7 +325,7 @@ void WriteI8Encoder(char* p, API_TYPE ApiType)
WRITE(p, " ocol0.rgba += IntensityConst.aaaa;\n"); // see WriteColorToIntensity
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteI4Encoder(char* p, API_TYPE ApiType)
@ -340,7 +373,7 @@ void WriteI4Encoder(char* p, API_TYPE ApiType)
WriteToBitDepth(p, 4, "color1", "color1");
WRITE(p, " ocol0 = (color0 * 16.0f + color1) / 255.0f;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteIA8Encoder(char* p,API_TYPE ApiType)
@ -359,7 +392,7 @@ void WriteIA8Encoder(char* p,API_TYPE ApiType)
WRITE(p, " ocol0.ga += IntensityConst.aa;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteIA4Encoder(char* p,API_TYPE ApiType)
@ -394,7 +427,7 @@ void WriteIA4Encoder(char* p,API_TYPE ApiType)
WriteToBitDepth(p, 4, "color1", "color1");
WRITE(p, " ocol0 = (color0 * 16.0f + color1) / 255.0f;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteRGB565Encoder(char* p,API_TYPE ApiType)
@ -404,10 +437,9 @@ void WriteRGB565Encoder(char* p,API_TYPE ApiType)
WriteSampleColor(p, "rgb", "float3 texSample0", ApiType);
WriteIncrementSampleX(p, ApiType);
WriteSampleColor(p, "rgb", "float3 texSample1", ApiType);
WRITE(p, " float2 texRs = {texSample0.r, texSample1.r};\n");
WRITE(p, " float2 texGs = {texSample0.g, texSample1.g};\n");
WRITE(p, " float2 texBs = {texSample0.b, texSample1.b};\n");
WRITE(p, " float2 texRs = float2(texSample0.r, texSample1.r);\n");
WRITE(p, " float2 texGs = float2(texSample0.g, texSample1.g);\n");
WRITE(p, " float2 texBs = float2(texSample0.b, texSample1.b);\n");
WriteToBitDepth(p, 6, "texGs", "float2 gInt");
WRITE(p, " float2 gUpper = floor(gInt / 8.0f);\n");
@ -419,7 +451,7 @@ void WriteRGB565Encoder(char* p,API_TYPE ApiType)
WRITE(p, " ocol0.ga = ocol0.ga + gLower * 32.0f;\n");
WRITE(p, " ocol0 = ocol0 / 255.0f;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteRGB5A3Encoder(char* p,API_TYPE ApiType)
@ -486,7 +518,7 @@ void WriteRGB5A3Encoder(char* p,API_TYPE ApiType)
WRITE(p, "}\n");
WRITE(p, " ocol0 = ocol0 / 255.0f;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteRGBA4443Encoder(char* p,API_TYPE ApiType)
@ -512,7 +544,7 @@ void WriteRGBA4443Encoder(char* p,API_TYPE ApiType)
WriteToBitDepth(p, 4, "texSample.b", "color1.a");
WRITE(p, " ocol0 = (color0 * 16.0f + color1) / 255.0f;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteRGBA8Encoder(char* p,API_TYPE ApiType)
@ -542,7 +574,7 @@ void WriteRGBA8Encoder(char* p,API_TYPE ApiType)
WRITE(p, " ocol0 = (cl0 * color0) + (cl1 * color1);\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteC4Encoder(char* p, const char* comp,API_TYPE ApiType)
@ -578,7 +610,7 @@ void WriteC4Encoder(char* p, const char* comp,API_TYPE ApiType)
WriteToBitDepth(p, 4, "color1", "color1");
WRITE(p, " ocol0 = (color0 * 16.0f + color1) / 255.0f;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteC8Encoder(char* p, const char* comp,API_TYPE ApiType)
@ -596,7 +628,7 @@ void WriteC8Encoder(char* p, const char* comp,API_TYPE ApiType)
WriteSampleColor(p, comp, "ocol0.a", ApiType);
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteCC4Encoder(char* p, const char* comp,API_TYPE ApiType)
@ -629,7 +661,7 @@ void WriteCC4Encoder(char* p, const char* comp,API_TYPE ApiType)
WriteToBitDepth(p, 4, "color1", "color1");
WRITE(p, " ocol0 = (color0 * 16.0f + color1) / 255.0f;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteCC8Encoder(char* p, const char* comp, API_TYPE ApiType)
@ -641,7 +673,7 @@ void WriteCC8Encoder(char* p, const char* comp, API_TYPE ApiType)
WriteSampleColor(p, comp, "ocol0.ra", ApiType);
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteZ8Encoder(char* p, const char* multiplier,API_TYPE ApiType)
@ -665,7 +697,7 @@ void WriteZ8Encoder(char* p, const char* multiplier,API_TYPE ApiType)
WriteSampleColor(p, "b", "depth", ApiType);
WRITE(p, "ocol0.a = frac(depth * %s);\n", multiplier);
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteZ16Encoder(char* p,API_TYPE ApiType)
@ -699,7 +731,7 @@ void WriteZ16Encoder(char* p,API_TYPE ApiType)
WRITE(p, " ocol0.r = expanded.g / 255;\n");
WRITE(p, " ocol0.a = expanded.r / 255;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteZ16LEncoder(char* p,API_TYPE ApiType)
@ -737,7 +769,7 @@ void WriteZ16LEncoder(char* p,API_TYPE ApiType)
WRITE(p, " ocol0.r = expanded.b;\n");
WRITE(p, " ocol0.a = expanded.g;\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
void WriteZ24Encoder(char* p, API_TYPE ApiType)
@ -780,7 +812,7 @@ void WriteZ24Encoder(char* p, API_TYPE ApiType)
WRITE(p, " ocol0.a = expanded1.r / 255;\n");
WRITE(p, " }\n");
WriteEncoderEnd(p);
WriteEncoderEnd(p, ApiType);
}
const char *GenerateEncodingShader(u32 format,API_TYPE ApiType)

View File

@ -44,8 +44,10 @@
#include "XFMemory.h"
extern float GC_ALIGNED16(g_fProjectionMatrix[16]);
#ifndef _M_GENERIC
#ifndef __APPLE__
#define USE_JIT
#endif
#endif
#define COMPILED_CODE_SIZE 4096

View File

@ -131,30 +131,32 @@ static char text[16384];
#define WRITE p+=sprintf
char* GenerateVSOutputStruct(char* p, u32 components, API_TYPE api_type)
char* GenerateVSOutputStruct(char* p, u32 components, API_TYPE ApiType)
{
// GLSL makes this ugly
// TODO: Make pretty
WRITE(p, "struct VS_OUTPUT {\n");
WRITE(p, " float4 pos : POSITION;\n");
WRITE(p, " float4 colors_0 : COLOR0;\n");
WRITE(p, " float4 colors_1 : COLOR1;\n");
WRITE(p, " float4 pos %s POSITION;\n", ApiType == API_OPENGL ? ";//" : ":");
WRITE(p, " float4 colors_0 %s COLOR0;\n", ApiType == API_OPENGL ? ";//" : ":");
WRITE(p, " float4 colors_1 %s COLOR1;\n", ApiType == API_OPENGL ? ";//" : ":");
if (xfregs.numTexGen.numTexGens < 7) {
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
WRITE(p, " float3 tex%d : TEXCOORD%d;\n", i, i);
WRITE(p, " float4 clipPos : TEXCOORD%d;\n", xfregs.numTexGen.numTexGens);
WRITE(p, " float3 tex%d %s TEXCOORD%d;\n", i, ApiType == API_OPENGL ? ";//" : ":", i);
WRITE(p, " float4 clipPos %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens);
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
WRITE(p, " float4 Normal : TEXCOORD%d;\n", xfregs.numTexGen.numTexGens + 1);
WRITE(p, " float4 Normal %s TEXCOORD%d;\n", ApiType == API_OPENGL ? ";//" : ":", xfregs.numTexGen.numTexGens + 1);
} else {
// clip position is in w of first 4 texcoords
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
for (int i = 0; i < 8; ++i)
WRITE(p, " float4 tex%d : TEXCOORD%d;\n", i, i);
WRITE(p, " float4 tex%d %s TEXCOORD%d;\n", i, ApiType == API_OPENGL? ";//" : ":", i);
}
else
{
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
WRITE(p, " float%d tex%d : TEXCOORD%d;\n", i < 4 ? 4 : 3 , i, i);
WRITE(p, " float%d tex%d %s TEXCOORD%d;\n", i < 4 ? 4 : 3 , i, ApiType == API_OPENGL ? ";//" : ":", i);
}
}
WRITE(p, "};\n");
@ -162,7 +164,10 @@ char* GenerateVSOutputStruct(char* p, u32 components, API_TYPE api_type)
return p;
}
const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
extern const char* WriteRegister(API_TYPE ApiType, const char *prefix, const u32 num);
extern const char *WriteLocation(API_TYPE ApiType);
const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
{
setlocale(LC_NUMERIC, "C"); // Reset locale for compilation
text[sizeof(text) - 1] = 0x7C; // canary
@ -170,7 +175,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
_assert_(bpmem.genMode.numtexgens == xfregs.numTexGen.numTexGens);
_assert_(bpmem.genMode.numcolchans == xfregs.numChan.numColorChans);
bool is_d3d = (api_type & API_D3D9 || api_type == API_D3D11);
bool is_d3d = (ApiType & API_D3D9 || ApiType == API_D3D11);
u32 lightMask = 0;
if (xfregs.numChan.numColorChans > 0)
lightMask |= xfregs.color[0].GetFullLightMask() | xfregs.alpha[0].GetFullLightMask();
@ -179,32 +184,80 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
char *p = text;
WRITE(p, "//Vertex Shader: comp:%x, \n", components);
WRITE(p, "typedef struct { float4 T0, T1, T2; float4 N0, N1, N2; } s_" I_POSNORMALMATRIX";\n"
"typedef struct { float4 t; } FLT4;\n"
"typedef struct { FLT4 T[24]; } s_" I_TEXMATRICES";\n"
"typedef struct { FLT4 T[64]; } s_" I_TRANSFORMMATRICES";\n"
"typedef struct { FLT4 T[32]; } s_" I_NORMALMATRICES";\n"
"typedef struct { FLT4 T[64]; } s_" I_POSTTRANSFORMMATRICES";\n"
"typedef struct { float4 col; float4 cosatt; float4 distatt; float4 pos; float4 dir; } Light;\n"
"typedef struct { Light lights[8]; } s_" I_LIGHTS";\n"
"typedef struct { float4 C0, C1, C2, C3; } s_" I_MATERIALS";\n"
"typedef struct { float4 T0, T1, T2, T3; } s_" I_PROJECTION";\n"
);
p = GenerateVSOutputStruct(p, components, api_type);
// uniforms
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "layout(std140) uniform VSBlock {\n");
WRITE(p, "uniform s_" I_TRANSFORMMATRICES" " I_TRANSFORMMATRICES" : register(c%d);\n", C_TRANSFORMMATRICES);
WRITE(p, "uniform s_" I_TEXMATRICES" " I_TEXMATRICES" : register(c%d);\n", C_TEXMATRICES); // also using tex matrices
WRITE(p, "uniform s_" I_NORMALMATRICES" " I_NORMALMATRICES" : register(c%d);\n", C_NORMALMATRICES);
WRITE(p, "uniform s_" I_POSNORMALMATRIX" " I_POSNORMALMATRIX" : register(c%d);\n", C_POSNORMALMATRIX);
WRITE(p, "uniform s_" I_POSTTRANSFORMMATRICES" " I_POSTTRANSFORMMATRICES" : register(c%d);\n", C_POSTTRANSFORMMATRICES);
WRITE(p, "uniform s_" I_LIGHTS" " I_LIGHTS" : register(c%d);\n", C_LIGHTS);
WRITE(p, "uniform s_" I_MATERIALS" " I_MATERIALS" : register(c%d);\n", C_MATERIALS);
WRITE(p, "uniform s_" I_PROJECTION" " I_PROJECTION" : register(c%d);\n", C_PROJECTION);
WRITE(p, "uniform float4 " I_DEPTHPARAMS" : register(c%d);\n", C_DEPTHPARAMS);
WRITE(p, "%sfloat4 " I_POSNORMALMATRIX"[6] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSNORMALMATRIX));
WRITE(p, "%sfloat4 " I_PROJECTION"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PROJECTION));
WRITE(p, "%sfloat4 " I_MATERIALS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_MATERIALS));
WRITE(p, "%sfloat4 " I_LIGHTS"[40] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_LIGHTS));
WRITE(p, "%sfloat4 " I_TEXMATRICES"[24] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_TEXMATRICES)); // also using tex matrices
WRITE(p, "%sfloat4 " I_TRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType),WriteRegister(ApiType, "c", C_TRANSFORMMATRICES));
WRITE(p, "%sfloat4 " I_NORMALMATRICES"[32] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_NORMALMATRICES));
WRITE(p, "%sfloat4 " I_POSTTRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSTTRANSFORMMATRICES));
WRITE(p, "%sfloat4 " I_DEPTHPARAMS" %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_DEPTHPARAMS));
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n");
p = GenerateVSOutputStruct(p, components, ApiType);
if(ApiType == API_OPENGL)
{
WRITE(p, "ATTRIN float4 rawpos; // ATTR%d,\n", SHADER_POSITION_ATTRIB);
if (components & VB_HAS_POSMTXIDX)
WRITE(p, "ATTRIN int posmtx; // ATTR%d,\n", SHADER_POSMTX_ATTRIB);
if (components & VB_HAS_NRM0)
WRITE(p, "ATTRIN float3 rawnorm0; // ATTR%d,\n", SHADER_NORM0_ATTRIB);
if (components & VB_HAS_NRM1)
WRITE(p, "ATTRIN float3 rawnorm1; // ATTR%d,\n", SHADER_NORM1_ATTRIB);
if (components & VB_HAS_NRM2)
WRITE(p, "ATTRIN float3 rawnorm2; // ATTR%d,\n", SHADER_NORM2_ATTRIB);
if (components & VB_HAS_COL0)
WRITE(p, "ATTRIN float4 color0; // ATTR%d,\n", SHADER_COLOR0_ATTRIB);
if (components & VB_HAS_COL1)
WRITE(p, "ATTRIN float4 color1; // ATTR%d,\n", SHADER_COLOR1_ATTRIB);
for (int i = 0; i < 8; ++i) {
u32 hastexmtx = (components & (VB_HAS_TEXMTXIDX0<<i));
if ((components & (VB_HAS_UV0<<i)) || hastexmtx)
WRITE(p, "ATTRIN float%d tex%d; // ATTR%d,\n", hastexmtx ? 3 : 2, i, SHADER_TEXTURE0_ATTRIB + i);
}
// Let's set up attributes
if (xfregs.numTexGen.numTexGens < 7)
{
for (int i = 0; i < 8; ++i)
WRITE(p, "VARYOUT float3 uv%d_2;\n", i);
WRITE(p, "VARYOUT float4 clipPos_2;\n");
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
WRITE(p, "VARYOUT float4 Normal_2;\n");
}
else
{
// wpos is in w of first 4 texcoords
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
for (int i = 0; i < 8; ++i)
WRITE(p, "VARYOUT float4 uv%d_2;\n", i);
}
else
{
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
WRITE(p, "VARYOUT float%d uv%d_2;\n", i < 4 ? 4 : 3 , i);
}
}
WRITE(p, "VARYOUT float4 colors_02;\n");
WRITE(p, "VARYOUT float4 colors_12;\n");
WRITE(p, "void main()\n{\n");
}
else
{
WRITE(p, "VS_OUTPUT main(\n");
// inputs
@ -233,37 +286,32 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
}
if (components & VB_HAS_POSMTXIDX) {
if (is_d3d)
{
WRITE(p, " float4 blend_indices : BLENDINDICES,\n");
}
else
WRITE(p, " float fposmtx : ATTR%d,\n", SHADER_POSMTX_ATTRIB);
}
WRITE(p, " float4 rawpos : POSITION) {\n");
}
WRITE(p, "VS_OUTPUT o;\n");
// transforms
if (components & VB_HAS_POSMTXIDX)
{
if (api_type & API_D3D9)
if (ApiType & API_D3D9)
{
WRITE(p, "int4 indices = D3DCOLORtoUBYTE4(blend_indices);\n");
WRITE(p, "int posmtx = indices.x;\n");
}
else if (api_type == API_D3D11)
else if (ApiType == API_D3D11)
{
WRITE(p, "int posmtx = blend_indices.x * 255.0f;\n");
}
else
{
WRITE(p, "int posmtx = fposmtx;\n");
}
WRITE(p, "float4 pos = float4(dot(" I_TRANSFORMMATRICES".T[posmtx].t, rawpos), dot(" I_TRANSFORMMATRICES".T[posmtx+1].t, rawpos), dot(" I_TRANSFORMMATRICES".T[posmtx+2].t, rawpos), 1);\n");
WRITE(p, "float4 pos = float4(dot(" I_TRANSFORMMATRICES"[posmtx], rawpos), dot(" I_TRANSFORMMATRICES"[posmtx+1], rawpos), dot(" I_TRANSFORMMATRICES"[posmtx+2], rawpos), 1);\n");
if (components & VB_HAS_NRMALL) {
WRITE(p, "int normidx = posmtx >= 32 ? (posmtx-32) : posmtx;\n");
WRITE(p, "float3 N0 = " I_NORMALMATRICES".T[normidx].t.xyz, N1 = " I_NORMALMATRICES".T[normidx+1].t.xyz, N2 = " I_NORMALMATRICES".T[normidx+2].t.xyz;\n");
WRITE(p, "float3 N0 = " I_NORMALMATRICES"[normidx].xyz, N1 = " I_NORMALMATRICES"[normidx+1].xyz, N2 = " I_NORMALMATRICES"[normidx+2].xyz;\n");
}
if (components & VB_HAS_NRM0)
@ -275,13 +323,13 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
}
else
{
WRITE(p, "float4 pos = float4(dot(" I_POSNORMALMATRIX".T0, rawpos), dot(" I_POSNORMALMATRIX".T1, rawpos), dot(" I_POSNORMALMATRIX".T2, rawpos), 1.0f);\n");
WRITE(p, "float4 pos = float4(dot(" I_POSNORMALMATRIX"[0], rawpos), dot(" I_POSNORMALMATRIX"[1], rawpos), dot(" I_POSNORMALMATRIX"[2], rawpos), 1.0f);\n");
if (components & VB_HAS_NRM0)
WRITE(p, "float3 _norm0 = normalize(float3(dot(" I_POSNORMALMATRIX".N0.xyz, rawnorm0), dot(" I_POSNORMALMATRIX".N1.xyz, rawnorm0), dot(" I_POSNORMALMATRIX".N2.xyz, rawnorm0)));\n");
WRITE(p, "float3 _norm0 = normalize(float3(dot(" I_POSNORMALMATRIX"[3].xyz, rawnorm0), dot(" I_POSNORMALMATRIX"[4].xyz, rawnorm0), dot(" I_POSNORMALMATRIX"[5].xyz, rawnorm0)));\n");
if (components & VB_HAS_NRM1)
WRITE(p, "float3 _norm1 = float3(dot(" I_POSNORMALMATRIX".N0.xyz, rawnorm1), dot(" I_POSNORMALMATRIX".N1.xyz, rawnorm1), dot(" I_POSNORMALMATRIX".N2.xyz, rawnorm1));\n");
WRITE(p, "float3 _norm1 = float3(dot(" I_POSNORMALMATRIX"[3].xyz, rawnorm1), dot(" I_POSNORMALMATRIX"[4].xyz, rawnorm1), dot(" I_POSNORMALMATRIX"[5].xyz, rawnorm1));\n");
if (components & VB_HAS_NRM2)
WRITE(p, "float3 _norm2 = float3(dot(" I_POSNORMALMATRIX".N0.xyz, rawnorm2), dot(" I_POSNORMALMATRIX".N1.xyz, rawnorm2), dot(" I_POSNORMALMATRIX".N2.xyz, rawnorm2));\n");
WRITE(p, "float3 _norm2 = float3(dot(" I_POSNORMALMATRIX"[3].xyz, rawnorm2), dot(" I_POSNORMALMATRIX"[4].xyz, rawnorm2), dot(" I_POSNORMALMATRIX"[5].xyz, rawnorm2));\n");
}
if (!(components & VB_HAS_NRM0))
@ -289,7 +337,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
WRITE(p, "o.pos = float4(dot(" I_PROJECTION".T0, pos), dot(" I_PROJECTION".T1, pos), dot(" I_PROJECTION".T2, pos), dot(" I_PROJECTION".T3, pos));\n");
WRITE(p, "o.pos = float4(dot(" I_PROJECTION"[0], pos), dot(" I_PROJECTION"[1], pos), dot(" I_PROJECTION"[2], pos), dot(" I_PROJECTION"[3], pos));\n");
WRITE(p, "float4 mat, lacc;\n"
"float3 ldir, h;\n"
@ -368,7 +416,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
if (components & (VB_HAS_NRM1|VB_HAS_NRM2)) {
// transform the light dir into tangent space
WRITE(p, "ldir = normalize(" I_LIGHTS".lights[%d].pos.xyz - pos.xyz);\n", texinfo.embosslightshift);
WRITE(p, "ldir = normalize(" I_LIGHTS"[%d + 3].xyz - pos.xyz);\n", texinfo.embosslightshift);
WRITE(p, "o.tex%d.xyz = o.tex%d.xyz + float3(dot(ldir, _norm1), dot(ldir, _norm2), 0.0f);\n", i, texinfo.embosssourceshift);
}
else
@ -388,18 +436,20 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
break;
case XF_TEXGEN_REGULAR:
default:
if (components & (VB_HAS_TEXMTXIDX0<<i)) {
if (components & (VB_HAS_TEXMTXIDX0<<i))
{
WRITE(p, "int tmp = int(tex%d.z);\n", i);
if (texinfo.projection == XF_TEXPROJ_STQ)
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TRANSFORMMATRICES".T[tex%d.z].t), dot(coord, " I_TRANSFORMMATRICES".T[tex%d.z+1].t), dot(coord, " I_TRANSFORMMATRICES".T[tex%d.z+2].t));\n", i, i, i, i);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TRANSFORMMATRICES"[tmp]), dot(coord, " I_TRANSFORMMATRICES"[tmp+1]), dot(coord, " I_TRANSFORMMATRICES"[tmp+2]));\n", i);
else {
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TRANSFORMMATRICES".T[tex%d.z].t), dot(coord, " I_TRANSFORMMATRICES".T[tex%d.z+1].t), 1);\n", i, i, i);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TRANSFORMMATRICES"[tmp]), dot(coord, " I_TRANSFORMMATRICES"[tmp+1]), 1);\n", i);
}
}
else {
if (texinfo.projection == XF_TEXPROJ_STQ)
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TEXMATRICES".T[%d].t), dot(coord, " I_TEXMATRICES".T[%d].t), dot(coord, " I_TEXMATRICES".T[%d].t));\n", i, 3*i, 3*i+1, 3*i+2);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TEXMATRICES"[%d]), dot(coord, " I_TEXMATRICES"[%d]), dot(coord, " I_TEXMATRICES"[%d]));\n", i, 3*i, 3*i+1, 3*i+2);
else
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TEXMATRICES".T[%d].t), dot(coord, " I_TEXMATRICES".T[%d].t), 1);\n", i, 3*i, 3*i+1);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TEXMATRICES"[%d]), dot(coord, " I_TEXMATRICES"[%d]), 1);\n", i, 3*i, 3*i+1);
}
break;
}
@ -408,9 +458,9 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
const PostMtxInfo& postInfo = xfregs.postMtxInfo[i];
int postidx = postInfo.index;
WRITE(p, "float4 P0 = " I_POSTTRANSFORMMATRICES".T[%d].t;\n"
"float4 P1 = " I_POSTTRANSFORMMATRICES".T[%d].t;\n"
"float4 P2 = " I_POSTTRANSFORMMATRICES".T[%d].t;\n",
WRITE(p, "float4 P0 = " I_POSTTRANSFORMMATRICES"[%d];\n"
"float4 P1 = " I_POSTTRANSFORMMATRICES"[%d];\n"
"float4 P2 = " I_POSTTRANSFORMMATRICES"[%d];\n",
postidx&0x3f, (postidx+1)&0x3f, (postidx+2)&0x3f);
if (texGenSpecialCase) {
@ -494,15 +544,49 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
//seems to get rather complicated
}
if (api_type & API_D3D9)
if (ApiType & API_D3D9)
{
// D3D9 is addressing pixel centers instead of pixel boundaries in clip space.
// Thus we need to offset the final position by half a pixel
WRITE(p, "o.pos = o.pos + float4(" I_DEPTHPARAMS".z, " I_DEPTHPARAMS".w, 0.f, 0.f);\n");
}
WRITE(p, "return o;\n}\n");
if(ApiType == API_OPENGL)
{
// Bit ugly here
// TODO: Make pretty
// Will look better when we bind uniforms in GLSL 1.3
// clipPos/w needs to be done in pixel shader, not here
if (xfregs.numTexGen.numTexGens < 7) {
for (unsigned int i = 0; i < 8; ++i)
if(i < xfregs.numTexGen.numTexGens)
WRITE(p, " uv%d_2.xyz = o.tex%d;\n", i, i);
else
WRITE(p, " uv%d_2.xyz = float3(0.0f, 0.0f, 0.0f);\n", i);
WRITE(p, " clipPos_2 = o.clipPos;\n");
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
WRITE(p, " Normal_2 = o.Normal;\n");
} else {
// clip position is in w of first 4 texcoords
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
for (int i = 0; i < 8; ++i)
WRITE(p, " uv%d_2 = o.tex%d;\n", i, i);
}
else
{
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
WRITE(p, " uv%d_2%s = o.tex%d;\n", i, i < 4 ? ".xyzw" : ".xyz" , i);
}
}
WRITE(p, "colors_02 = o.colors_0;\n");
WRITE(p, "colors_12 = o.colors_1;\n");
WRITE(p, "gl_Position = o.pos;\n");
WRITE(p, "}\n");
}
else
WRITE(p, "return o;\n}\n");
if (text[sizeof(text) - 1] != 0x7C)
PanicAlert("VertexShader generator - buffer too small, canary has been eaten!");

View File

@ -21,9 +21,24 @@
#include "XFMemory.h"
#include "VideoCommon.h"
// TODO should be reordered
#define SHADER_POSITION_ATTRIB 0
#define SHADER_POSMTX_ATTRIB 1
#define SHADER_NORM1_ATTRIB 6
#define SHADER_NORM2_ATTRIB 7
#define SHADER_NORM0_ATTRIB 2
#define SHADER_NORM1_ATTRIB 3
#define SHADER_NORM2_ATTRIB 4
#define SHADER_COLOR0_ATTRIB 5
#define SHADER_COLOR1_ATTRIB 6
#define SHADER_TEXTURE0_ATTRIB 8
#define SHADER_TEXTURE1_ATTRIB 9
#define SHADER_TEXTURE2_ATTRIB 10
#define SHADER_TEXTURE3_ATTRIB 11
#define SHADER_TEXTURE4_ATTRIB 12
#define SHADER_TEXTURE5_ATTRIB 13
#define SHADER_TEXTURE6_ATTRIB 14
#define SHADER_TEXTURE7_ATTRIB 15
// shader variables
@ -46,8 +61,17 @@
#define C_NORMALMATRICES (C_TRANSFORMMATRICES + 64)
#define C_POSTTRANSFORMMATRICES (C_NORMALMATRICES + 32)
#define C_DEPTHPARAMS (C_POSTTRANSFORMMATRICES + 64)
#define C_VENVCONST_END (C_DEPTHPARAMS + 4)
#define C_VENVCONST_END (C_DEPTHPARAMS + 1)
const s_svar VSVar_Loc[] = { {I_POSNORMALMATRIX, C_POSNORMALMATRIX, 6 },
{I_PROJECTION , C_PROJECTION, 4 },
{I_MATERIALS, C_MATERIALS, 4 },
{I_LIGHTS, C_LIGHTS, 40 },
{I_TEXMATRICES, C_TEXMATRICES, 24 },
{I_TRANSFORMMATRICES , C_TRANSFORMMATRICES, 64 },
{I_NORMALMATRICES , C_NORMALMATRICES, 32 },
{I_POSTTRANSFORMMATRICES, C_POSTTRANSFORMMATRICES, 64 },
{I_DEPTHPARAMS, C_DEPTHPARAMS, 1 },
};
template<bool safe>
class _VERTEXSHADERUID
{

View File

@ -194,6 +194,8 @@ void VertexShaderManager::Dirty()
// TODO: A cleaner way to control the matricies without making a mess in the parameters field
void VertexShaderManager::SetConstants()
{
if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO)
Dirty();
if (nTransformMatricesChanged[0] >= 0)
{
int startn = nTransformMatricesChanged[0] / 4;

View File

@ -102,8 +102,7 @@ typedef enum
API_D3D9_SM20 = 4,
API_D3D9 = 6,
API_D3D11 = 8,
API_GLSL = 16,
API_NONE = 32
API_NONE = 16
} API_TYPE;
inline u32 RGBA8ToRGBA6ToRGBA8(u32 src)
@ -149,5 +148,11 @@ inline unsigned int GetPow2(unsigned int val)
++ret;
return ret;
}
struct s_svar
{
const char *name;
const unsigned int reg;
const unsigned int size;
};
#endif // _VIDEOCOMMON_H

View File

@ -76,6 +76,7 @@ void VideoConfig::Load(const char *ini_file)
iniFile.Get("Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation, 200);
iniFile.Get("Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle, 0);
iniFile.Get("Settings", "EnablePixelLighting", &bEnablePixelLighting, 0);
iniFile.Get("Settings", "HackedBufferUpload", &bHackedBufferUpload, 0);
iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
iniFile.Get("Settings", "EFBScale", &iEFBScale, 2); // native
@ -134,6 +135,7 @@ void VideoConfig::GameIniLoad(const char *ini_file)
iniFile.GetIfExists("Video_Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation);
iniFile.GetIfExists("Video_Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle);
iniFile.GetIfExists("Video_Settings", "EnablePixelLighting", &bEnablePixelLighting);
iniFile.GetIfExists("Video_Settings", "HackedBufferUpload", &bHackedBufferUpload);
iniFile.GetIfExists("Video_Settings", "MSAA", &iMultisampleMode);
iniFile.GetIfExists("Video_Settings", "EFBScale", &iEFBScale); // integral
iniFile.GetIfExists("Video_Settings", "DstAlphaPass", &bDstAlphaPass);
@ -172,6 +174,7 @@ void VideoConfig::VerifyValidity()
if (!backend_info.bSupports3DVision) b3DVision = false;
if (!backend_info.bSupportsFormatReinterpretation) bEFBEmulateFormatChanges = false;
if (!backend_info.bSupportsPixelLighting) bEnablePixelLighting = false;
if (backend_info.APIType != API_OPENGL) backend_info.bSupportsGLSLUBO = false;
}
void VideoConfig::Save(const char *ini_file)
@ -202,7 +205,7 @@ void VideoConfig::Save(const char *ini_file)
iniFile.Set("Settings", "AnaglyphStereoSeparation", iAnaglyphStereoSeparation);
iniFile.Set("Settings", "AnaglyphFocalAngle", iAnaglyphFocalAngle);
iniFile.Set("Settings", "EnablePixelLighting", bEnablePixelLighting);
iniFile.Set("Settings", "HackedBufferUpload", bHackedBufferUpload);
iniFile.Set("Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
iniFile.Set("Settings", "MSAA", iMultisampleMode);

View File

@ -133,6 +133,7 @@ struct VideoConfig
bool bZTPSpeedHack; // The Legend of Zelda: Twilight Princess
bool bUseBBox;
bool bEnablePixelLighting;
bool bHackedBufferUpload;
int iLog; // CONF_ bits
int iSaveTargetId; // TODO: Should be dropped
@ -162,6 +163,12 @@ struct VideoConfig
bool bSupportsDualSourceBlend; // only supported by D3D11 and OpenGL
bool bSupportsFormatReinterpretation;
bool bSupportsPixelLighting;
bool bSupportsGLSLUBO;
bool bSupportsGLSLCache;
bool bSupportsGLPinnedMemory;
bool bSupportsGLSync;
bool bSupportsGLBaseVertex;
} backend_info;
// Utility

View File

@ -208,6 +208,8 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
void XFBSource::CopyEFB(float Gamma)
{
g_renderer->ResetAPIState(); // reset any game specific settings
// Copy EFB data to XFB and restore render target again
const D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)texWidth, (float)texHeight);
@ -222,6 +224,8 @@ void XFBSource::CopyEFB(float Gamma)
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(),
FramebufferManager::GetEFBDepthTexture()->GetDSV());
g_renderer->RestoreAPIState();
}
} // namespace DX11

Some files were not shown because too many files have changed in this diff Show More