Geometry 5

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5

#version 320 es

#define CITRA_GLES
#if defined(GL_ANDROID_extension_pack_es31a)
#extension GL_ANDROID_extension_pack_es31a : enable
#endif // defined(GL_ANDROID_extension_pack_es31a)
#if defined(GL_EXT_clip_cull_distance)
#extension GL_EXT_clip_cull_distance : enable
#endif // defined(GL_EXT_clip_cull_distance)

#define mul_s(x, y) (x * y)
#define fma_s(x, y, z) fma(x, y, z)
#define dot_s(x, y) dot(x, y)
#define dot_3(x, y) dot(x, y)

#define rcp_s(x) (1.0 / x)


#define rsq_s(x) inversesqrt(x)

#define min_s(x, y) min(x, y)


#define max_s(x, y) max(x, y)
layout(points) in;
layout(triangle_strip, max_vertices=30) out;
layout(location=0) uniform vec4 clip_coef;

layout(binding=3, std140) uniform gs_config {


bool b[16];
uvec4 i[4];
vec4 f[96];
}gs_pica;
bool ExecGS();
layout(location=0) in vec4 vs_out_reg0[];
layout(location=1) in vec4 vs_out_reg1[];
layout(location=2) in vec4 vs_out_reg2[];
layout(location=3) in vec4 vs_out_reg3[];
layout(location=4) in vec4 vs_out_reg4[];
layout(location=5) in vec4 vs_out_reg5[];
layout(location=6) in vec4 vs_out_reg6[];
layout(location=7) in vec4 vs_out_reg7[];
vec4 gs_out_reg[3][3];
vec4 vtx_regs[3] = vec4[3](vec4(1),vec4(1),vec4(1));
layout(location=0) out vec4 primary_color;
layout(location=1) out vec4 texcoord0;
layout(location=2) out vec4 texcoord12;
layout(location=3) out vec4 normquat;
layout(location=4) out vec4 view;
vec4 GetQuaternion(int idx) {
return vec4(1,1,1,1);
}
bool IsOpposite(vec4 qa, vec4 qb) {
return (dot(qa, qb) < 0.0);
}
void EmitVtx(int idx, bool opposite) {
vec4 vtx_pos = vec4(gs_out_reg[idx][0].x,gs_out_reg[idx][0].y,gs_out_reg[idx]
[0].z,gs_out_reg[idx][0].w);
gl_Position = vtx_pos;
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
gl_ClipDistance[0] = -vtx_pos.z;
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
#endif
vec4 vtx_quat = GetQuaternion(idx);
normquat = mix(vtx_quat, -vtx_quat, bvec4(opposite));
vec4 vtx_color = vec4(gs_out_reg[idx][1].x,gs_out_reg[idx][1].y,gs_out_reg[idx]
[1].z, gs_out_reg[idx][1].w);
primary_color = clamp(vtx_color,vec4(0),vec4(1));
texcoord0 = vec4(gs_out_reg[idx][2].x,gs_out_reg[idx][2].y,1,1);
texcoord12 = vec4(1,1,1,1);
view = vec4(1,1,1,1);
EmitVertex();
}
void EmitPrim(int idx0, int idx1, int idx2) {
EmitVtx(idx0, false);
EmitVtx(idx1, IsOpposite(GetQuaternion(idx0), GetQuaternion(idx1)));
EmitVtx(idx2, IsOpposite(GetQuaternion(idx0), GetQuaternion(idx2)));
EndPrimitive();
}

int vtx_idx = 0;
bool prim_emit = false;
bool winding = false;
void SetEmit(int i, bool p, bool w) {
vtx_idx = i;
prim_emit = p;
winding = w;
}
void Emit() {
gs_out_attr[vtx_idx] = vtx_regs;
if (prim_emit) {
if (winding) {
EmitPrim(1,0,2);
winding = false;
} else {
EmitPrim(0,1,2);
}
}
}
void main() {
ExecGS();
}
bvec2 bool_regs = bvec2(false);
ivec3 addr_regs = ivec3(0);
bool Gfn0();
bool Gfn3();
bool Gfn11();
vec4 tmp_reg0;
vec4 tmp_reg1;
vec4 tmp_reg2;
vec4 tmp_reg3;
vec4 tmp_reg5;
vec4 tmp_reg6;
vec4 tmp_reg7;
vec4 tmp_reg11;
vec4 tmp_reg12;
vec4 tmp_reg13;
vec4 tmp_reg14;
vec4 tmp_reg15;
bool ExecGS() {tmp_reg0 = vec4(0, 0, 0, 1);
tmp_reg1 = vec4(0, 0, 0, 1);
tmp_reg2 = vec4(0, 0, 0, 1);
tmp_reg3 = vec4(0, 0, 0, 1);
tmp_reg5 = vec4(0, 0, 0, 1);
tmp_reg6 = vec4(0, 0, 0, 1);
tmp_reg7 = vec4(0, 0, 0, 1);
tmp_reg11 = vec4(0, 0, 0, 1);
tmp_reg12 = vec4(0, 0, 0, 1);
tmp_reg13 = vec4(0, 0, 0, 1);
tmp_reg14 = vec4(0, 0, 0, 1);
tmp_reg15 = vec4(0, 0, 0, 1);
Gfn0();
return true;
}

bool Gfn0() {
uint jmp_to = 60u;
while (true) {
switch (jmp_to) {
case 60u:
bool_regs = lessThan(gs_pica.f[82].zz, vs_out_reg3[0].ww);
if (bool_regs.x) {
jmp_to = 130u; break;
}
tmp_reg1.xy = (tmp_reg15.xxxx).xy;
bool_regs = lessThan(gs_pica.f[81].xx, tmp_reg1.xy);
if (bool_regs.x) {
tmp_reg0 = vs_out_reg3[0].xyzz;
tmp_reg0.w = (gs_pica.f[81].xxxx).w;
tmp_reg0 = mul_s(tmp_reg0, vs_out_reg4[0].wwww);
} else {
tmp_reg0.xyz = (vs_out_reg4[0].xyzz).xyz;
tmp_reg1.xyz = (vs_out_reg3[0].xyzz).xyz;
tmp_reg2.xyz = (mul_s(tmp_reg0.yzxx, tmp_reg1.zxyy)).xyz;
tmp_reg2.xyz = (fma_s(-tmp_reg1.yzxx, tmp_reg0.zxyy, tmp_reg2)).xyz;
tmp_reg2.w = (gs_pica.f[81].xxxx).w;
tmp_reg0.x = dot_s(tmp_reg2, tmp_reg2);
tmp_reg0.x = rsq_s(tmp_reg0.x);
tmp_reg0 = mul_s(tmp_reg2, tmp_reg0.xxxx);
tmp_reg0.xyz = (mul_s(tmp_reg0.xyzz, vs_out_reg4[0].wwww)).xyz;
tmp_reg7.x = (vs_out_reg5[0].zzzz).x;
tmp_reg7.y = (vs_out_reg6[0].zzzz).y;
tmp_reg7.z = (vs_out_reg7[0].zzzz).z;
tmp_reg7.xyz = (mul_s(tmp_reg7.xyzz, tmp_reg15.zzzz)).xyz;
}
bool_regs.x = gs_pica.f[81].xxxx.x == tmp_reg15.wwww.x;
bool_regs.y = gs_pica.f[81].xxxx.y != tmp_reg15.wwww.y;
if (bool_regs.x) {
jmp_to = 97u; break;
}
bool_regs = equal(gs_pica.f[81].zw, tmp_reg15.ww);
if (bool_regs.x) {
jmp_to = 108u; break;
}
if (bool_regs.y) {
jmp_to = 119u; break;
}
tmp_reg6.xyz = (tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].xyyy).xy;
SetEmit(0, true, false);
Emit();
tmp_reg6.xyz = (-tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].zwww).xy;
SetEmit(1, true, true);
Emit();
tmp_reg15.w = (gs_pica.f[81].zzzz).w;
return true;
case 97u:
tmp_reg6.xyz = (tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].xyyy).xy;
SetEmit(0, false, false);
Emit();
tmp_reg6.xyz = (-tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].zwww).xy;
SetEmit(1, false, false);
Emit();
Gfn11();
return true;
case 108u:
tmp_reg6.xyz = (tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].xyyy).xy;
SetEmit(2, true, false);
Emit();
tmp_reg6.xyz = (-tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].zwww).xy;
SetEmit(0, true, true);
Emit();
Gfn11();
return true;
case 119u:
tmp_reg6.xyz = (tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].xyyy).xy;
SetEmit(1, true, false);
Emit();
tmp_reg6.xyz = (-tmp_reg0.xyzz).xyz;
Gfn3();
vtx_regs[2].xy = (vs_out_reg2[0].zwww).xy;
SetEmit(2, true, true);
Emit();
Gfn11();
return true;
case 130u:
tmp_reg11 = vs_out_reg4[0];
tmp_reg12 = vs_out_reg5[0];
tmp_reg13 = vs_out_reg6[0];
tmp_reg14 = vs_out_reg7[0];
tmp_reg15.w = (gs_pica.f[81].xxxx).w;
tmp_reg15.z = (vs_out_reg0[0].wwww).z;
tmp_reg15.x = (vs_out_reg3[0].zzzz).x;
return true;
default: return false;
}
}
return false;
}
bool Gfn3() {
tmp_reg1.xy = (tmp_reg15.xxxx).xy;
bool_regs = lessThan(gs_pica.f[81].xx, tmp_reg1.xy);
if (bool_regs.x) {
tmp_reg5.xyz = (vs_out_reg0[0].xyzz + tmp_reg6.xyzz).xyz;
tmp_reg5.w = (gs_pica.f[81].zzzz).w;
vtx_regs[0].x = dot_s(tmp_reg5, tmp_reg11);
vtx_regs[0].y = dot_s(tmp_reg5, tmp_reg12);
vtx_regs[0].z = dot_s(tmp_reg5, tmp_reg13);
vtx_regs[0].w = dot_s(tmp_reg5, tmp_reg14);
} else {
tmp_reg5.xyz = (vs_out_reg0[0].xyzz + tmp_reg6.xyzz).xyz;
tmp_reg5.w = (gs_pica.f[81].zzzz).w;
vtx_regs[0].x = dot_s(tmp_reg5, tmp_reg11);
vtx_regs[0].y = dot_s(tmp_reg5, tmp_reg12);
tmp_reg1.w = dot_s(tmp_reg5, tmp_reg14);
tmp_reg2.xyz = (tmp_reg7.xyzz + tmp_reg5.xyzz).xyz;
tmp_reg2.w = (gs_pica.f[81].zzzz).w;
tmp_reg3.w = dot_s(tmp_reg2, tmp_reg14);
tmp_reg3.z = dot_s(tmp_reg2, -tmp_reg13);
tmp_reg3.z = (mul_s(tmp_reg1.wwww, tmp_reg3.zzzz)).z;
tmp_reg2 = vec4(rcp_s(tmp_reg3.w));
vtx_regs[0].z = (mul_s(tmp_reg3.zzzz, tmp_reg2.zzzz)).z;
vtx_regs[0].w = (tmp_reg1.wwww).w;
}
vtx_regs[1] = vs_out_reg1[0];
return false;
}
bool Gfn11() {
tmp_reg15.w = (gs_pica.f[81].zzzz + tmp_reg15.wwww).w;
return false;
}

ERROR: 0:83: 'gs_out_attr' : undeclared identifier


ERROR: 0:83: 'expression' : left of '[' is not of type array, matrix, or vector
ERROR: 0:83: 'assign' : cannot convert from 'array of 4-component vector of float'
to 'float'
ERROR: 3 compilation errors. No code generated.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy