[Mesa-dev] MESA and KOTOR

Miklós Máté mtmkls at gmail.com
Fri Oct 13 23:30:27 UTC 2017


Hello!

I'm sorry for being late to the party.

The patch you linked did land in mesa: 
https://cgit.freedesktop.org/mesa/mesa/commit/?id=baab345b192d207236253ce67b320fb32fa67625 
However, that area of the code has since been altered a lot.

Back then I made sure that KOTOR ran perfectly with Wine+Mesa on Linux, 
and it's still the case (thanks Marek for maintaining my code!). The 
only hardware driver I can test it with is radeonsi though. With 
llvmpipe the game runs, but it has limitations: the post-process effects 
have to be turned off or it dies with X error (BadMatch for X_PutImage), 
texture effects are ugly due to insufficient precision, and it's 
horribly slow (around 2fps on my Phenom II x4).

Federico, if the game runs well on your system with llvmpipe when the 
post-process effects are disabled, I recommend that you leave it that 
way. Framebuffer effects and soft shadows look cool, but they are 
resource hogs, and even if you managed to fix them the performance would 
be quite bad. Even on radeonsi they halve the fps.

I hope my $0.02 was useful.

MM

On 27/09/17 10:31, Federico Dossena wrote:
> Yes his work was on radeonsi, but the patch that he says fixes the 
> crash with framebuffer effects and soft shadows was in the state 
> tracker. Link: https://patchwork.freedesktop.org/patch/68298/
>
> The patch never made it to master, and the files touched seem to have 
> changed a lot since he made this patch, so it does not apply. I tried 
> to make some changes myself but I don't really know what I'm doing 
> here to be honest.
>
> Do you know what I could do to get the same behaviour?
>
> Thanks
>
>
> On 2017-09-27 10:25, Marek Olšák wrote:
>> Pbuffers are problematic because it's an ancient feature that nobody
>> cares about anymore.
>>
>> I think Miklos made KOTOR work on radeonsi or r600.
>>
>> Marek
>>
>> On Mon, Sep 25, 2017 at 6:50 PM, Federico Dossena 
>> <dossenus91 at gmail.com> wrote:
>>> Hello everyone,
>>> you may remember that a few months ago I was trying to fix KOTOR to 
>>> work
>>> with Mesa to use the Gallium llvmpipe software renderer.
>>>
>>> Well, it's been a while and I'm happy to see that things are a bit 
>>> better
>>> with Mesa 17.2. The game still crashes, but we're closer to fixing it.
>>>
>>> Here's what I found using 17.2.1:
>>> With frame buffer effects and soft shadows the game crashes at the 
>>> end of
>>> loading; the crash is inside a function that amongst other things, 
>>> generates
>>> mipmaps for a texture used in a pbuffer (function at offset 2FB37D 
>>> in my
>>> exe).
>>> The crash happens when gluBuild2DMipmaps is called, however doesn't 
>>> seem to
>>> be a null pointer like it was back in march: it's an access violation
>>> alright but no longer a null pointer. So I think it's a different, 
>>> hopefully
>>> simpler, problem.
>>>
>>> Back in march, Miklòs Màté suggested that changing the checks for 
>>> the pixel
>>> format could fix the problem, and he was right; without those checks we
>>> definitely got a step closer to fixing it.
>>>
>>> My first thought was to just NOP the entire section that generates 
>>> mipmaps
>>> and a bit of code later that uses it. The game no longer crashes, 
>>> however it
>>> displays nothing, but I can hear it running in background. So this 
>>> is the
>>> last issue! We're almost there!
>>>
>>> Now, I'm bothering you again because I think that at this point it's 
>>> just a
>>> problem with the texture format used there. The call to 
>>> gluBuild2DMipmaps
>>> uses LuminanceAlpha' as texture format as well as internal format 
>>> (0x190a).
>>> I tried changing it to RGB and RGBA just to try something, but that 
>>> didn't
>>> work because I guess the texture was already generated with another 
>>> format.
>>>
>>> What could I do to investigate this further? And where should I look 
>>> inside
>>> Mesa if I wanted to say... force a specific texture format for 
>>> pbuffers?
>>>
>>> I feel that we're very close to fixing this. Your help would mean 
>>> the world
>>> to me and the whole KOTOR community.
>>>
>>> Thank you ;)
>>>
>>> P.S.
>>> This has nothing to do with mesa, but you should know that KOTOR is 
>>> slowly
>>> dieing. It is currently unplayable on Intel and AMD graphics, and 
>>> recent
>>> nVidia driver updates have introduced a glitch with transparencies 
>>> (it can
>>> be fixed, but still, no one can play KOTOR on modern hardware 
>>> properly and
>>> we have to keep old computers as dedicated "shrines" for KOTOR, 
>>> that's why I
>>> insist so much on Mesa)
>>>
>>>
>>> _______________________________________________
>>> mesa-dev mailing list
>>> mesa-dev at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list