summaryrefslogtreecommitdiff
path: root/shaders/dolphin/format_changes.1.shader_test
blob: 2b09fd9d1ad10bc28baa543ceb6898a36e45f2d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[require]
GLSL >= 1.30

[vertex shader]
#version 130
#extension GL_ARB_uniform_buffer_object : enable

#extension GL_ARB_shading_language_420pack : enable


#define ATTRIN in
#define ATTROUT out
#define VARYIN centroid in
#define VARYOUT centroid out
#define float2 vec2
#define float3 vec3
#define float4 vec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define frac fract
#define lerp mix

void main(void) {
	vec2 rawpos = vec2(gl_VertexID&1, gl_VertexID&2);
	gl_Position = vec4(rawpos*2.0-1.0, 0.0, 1.0);
}

[fragment shader]
#version 130
#extension GL_ARB_uniform_buffer_object : enable

#extension GL_ARB_shading_language_420pack : enable


#define ATTRIN in
#define ATTROUT out
#define VARYIN centroid in
#define VARYOUT centroid out
#define float2 vec2
#define float3 vec3
#define float4 vec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define frac fract
#define lerp mix

uniform sampler2D samp9;
out vec4 ocol0;
void main()
{
	ivec4 src6 = ivec4(round(texelFetch(samp9, ivec2(gl_FragCoord.xy), 0) * 63.f));
	ivec4 dst8;
	dst8.r = (src6.r << 2) | (src6.g >> 4);
	dst8.g = ((src6.g & 0xF) << 4) | (src6.b >> 2);
	dst8.b = ((src6.b & 0x3) << 6) | src6.a;
	dst8.a = 255;
	ocol0 = float4(dst8) / 255.f;
}