On 16 June 2015 at 22:45, Matteo Bruni mbruni@codeweavers.com wrote:
get_fog_start_end(context, state, &start, &end);
- scale = 1.0f / (end - start);
- scale = end == start ? INFINITY : 1.0f / (end - start);
Do we really need this? It almost feels nicer to just pass "end - start" to the shader and handle the division there, or perhaps even just pass "start".
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-06-17 um 11:36 schrieb Henri Verbeet:
Do we really need this? It almost feels nicer to just pass "end - start" to the shader and handle the division there, or perhaps even just pass "start".
I like the idea of calculating this once per draw rather than once per fragment. I did notice a performance difference when I wrote ba61730daa6a614ef07128a69a0bbca819e716b4, although it was only visible in a test application I wrote for World of Tanks performance, not in a real world game.
I think Matteo's patch comment should be put inside the code to explain why the explicit check and INFINITE are there.
2015-06-17 11:57 GMT+02:00 Stefan Dösinger stefandoesinger@gmail.com:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-06-17 um 11:36 schrieb Henri Verbeet:
Do we really need this? It almost feels nicer to just pass "end - start" to the shader and handle the division there, or perhaps even just pass "start".
I like the idea of calculating this once per draw rather than once per fragment. I did notice a performance difference when I wrote ba61730daa6a614ef07128a69a0bbca819e716b4, although it was only visible in a test application I wrote for World of Tanks performance, not in a real world game.
Yeah, that was the reasoning for passing scale instead of start to the shader (actually I used start in my initial implementation of the fog emulation).
I think Matteo's patch comment should be put inside the code to explain why the explicit check and INFINITE are there.
That's a good idea.
I don't know of any specific application requiring this right now. I guess I can defer resending the patch in any form until (and if) we get any indication that this is a problem.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-06-17 um 15:35 schrieb Matteo Bruni:
I don't know of any specific application requiring this right now. I guess I can defer resending the patch in any form until (and if) we get any indication that this is a problem.
The game in question is called Risk of Rain. The bug applies to any game made with Game Maker from YoYo Games. Unfortunately that problem was never reported to us, it was reported to Nvidia and I got the information from them.
Note that there's a demo of the game that is not affected by the problem. It seems an update to the game later introduced the issue.