Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Veyrdite opened this issue Nov 11, 2014 · 6 comments
Open

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

Veyrdite opened this issue Nov 11, 2014 · 6 comments

Comments

@Veyrdite
Copy link

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 Veyrdite changed the title Shaders don't work with open-source Radeon drivers (r600) TGSI shaders do not work with open-source Radeon drivers (r600) Nov 11, 2014
@Veyrdite Veyrdite changed the title TGSI shaders do not work with open-source Radeon drivers (r600) Shaders do not work with open-source Radeon drivers (r600) Nov 11, 2014
@Veyrdite
Copy link
Author

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

@cnlohr
Copy link
Owner

cnlohr commented Dec 11, 2014

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.

@Veyrdite
Copy link
Author

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?

@cnlohr
Copy link
Owner

cnlohr commented Dec 29, 2014

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.

@Veyrdite
Copy link
Author

Veyrdite commented Jan 8, 2015

References for when I have more of a stab at this:
pioneerspacesim/pioneer#2176
pioneerspacesim/pioneer#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()

@impaktor
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants