Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zelda link between worlds. Game crashed when i used fire rod #907

Open
qret opened this issue Feb 25, 2024 · 0 comments
Open

zelda link between worlds. Game crashed when i used fire rod #907

qret opened this issue Feb 25, 2024 · 0 comments

Comments

@qret
Copy link

qret commented Feb 25, 2024

#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)
#extension GL_EXT_shader_framebuffer_fetch : enable
#define FragColor color

precision highp int;
precision highp float;
precision highp uimage2D;
precision highp usampler2D;
precision highp samplerBuffer;
layout(location=0) in vec4 primary_color;
layout(location=1) in vec4 texcoord0;
layout(location=2) in vec4 texcoord12;
layout(location=3) in vec4 normquat;
layout(location=4) in vec4 view;
out vec4 color;
layout(binding=0) uniform sampler2D tex0;
layout(binding=1) uniform sampler2D tex1;
layout(binding=2) uniform sampler2D tex2;
layout(binding=3) uniform samplerBuffer tex_lut_lf;
layout(binding=4) uniform samplerBuffer tex_lut_rg;
layout(binding=5) uniform samplerBuffer tex_lut_rgba;

layout(binding=0, std140) uniform shader_data {
int scissor_x1;
int scissor_y1;
int scissor_x2;
int scissor_y2;
int fog_lut_offset;
int proctex_lut_offset;
int proctex_diff_lut_offset;
int proctex_noise_lut_offset;
int proctex_color_map_offset;
int proctex_alpha_map_offset;
float alphatest_ref;
float depth_scale;
float depth_offset;
float shadow_bias_constant;
float shadow_bias_linear;
float proctex_bias;
vec3 fog_color;
vec3 tex_lod_bias;
vec2 proctex_noise_f;
vec2 proctex_noise_a;
vec2 proctex_noise_p;
vec4 blend_color;
vec4 tev_combiner_color;
vec4 const_color[6];
};

float ByteRound(float x) {
return round(x * 255.0) * (1.0 / 255.0);
}
vec3 ByteRound(vec3 x) {
return round(x * 255.0) * (1.0 / 255.0);
}
vec4 ByteRound(vec4 x) {
return round(x * 255.0) * (1.0 / 255.0);
}
float GetLod(vec2 coord) {
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
return log2(max(d.x, d.y));
}

void main() {
vec4 rounded_primary_color = ByteRound(primary_color);
vec4 primary_fragment_color = vec4(0);
vec4 secondary_fragment_color = vec4(0);
if (gl_FragCoord.x < float(scissor_x1) || gl_FragCoord.y < float(scissor_y1) || gl_FragCoord.x >= float(scissor_x2) || gl_FragCoord.y >= float(scissor_y2)) discard;
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
float depth = z_over_w * depth_scale + depth_offset;
vec4 texcolor0 = textureLod(tex0, texcoord0.xy, GetLod(texcoord0.xy * vec2(textureSize(tex0, 0))) + tex_lod_bias[0]);
vec4 texcolor1 = textureLod(tex1, texcoord12.xy, GetLod(texcoord12.xy * vec2(textureSize(tex1, 0))) + tex_lod_bias[1]);
vec4 texcolor2 = textureLod(tex2, texcoord12.zw, GetLod(texcoord12.zw * vec2(textureSize(tex2, 0))) + tex_lod_bias[2]);
vec4 combiner_buffer = vec4(0);
vec4 next_combiner_buffer = tev_combiner_color;
vec4 last_tev_out = rounded_primary_color;
vec3 color_output_0 = ByteRound(clamp((texcolor0.rgb) - (texcolor1.rgb), vec3(0), vec3(1)));
float alpha_output_0 = ByteRound(clamp((texcolor0.r) + (texcolor1.r) - 0.5, 0.0, 1.0));
last_tev_out = vec4(color_output_0 * 2.0, alpha_output_0 * 1.0);
last_tev_out = clamp(last_tev_out, vec4(0), vec4(1));
combiner_buffer = next_combiner_buffer;
vec3 color_output_1 = ByteRound(clamp((last_tev_out.rgb) * (texcolor1.rgb), vec3(0), vec3(1)));
float alpha_output_1 = ByteRound(clamp((last_tev_out.a) * (texcolor0.r), 0.0, 1.0));
last_tev_out = vec4(color_output_1 * 2.0, alpha_output_1 * 4.0);
last_tev_out = clamp(last_tev_out, vec4(0), vec4(1));
vec3 color_output_2 = ByteRound(clamp((const_color[2].rgb) * (texcolor2.aaa) + (last_tev_out.rgb), vec3(0), vec3(1)));
float alpha_output_2 = ByteRound(clamp((last_tev_out.a) * (texcolor2.r), 0.0, 1.0));
last_tev_out = vec4(color_output_2, alpha_output_2);
last_tev_out = clamp(last_tev_out, vec4(0), vec4(1));
vec3 color_output_3 = ByteRound(clamp((const_color[3].rgb) * (last_tev_out.rgb) + (combiner_buffer.rgb) * (vec3(1) - (last_tev_out.rgb)), vec3(0), vec3(1)));
float alpha_output_3 = ByteRound(clamp((last_tev_out.a) * (rounded_primary_color.a), 0.0, 1.0));
last_tev_out = vec4(color_output_3 * 2.0, alpha_output_3 * 4.0);
last_tev_out = clamp(last_tev_out, vec4(0), vec4(1));
vec3 color_output_4 = ByteRound(clamp((last_tev_out.rgb) + (texcolor0.rgb) - vec3(0.5), vec3(0), vec3(1)));
float alpha_output_4 = ByteRound(clamp((last_tev_out.a) * (const_color[4].a), 0.0, 1.0));
last_tev_out = vec4(color_output_4, alpha_output_4);
last_tev_out = clamp(last_tev_out, vec4(0), vec4(1));
vec3 color_output_5 = ByteRound(clamp((last_tev_out.rgb) + (last_tev_out.rgb) - vec3(0.5), vec3(0), vec3(1)));
float alpha_output_5 = (last_tev_out.a);
last_tev_out = vec4(color_output_5 * 1.0, alpha_output_5 * 4.0);
last_tev_out = clamp(last_tev_out, vec4(0), vec4(1));
gl_FragDepth = depth;
last_tev_out = ByteRound(last_tev_out);
vec4 src_color = last_tev_out;
vec4 dst_color = FragColor;
last_tev_out.a = min(src_color.a * vec4(1f - dst_color.a).a, dst_color.a * vec4(0).a);
color = last_tev_out;
}

ERROR: 0:113: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'const int' and a right operand of type 'float' (or there is no acceptable conversion)
ERROR: 1 compilation errors. No code generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant