Merge pull request #550 from FunkinCrew/sanitized/bugfix/shader-crash-freeplay

Fix a shader crash on Freeplay on some AMD cards.
This commit is contained in:
Cameron Taylor 2024-05-08 23:21:52 -04:00 committed by GitHub
commit 9730ef4280
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,8 +40,8 @@ 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;
@ -49,9 +49,9 @@ class StrokeShader extends FlxShader
|| 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)