bsnes-emu / bsnes

bsnes is a Super Nintendo (SNES) emulator focused on performance, features, and ease of use.
Other
1.64k stars 154 forks source link

Clarify license of FXAA shader #266

Open Splendide-Imaginarius opened 1 year ago

Splendide-Imaginarius commented 1 year ago

This file seems to contain an All Rights Reserved license from Nvidia: https://github.com/bsnes-emu/bsnes/blob/c0c60c83a84a49d4a2b822a0491cb258a3c5b98a/shaders/xBRZ.shader/fxaa.fs

If that's the only license it's under, it's not clear to me how it's compliant with the GPLv3+ license of the rest of the project. If it is under a GPLv3-compatible license, can this status be clarified?

LukeUsher commented 1 year ago

GPLv3 requires that all code compiled and linked against the bsnes binary to be under a compatibile license, however, shader programs are neither compiled into, or linked against the bsnes binary.

Shader programs read by bsnes in the source code form and are compiled by the graphics pipeline/drivers of the operating system (in this case, the OpenGL stack), and uploaded to the GPU as a binary blob; they are stand-alone programs and do not contain any object code that is called by bsnes itself, and as such, are never linked into the bsnes binary in any shape or form; it is not indifferent from launching an external executable.

As a resut, it is my understanding that these shaders are not bound by the overall license of bsnes.

LukeUsher commented 1 year ago

Further to this, it would appear that it was intended for FXAA3 to be Public Domain, which would be compatible with the GPL license of bsnes

See https://stackoverflow.com/questions/12170575/using-nvidia-fxaa-in-my-code-whats-the-licensing-model/12170857#12170857 , specifically, this tweet:

image

Screwtapello commented 1 year ago

It'd be really nice to find an actual copy of the FXAA shader with either a "public domain" or (as another part of that Stack Overflow page suggests) a BSD-based licence comment.

So far as I can tell, Timothy Lottes has nuked his Twitter (where he gave that answer) and his blog (where he released the code) and NVIDIA have very carefully broken all the external links to their SDK and example code documentation. The only sources for "the FXAA shader" I've been able to find have all included the "All Rights Reserved" text.

Splendide-Imaginarius commented 1 year ago

@LukeUsher Thanks for clarifying that. I think I agree with you that externally loaded shaders probably are not covered by the GPLv3 constraints on combined works (though that doesn't solve the non-legal issue of having a non-free dependency, which is undesirable for an open-source project). I wasn't aware of the informal public domain declaration for that code. While the informal declaration might not be good enough for corporate lawyers to be satisfied, I am not a lawyer -- I'm just interested in practical issues, and from a practical standpoint, that public domain statement is good enough for me.

If the copy of that file in this repo could be amended to include a comment summarizing the fact that it's believed to be public-domain code, and linking to that tweet screenshot and Stack Overflow answer (perhaps with the tweet transcribed in the comment so that it's not dependent on an external link), I would consider this issue to be solved (though maybe the bsnes team has stricter standards than I do).

@Screwtapello The linked Stack Overflow page seems to suggest that newer versions of NVIDIA SDK's have an explicit license, which by eye looks to me like it's GPL-compatible. If the newer SDK's are still available, would it make sense to replace the file in this repo with the newer version from NVIDIA, both to avoid legal ambiguity and to benefit from whatever improvements the newer version might have?

Splendide-Imaginarius commented 1 year ago

I did some digging on GitHub and this looks like a mirror of the relevant NVIDIA code: https://github.com/hyzboy/NVIDIAGameWorks-GraphicsSamples/tree/a2d86e0c7017d17018070a69a8fa09b3c19951f0/samples/es3-kepler/FXAA/assets/shaders

The version of the code there does seem to have a BSD-style license by eye. Maybe that code could be used as a replacement for the ambiguous code?