Skip to content

Commit

Permalink
Merge pull request #2357 from FunkinCrew/bugfix/shader-crash-freeplay
Browse files Browse the repository at this point in the history
Fix an AMD shader crash on Freeplay.
  • Loading branch information
ninjamuffin99 authored May 15, 2024
2 parents 5e70d9f + d4f113d commit 37fc849
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/funkin/graphics/shaders/StrokeShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ class StrokeShader extends FlxShader

void main()
{
vec4 sample = flixel_texture2D(bitmap, openfl_TextureCoordv);
if (sample.a == 0.) {
vec4 gay = flixel_texture2D(bitmap, openfl_TextureCoordv);
if (gay.a == 0.) {
float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y;

if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.)
sample = color;
gay = color;
}
gl_FragColor = sample;
gl_FragColor = gay;
}
')
public function new(color:FlxColor = 0xFFFFFFFF, width:Float = 1, height:Float = 1)
Expand Down

0 comments on commit 37fc849

Please sign in to comment.