Created attachment 116421 [details]
I tried this project: https://github.com/highfidelity/hifi
Build instructions aren't so clear, but once you have all dependencies (with the oculus rift sdk I believe), building&running should work with simply:
cmake /path/to/hifi; make; ./interface/interface
Anyway, with mesa git on intel ivy bridge it segfaults in mesa, see attached gdb.txt.
With radeonsi (with PRIME) it doesn't segfault. It still has the "Error: [Context] Unable to obtain x11 visual from context" problem, but that's a different one that comes from the oculus rift SDK I think.
Short discussion in IRC with not much results a few days ago:
Would it be possible to get apitrace dump of the application?
Created attachment 116423 [details]
Hm. More or less.
apitrace doesn't seem to like that much.
The program seems to segfault even if I revert 222e5b8 which changes glGetAttribLocation implementation. This makes it painful to know if my fix for this bug works correctly :/
Program received signal SIGSEGV, Segmentation fault.
0x00000000004c03a4 in retrace_glGetAttribLocation(trace::Call&) ()
This is a strange bug, the ir_variable in question seems to have NULL as it's name, I need to dig out if this is a valid condition, code currently assumes that everything has at least some name.
I think what happens is that during linking we add resource but only later on this resource gets deleted by the backend (decides it is not used/active). This is a bit strange pattern, typically unused variables get dropped already early. Will investigate what should be done here.
OK, now I know what is going on. This is actually major issue with the current implementation. Like said in comment #4, we are creating ProgramResourceList too early. Backend driver will still do optimization and is still able to remove dead code, thus removing variables that are in the resource list.
The solution is to move resource list creation up in the linking to happen only after backend LinkShader hook and remove symbol table usage from the list creation (symbol table usage was just optimization instead of iterating whole IR to find variables).
Ah fortunately it seems dead code removal works just fine after all! It's just me building the list using a symbol table that still contains removed variables. I will change the list creation to not use symbol table.
(In reply to Tapani Pälli from comment #6)
> Ah fortunately it seems dead code removal works just fine after all! It's
> just me building the list using a symbol table that still contains removed
> variables. I will change the list creation to not use symbol table.
correction, I will change list creation to not use symbol table + move the program resource list creation to happen after backend LinkShader hook.
fixed in master
Can confirm, High Fidelity works fine now. Thanks a lot.
Please leave a comment noting the commit that fixed it.
Author: Tapani Pälli <email@example.com>
Date: Mon Jun 29 15:23:45 2015 +0300
glsl: create program resource list after LinkShader
Resource list can be created properly only after LinkShader hook
has been called to make sure all dead variables have been removed.
Signed-off-by: Tapani Pälli <firstname.lastname@example.org>
Reviewed-by: Martin Peres <email@example.com>
I have been bisecting dEQP regressions for 10.6. It appears that several 10.6 dEQP regressions are fixed by the commit that fixes this bug.
Tapani, is it possible to backport this fix to 10.6?
(In reply to Mark Janes from comment #12)
> I have been bisecting dEQP regressions for 10.6. It appears that several
> 10.6 dEQP regressions are fixed by the commit that fixes this bug.
> Tapani, is it possible to backport this fix to 10.6?
Sure, will do.