From 815c75c6a8dbc0e69553cc1d1a76b1fc70728a27 Mon Sep 17 00:00:00 2001 From: Adriano Bini Date: Mon, 29 Jan 2024 17:08:27 -0300 Subject: [PATCH 1/4] Add port-net/netplay build links to default README Some people are not being able to properly download/play because of Github's always defaulting to master's README.MD. This includes netplay links in the master branchg README as well. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d54b38e18..6636217c6 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,9 @@ though you might have to install some additional libraries. Latest [automatic builds](https://github.com/fgsfdsfgs/perfect_dark/actions) for supported platforms: * [i686-windows](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port/pd-i686-windows.zip) +* [i686-windows (port-net/netplay)](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port-net/pd-i686-windows.zip) * [i686-linux](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port/pd-i686-linux.zip) +* [i686-linux (port-net/netplay)](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port-net/pd-i686-linux.zip) ## Running From 36f8494ebfac04ccbf04ee7a8e7c89e0e600d2dc Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 29 Jan 2024 22:11:34 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6636217c6..3451264ff 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,9 @@ though you might have to install some additional libraries. Latest [automatic builds](https://github.com/fgsfdsfgs/perfect_dark/actions) for supported platforms: * [i686-windows](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port/pd-i686-windows.zip) -* [i686-windows (port-net/netplay)](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port-net/pd-i686-windows.zip) * [i686-linux](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port/pd-i686-linux.zip) -* [i686-linux (port-net/netplay)](https://nightly.link/fgsfdsfgs/perfect_dark/workflows/c-cpp/port-net/pd-i686-linux.zip) + +If you are looking for netplay builds (the `port-net` branch), see [this link](https://github.com/fgsfdsfgs/perfect_dark/blob/port-net/README.md#download). ## Running From 935cd1faa9ab428f5e50dbe9090d06c32922ede8 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sat, 10 Feb 2024 14:07:20 +0100 Subject: [PATCH 3/4] port: gl: dump shader source when compilation fails --- port/fast3d/gfx_opengl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/port/fast3d/gfx_opengl.cpp b/port/fast3d/gfx_opengl.cpp index 44c420e10..f8569a370 100644 --- a/port/fast3d/gfx_opengl.cpp +++ b/port/fast3d/gfx_opengl.cpp @@ -586,6 +586,7 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad glGetShaderiv(vertex_shader, GL_INFO_LOG_LENGTH, &max_length); char error_log[1024]; glGetShaderInfoLog(vertex_shader, max_length, &max_length, &error_log[0]); + sysLogPrintf(LOG_ERROR, "Failed to compile this vertex shader (ID %llx, %x):\n%s", shader_id0, shader_id1, vs_buf); sysFatalError("Vertex shader compilation failed:\n%s", error_log); } @@ -598,6 +599,7 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad glGetShaderiv(fragment_shader, GL_INFO_LOG_LENGTH, &max_length); char error_log[1024]; glGetShaderInfoLog(fragment_shader, max_length, &max_length, &error_log[0]); + sysLogPrintf(LOG_ERROR, "Failed to compile this fragment shader (ID %llx, %x):\n%s", shader_id0, shader_id1, fs_buf); sysFatalError("Fragment shader compilation failed:\n%s", error_log); } From fe0d9b3cfdd7acf3e7bfc615d4277f8ddd633c20 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sat, 10 Feb 2024 16:56:54 +0100 Subject: [PATCH 4/4] port: fix blur shader on some older cards --- port/fast3d/gfx_opengl.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/port/fast3d/gfx_opengl.cpp b/port/fast3d/gfx_opengl.cpp index f8569a370..86efd96bc 100644 --- a/port/fast3d/gfx_opengl.cpp +++ b/port/fast3d/gfx_opengl.cpp @@ -397,19 +397,14 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad if (cc_features.opt_blur) { // blur filter, used for menu backgrounds // used to be two for loops from 0 to 4, but apparently intel drivers crashed trying to unroll it + // used to have a const weight array, but apparently drivers for the GT620 don't like const array initializers append_line(fs_buf, &fs_len, R"( - const lowp float blurWeights[16] = float[16]( - 0.009947, 0.009641, 0.008778, 0.007509, - 0.009641, 0.009345, 0.008508, 0.007278, - 0.008778, 0.008508, 0.007747, 0.006626, - 0.007509, 0.007278, 0.006626, 0.005668 - ); lowp vec4 hookTexture2D(in sampler2D t, in vec2 uv, in vec2 tsize) { lowp vec4 cw = vec4(0.0); for (int i = 0; i < 16; ++i) { vec2 xy = vec2(float(i & 3), float(i >> 2)); - vec2 ofs = (vec2(-1.5) + xy) / tsize; - cw += vec4(texture2D(t, uv + ofs).rgb * blurWeights[i], blurWeights[i]); + lowp float w = 0.009947 - length(xy) * 0.001; + cw += vec4(texture2D(t, uv + (vec2(-1.5) + xy) / tsize).rgb * w, w); } return vec4(cw.rgb / cw.a, 1.0); })"