Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on May 6, 2015 at 02:40 AM

Section 1 (Text)

#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


//Pixel Shader for TEV stages
//1 TEV stages, 6 texgens, 118 IND stages
int idot(int3 x, int3 y)
{
	int3 tmp = x * y;
	return tmp.x + tmp.y + tmp.z;
}
int idot(int4 x, int4 y)
{
	int4 tmp = x * y;
	return tmp.x + tmp.y + tmp.z + tmp.w;
}

int  iround(float  x) { return int (round(x)); }
int2 iround(float2 x) { return int2(round(x)); }
int3 iround(float3 x) { return int3(round(x)); }
int4 iround(float4 x) { return int4(round(x)); }

int  itrunc(float  x) { return int (trunc(x)); }
int2 itrunc(float2 x) { return int2(trunc(x)); }
int3 itrunc(float3 x) { return int3(trunc(x)); }
int4 itrunc(float4 x) { return int4(trunc(x)); }

SAMPLER_BINDING(0) uniform sampler2DArray samp0;
SAMPLER_BINDING(1) uniform sampler2DArray samp1;
SAMPLER_BINDING(2) uniform sampler2DArray samp2;
SAMPLER_BINDING(3) uniform sampler2DArray samp3;
SAMPLER_BINDING(4) uniform sampler2DArray samp4;
SAMPLER_BINDING(5) uniform sampler2DArray samp5;
SAMPLER_BINDING(6) uniform sampler2DArray samp6;
SAMPLER_BINDING(7) uniform sampler2DArray samp7;

layout(std140, binding = 1) uniform PSBlock {
	int4 color[4];
	int4 k[4];
	int4 alphaRef;
	float4 texdim[8];
	int4 czbias[2];
	int4 cindscale[2];
	int4 cindmtx[6];
	int4 cfogcolor;
	int4 cfogi;
	float4 cfogf[2];
	float4 czslope;
	float4 cefbscale;
};
layout(std140, binding = 3) buffer BBox {
	int4 bbox_data;
};
struct VS_OUTPUT {
	float4 pos;
	float4 colors_0;
	float4 colors_1;
	float3 tex0;
	float4 clipPos;
};
layout(early_fragment_tests) in;
out vec4 ocol0;
in VertexData {
	centroid float4 pos;
	centroid float4 colors_0;
	centroid float4 colors_1;
	centroid float3 tex0;
	centroid float4 clipPos;
};
void main()
{
	float3 uv0 = tex0;
	float3 uv1 = tex1;
	float3 uv2 = tex2;
	float3 uv3 = tex3;
	float3 uv4 = tex4;
	float3 uv5 = tex5;
	float4 rawpos = gl_FragCoord;
	int4 c0 = color[1], c1 = color[2], c2 = color[3], prev = color[0];
	int4 rastemp = int4(0, 0, 0, 0), textemp = int4(0, 0, 0, 0), konsttemp = int4(0, 0, 0, 0);
	int3 comp16 = int3(1, 256, 0), comp24 = int3(1, 256, 256*256);
	int alphabump=0;
	int3 tevcoord=int3(0, 0, 0);
	int2 wrappedcoord=int2(0,0), tempcoord=int2(0,0);
	int4 tevin_a=int4(0,0,0,0),tevin_b=int4(0,0,0,0),tevin_c=int4(0,0,0,0),tevin_d=int4(0,0,0,0);

	float4 col0 = colors_0;
	float4 col1 = colors_1;
	int2 fixpoint_uv0 = itrunc(uv0.xy * texdim[0].zw * 128.0);
	int2 fixpoint_uv1 = itrunc((uv1.z == 0.0 ? uv1.xy : uv1.xy / uv1.z) * texdim[1].zw * 128.0);
	int2 fixpoint_uv2 = itrunc((uv2.z == 0.0 ? uv2.xy : uv2.xy / uv2.z) * texdim[2].zw * 128.0);
	int2 fixpoint_uv3 = itrunc((uv3.z == 0.0 ? uv3.xy : uv3.xy / uv3.z) * texdim[3].zw * 128.0);
	int2 fixpoint_uv4 = itrunc((uv4.z == 0.0 ? uv4.xy : uv4.xy / uv4.z) * texdim[4].zw * 128.0);
	int2 fixpoint_uv5 = itrunc((uv5.z == 0.0 ? uv5.xy : uv5.xy / uv5.z) * texdim[5].zw * 128.0);

	// TEV stage 0
	rastemp = iround(col0 * 255.0).rgba;
	tevcoord.xy = fixpoint_uv0;
	textemp = iround(255.0 * texture(samp0, float3((float2(tevcoord.xy)/128.0).xy * texdim[0].xy, 0.0))).rgba;
	tevin_a = int4(int3(0,0,0), 0)&255;
	tevin_b = int4(textemp.rgb, textemp.a)&255;
	tevin_c = int4(rastemp.rgb, rastemp.a)&255;
	tevin_d = int4(int3(0,0,0), 0);
	// color combine
	prev.rgb = clamp((((tevin_d.rgb)) + (((((tevin_a.rgb<<8) + (tevin_b.rgb-tevin_a.rgb)*(tevin_c.rgb+(tevin_c.rgb>>7)))) + 128)>>8)), int3(0,0,0), int3(255,255,255));
	// alpha combine
	prev.a = clamp((((tevin_d.a)) + (((((tevin_a.a<<8) + (tevin_b.a-tevin_a.a)*(tevin_c.a+(tevin_c.a>>7)))) + 128)>>8)), 0, 255);
	prev = prev & 255;
	if(!( (prev.a >  alphaRef.r) && (true))) {
		ocol0 = float4(0.0, 0.0, 0.0, 0.0);
		discard;
		return;
	}
	int zCoord = iround(rawpos.z * float(0xFFFFFF));
	ocol0 = float4(prev) / 255.0;
}
0(96) : error C1008: undefined variable "tex1"
0(97) : error C1008: undefined variable "tex2"
0(98) : error C1008: undefined variable "tex3"
0(99) : error C1008: undefined variable "tex4"
0(100) : error C1008: undefined variable "tex5"