noeuclid icon indicating copy to clipboard operation
noeuclid copied to clipboard

Shaders do not work with open-source Radeon drivers (r600)

Open Veyrdite opened this issue 10 years ago • 6 comments

Terrain is not rendered properly, but HUD text is. Moving the mouse and entering commands (movement, noclip, etc) does not change the view in the slightest, but it very subtly appears that I'm falling. noeuclid

Console log spams this message:

EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:758 r600_shader_select - Failed to build shader variant (type=1) -1

Apparently r600_shader.c does not support TGSI (unrelated project, might not be true):

Edit: Looking at the latest source code for the R600 Gallium drivers, it looks like TGSI_OPCODE_RET is simply not supported (r600_shader.c).. Not supported by mesa or not supported by the hardware, I'm not sure which.. I'd guess this is a mesa bug if this game has a shader that needs it.

Is it possible to convert those GLSL shaders to ARB? If so, I think that might be something to try.

Workaround

Force software rendering (completely unplayable, ~1FPS): $ export LIBGL_ALWAYS_SOFTWARE=1 $ ./noeuclid

Hardware & Software

mesa 10.3.3-1 Radeon Radeon HD 6790 (Barts LE) Linux 3.17.2-1-ARCH #1 SMP PREEMPT x86_64 (graphics drivers tied to kernel version)

EDIT: Small changes in problem after I updated my system. Originally the game was completely black except for the HUD text.

Veyrdite avatar Nov 11 '14 02:11 Veyrdite

Looking at r600_state_common.c:

    r = r600_shader_from_tgsi(rctx, shader, key);
    if (r) {
        R600_ERR("translation from TGSI failed !\n");
        goto error;
    }

r600_shader_from_tgsi() is a 700 line monster :D

Veyrdite avatar Nov 11 '14 09:11 Veyrdite

o.o;; I have no idea what's going on there, but, we are doing some crazy things and I would wager that it's a good bit out of the open source driver's league.

cnlohr avatar Dec 11 '14 05:12 cnlohr

takes offence at your classicism of drivers :P

Radeon has improved a lot of the last few years and ATI now pays devs to work on it. Would it be possible to report a bug upstream to mesa for this?

Veyrdite avatar Dec 15 '14 01:12 Veyrdite

You absolutely can. Though the shader is so complicated it's likely going to be difficult for them to diagnose the exact problem. Perhaps you could take to editing the various .vert and .frag's to see if you can get it to work.

cnlohr avatar Dec 29 '14 00:12 cnlohr

References for when I have more of a stab at this: https://github.com/pioneerspacesim/pioneer/issues/2176 https://github.com/pioneerspacesim/pioneer/pull/2439 ftp://ftp.freedesktop.org/pub/mesa/10.4.1/ Mesa-10.4.1/src/gallium/drivers/r600/r600_shader.c -> r600_shader_from_tgsi()

Veyrdite avatar Jan 08 '15 13:01 Veyrdite

I found my way here through the links in the previous post, to the pioneer issue 2176, whcih we now understand better: https://github.com/pioneerspacesim/pioneer/pull/3721, if it helps.

impaktor avatar Jun 20 '16 19:06 impaktor