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

Black screen when using Mesa drivers (?) #14

Closed
wahn opened this issue Dec 4, 2018 · 14 comments
Closed

Black screen when using Mesa drivers (?) #14

wahn opened this issue Dec 4, 2018 · 14 comments
Labels
Area: Graphics Issues related to graphics/rendering. Type: Bug Problems with the code/documentation that need to be fixed.

Comments

@wahn
Copy link

wahn commented Dec 4, 2018

After installing the -lSDL2 dependency:

apt-get install libsdl2-dev

I can compile and run the examples (on Debian), but they all render black without error messages:

$ uname -a
Linux purism 4.15.0-2-amd64 #1 SMP Debian 4.15.11-1 (2018-03-20) x86_64 GNU/Linux
$ cargo run --example hello_world
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/examples/hello_world`
OpenGL Device: Mesa DRI Intel(R) Iris 6100 (Broadwell GT3)
OpenGL Driver: 3.0 Mesa 18.1.9
OpenGL Vendor: Intel Open Source Technology Center
Swap Interval: VSync
@wahn
Copy link
Author

wahn commented Dec 4, 2018

They do work on another machine (CentOS) though:

> cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core) 
> cargo run --example texture
   Compiling tetra v0.1.2 (/mill3d/users/jan/git/github/tetra)                                                                              
    Finished dev [unoptimized + debuginfo] target(s) in 4.58s                                                                               
     Running `target/debug/examples/texture`
OpenGL Device: Quadro 4000/PCIe/SSE2
OpenGL Driver: 4.6.0 NVIDIA 390.59
OpenGL Vendor: NVIDIA Corporation
Swap Interval: VSync

@17cupsofcoffee 17cupsofcoffee added the Type: Bug Problems with the code/documentation that need to be fixed. label Dec 4, 2018
@17cupsofcoffee
Copy link
Owner

Thank you for the report! I'll look into it further this evening - my work laptop has Intel integrated graphics too, so hopefully I'll be able to reproduce the issue on there. Failing that, might need to spin up a Debian VM or something...

@17cupsofcoffee 17cupsofcoffee added the Area: Graphics Issues related to graphics/rendering. label Dec 4, 2018
@17cupsofcoffee
Copy link
Owner

17cupsofcoffee commented Dec 4, 2018

I wasn't able to replicate on my laptop, but I think I understand why - from the looks of your log output, it looks like your drivers might be using OpenGL 3.0? I've been targeting 3.2, so perhaps I've used an incompatible feature somewhere... I'll try to force it into 3.0 mode on my machine and see if it breaks :)

@17cupsofcoffee
Copy link
Owner

Dang, no luck - I set the context version to 3.0 on my laptop, and it still seems to work fine for me. Perhaps it's something to do with the Mesa drivers?

@wahn
Copy link
Author

wahn commented Dec 5, 2018

Let me try something on my side and I will report back ...

# maybe this will help?
apt-get upgrade mesa-common-dev

@wahn
Copy link
Author

wahn commented Dec 5, 2018

I upgraded a couple of things (Mesa + Intel Graphics related) but it didn't fix the problem:

OpenGL Device: Mesa DRI Intel(R) Iris 6100 (Broadwell GT3)
OpenGL Driver: 3.0 Mesa 18.2.5
OpenGL Vendor: Intel Open Source Technology Center
Swap Interval: VSync

@wahn
Copy link
Author

wahn commented Dec 5, 2018

Anyway, don't worry, I can work on the CentOS box. Close if you want ...

@17cupsofcoffee
Copy link
Owner

17cupsofcoffee commented Dec 5, 2018

Strange! Thanks for the report, anyway - I'll close it for now, but hopefully I'll get chance to play around on Debian at some point and see if I can replicate.

Hope you have better luck on your CentOS box!

@17cupsofcoffee 17cupsofcoffee added the Status: Needs Replicating Indicates that the issue cannot be replicated - this doesn't necessarily mean it's invalid! label Dec 5, 2018
@17cupsofcoffee
Copy link
Owner

I'm re-opening this, as @VictorKoenders seems to be having a similar issue on Ubuntu.

@17cupsofcoffee 17cupsofcoffee removed the Status: Needs Replicating Indicates that the issue cannot be replicated - this doesn't necessarily mean it's invalid! label Dec 14, 2018
@VictorKoenders
Copy link
Contributor

Ubuntu 18.10
libsdl2-dev: 2.0.8+dfsg1-4ubuntu1
OpenGL Device: Mesa DRI Intel(R) UHD Graphics 620 (Kabylake GT2)
OpenGL Driver: 3.0 Mesa 18.2.2
OpenGL Vendor: Intel Open Source Technology Center
Swap Interval: VSync

Also doesn't seem to work with sdl2's bundled feature. I fear it's an openGL issue.

@17cupsofcoffee 17cupsofcoffee changed the title examples render black (for me) Black screen when using Mesa drivers (?) Dec 14, 2018
@17cupsofcoffee
Copy link
Owner

@VictorKoenders My suspicion is that the issue might be due to me using #version 330 stuff in my GLSL - could you try running the examples on the simplified-glsl branch that I've just pushed?

@VictorKoenders
Copy link
Contributor

That seemed to fix it for me!
screenshot from 2018-12-14 18-09-57

@VictorKoenders
Copy link
Contributor

VictorKoenders commented Dec 14, 2018

A friend found this resource: https://stackoverflow.com/a/21567167

What they do not tell you, but indirectly imply ("Some drivers don't support all the features required in 
OpenGL 3.3."), is that in the last official release of Mesa (10.0), GL 3.3 only works on Intel hardware. This
 is one of the joys of Intel's close involvement with the Mesa project. If you want reliable GL 3.3 support
 in any form on AMD hardware, you should use fglrx (the proprietary AMD driver) for the time being.

@17cupsofcoffee
Copy link
Owner

Ah, the joys of OpenGL...

Anyway, the shader changes don't add any extra complexity/lose us any functionality, so I've merged them into master :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Graphics Issues related to graphics/rendering. Type: Bug Problems with the code/documentation that need to be fixed.
Projects
None yet
Development

No branches or pull requests

3 participants