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

Fix shader #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix shader #6

wants to merge 2 commits into from

Conversation

giraldeau
Copy link

Hello!

I'm trying to make the shader work on my modest machine, with a cheap Intel card. The driver does not supports the GL_EXT_gpu_shader4 extension, and therefore usampler2DRect is not available. I tried to revert to sampler2DRect, but the window is blank (see screenshot below). Can we make it work with simply sampler2DRect?

The first patch is about reporting to the user if the shader does not load.

Thanks!

image

If the GL shader fails to load, terminate the children and report the error to
the user.

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
usampler2DRect requires GL_EXT_gpu_shader4, see:

  https://www.opengl.org/wiki/GL_EXT_texture_integer

However, it is not available on cheap Linux/Intel cards/drivers.  When using
sampler2DRect, the shader loads, but the window is completely dark.

This fix is therefore incomplete. How can we make drawing work with
sampler2DRect only?

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
@ajclinto
Copy link
Owner

ajclinto commented Sep 5, 2015

I don't think it's possible to use sampler2DRect as a replacement for usampler2DRect. The host has set up the texture using unsigned integer values, and any conversion to/from float would cause other parts of the shader program to fail - eg. this stuff:

uint dtype = val & 7u;
uint type = (val >> 3u) & 3u;
bool freed = ((val >> 3u) & 4u) > 0u;
uint tid = (val >> 6u) & 0x3FFu;

And look at MemViewWidget::paintGL() and myImage.

Your other fix to add an error message when failing to load the program is probably a good idea.

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

Successfully merging this pull request may close these issues.

None yet

2 participants