123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
#version 150
#extension GL_ARB_shader_image_load_store : enable
#extension GL_ARB_shading_language_420pack : enable
#extension GL_ARB_sample_shading : enable
#define SAMPLER_BINDING(x) layout(binding = x)
#extension GL_ARB_shader_storage_buffer_object : enable
#extension GL_ARB_gpu_shader5 : enable
#define float2 vec2
#define float3 vec3
#define float4 vec4
#define uint2 uvec2
#define uint3 uvec3
#define uint4 uvec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define frac fract
#define lerp mix
layout(points, invocations = 1) in;
layout(triangle_strip, max_vertices = 4) out;
struct Light {
int4 color;
float4 cosatt;
float4 distatt;
float4 pos;
float4 dir;
};
layout(std140, binding = 3) uniform GSBlock {
float4 cstereo;
float4 clinept;
int4 ctexoffset;
};
struct VS_OUTPUT {
float4 pos;
float4 colors_0;
float4 colors_1;
float3 tex0;
float4 clipPos;
};
#define InstanceID gl_InvocationID
in VertexData {
centroid float4 pos;
centroid float4 colors_0;
centroid float4 colors_1;
centroid float3 tex0;
centroid float4 clipPos;
} vs[1];
out VertexData {
centroid float4 pos;
centroid float4 colors_0;
centroid float4 colors_1;
centroid float3 tex0;
centroid float4 clipPos;
} ps;
void main()
{
VS_OUTPUT center;
center.pos = vs[0].pos;
center.colors_0 = vs[0].colors_0;
center.colors_1 = vs[0].colors_1;
center.tex0 = vs[0].tex0;
center.clipPos = vs[0].clipPos;
float2 offset = float2(clinept.w / clinept.x, -clinept.w / clinept.y) * center.pos.w;
for (int i = 0; i < 1; ++i) {
VS_OUTPUT f;
f.pos = vs[i].pos;
f.colors_0 = vs[i].colors_0;
f.colors_1 = vs[i].colors_1;
f.tex0 = vs[i].tex0;
f.clipPos = vs[i].clipPos;
VS_OUTPUT ll = f;
VS_OUTPUT lr = f;
VS_OUTPUT ul = f;
VS_OUTPUT ur = f;
ll.pos.xy += float2(-1,-1) * offset;
lr.pos.xy += float2(1,-1) * offset;
ul.pos.xy += float2(-1,1) * offset;
ur.pos.xy += offset;
if (ctexoffset[3] != 0) {
float2 texOffset = float2(1.0 / float(ctexoffset[3]), 1.0 / float(ctexoffset[3]));
if (((ctexoffset[1] >> 0) & 0x1) != 0) {
ll.tex0.xy += float2(0,1) * texOffset;
lr.tex0.xy += texOffset;
ur.tex0.xy += float2(1,0) * texOffset;
}
if (((ctexoffset[1] >> 1) & 0x1) != 0) {
ll.tex1.xy += float2(0,1) * texOffset;
lr.tex1.xy += texOffset;
ur.tex1.xy += float2(1,0) * texOffset;
}
if (((ctexoffset[1] >> 2) & 0x1) != 0) {
ll.tex2.xy += float2(0,1) * texOffset;
lr.tex2.xy += texOffset;
ur.tex2.xy += float2(1,0) * texOffset;
}
if (((ctexoffset[1] >> 3) & 0x1) != 0) {
ll.tex3.xy += float2(0,1) * texOffset;
lr.tex3.xy += texOffset;
ur.tex3.xy += float2(1,0) * texOffset;
}
if (((ctexoffset[1] >> 4) & 0x1) != 0) {
ll.tex4.xy += float2(0,1) * texOffset;
lr.tex4.xy += texOffset;
ur.tex4.xy += float2(1,0) * texOffset;
}
if (((ctexoffset[1] >> 5) & 0x1) != 0) {
ll.tex5.xy += float2(0,1) * texOffset;
lr.tex5.xy += texOffset;
ur.tex5.xy += float2(1,0) * texOffset;
}
}
gl_Position = ll.pos;
ps.pos = ll.pos;
ps.colors_0 = ll.colors_0;
ps.colors_1 = ll.colors_1;
ps.tex0 = ll.tex0;
ps.clipPos = ll.clipPos;
EmitVertex();
gl_Position = lr.pos;
ps.pos = lr.pos;
ps.colors_0 = lr.colors_0;
ps.colors_1 = lr.colors_1;
ps.tex0 = lr.tex0;
ps.clipPos = lr.clipPos;
EmitVertex();
gl_Position = ul.pos;
ps.pos = ul.pos;
ps.colors_0 = ul.colors_0;
ps.colors_1 = ul.colors_1;
ps.tex0 = ul.tex0;
ps.clipPos = ul.clipPos;
EmitVertex();
gl_Position = ur.pos;
ps.pos = ur.pos;
ps.colors_0 = ur.colors_0;
ps.colors_1 = ur.colors_1;
ps.tex0 = ur.tex0;
ps.clipPos = ur.clipPos;
EmitVertex();
}
EndPrimitive();
}
0(96) : error C1009: "tex1" is not member of struct "VS_OUTPUT"
0(97) : error C1009: "tex1" is not member of struct "VS_OUTPUT"
0(98) : error C1009: "tex1" is not member of struct "VS_OUTPUT"
0(101) : error C1009: "tex2" is not member of struct "VS_OUTPUT"
0(102) : error C1009: "tex2" is not member of struct "VS_OUTPUT"
0(103) : error C1009: "tex2" is not member of struct "VS_OUTPUT"
0(106) : error C1009: "tex3" is not member of struct "VS_OUTPUT"
0(107) : error C1009: "tex3" is not member of struct "VS_OUTPUT"
0(108) : error C1009: "tex3" is not member of struct "VS_OUTPUT"
0(111) : error C1009: "tex4" is not member of struct "VS_OUTPUT"
0(112) : error C1009: "tex4" is not member of struct "VS_OUTPUT"
0(113) : error C1009: "tex4" is not member of struct "VS_OUTPUT"
0(116) : error C1009: "tex5" is not member of struct "VS_OUTPUT"
0(117) : error C1009: "tex5" is not member of struct "VS_OUTPUT"
0(118) : error C1009: "tex5" is not member of struct "VS_OUTPUT"