[Mesa-dev] Bug introduced with Mesa 18.0.0: Star Trek Voyager Elite Force shadow glitches

Roland Scheidegger sroland at vmware.com
Tue Sep 18 20:13:17 UTC 2018


Am 18.09.2018 um 20:04 schrieb Federico Dossena:
> The problem is caused by this commit:
> [3d81e11b49366b5636b8524ba0f8c7076e3fdf34] mesa: remove unnecessary
> 'sort by year' for the GL extensions
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcgit.freedesktop.org%2Fmesa%2Fmesa%2Fcommit%2F%3Fh%3D18.0%26id%3D3d81e11b49366b5636b8524ba0f8c7076e3fdf34&data=02%7C01%7Csroland%40vmware.com%7Ca86739b7f85143fa9e3708d61d913462%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728906827282422&sdata=ogY7oxl%2F5HI388Pi7mAbrj7cPb6DKEm7JGo%2Bu9s7HbA%3D&reserved=0>
> 
> I guess the game can't find some extension because of this change.
Ahh yes I suppose that would make sense. id tech 3 is famous for bugs
with long extension strings, albeit usually it was a crash. But maybe
this version there doesn't actually overflow but only considers the
first few kB of the string or something along these lines.
In this case setting MESA_EXTENSION_MAX_YEAR=2002 or so should help (I'm
not sure what extension it would be missing, EXT_stencil_wrap would come
to mind, which is listed as 2002 albeit the extension is actually 1999
so might have been just available for this game - quake 3 however
doesn't use it (it really only uses very few extensions), but not sure
about the engine differences for this game, although at least quake3
should have printed out if an extension is available or not for all it
could potentially use).
There's no automatic detection of any of the affected apps by mesa by
the looks of it.

Roland


> 
> 
> On 2018-09-18 18:37, Roland Scheidegger wrote:
>> Am 18.09.2018 um 18:14 schrieb Federico Dossena:
>>> Upon further investigation, renaming the game to quake3.exe somehow
>>> forces it to load the system opengl32.dll instead of gallium, so that's
>>> why it worked. I should have checked that.
>>>
>>> As I said in my previous email, I have tested every single version of
>>> Mesa (since 13.0.5 to be exact), and the problem is only present after
>>> version 18.0.0, all subsequent versions are affected, including the
>>> current master.
>> Ah sorry I missed that I thought you didn't test versions later than 18.0.
>>
>>
>>> The glitch must have been introduced when version 18 was in development
>>> and it doesn't affect 17.3.x, that narrows it down to a few hundred
>>> commits I guess. I will try to do a bisect to find the exact commit that
>>> caused the issue but that's going to take a while since I have to test
>>> manually. I'll keep you informed.
>> Thanks for doing the testing!
>>
>> Roland
>>
>>> On 2018-09-18 17:40, Roland Scheidegger wrote:
>>>> Am 18.09.2018 um 17:09 schrieb Federico Dossena:
>>>>> Weapon fire doesn't generate shadows in this game, just a light.
>>>>>
>>>>> cg_shadow is set to 3.  Other values don't seem to change anything
>>>>> except for 2 making the game sluggish.
>>>>> r_stencilbits is already set to 8.
>>>>> r_dynamiclights is set to 1; setting it to 0 obviously fixes the issue
>>>>> but it's not a solution, you're just disabling dynamic lights.
>>>>>
>>>>>  From what I can tell, the glitch affects only the surfaces that are
>>>>> affected by dynamic lighting, and it looks like the lighting is
>>>>> "multiplied" by the dynamic light that's supposed to be added to that
>>>>> surface? Does that make any sense? This affects all dynamic lights in
>>>>> the game, not just weapons.
>>>>>
>>>>> It also looks like Mesa already has some workaround for this, because if
>>>>> i rename the game to quake3.exe, it looks correct. Maybe you could add
>>>>> stvoy.exe and stvoyHM.exe to that list.
>>>> I don't see quake3.exe in the list of workarounds, so this seems very
>>>> very odd.
>>>>
>>>>
>>>>> Is there some way I can help you figure out the problem? Do you want a
>>>>> trace?
>>>> Could you try with a newer version?
>>>> Otherwise if you could do a git bisect that would help, a trace would be
>>>> nice if someone has time to look into it (but I won't have, while I try
>>>> to look into llvmpipe bugs that doesn't really extend to things which
>>>> are likely app issues).
>>>>
>>>> Roland
>>>>
>>>>
>>>>> On 2018-09-18 16:55, Roland Scheidegger wrote:
>>>>>> I don't see any shadows at all with the 17.3.7 video?
>>>>>> Whereas the 18.0.0 one look quite bogus to me, but I think shadows are
>>>>>> known to be glitchy with id tech 3?
>>>>>> It should be possible to tweak shadows via cg_shadow (0-3),
>>>>>> r_stencilbits 8 might be necessary for some modes, r_dynamiclights 0
>>>>>> might also switch them off, if it works the same as with quake 3...
>>>>>>
>>>>>> Roland
>>>>>>
>>>>>>
>>>>>> Am 17.09.2018 um 18:55 schrieb Federico Dossena:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm using Mesa (specifically Gallium on LLVMPipe) to run an old game
>>>>>>> called Star Trek Voyager Elite Force.
>>>>>>>
>>>>>>> I'd like to report a bug introduced with version 18.0.0 and still
>>>>>>> present in Mesa master that completely breaks the shadows in this
>>>>>>> game.
>>>>>>>
>>>>>>> I don't know how Mesa works internally so I'll just attach 2 videos:
>>>>>>>
>>>>>>>     * Mesa 17.3.7: shadows work normally:
>>>>>>>     
>>>>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D1UOD4NqEuL12FrZfvukkP5r83dyjTd3E2&data=02%7C01%7Csroland%40vmware.com%7Cf74d51879018487d372b08d61d81dc3f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728840918657206&sdata=z6h8%2B%2F7elDbM3MIeE2x8uaAP94vT0ieepeLIaaAsbdY%3D&reserved=0
>>>>>>>
>>>>>>>
>>>>>>>     
>>>>>>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D1UOD4NqEuL12FrZfvukkP5r83dyjTd3E2&data=02%7C01%7Csroland%40vmware.com%7Cf74d51879018487d372b08d61d81dc3f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728840918657206&sdata=z6h8%2B%2F7elDbM3MIeE2x8uaAP94vT0ieepeLIaaAsbdY%3D&reserved=0>
>>>>>>>
>>>>>>>
>>>>>>>     * Mesa 18.0.0 and newer: shadows are broken:
>>>>>>>     
>>>>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D10cYYciVfLD3fCHpoOrp4cRTGj_GTuh2j&data=02%7C01%7Csroland%40vmware.com%7Cf74d51879018487d372b08d61d81dc3f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728840918657206&sdata=z00%2BLDTFxD5EYmkXEfdxZsvzaqBusMVsnivEmqIO5%2Fs%3D&reserved=0
>>>>>>>
>>>>>>>
>>>>>>>     
>>>>>>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D10cYYciVfLD3fCHpoOrp4cRTGj_GTuh2j&data=02%7C01%7Csroland%40vmware.com%7Cf74d51879018487d372b08d61d81dc3f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728840918657206&sdata=z00%2BLDTFxD5EYmkXEfdxZsvzaqBusMVsnivEmqIO5%2Fs%3D&reserved=0>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The game uses the id3 engine so I assume other games are also
>>>>>>> affected,
>>>>>>> although I haven't tested it.
>>>>>>>
>>>>>>> For what it's worth, the proprietary AMD drivers have the same bug.
>>>>>>>
>>>>>>> If you need the game for testing, please let me know.
>>>>>>> A demo is also available here:
>>>>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fileplanet.com%2F46986%2F40000%2Ffileinfo%2FStar-Trek%3A-Voyager---Elite-Force-Demo&data=02%7C01%7Csroland%40vmware.com%7Cf74d51879018487d372b08d61d81dc3f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728840918657206&sdata=IA6ED%2Ftub%2F3oFDRrDrlnNUg4MLf3Xqj%2BE700pozoK7A%3D&reserved=0
>>>>>>>
>>>>>>>
>>>>>>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fileplanet.com%2F46986%2F40000%2Ffileinfo%2FStar-Trek%3A-Voyager---Elite-Force-Demo&data=02%7C01%7Csroland%40vmware.com%7Cf74d51879018487d372b08d61d81dc3f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728840918657206&sdata=IA6ED%2Ftub%2F3oFDRrDrlnNUg4MLf3Xqj%2BE700pozoK7A%3D&reserved=0>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> mesa-dev mailing list
>>>>>>> mesa-dev at lists.freedesktop.org
>>>>>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-dev&data=02%7C01%7Csroland%40vmware.com%7Cf74d51879018487d372b08d61d81dc3f%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636728840918657206&sdata=rrbXOi58EfuanxSU1QLapKy6Ck16QE66O4wf%2B9FF7ZY%3D&reserved=0
>>>>>>>
>>>>>>>
>>>>>>>
> 



More information about the mesa-dev mailing list